Lines Matching defs:p7i
365 int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
376 if (!ASN1_INTEGER_set(p7i->version,1))
378 if (!X509_NAME_set(&p7i->issuer_and_serial->issuer,
384 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
385 if (!(p7i->issuer_and_serial->serial=
391 p7i->pkey=pkey;
394 if (is_dsa) p7i->digest_alg->algorithm=OBJ_nid2obj(NID_sha1);
396 p7i->digest_alg->algorithm=OBJ_nid2obj(EVP_MD_type(dgst));
398 if (p7i->digest_alg->parameter != NULL)
399 ASN1_TYPE_free(p7i->digest_alg->parameter);
400 if ((p7i->digest_alg->parameter=ASN1_TYPE_new()) == NULL)
402 p7i->digest_alg->parameter->type=V_ASN1_NULL;
404 if (p7i->digest_enc_alg->parameter != NULL)
405 ASN1_TYPE_free(p7i->digest_enc_alg->parameter);
409 p7i->digest_enc_alg->algorithm=OBJ_nid2obj(NID_rsaEncryption);
410 if (!(p7i->digest_enc_alg->parameter=ASN1_TYPE_new()))
412 p7i->digest_enc_alg->parameter->type=V_ASN1_NULL;
419 p7i->digest_enc_alg->algorithm=OBJ_nid2obj(NID_dsa);
423 p7i->digest_enc_alg->algorithm=OBJ_nid2obj(NID_dsaWithSHA1);
425 p7i->digest_enc_alg->parameter = NULL; /* special case for DSA: omit 'parameter'! */
429 p7i->digest_enc_alg->algorithm=OBJ_nid2obj(NID_ecdsa_with_SHA1);
430 if (!(p7i->digest_enc_alg->parameter=ASN1_TYPE_new()))
432 p7i->digest_enc_alg->parameter->type=V_ASN1_NULL;
525 int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509)
527 if (!ASN1_INTEGER_set(p7i->version,0))
529 if (!X509_NAME_set(&p7i->issuer_and_serial->issuer,
533 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
534 if (!(p7i->issuer_and_serial->serial=
538 X509_ALGOR_free(p7i->key_enc_algor);
539 if (!(p7i->key_enc_algor= X509_ALGOR_dup(x509->cert_info->key->algor)))
543 p7i->cert=x509;