From: Bodo Möller Date: Tue, 20 Feb 2001 08:10:38 +0000 (+0000) Subject: Fix BN_[pseudo_]rand: 'mask' must be used even if top=-1. X-Git-Tag: OpenSSL_0_9_6a-beta1~23^2~63 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f2bc668429fa2abdc77db0db861a9bb2be0c3a85;p=oweals%2Fopenssl.git Fix BN_[pseudo_]rand: 'mask' must be used even if top=-1. Mention BN_[pseudo_]rand with top=-1 in CHANGES. --- diff --git a/CHANGES b/CHANGES index f4dee4f0e0..4955e13732 100644 --- a/CHANGES +++ b/CHANGES @@ -113,6 +113,9 @@ *) Add new function BN_rand_range(), and fix DSA_sign_setup() to prevent Bleichenbacher's DSA attack. + Extend BN_[pseudo_]rand: As before, top=1 forces the highest two bits + to be set and top=0 forces the highest bit to be set; top=-1 is new + and leaves the highest bit random. [Ulf Moeller, Bodo Moeller] *) Update Rijndael code to version 3.0 and change EVP AES ciphers to diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index b8fbbc8386..fb583fb358 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -76,7 +76,7 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) bytes=(bits+7)/8; bit=(bits-1)%8; - mask=0xff<