diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-11 15:21:52 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-11 15:21:52 +0000 |
commit | 230300342d3bc405f43a2d15159c779893b0cc5e (patch) | |
tree | 542c204cbe0adb18ac28db8cc1acfcf812e81e0e /lib/libcrypto/rsa | |
parent | 720e3c72e4347b42623eb96ed5183928625babf7 (diff) |
In RSA_eay_private_encrypt(), correctly return the smaller BN; OpenSSL
PR #3418 via OpenSSL trunk
Diffstat (limited to 'lib/libcrypto/rsa')
-rw-r--r-- | lib/libcrypto/rsa/rsa_eay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/rsa/rsa_eay.c b/lib/libcrypto/rsa/rsa_eay.c index 571a9a0f059..d76ff692088 100644 --- a/lib/libcrypto/rsa/rsa_eay.c +++ b/lib/libcrypto/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; |