New function EVP_PKEY_asn1_copy(). Use default MD if type param is NULL.
[openssl.git] / crypto / asn1 / d2i_pr.c
index 0f0e6b1ae454ac336bf9e46bebb1578fa49c36e7..e90cfa9db86c4e75cfaba0367ef092606d9f99f5 100644 (file)
@@ -61,7 +61,7 @@
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
-#include OPENSSL_NO_ENGINE
+#ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
 #endif
 #include <openssl/asn1.h>
@@ -124,8 +124,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
         * by analyzing it we can determine the passed structure: this
         * assumes the input is surrounded by an ASN1 SEQUENCE.
         */
-       inkey = d2i_ASN1_SET_OF_ASN1_TYPE(NULL, &p, length, d2i_ASN1_TYPE, 
-                       ASN1_TYPE_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
+       inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
        /* Since we only need to discern "traditional format" RSA and DSA
         * keys we can just count the elements.
          */