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:
parent
25ba90e34a
commit
ac71c09529
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user