CRYPTO_add(&ret->references,1,CRYPTO_LOCK_EVP_PKEY);
EVP_PKEY *X509_PUBKEY_get(key)X509_PUBKEY *key;	{	EVP_PKEY *ret=NULL;	long j;	int type;	unsigned char *p;#ifndef NO_DSA	X509_ALGOR *a;#endif	if (key == NULL) goto err;	if (key->pkey != NULL) return(key->pkey);	if (key->public_key == NULL) goto err;	type=OBJ_obj2nid(key->algor->algorithm);	p=key->public_key->data;        j=key->public_key->length;        if ((ret=d2i_PublicKey(type,NULL,&p,(long)j)) == NULL)		{		X509err(X509_F_X509_PUBKEY_GET,X509_R_ERR_ASN1_LIB);		goto err;		}	ret->save_parameters=0;#ifndef NO_DSA	a=key->algor;	if (ret->type == EVP_PKEY_DSA)		{		if (a->parameter->type == V_ASN1_SEQUENCE)			{			ret->pkey.dsa->write_params=0;			p=a->parameter->value.sequence->data;			j=a->parameter->value.sequence->length;			if (!d2i_DSAparams(&ret->pkey.dsa,&p,(long)j))				goto err;			}		ret->save_parameters=1;		}#endif	key->pkey=ret;	return(ret);err:	if (ret != NULL)		EVP_PKEY_free(ret);	return(NULL);	}