aboutsummaryrefslogtreecommitdiff
path: root/providers/implementations/signature/rsa_sig.c
diff options
context:
space:
mode:
authorPierre Pronchery <pierre@freebsdfoundation.org>2023-05-31 22:06:50 +0000
committerEd Maste <emaste@FreeBSD.org>2023-06-23 13:13:27 +0000
commitb84c4564effd02dfdc047dd6cbeaf910bbb1a888 (patch)
tree39604e7e6f13fced003ef2f77c35f3989aa574ca /providers/implementations/signature/rsa_sig.c
parente4520c8bd1d300a7a338d0ed4af171a2d0e583ef (diff)
Diffstat (limited to 'providers/implementations/signature/rsa_sig.c')
-rw-r--r--providers/implementations/signature/rsa_sig.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c
index 7023a866131e..76516d9a0987 100644
--- a/providers/implementations/signature/rsa_sig.c
+++ b/providers/implementations/signature/rsa_sig.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -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))