mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
Fix RSA PSS padding
This commit is contained in:
@@ -3478,7 +3478,11 @@ int wc_RsaPSS_Verify_ex(byte* in, word32 inLen, byte* out, word32 outLen,
|
|||||||
int wc_RsaPSS_CheckPadding(const byte* in, word32 inSz, byte* sig,
|
int wc_RsaPSS_CheckPadding(const byte* in, word32 inSz, byte* sig,
|
||||||
word32 sigSz, enum wc_HashType hashType)
|
word32 sigSz, enum wc_HashType hashType)
|
||||||
{
|
{
|
||||||
return wc_RsaPSS_CheckPadding_ex(in, inSz, sig, sigSz, hashType, inSz, 0);
|
#ifndef WOLFSSL_PSS_SALT_LEN_DISCOVER
|
||||||
|
return wc_RsaPSS_CheckPadding_ex(in, inSz, sig, sigSz, hashType, RSA_PSS_SALT_LEN_DEFAULT, 0);
|
||||||
|
#else
|
||||||
|
return wc_RsaPSS_CheckPadding_ex(in, inSz, sig, sigSz, hashType, RSA_PSS_SALT_LEN_DISCOVER, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks the PSS data to ensure that the signature matches.
|
/* Checks the PSS data to ensure that the signature matches.
|
||||||
@@ -3524,7 +3528,7 @@ int wc_RsaPSS_CheckPadding_ex(const byte* in, word32 inSz, byte* sig,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef WOLFSSL_PSS_LONG_SALT
|
#ifndef WOLFSSL_PSS_LONG_SALT
|
||||||
else if ((word32)saltLen > inSz) {
|
else if (saltLen > (int)inSz) {
|
||||||
ret = PSS_SALTLEN_E;
|
ret = PSS_SALTLEN_E;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user