artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8420994
)
Add check for BN_sub return value
author
inoguchi
<inoguchi@openbsd.org>
Thu, 20 Jan 2022 11:10:11 +0000
(11:10 +0000)
committer
inoguchi
<inoguchi@openbsd.org>
Thu, 20 Jan 2022 11:10:11 +0000
(11:10 +0000)
CID 24839
ok jsing@ millert@ tb@
lib/libcrypto/rsa/rsa_eay.c
patch
|
blob
|
history
diff --git
a/lib/libcrypto/rsa/rsa_eay.c
b/lib/libcrypto/rsa/rsa_eay.c
index
a45cad0
..
0f8c324
100644
(file)
--- a/
lib/libcrypto/rsa/rsa_eay.c
+++ b/
lib/libcrypto/rsa/rsa_eay.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rsa_eay.c,v 1.5
3 2022/01/07 09:55:32 tb
Exp $ */
+/* $OpenBSD: rsa_eay.c,v 1.5
4 2022/01/20 11:10:11 inoguchi
Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@
-447,7
+447,8
@@
RSA_eay_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
goto err;
if (padding == RSA_X931_PADDING) {
- BN_sub(f, rsa->n, ret);
+ if (!BN_sub(f, rsa->n, ret))
+ goto err;
if (BN_cmp(ret, f) > 0)
res = f;
else