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:42:31 +0000 (19:42 +0200)
commit05f61fb27efaf1a3f4cfa1a8d4d62c34e3c8a0fe
tree7876cf5011258071864856dc5a466b1716722319
parent10be715b9583eab82b4c280e45359c74dc3d1cf8
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