X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Fi2d_pr.c;h=bbf2a0d2d6b06c9878189cd4a5f168655057e2bf;hb=7bdeeb64ac00caacfa476ac73bec52bea0aade34;hp=361beb9fddf942916aa0b31855cc4a0214a08b92;hpb=b7896b3cb86d80206af14a14d69b0717786f2729;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c index 361beb9fdd..bbf2a0d2d6 100644 --- a/crypto/asn1/i2d_pr.c +++ b/crypto/asn1/i2d_pr.c @@ -1,5 +1,5 @@ /* crypto/asn1/i2d_pr.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -58,27 +58,40 @@ #include #include "cryptlib.h" -#include "bn.h" -#include "evp.h" -#include "objects.h" +#include +#include +#include +#ifndef OPENSSL_NO_RSA +#include +#endif +#ifndef OPENSSL_NO_DSA +#include +#endif +#ifndef OPENSSL_NO_EC +#include +#endif -int i2d_PrivateKey(a,pp) -EVP_PKEY *a; -unsigned char **pp; +int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) { -#ifndef NO_RSA +#ifndef OPENSSL_NO_RSA if (a->type == EVP_PKEY_RSA) { return(i2d_RSAPrivateKey(a->pkey.rsa,pp)); } else #endif -#ifndef NO_DSA +#ifndef OPENSSL_NO_DSA if (a->type == EVP_PKEY_DSA) { return(i2d_DSAPrivateKey(a->pkey.dsa,pp)); } #endif +#ifndef OPENSSL_NO_EC + if (a->type == EVP_PKEY_EC) + { + return(i2d_ECPrivateKey(a->pkey.eckey, pp)); + } +#endif ASN1err(ASN1_F_I2D_PRIVATEKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); return(-1);