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:49:34 +0000 (19:49 +0200)
commit0388ac4c99e801462dafef3f2dab3f255ec33c96
tree3afeff95722f1b30934dd883db2496e51f0858b2
parent7b3e11c54466f1da8b707c932e308d345fd61101
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>
crypto/ec/ec_ameth.c
crypto/ec/ec_asn1.c