Add support for DJGPP.
[openssl.git] / crypto / asn1 / i2d_pr.c
index 5ae6568112a37cd92834d265d2da500e10a8206b..a40c64d3f4991cbe0105f65331151687ede6da6b 100644 (file)
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+#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)
        {
@@ -77,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);