From: William Brawner Date: Sun, 5 Apr 2020 16:39:41 +0000 (-0700) Subject: Ensure ECDSA_size always returns >= 0 X-Git-Tag: OpenSSL_1_1_1g~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9f2e609db4de8d1f2022189a99c8277c3f6289d;p=thirdparty%2Fopenssl.git Ensure ECDSA_size always returns >= 0 Fixes #10484 Signed-off-by: William Brawner Reviewed-by: Nicola Tuveri Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11472) --- diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index 336afc989d3..831b74ce6c2 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -1297,5 +1297,7 @@ int ECDSA_size(const EC_KEY *r) i = i2d_ASN1_INTEGER(&bs, NULL); i += i; /* r and s */ ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE); + if (ret < 0) + return 0; return ret; }