Add bn_dup_expand() comment from the main branch explaining that
authorBodo Möller <bodo@openssl.org>
Thu, 25 Jul 2002 12:14:41 +0000 (12:14 +0000)
committerBodo Möller <bodo@openssl.org>
Thu, 25 Jul 2002 12:14:41 +0000 (12:14 +0000)
bn_dup_expand() is broken.

[No need to fix this in 0.9.7-stable, it is just an unused internal
function.]

crypto/bn/bn_lib.c

index a016cb7f5379776658357367bd86d5383e297392..8abe095af28e3797f72a8230fd5b82183cb6f44b 100644 (file)
@@ -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);