Ensure ECDSA_size always returns >= 0
Fixes #10484 Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
parent
d251c4ecc1
commit
0bd62a2d17
1 changed files with 2 additions and 0 deletions
|
@ -1297,5 +1297,7 @@ int ECDSA_size(const EC_KEY *r)
|
||||||
i = i2d_ASN1_INTEGER(&bs, NULL);
|
i = i2d_ASN1_INTEGER(&bs, NULL);
|
||||||
i += i; /* r and s */
|
i += i; /* r and s */
|
||||||
ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
|
ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
|
||||||
|
if (ret < 0)
|
||||||
|
return 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue