summaryrefslogtreecommitdiffstats
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:26:40 +1100
commit0ad18226d00e57419239c6d1b3e29dcc8960f355 (patch)
tree7baf1da60054bc15c999cfaedc3dd4b6508e5f3c /providers
parent6a2006e566fed897d2452cff0e334660284dab67 (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 559e078d94f1213318105b03f4e88b848fc28314)
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 be7cf53b26..cd5de6bd51 100644
--- a/providers/implementations/signature/rsa_sig.c
+++ b/providers/implementations/signature/rsa_sig.c
@@ -837,14 +837,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))