Lines Matching refs:p7
24 int PKCS7_type_is_other(PKCS7 *p7)
28 int nid = OBJ_obj2nid(p7->type);
47 ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7)
49 if (PKCS7_type_is_data(p7))
50 return p7->d.data;
51 if (PKCS7_type_is_other(p7) && p7->d.other
52 && (p7->d.other->type == V_ASN1_OCTET_STRING))
53 return p7->d.other->value.octet_string;
207 BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
224 if (p7 == NULL) {
228 p7_ctx = ossl_pkcs7_get0_ctx(p7);
240 * calling this method, so a NULL p7->d is always an error.
242 if (p7->d.ptr == NULL) {
247 i = OBJ_obj2nid(p7->type);
248 p7->state = PKCS7_S_HEADER;
252 md_sk = p7->d.sign->md_algs;
253 os = PKCS7_get_octet_string(p7->d.sign->contents);
256 rsk = p7->d.signed_and_enveloped->recipientinfo;
257 md_sk = p7->d.signed_and_enveloped->md_algs;
258 xalg = p7->d.signed_and_enveloped->enc_data->algorithm;
259 evp_cipher = p7->d.signed_and_enveloped->enc_data->cipher;
266 rsk = p7->d.enveloped->recipientinfo;
267 xalg = p7->d.enveloped->enc_data->algorithm;
268 evp_cipher = p7->d.enveloped->enc_data->cipher;
275 xa = p7->d.digest->md;
276 os = PKCS7_get_octet_string(p7->d.digest->contents);
357 if (PKCS7_is_detached(p7)) {
395 BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
417 if (p7 == NULL) {
422 p7_ctx = ossl_pkcs7_get0_ctx(p7);
426 if (p7->d.ptr == NULL) {
431 i = OBJ_obj2nid(p7->type);
432 p7->state = PKCS7_S_HEADER;
437 * p7->d.sign->contents is a PKCS7 structure consisting of a contentType
442 data_body = PKCS7_get_octet_string(p7->d.sign->contents);
443 if (!PKCS7_is_detached(p7) && data_body == NULL) {
447 md_sk = p7->d.sign->md_algs;
450 rsk = p7->d.signed_and_enveloped->recipientinfo;
451 md_sk = p7->d.signed_and_enveloped->md_algs;
453 data_body = p7->d.signed_and_enveloped->enc_data->enc_data;
454 enc_alg = p7->d.signed_and_enveloped->enc_data->algorithm;
473 rsk = p7->d.enveloped->recipientinfo;
474 enc_alg = p7->d.enveloped->enc_data->algorithm;
476 data_body = p7->d.enveloped->enc_data->enc_data;
727 int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
739 if (p7 == NULL) {
744 p7_ctx = ossl_pkcs7_get0_ctx(p7);
746 if (p7->d.ptr == NULL) {
757 i = OBJ_obj2nid(p7->type);
758 p7->state = PKCS7_S_HEADER;
762 os = p7->d.data;
766 si_sk = p7->d.signed_and_enveloped->signer_info;
767 os = p7->d.signed_and_enveloped->enc_data->enc_data;
774 p7->d.signed_and_enveloped->enc_data->enc_data = os;
779 os = p7->d.enveloped->enc_data->enc_data;
786 p7->d.enveloped->enc_data->enc_data = os;
790 si_sk = p7->d.sign->signer_info;
791 os = PKCS7_get_octet_string(p7->d.sign->contents);
793 if (PKCS7_type_is_data(p7->d.sign->contents) && p7->detached) {
796 p7->d.sign->contents->d.data = NULL;
801 os = PKCS7_get_octet_string(p7->d.digest->contents);
803 if (PKCS7_type_is_data(p7->d.digest->contents) && p7->detached) {
806 p7->d.digest->contents->d.data = NULL;
867 OBJ_obj2nid(p7->d.digest->md->algorithm)))
871 if (!ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, md_len))
875 if (!PKCS7_is_detached(p7)) {
961 PKCS7 *p7, PKCS7_SIGNER_INFO *si)
968 if (p7 == NULL) {
973 if (p7->d.ptr == NULL) {
978 if (PKCS7_type_is_signed(p7)) {
979 cert = p7->d.sign->cert;
980 } else if (PKCS7_type_is_signedAndEnveloped(p7)) {
981 cert = p7->d.signed_and_enveloped->cert;
1009 return PKCS7_signatureVerify(bio, p7, si, x509);
1014 int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
1027 const PKCS7_CTX *ctx = ossl_pkcs7_get0_ctx(p7);
1037 if (!PKCS7_type_is_signed(p7) && !PKCS7_type_is_signedAndEnveloped(p7)) {
1141 PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
1147 i = OBJ_obj2nid(p7->type);
1150 if (p7->d.signed_and_enveloped == NULL)
1152 rsk = p7->d.signed_and_enveloped->recipientinfo;