Reformat/tidy some of the ASN1 code.
[openssl.git] / crypto / asn1 / d2i_pu.c
index cf97b83eac4311a9179064c13d5b31cfd3d1fec3..8a05810edabd9a9ee7e73c0408976ea935464147 100644 (file)
@@ -72,7 +72,7 @@
 #include <openssl/ec.h>
 #endif
 
-EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
+EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
             long length)
        {
        EVP_PKEY *ret;
@@ -103,8 +103,8 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
 #endif
 #ifndef OPENSSL_NO_DSA
        case EVP_PKEY_DSA:
-               if ((ret->pkey.dsa=d2i_DSAPublicKey(&(ret->pkey.dsa),
-                       (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
+               if (!d2i_DSAPublicKey(&(ret->pkey.dsa),
+                       (const unsigned char **)pp,length)) /* TMP UGLY CAST */
                        {
                        ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
                        goto err;
@@ -113,9 +113,8 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
 #endif
 #ifndef OPENSSL_NO_EC
        case EVP_PKEY_EC:
-               if ((ret->pkey.eckey = ECPublicKey_set_octet_string(
-                       &(ret->pkey.eckey), (const unsigned char **)pp, 
-                       length)) == NULL)
+               if (!o2i_ECPublicKey(&(ret->pkey.eckey),
+                                    (const unsigned char **)pp, length))
                        {
                        ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
                        goto err;