]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/bn/bn_sqrt.c
Put the first stage of my bignum debugging adventures into CVS. This code
[thirdparty/openssl.git] / crypto / bn / bn_sqrt.c
index 463d4a81394fb57a3db51e3bc5c2abd13e497fc9..51902703e1ed1e8b4ba3e8d621894079feeeacd7 100644 (file)
@@ -86,6 +86,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
                                BN_free(ret);
                                return NULL;
                                }
+                       bn_check_top(ret);
                        return ret;
                        }
 
@@ -104,6 +105,7 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
                        BN_free(ret);
                        return NULL;
                        }
+               bn_check_top(ret);
                return ret;
                }
 
@@ -384,5 +386,6 @@ BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
                ret = NULL;
                }
        BN_CTX_end(ctx);
+       bn_check_top(ret);
        return ret;
        }