summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-07-11 15:21:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-07-11 15:21:52 +0000
commit9d46ce95080686dc2b8b3591d9033d8352593e6e (patch)
tree6f73a39ed43f416d0f382b85ff17ba01e6120f60
parent0b6ac654b16278edfbce365c5a2e7e62163c0a29 (diff)
In RSA_eay_private_encrypt(), correctly return the smaller BN; OpenSSL
PR #3418 via OpenSSL trunk
-rw-r--r--lib/libssl/src/crypto/rsa/rsa_eay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/rsa/rsa_eay.c b/lib/libssl/src/crypto/rsa/rsa_eay.c
index 571a9a0f059..d76ff692088 100644
--- a/lib/libssl/src/crypto/rsa/rsa_eay.c
+++ b/lib/libssl/src/crypto/rsa/rsa_eay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_eay.c,v 1.34 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: rsa_eay.c,v 1.35 2014/07/11 15:21:51 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -452,7 +452,7 @@ RSA_eay_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
if (padding == RSA_X931_PADDING) {
BN_sub(f, rsa->n, ret);
- if (BN_cmp(ret, f))
+ if (BN_cmp(ret, f) > 0)
res = f;
else
res = ret;