diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-03-08 11:17:31 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-03-15 08:24:42 +1100 |
commit | 559e078d94f1213318105b03f4e88b848fc28314 (patch) | |
tree | e50d4fbe0c5741eba0d2be0e9cb1a7b457795cfe /providers | |
parent | 27093ba73372935fe4ef91d0a45ce6ea90a1ac8e (diff) | |
download | openssl-new-559e078d94f1213318105b03f4e88b848fc28314.tar.gz |
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)
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 e0faf1c1ad..4ebb6517d6 100644 --- a/providers/implementations/signature/rsa_sig.c +++ b/providers/implementations/signature/rsa_sig.c @@ -834,14 +834,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)) |