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:49:35 +0000 (19:49 +0200)
commitf34a57202be4a5d3786ba65ad88d760aa02630f0
tree46cbefa09df385743baa38a3a09f56c6ec41e3d1
parentf063e30fe9f316067950bdf0397b51cf87d4b6a6
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>
crypto/ec/ec_asn1.c