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:36 +0000 (19:50 +0200)
commit3e5df378613b2bd70e2e2eee4bec7b5c88b298e6
treed830e6379332df4af6c36d380d3e1f9d5ca6689e
parent4e5f9f8a9a10d0a6a23552ce1a640beab0c0f547
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