RT3065: ec_private_key_dont_crash
authorAdam Langley <agl@chromium.org>
Tue, 23 Apr 2013 19:12:36 +0000 (15:12 -0400)
committerEmilia Kasper <emilia@openssl.org>
Wed, 27 Aug 2014 17:42:09 +0000 (19:42 +0200)
commite87a4a70116be199ad8961c77622136342cd7c38
tree96539fdcac266e821c91ac8789b7f3344994a4bd
parentf2a57c101f69a01c7cdef188f63796b124b84175
RT3065: ec_private_key_dont_crash

This change saves several EC routines from crashing when an EC_KEY is
missing a public key. The public key is optional in the EC private key
format and, without this patch, running the following through `openssl
ec` causes a crash:

-----BEGIN EC PRIVATE KEY-----
MBkCAQEECAECAwQFBgcIoAoGCCqGSM49AwEH
-----END EC PRIVATE KEY-----

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