Skip to content

Commit 36418ac

Browse files
Set useRsaPss flag in both SSL and CTX structures
1 parent d766b82 commit 36418ac

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/internal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6983,6 +6983,9 @@ int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
69836983
#endif
69846984
#ifndef NO_RSA
69856985
ssl->options.minRsaKeySz = ctx->minRsaKeySz;
6986+
#ifdef WC_RSA_PSS
6987+
ssl->useRsaPss = ctx->useRsaPss;
6988+
#endif
69866989
#endif
69876990
#ifdef HAVE_ECC
69886991
ssl->options.minEccKeySz = ctx->minEccKeySz;

src/ssl_load.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,10 +1625,12 @@ static int ProcessBufferCertPublicKey(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
16251625
ctx->minRsaKeySz, RSA_MAX_SIZE / 8, keySz, RSA_KEY_SIZE_E);
16261626
}
16271627
#ifdef WC_RSA_PSS
1628-
if (ssl)
1629-
ssl->ctx->useRsaPss = cert->keyOID == RSAPSSk;
1630-
else
1628+
if (ssl) {
1629+
ssl->useRsaPss = cert->keyOID == RSAPSSk;
1630+
}
1631+
if (ctx) {
16311632
ctx->useRsaPss = cert->keyOID == RSAPSSk;
1633+
}
16321634
#endif
16331635
break;
16341636
#endif /* !NO_RSA */

src/tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7907,7 +7907,7 @@ static WC_INLINE void EncodeSigAlg(const WOLFSSL * ssl, byte hashAlgo, byte hsTy
79077907
/* If the private key uses the RSA-PSS OID, and the peer supports
79087908
* the rsa_pss_pss_* signature algorithm in use, then report
79097909
* rsa_pss_pss_* rather than rsa_pss_rsae_*. */
7910-
if (ssl->ctx->useRsaPss &&
7910+
if (ssl->useRsaPss &&
79117911
((ssl->pssAlgo & (1U << hashAlgo)) != 0U) &&
79127912
(sha256_mac <= hashAlgo) && (hashAlgo <= sha512_mac))
79137913
{

wolfssl/internal.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,7 @@ struct WOLFSSL_CTX {
39083908
#ifndef NO_RSA
39093909
short minRsaKeySz; /* minimum RSA key size */
39103910
#ifdef WC_RSA_PSS
3911-
word8 useRsaPss;
3911+
word8 useRsaPss; /* cert supports RSA-PSS */
39123912
#endif
39133913
#endif
39143914
#if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
@@ -5941,6 +5941,9 @@ struct WOLFSSL {
59415941
byte* peerSceTsipEncRsaKeyIndex;
59425942
#endif
59435943
byte peerRsaKeyPresent;
5944+
#ifdef WC_RSA_PSS
5945+
word8 useRsaPss; /* cert supports RSA-PSS */
5946+
#endif
59445947
#endif
59455948
#if defined(WOLFSSL_TLS13) || defined(HAVE_FFDHE)
59465949
word16 namedGroup;

0 commit comments

Comments
 (0)