diff options
Diffstat (limited to 'crypto/asn1/i2d_pr.c')
-rw-r--r-- | crypto/asn1/i2d_pr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c index 1e951ae01d..a40c64d3f4 100644 --- a/crypto/asn1/i2d_pr.c +++ b/crypto/asn1/i2d_pr.c @@ -67,6 +67,9 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif +#ifndef OPENSSL_NO_ECDSA +#include <openssl/ecdsa.h> +#endif int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) { @@ -83,6 +86,12 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) return(i2d_DSAPrivateKey(a->pkey.dsa,pp)); } #endif +#ifndef OPENSSL_NO_ECDSA + if (a->type == EVP_PKEY_ECDSA) + { + return(i2d_ECDSAPrivateKey(a->pkey.ecdsa, pp)); + } +#endif ASN1err(ASN1_F_I2D_PRIVATEKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); return(-1); |