diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-03-08 11:17:31 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-03-15 08:27:11 +1100 |
commit | b6407c151932365fb889aa96ee127b848824a709 (patch) | |
tree | 78c1fcdff6238dec05dd0d77c6b29af091f5d36c /providers | |
parent | f09b894101d2f8ed2dbff02eda9153c4b455c27b (diff) |
Fix size_t/int mismatch in cms_ec.c and rsa_sig.c
Fixes #20435
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20457)
(cherry picked from commit 0ad18226d00e57419239c6d1b3e29dcc8960f355)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/signature/rsa_sig.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c index 6fa9db38db..34b0c2ba90 100644 --- a/providers/implementations/signature/rsa_sig.c +++ b/providers/implementations/signature/rsa_sig.c @@ -823,14 +823,17 @@ static int rsa_verify(void *vprsactx, const unsigned char *sig, size_t siglen, return 0; } } else { + int ret; + if (!setup_tbuf(prsactx)) return 0; - rslen = RSA_public_decrypt(siglen, sig, prsactx->tbuf, prsactx->rsa, - prsactx->pad_mode); - if (rslen <= 0) { + ret = RSA_public_decrypt(siglen, sig, prsactx->tbuf, prsactx->rsa, + prsactx->pad_mode); + if (ret <= 0) { ERR_raise(ERR_LIB_PROV, ERR_R_RSA_LIB); return 0; } + rslen = (size_t)ret; } if ((rslen != tbslen) || memcmp(tbs, prsactx->tbuf, rslen)) |