remove unreachable code
[oweals/openssl.git] / crypto / asn1 / d2i_pr.c
index b2791ea66e351be76d1c71abb9d403cdbf24c9de..e90cfa9db86c4e75cfaba0367ef092606d9f99f5 100644 (file)
@@ -61,7 +61,9 @@
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 #include <openssl/objects.h>
+#ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
+#endif
 #include <openssl/asn1.h>
 #include "asn1_locl.h"
 
@@ -81,11 +83,13 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
        else
                {
                ret= *a;
+#ifndef OPENSSL_NO_ENGINE
                if (ret->engine)
                        {
                        ENGINE_finish(ret->engine);
                        ret->engine = NULL;
                        }
+#endif
                }
 
        if (!EVP_PKEY_set_type(ret, type))
@@ -120,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.
          */