summaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-03-08 11:17:31 +0100
committerPauli <pauli@openssl.org>2023-03-15 08:24:42 +1100
commit559e078d94f1213318105b03f4e88b848fc28314 (patch)
treee50d4fbe0c5741eba0d2be0e9cb1a7b457795cfe /providers
parent27093ba73372935fe4ef91d0a45ce6ea90a1ac8e (diff)
downloadopenssl-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.c9
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))