p7i->digest_enc_alg->algorithm=OBJ_nid2obj(EVP_MD_pkey_type(dgst));
int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,	     EVP_MD *dgst)	{	/* We now need to add another PKCS7_SIGNER_INFO entry */	ASN1_INTEGER_set(p7i->version,1);	X509_NAME_set(&p7i->issuer_and_serial->issuer,		X509_get_issuer_name(x509));	/* because ASN1_INTEGER_set is used to set a 'long' we will do	 * things the ugly way. */	ASN1_INTEGER_free(p7i->issuer_and_serial->serial);	p7i->issuer_and_serial->serial=		ASN1_INTEGER_dup(X509_get_serialNumber(x509));	/* lets keep the pkey around for a while */	CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);	p7i->pkey=pkey;	/* Set the algorithms */	if (pkey->type == EVP_PKEY_DSA)		p7i->digest_alg->algorithm=OBJ_nid2obj(NID_sha1);	else			p7i->digest_alg->algorithm=OBJ_nid2obj(EVP_MD_type(dgst));	p7i->digest_enc_alg->algorithm=OBJ_nid2obj(EVP_MD_pkey_type(dgst));#if 1	if (p7i->digest_enc_alg->parameter != NULL)		ASN1_TYPE_free(p7i->digest_enc_alg->parameter);	if ((p7i->digest_enc_alg->parameter=ASN1_TYPE_new()) == NULL)		goto err;	p7i->digest_enc_alg->parameter->type=V_ASN1_NULL;#endif	return(1);err:	return(0);	}