Lines Matching refs:p7
20 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
25 PKCS7 *p7; in PKCS7_sign() local
28 if ((p7 = PKCS7_new()) == NULL) { in PKCS7_sign()
33 if (!PKCS7_set_type(p7, NID_pkcs7_signed)) in PKCS7_sign()
36 if (!PKCS7_content_new(p7, NID_pkcs7_data)) in PKCS7_sign()
39 if (pkey && !PKCS7_sign_add_signer(p7, signcert, pkey, NULL, flags)) { in PKCS7_sign()
46 if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i))) in PKCS7_sign()
52 PKCS7_set_detached(p7, 1); in PKCS7_sign()
55 return p7; in PKCS7_sign()
57 if (PKCS7_final(p7, data, flags)) in PKCS7_sign()
58 return p7; in PKCS7_sign()
61 PKCS7_free(p7); in PKCS7_sign()
65 int PKCS7_final(PKCS7 *p7, BIO *data, int flags) in PKCS7_final() argument
70 if ((p7bio = PKCS7_dataInit(p7, NULL)) == NULL) { in PKCS7_final()
79 if (!PKCS7_dataFinal(p7, p7bio)) { in PKCS7_final()
109 PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert, in PKCS7_sign_add_signer() argument
121 if ((si = PKCS7_add_signature(p7, signcert, pkey, md)) == NULL) { in PKCS7_sign_add_signer()
128 if (!PKCS7_add_certificate(p7, signcert)) in PKCS7_sign_add_signer()
159 if (!pkcs7_copy_existing_digest(p7, si)) in PKCS7_sign_add_signer()
176 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si) in pkcs7_copy_existing_digest() argument
182 sinfos = PKCS7_get_signer_info(p7); in pkcs7_copy_existing_digest()
204 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, in PKCS7_verify() argument
217 if (!p7) { in PKCS7_verify()
222 if (!PKCS7_type_is_signed(p7)) { in PKCS7_verify()
228 if (PKCS7_get_detached(p7) && !indata) { in PKCS7_verify()
241 if (!PKCS7_get_detached(p7) && indata) { in PKCS7_verify()
247 sinfos = PKCS7_get_signer_info(p7); in PKCS7_verify()
254 signers = PKCS7_get0_signers(p7, certs, flags); in PKCS7_verify()
268 p7->d.sign->cert)) { in PKCS7_verify()
278 X509_STORE_CTX_set0_crls(cert_ctx, p7->d.sign->crl); in PKCS7_verify()
312 if ((p7bio = PKCS7_dataInit(p7, tmpin)) == NULL) in PKCS7_verify()
351 j = PKCS7_signatureVerify(p7bio, p7, si, signer); in PKCS7_verify()
372 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, in STACK_OF()
382 if (!p7) { in STACK_OF()
387 if (!PKCS7_type_is_signed(p7)) { in STACK_OF()
394 sinfos = PKCS7_get_signer_info(p7); in STACK_OF()
415 && p7->d.sign->cert) in STACK_OF()
417 X509_find_by_issuer_and_serial(p7->d.sign->cert, in STACK_OF()
439 PKCS7 *p7; in PKCS7_encrypt() local
443 if ((p7 = PKCS7_new()) == NULL) { in PKCS7_encrypt()
448 if (!PKCS7_set_type(p7, NID_pkcs7_enveloped)) in PKCS7_encrypt()
450 if (!PKCS7_set_cipher(p7, cipher)) { in PKCS7_encrypt()
457 if (!PKCS7_add_recipient(p7, x509)) { in PKCS7_encrypt()
464 return p7; in PKCS7_encrypt()
466 if (PKCS7_final(p7, in, flags)) in PKCS7_encrypt()
467 return p7; in PKCS7_encrypt()
472 PKCS7_free(p7); in PKCS7_encrypt()
477 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) in PKCS7_decrypt() argument
483 if (!p7) { in PKCS7_decrypt()
488 if (!PKCS7_type_is_enveloped(p7)) { in PKCS7_decrypt()
499 if ((tmpmem = PKCS7_dataDecode(p7, pkey, NULL, cert)) == NULL) { in PKCS7_decrypt()