Skip to content

Commit

Permalink
account for rsa_pss_pss with TLS 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Dec 13, 2024
1 parent 6cc3546 commit bf1d60f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4910,7 +4910,7 @@ int RsaVerify(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, int sigAlgo,
#endif

#if defined(WC_RSA_PSS)
if (sigAlgo == rsa_pss_sa_algo) {
if (sigAlgo == rsa_pss_sa_algo || sigAlgo == rsa_pss_pss_algo) {
enum wc_HashType hashType = WC_HASH_TYPE_NONE;
int mgf = 0;

Expand Down Expand Up @@ -31892,6 +31892,13 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
}
else
#endif
#ifdef WC_RSA_PSS
if (sigAlgo == rsa_pss_pss_algo &&
ssl->options.peerSigAlgo == rsa_sa_algo) {
ssl->options.peerSigAlgo = sigAlgo;
}
else
#endif
#if defined(WOLFSSL_SM2) && defined(WOLFSSL_SM3)
if (sigAlgo == sm2_sa_algo &&
ssl->options.peerSigAlgo == ecc_dsa_sa_algo) {
Expand Down Expand Up @@ -31958,6 +31965,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
#ifndef NO_RSA
#ifdef WC_RSA_PSS
case rsa_pss_sa_algo:
case rsa_pss_pss_algo:
#endif
case rsa_sa_algo:
{
Expand Down Expand Up @@ -32058,6 +32066,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
#ifndef NO_RSA
#ifdef WC_RSA_PSS
case rsa_pss_sa_algo:
case rsa_pss_pss_algo:
#endif
case rsa_sa_algo:
{
Expand Down Expand Up @@ -32269,6 +32278,7 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
#ifndef NO_RSA
#ifdef WC_RSA_PSS
case rsa_pss_sa_algo:
case rsa_pss_pss_algo:
#ifdef HAVE_SELFTEST
ret = wc_RsaPSS_CheckPadding(
ssl->buffers.digest.buffer,
Expand Down

0 comments on commit bf1d60f

Please sign in to comment.