From 559e078d94f1213318105b03f4e88b848fc28314 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 8 Mar 2023 11:17:31 +0100 Subject: Fix size_t/int mismatch in cms_ec.c and rsa_sig.c Fixes #20435 Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/20457) --- providers/implementations/signature/rsa_sig.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'providers') 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)) -- cgit v1.2.1