EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,ERR_R_MALLOC_FAILURE);
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken){	PKCS8_PRIV_KEY_INFO *p8;	if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) {			EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);		return NULL;	}	p8->broken = broken;	if (!ASN1_INTEGER_set(p8->version, 0)) {		EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);		PKCS8_PRIV_KEY_INFO_free (p8);		return NULL;	}	if (!(p8->pkeyalg->parameter = ASN1_TYPE_new ())) {		EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);		PKCS8_PRIV_KEY_INFO_free (p8);		return NULL;	}	p8->pkey->type = V_ASN1_OCTET_STRING;	switch (EVP_PKEY_type(pkey->type)) {#ifndef OPENSSL_NO_RSA		case EVP_PKEY_RSA:		if(p8->broken == PKCS8_NO_OCTET) p8->pkey->type = V_ASN1_SEQUENCE;		p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption);		p8->pkeyalg->parameter->type = V_ASN1_NULL;		if (!ASN1_pack_string_of (EVP_PKEY,pkey, i2d_PrivateKey,					 &p8->pkey->value.octet_string)) {			EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);			PKCS8_PRIV_KEY_INFO_free (p8);			return NULL;		}		break;#endif#ifndef OPENSSL_NO_DSA		case EVP_PKEY_DSA:		if(!dsa_pkey2pkcs8(p8, pkey)) {			PKCS8_PRIV_KEY_INFO_free (p8);			return NULL;		}		break;#endif#ifndef OPENSSL_NO_EC		case EVP_PKEY_EC:		if (!eckey_pkey2pkcs8(p8, pkey))		{			PKCS8_PRIV_KEY_INFO_free(p8);			return(NULL);		}		break;#endif		default:		EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);		PKCS8_PRIV_KEY_INFO_free (p8);		return NULL;	}	RAND_add(p8->pkey->value.octet_string->data,		 p8->pkey->value.octet_string->length, 0.0);	return p8;}