ret->write_params = priv_key->write_params;
ECDSA 	*d2i_ECDSAPrivateKey(ECDSA **a, const unsigned char **in, long len){	int reason=ERR_R_BN_LIB, ok=0;	ECDSA *ret=NULL;	ECDSAPrivateKey *priv_key=NULL;	if ((priv_key = ECDSAPrivateKey_new()) == NULL)		OPENSSL_ECDSA_ABORT(ECDSA_R_ECDSAPRIVATEKEY_NEW_FAILURE)	if ((priv_key = d2i_ecdsaPrivateKey(&priv_key, in, len)) == NULL)		OPENSSL_ECDSA_ABORT(ECDSA_R_D2I_ECDSA_PRIVATEKEY_FAILURE)	if ((ret = ECDSA_ecparameters2ecdsa(priv_key->parameters, NULL)) == NULL)		OPENSSL_ECDSA_ABORT(ECDSA_R_ECDSA_GET_FAILURE)	ret->version = priv_key->version;	ret->write_params = priv_key->write_params;	if (priv_key->priv_key)	{		if ((ret->priv_key = BN_dup(priv_key->priv_key)) == NULL)			OPENSSL_ECDSA_ABORT(ERR_R_BN_LIB)	}	else		OPENSSL_ECDSA_ABORT(ECDSA_R_D2I_ECDSAPRIVATEKEY_MISSING_PRIVATE_KEY)	if ((ret->pub_key = EC_POINT_new(ret->group)) == NULL)		OPENSSL_ECDSA_ABORT(ERR_R_EC_LIB)	if (!EC_POINT_oct2point(ret->group, ret->pub_key, priv_key->pub_key->data, priv_key->pub_key->length, NULL))		OPENSSL_ECDSA_ABORT(ERR_R_EC_LIB)	ok = 1;err :	if (!ok)	{		if (ret) ECDSA_free(ret);		ret = NULL;		ECDSAerr(ECDSA_F_D2I_ECDSAPRIVATEKEY, reason);	}	if (priv_key)	ECDSAPrivateKey_free(priv_key);	return(ret);}