Skip to content

Commit ba5cc9b

Browse files
author
Lealem Amedie
committed
Fix building FIPS v5 with PK callbacks
1 parent 287323a commit ba5cc9b

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
@@ -33478,7 +33478,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3347833478

3347933479
#ifndef NO_CERTS
3348033480

33481-
#ifdef WOLF_PRIVATE_KEY_ID
33481+
#if defined(WOLF_PRIVATE_KEY_ID) || defined(HAVE_PK_CALLBACKS)
3348233482
int GetPrivateKeySigSize(WOLFSSL* ssl)
3348333483
{
3348433484
int sigSz = 0;
@@ -33519,7 +33519,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3351933519
}
3352033520
return sigSz;
3352133521
}
33522-
#endif /* HAVE_PK_CALLBACKS */
33522+
#endif /* WOLF_PRIVATE_KEY_ID || HAVE_PK_CALLBACKS */
3352333523

3352433524
#endif /* NO_CERTS */
3352533525

wolfssl/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,7 @@ WOLFSSL_LOCAL int DecodePrivateKey(WOLFSSL *ssl, word32* length);
21892189
#ifdef WOLFSSL_DUAL_ALG_CERTS
21902190
WOLFSSL_LOCAL int DecodeAltPrivateKey(WOLFSSL *ssl, word32* length);
21912191
#endif
2192-
#ifdef WOLF_PRIVATE_KEY_ID
2192+
#if defined(WOLF_PRIVATE_KEY_ID) || defined(HAVE_PK_CALLBACKS)
21932193
WOLFSSL_LOCAL int GetPrivateKeySigSize(WOLFSSL* ssl);
21942194
#ifndef NO_ASN
21952195
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
@@ -3396,6 +3396,11 @@ extern void uITRON4_free(void *p) ;
33963396
#error The SRTP extension requires DTLS
33973397
#endif
33983398

3399+
/* FIPS v5 and older doesn't support WOLF_PRIVATE_KEY_ID with PK callbacks */
3400+
#if defined(HAVE_FIPS) && FIPS_VERSION_LT(5,3) && defined(HAVE_PK_CALLBACKS)
3401+
#define NO_WOLF_PRIVATE_KEY_ID
3402+
#endif
3403+
33993404
/* Are we using an external private key store like:
34003405
* PKCS11 / HSM / crypto callback / PK callback */
34013406
#if !defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_WOLF_PRIVATE_KEY_ID) && \

0 commit comments

Comments
 (0)