Skip to content

Commit e349eef

Browse files
adjust key unlock location
1 parent 20a3926 commit e349eef

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/wp_hkdf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ static int wp_tls13_hkdf_expand(wp_HkdfCtx* ctx, unsigned char* inKey,
519519
}
520520
ctx->infoSz = idx;
521521

522+
PRIVATE_KEY_UNLOCK();
522523
rc = wc_HKDF_Expand(ctx->mdType, inKey, (word32)inKeyLen, ctx->info,
523524
(word32)ctx->infoSz, key, (word32)keyLen);
525+
PRIVATE_KEY_LOCK();
524526
if (rc != 0) {
525527
ok = 0;
526528
}
@@ -578,6 +580,7 @@ static int wp_tls13_hkdf_extract(wp_HkdfCtx* ctx, unsigned char* key,
578580

579581
if (ok) {
580582
(void)keyLen;
583+
PRIVATE_KEY_UNLOCK();
581584
if (saltLen == 0) {
582585
rc = wc_HKDF_Extract(ctx->mdType, NULL, 0, inKey,
583586
(word32)inKeyLen, key);
@@ -586,6 +589,7 @@ static int wp_tls13_hkdf_extract(wp_HkdfCtx* ctx, unsigned char* key,
586589
rc = wc_HKDF_Extract(ctx->mdType, salt, (word32)saltLen, inKey,
587590
(word32)inKeyLen, key);
588591
}
592+
PRIVATE_KEY_LOCK();
589593
if (rc != 0) {
590594
ok = 0;
591595
}

src/wp_wolfprov.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,6 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
997997
int ok = 1;
998998
OSSL_FUNC_core_get_libctx_fn* c_get_libctx = NULL;
999999

1000-
#ifdef HAVE_FIPS
1001-
PRIVATE_KEY_UNLOCK();
1002-
#endif
1003-
10041000
for (; in->function_id != 0; in++) {
10051001
switch (in->function_id) {
10061002
case OSSL_FUNC_CORE_GETTABLE_PARAMS:

0 commit comments

Comments
 (0)