Lines Matching refs:p7
22 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
28 PKCS7 *p7; in PKCS7_sign_ex() local
31 if ((p7 = PKCS7_new_ex(libctx, propq)) == NULL) { in PKCS7_sign_ex()
36 if (!PKCS7_set_type(p7, NID_pkcs7_signed)) in PKCS7_sign_ex()
39 if (!PKCS7_content_new(p7, NID_pkcs7_data)) in PKCS7_sign_ex()
42 if (pkey && !PKCS7_sign_add_signer(p7, signcert, pkey, NULL, flags)) { in PKCS7_sign_ex()
49 if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i))) in PKCS7_sign_ex()
55 PKCS7_set_detached(p7, 1); in PKCS7_sign_ex()
58 return p7; in PKCS7_sign_ex()
60 if (PKCS7_final(p7, data, flags)) in PKCS7_sign_ex()
61 return p7; in PKCS7_sign_ex()
64 PKCS7_free(p7); in PKCS7_sign_ex()
75 int PKCS7_final(PKCS7 *p7, BIO *data, int flags) in PKCS7_final() argument
80 if ((p7bio = PKCS7_dataInit(p7, NULL)) == NULL) { in PKCS7_final()
90 if (!PKCS7_dataFinal(p7, p7bio)) { in PKCS7_final()
118 PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert, in PKCS7_sign_add_signer() argument
131 if ((si = PKCS7_add_signature(p7, signcert, pkey, md)) == NULL) { in PKCS7_sign_add_signer()
136 si->ctx = ossl_pkcs7_get0_ctx(p7); in PKCS7_sign_add_signer()
138 if (!PKCS7_add_certificate(p7, signcert)) in PKCS7_sign_add_signer()
169 if (!pkcs7_copy_existing_digest(p7, si)) in PKCS7_sign_add_signer()
187 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si) in pkcs7_copy_existing_digest() argument
193 sinfos = PKCS7_get_signer_info(p7); in pkcs7_copy_existing_digest()
215 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, in PKCS7_verify() argument
231 if (p7 == NULL) { in PKCS7_verify()
236 if (!PKCS7_type_is_signed(p7)) { in PKCS7_verify()
242 if (PKCS7_get_detached(p7) && indata == NULL) { in PKCS7_verify()
255 if (!PKCS7_get_detached(p7) && indata != NULL) { in PKCS7_verify()
261 sinfos = PKCS7_get_signer_info(p7); in PKCS7_verify()
268 signers = PKCS7_get0_signers(p7, certs, flags); in PKCS7_verify()
273 p7_ctx = ossl_pkcs7_get0_ctx(p7); in PKCS7_verify()
281 included_certs = pkcs7_get0_certificates(p7); in PKCS7_verify()
297 X509_STORE_CTX_set0_crls(cert_ctx, p7->d.sign->crl); in PKCS7_verify()
310 if ((p7bio = PKCS7_dataInit(p7, indata)) == NULL) in PKCS7_verify()
347 j = PKCS7_signatureVerify(p7bio, p7, si, signer); in PKCS7_verify()
367 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, in STACK_OF()
377 if (p7 == NULL) { in STACK_OF()
382 if (!PKCS7_type_is_signed(p7)) { in STACK_OF()
386 included_certs = pkcs7_get0_certificates(p7); in STACK_OF()
390 sinfos = PKCS7_get_signer_info(p7); in STACK_OF()
432 PKCS7 *p7; in PKCS7_encrypt_ex() local
437 if ((p7 = PKCS7_new_ex(libctx, propq)) == NULL) { in PKCS7_encrypt_ex()
442 if (!PKCS7_set_type(p7, NID_pkcs7_enveloped)) in PKCS7_encrypt_ex()
444 if (!PKCS7_set_cipher(p7, cipher)) { in PKCS7_encrypt_ex()
451 if (!PKCS7_add_recipient(p7, x509)) { in PKCS7_encrypt_ex()
458 return p7; in PKCS7_encrypt_ex()
460 if (PKCS7_final(p7, in, flags)) in PKCS7_encrypt_ex()
461 return p7; in PKCS7_encrypt_ex()
466 PKCS7_free(p7); in PKCS7_encrypt_ex()
478 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) in PKCS7_decrypt() argument
484 if (p7 == NULL) { in PKCS7_decrypt()
489 if (!PKCS7_type_is_enveloped(p7) in PKCS7_decrypt()
490 && !PKCS7_type_is_signedAndEnveloped(p7)) { in PKCS7_decrypt()
501 if ((tmpmem = PKCS7_dataDecode(p7, pkey, NULL, cert)) == NULL) { in PKCS7_decrypt()