From ae97a6ab623f3ff87143530d86559eca7ed147aa Mon Sep 17 00:00:00 2001 From: miod <> Date: Fri, 11 Jul 2014 15:21:51 +0000 Subject: In RSA_eay_private_encrypt(), correctly return the smaller BN; OpenSSL PR #3418 via OpenSSL trunk --- src/lib/libcrypto/rsa/rsa_eay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/rsa/rsa_eay.c') diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c index 571a9a0f05..d76ff69208 100644 --- a/src/lib/libcrypto/rsa/rsa_eay.c +++ b/src/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; -- cgit v1.2.3-55-g6feb