Explicitly check for empty ASN.1 strings in d2i_ECPrivateKey
authorEmilia Kasper <emilia@openssl.org>
Mon, 25 Aug 2014 10:38:16 +0000 (12:38 +0200)
committerEmilia Kasper <emilia@openssl.org>
Wed, 27 Aug 2014 17:50:15 +0000 (19:50 +0200)
commit7f7c05ca638c3cc6d261961fae439cd91e3c1d27
treea119dc28ccb5729bc0a5497a4b79fd9bc25dba78
parent2083f7c465d07867dd9867b8742bb71c03d1f203
Explicitly check for empty ASN.1 strings in d2i_ECPrivateKey

The old code implicitly relies on the ASN.1 code returning a \0-prefixed buffer
when the buffer length is 0. Change this to verify explicitly that the ASN.1 string
has positive length.

Reviewed-by: Dr Stephen Henson <steve@openssl.org>
(cherry picked from commit 82dc08de54ce443c2a9ac478faffe79e76157795)
crypto/ec/ec_asn1.c