Skip to content

Commit 425dd19

Browse files
authored
Merge pull request #7568 from lealem47/fips_pkcallback
Fix building FIPS v5 with PK callbacks
2 parents 32c5acc + ba5cc9b commit 425dd19

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33521,7 +33521,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3352133521

3352233522
#ifndef NO_CERTS
3352333523

33524-
#ifdef WOLF_PRIVATE_KEY_ID
33524+
#if defined(WOLF_PRIVATE_KEY_ID) || defined(HAVE_PK_CALLBACKS)
3352533525
int GetPrivateKeySigSize(WOLFSSL* ssl)
3352633526
{
3352733527
int sigSz = 0;
@@ -33562,7 +33562,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3356233562
}
3356333563
return sigSz;
3356433564
}
33565-
#endif /* HAVE_PK_CALLBACKS */
33565+
#endif /* WOLF_PRIVATE_KEY_ID || HAVE_PK_CALLBACKS */
3356633566

3356733567
#endif /* NO_CERTS */
3356833568

wolfssl/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ WOLFSSL_LOCAL int DecodePrivateKey(WOLFSSL *ssl, word32* length);
21912191
#ifdef WOLFSSL_DUAL_ALG_CERTS
21922192
WOLFSSL_LOCAL int DecodeAltPrivateKey(WOLFSSL *ssl, word32* length);
21932193
#endif
2194-
#ifdef WOLF_PRIVATE_KEY_ID
2194+
#if defined(WOLF_PRIVATE_KEY_ID) || defined(HAVE_PK_CALLBACKS)
21952195
WOLFSSL_LOCAL int GetPrivateKeySigSize(WOLFSSL* ssl);
21962196
#ifndef NO_ASN
21972197
WOLFSSL_LOCAL int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx);

wolfssl/wolfcrypt/settings.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3400,6 +3400,11 @@ extern void uITRON4_free(void *p) ;
34003400
#error The SRTP extension requires DTLS
34013401
#endif
34023402

3403+
/* FIPS v5 and older doesn't support WOLF_PRIVATE_KEY_ID with PK callbacks */
3404+
#if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,3) && defined(HAVE_PK_CALLBACKS)
3405+
#define NO_WOLF_PRIVATE_KEY_ID
3406+
#endif
3407+
34033408
/* Are we using an external private key store like:
34043409
* PKCS11 / HSM / crypto callback / PK callback */
34053410
#if !defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_WOLF_PRIVATE_KEY_ID) && \

0 commit comments

Comments
 (0)