Skip to content

Commit 20a3926

Browse files
changes for tls 1.3 with FIPS ready
1 parent 4246a2f commit 20a3926

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/wp_hkdf.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,14 @@ static int wp_tls13_hkdf_extract(wp_HkdfCtx* ctx, unsigned char* key,
578578

579579
if (ok) {
580580
(void)keyLen;
581-
rc = wc_HKDF_Extract(ctx->mdType, salt, (word32)saltLen, inKey,
582-
(word32)inKeyLen, key);
581+
if (saltLen == 0) {
582+
rc = wc_HKDF_Extract(ctx->mdType, NULL, 0, inKey,
583+
(word32)inKeyLen, key);
584+
}
585+
else {
586+
rc = wc_HKDF_Extract(ctx->mdType, salt, (word32)saltLen, inKey,
587+
(word32)inKeyLen, key);
588+
}
583589
if (rc != 0) {
584590
ok = 0;
585591
}

src/wp_wolfprov.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,10 @@ 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+
10001004
for (; in->function_id != 0; in++) {
10011005
switch (in->function_id) {
10021006
case OSSL_FUNC_CORE_GETTABLE_PARAMS:

0 commit comments

Comments
 (0)