Make sure BN_sqr can never return a negative value.

PR#3410

(Imported from upstream's b7a4f98b152e5b9a56da1501e73053d83a9799b6)

Change-Id: I382c12f205d9adbd418574f7938a1d55a07128e4
This commit is contained in:
Adam Langley 2014-07-24 16:06:47 -07:00
parent 25ba90e34a
commit ac71c09529

View File

@ -821,6 +821,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) {
al = a->top;
if (al <= 0) {
r->top = 0;
r->neg = 0;
return 1;
}