#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;
#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;
#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.ec),
+ (const unsigned char **)pp, length))
{
ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
goto err;