get rid of EVP_PKEY_ECDSA (now we have EVP_PKEY_EC instead)
[openssl.git] / crypto / pem / pem_pkey.c
index 270892d..92a55f5 100644 (file)
@@ -82,9 +82,12 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, vo
                ret=d2i_PrivateKey(EVP_PKEY_RSA,x,&p,len);
        else if (strcmp(nm,PEM_STRING_DSA) == 0)
                ret=d2i_PrivateKey(EVP_PKEY_DSA,x,&p,len);
+       else if (strcmp(nm,PEM_STRING_ECPRIVATEKEY) == 0)
+               ret=d2i_PrivateKey(EVP_PKEY_EC,x,&p,len);
        else if (strcmp(nm,PEM_STRING_PKCS8INF) == 0) {
                PKCS8_PRIV_KEY_INFO *p8inf;
                p8inf=d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len);
+               if(!p8inf) goto p8err;
                ret = EVP_PKCS82PKEY(p8inf);
                PKCS8_PRIV_KEY_INFO_free(p8inf);
        } else if (strcmp(nm,PEM_STRING_PKCS8) == 0) {