Lines Matching defs:p7

71 static int PKCS7_type_is_other(PKCS7 *p7)
75 int nid = OBJ_obj2nid(p7->type);
94 static ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7)
96 if (PKCS7_type_is_data(p7))
97 return p7->d.data;
98 if (PKCS7_type_is_other(p7) && p7->d.other
99 && (p7->d.other->type == V_ASN1_OCTET_STRING))
100 return p7->d.other->value.octet_string;
252 BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
264 if (p7 == NULL) {
276 * calling this method, so a NULL p7->d is always an error.
278 if (p7->d.ptr == NULL) {
283 i = OBJ_obj2nid(p7->type);
284 p7->state = PKCS7_S_HEADER;
288 md_sk = p7->d.sign->md_algs;
289 os = PKCS7_get_octet_string(p7->d.sign->contents);
292 rsk = p7->d.signed_and_enveloped->recipientinfo;
293 md_sk = p7->d.signed_and_enveloped->md_algs;
294 xalg = p7->d.signed_and_enveloped->enc_data->algorithm;
295 evp_cipher = p7->d.signed_and_enveloped->enc_data->cipher;
302 rsk = p7->d.enveloped->recipientinfo;
303 xalg = p7->d.enveloped->enc_data->algorithm;
304 evp_cipher = p7->d.enveloped->enc_data->cipher;
311 xa = p7->d.digest->md;
312 os = PKCS7_get_octet_string(p7->d.digest->contents);
378 if (PKCS7_is_detached(p7))
417 BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
433 if (p7 == NULL) {
438 if (p7->d.ptr == NULL) {
443 i = OBJ_obj2nid(p7->type);
444 p7->state = PKCS7_S_HEADER;
449 * p7->d.sign->contents is a PKCS7 structure consisting of a contentType
454 data_body = PKCS7_get_octet_string(p7->d.sign->contents);
455 if (!PKCS7_is_detached(p7) && data_body == NULL) {
460 md_sk = p7->d.sign->md_algs;
463 rsk = p7->d.signed_and_enveloped->recipientinfo;
464 md_sk = p7->d.signed_and_enveloped->md_algs;
466 data_body = p7->d.signed_and_enveloped->enc_data->enc_data;
467 enc_alg = p7->d.signed_and_enveloped->enc_data->algorithm;
476 rsk = p7->d.enveloped->recipientinfo;
477 enc_alg = p7->d.enveloped->enc_data->algorithm;
479 data_body = p7->d.enveloped->enc_data->enc_data;
744 int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
755 if (p7 == NULL) {
760 if (p7->d.ptr == NULL) {
766 i = OBJ_obj2nid(p7->type);
767 p7->state = PKCS7_S_HEADER;
771 os = p7->d.data;
775 si_sk = p7->d.signed_and_enveloped->signer_info;
776 os = p7->d.signed_and_enveloped->enc_data->enc_data;
783 p7->d.signed_and_enveloped->enc_data->enc_data = os;
788 os = p7->d.enveloped->enc_data->enc_data;
795 p7->d.enveloped->enc_data->enc_data = os;
799 si_sk = p7->d.sign->signer_info;
800 os = PKCS7_get_octet_string(p7->d.sign->contents);
802 if (PKCS7_type_is_data(p7->d.sign->contents) && p7->detached) {
805 p7->d.sign->contents->d.data = NULL;
810 os = PKCS7_get_octet_string(p7->d.digest->contents);
812 if (PKCS7_type_is_data(p7->d.digest->contents) && p7->detached) {
815 p7->d.digest->contents->d.data = NULL;
873 OBJ_obj2nid(p7->d.digest->md->algorithm)))
877 M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, md_len);
880 if (!PKCS7_is_detached(p7)) {
971 PKCS7 *p7, PKCS7_SIGNER_INFO *si)
978 if (p7 == NULL) {
983 if (p7->d.ptr == NULL) {
988 if (PKCS7_type_is_signed(p7)) {
989 cert = p7->d.sign->cert;
990 } else if (PKCS7_type_is_signedAndEnveloped(p7)) {
991 cert = p7->d.signed_and_enveloped->cert;
1022 return PKCS7_signatureVerify(bio, p7, si, x509);
1027 int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
1040 if (!PKCS7_type_is_signed(p7) && !PKCS7_type_is_signedAndEnveloped(p7)) {
1147 PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
1153 i = OBJ_obj2nid(p7->type);
1156 if (p7->d.signed_and_enveloped == NULL)
1158 rsk = p7->d.signed_and_enveloped->recipientinfo;