From: Bodo Möller Date: Thu, 25 Jul 2002 12:14:41 +0000 (+0000) Subject: Add bn_dup_expand() comment from the main branch explaining that X-Git-Tag: OpenSSL_0_9_7-beta3~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6178bb8fe9a1754aa34c2c8c62f6c85edd64b872;p=oweals%2Fopenssl.git Add bn_dup_expand() comment from the main branch explaining that bn_dup_expand() is broken. [No need to fix this in 0.9.7-stable, it is just an unused internal function.] --- diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index a016cb7f53..8abe095af2 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -397,6 +397,12 @@ BIGNUM *bn_dup_expand(const BIGNUM *b, int words) { BIGNUM *r = NULL; + /* This function does not work if + * words <= b->dmax && top < words + * because BN_dup() does not preserve 'dmax'! + * (But bn_dup_expand() is not used anywhere yet.) + */ + if (words > b->dmax) { BN_ULONG *a = bn_expand_internal(b, words);