In BIO_write(), update the write statistics, not the read statistics.
[oweals/openssl.git] / crypto / asn1 / i2d_pr.c
index 1e951ae01d3bc30c3583136bf8c894aa70475ead..0be52c5b76ac197e1a84b99da6fa4e5120c9b9af 100644 (file)
@@ -67,6 +67,9 @@
 #ifndef OPENSSL_NO_DSA
 #include <openssl/dsa.h>
 #endif
+#ifndef OPENSSL_NO_EC
+#include <openssl/ec.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_EC
+       if (a->type == EVP_PKEY_EC)
+               {
+               return(i2d_ECPrivateKey(a->pkey.ec, pp));
+               }
+#endif
 
        ASN1err(ASN1_F_I2D_PRIVATEKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE);
        return(-1);