summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/crypto/ec/ec_asn1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/ec/ec_asn1.c b/lib/libssl/src/crypto/ec/ec_asn1.c
index 52f33d8f346..9478e5260a6 100644
--- a/lib/libssl/src/crypto/ec/ec_asn1.c
+++ b/lib/libssl/src/crypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_asn1.c,v 1.7 2014/06/12 15:49:29 deraadt Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.8 2014/07/01 21:26:27 miod Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -1092,7 +1092,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
goto err;
}
}
- if (!(a->enc_flag & EC_PKEY_NO_PUBKEY)) {
+ if (!(a->enc_flag & EC_PKEY_NO_PUBKEY) && a->pub_key != NULL) {
priv_key->publicKey = M_ASN1_BIT_STRING_new();
if (priv_key->publicKey == NULL) {
ECerr(EC_F_I2D_ECPRIVATEKEY,