From: Alan Hryngle Date: Sat, 5 Jul 2014 21:24:03 +0000 (+0100) Subject: Return smaller of ret and f. X-Git-Tag: OpenSSL_1_0_0n~39 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e6b98d5a40cdf26370caec70dff15ba007075654;p=oweals%2Fopenssl.git Return smaller of ret and f. PR#3418. (cherry picked from commit fdea4fff8fb058be928980600b24cf4c62ef3630) --- diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c index 2e1ddd48d3..56880dc138 100644 --- a/crypto/rsa/rsa_eay.c +++ b/crypto/rsa/rsa_eay.c @@ -459,7 +459,7 @@ static int RSA_eay_private_encrypt(int flen, const unsigned char *from, 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;