• Home
  • Raw
  • Download

Lines Matching refs:p7

17 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)  in PKCS7_ctrl()  argument
22 nid = OBJ_obj2nid(p7->type); in PKCS7_ctrl()
28 ret = p7->detached = (int)larg; in PKCS7_ctrl()
29 if (ret && PKCS7_type_is_data(p7->d.sign->contents)) { in PKCS7_ctrl()
31 os = p7->d.sign->contents->d.data; in PKCS7_ctrl()
33 p7->d.sign->contents->d.data = NULL; in PKCS7_ctrl()
43 if (!p7->d.sign || !p7->d.sign->contents->d.ptr) in PKCS7_ctrl()
48 p7->detached = ret; in PKCS7_ctrl()
63 int PKCS7_content_new(PKCS7 *p7, int type) in PKCS7_content_new() argument
71 if (!PKCS7_set_content(p7, ret)) in PKCS7_content_new()
80 int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data) in PKCS7_set_content() argument
84 i = OBJ_obj2nid(p7->type); in PKCS7_set_content()
87 PKCS7_free(p7->d.sign->contents); in PKCS7_set_content()
88 p7->d.sign->contents = p7_data; in PKCS7_set_content()
91 PKCS7_free(p7->d.digest->contents); in PKCS7_set_content()
92 p7->d.digest->contents = p7_data; in PKCS7_set_content()
107 int PKCS7_set_type(PKCS7 *p7, int type) in PKCS7_set_type() argument
118 p7->type = obj; in PKCS7_set_type()
119 if ((p7->d.sign = PKCS7_SIGNED_new()) == NULL) in PKCS7_set_type()
121 if (!ASN1_INTEGER_set(p7->d.sign->version, 1)) { in PKCS7_set_type()
122 PKCS7_SIGNED_free(p7->d.sign); in PKCS7_set_type()
123 p7->d.sign = NULL; in PKCS7_set_type()
128 p7->type = obj; in PKCS7_set_type()
129 if ((p7->d.data = ASN1_OCTET_STRING_new()) == NULL) in PKCS7_set_type()
133 p7->type = obj; in PKCS7_set_type()
134 if ((p7->d.signed_and_enveloped = PKCS7_SIGN_ENVELOPE_new()) in PKCS7_set_type()
137 if (!ASN1_INTEGER_set(p7->d.signed_and_enveloped->version, 1)) in PKCS7_set_type()
139 p7->d.signed_and_enveloped->enc_data->content_type in PKCS7_set_type()
143 p7->type = obj; in PKCS7_set_type()
144 if ((p7->d.enveloped = PKCS7_ENVELOPE_new()) in PKCS7_set_type()
147 if (!ASN1_INTEGER_set(p7->d.enveloped->version, 0)) in PKCS7_set_type()
149 p7->d.enveloped->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_data); in PKCS7_set_type()
152 p7->type = obj; in PKCS7_set_type()
153 if ((p7->d.encrypted = PKCS7_ENCRYPT_new()) in PKCS7_set_type()
156 if (!ASN1_INTEGER_set(p7->d.encrypted->version, 0)) in PKCS7_set_type()
158 p7->d.encrypted->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_data); in PKCS7_set_type()
162 p7->type = obj; in PKCS7_set_type()
163 if ((p7->d.digest = PKCS7_DIGEST_new()) in PKCS7_set_type()
166 if (!ASN1_INTEGER_set(p7->d.digest->version, 0)) in PKCS7_set_type()
178 int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other) in PKCS7_set0_type_other() argument
180 p7->type = OBJ_nid2obj(type); in PKCS7_set0_type_other()
181 p7->d.other = other; in PKCS7_set0_type_other()
185 int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *psi) in PKCS7_add_signer() argument
192 i = OBJ_obj2nid(p7->type); in PKCS7_add_signer()
195 signer_sk = p7->d.sign->signer_info; in PKCS7_add_signer()
196 md_sk = p7->d.sign->md_algs; in PKCS7_add_signer()
199 signer_sk = p7->d.signed_and_enveloped->signer_info; in PKCS7_add_signer()
200 md_sk = p7->d.signed_and_enveloped->md_algs; in PKCS7_add_signer()
238 int PKCS7_add_certificate(PKCS7 *p7, X509 *x509) in PKCS7_add_certificate() argument
243 i = OBJ_obj2nid(p7->type); in PKCS7_add_certificate()
246 sk = &(p7->d.sign->cert); in PKCS7_add_certificate()
249 sk = &(p7->d.signed_and_enveloped->cert); in PKCS7_add_certificate()
270 int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl) in PKCS7_add_crl() argument
275 i = OBJ_obj2nid(p7->type); in PKCS7_add_crl()
278 sk = &(p7->d.sign->crl); in PKCS7_add_crl()
281 sk = &(p7->d.signed_and_enveloped->crl); in PKCS7_add_crl()
349 PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, EVP_PKEY *pkey, in PKCS7_add_signature() argument
369 if (!PKCS7_add_signer(p7, si)) in PKCS7_add_signature()
377 int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md) in PKCS7_set_digest() argument
379 if (PKCS7_type_is_digest(p7)) { in PKCS7_set_digest()
380 if ((p7->d.digest->md->parameter = ASN1_TYPE_new()) == NULL) { in PKCS7_set_digest()
384 p7->d.digest->md->parameter->type = V_ASN1_NULL; in PKCS7_set_digest()
385 p7->d.digest->md->algorithm = OBJ_nid2obj(EVP_MD_nid(md)); in PKCS7_set_digest()
393 STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7) in STACK_OF()
395 if (p7 == NULL || p7->d.ptr == NULL) in STACK_OF()
397 if (PKCS7_type_is_signed(p7)) { in STACK_OF()
398 return p7->d.sign->signer_info; in STACK_OF()
399 } else if (PKCS7_type_is_signedAndEnveloped(p7)) { in STACK_OF()
400 return p7->d.signed_and_enveloped->signer_info; in STACK_OF()
422 PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509) in PKCS7_add_recipient() argument
430 if (!PKCS7_add_recipient_info(p7, ri)) in PKCS7_add_recipient()
438 int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri) in PKCS7_add_recipient_info() argument
443 i = OBJ_obj2nid(p7->type); in PKCS7_add_recipient_info()
446 sk = p7->d.signed_and_enveloped->recipientinfo; in PKCS7_add_recipient_info()
449 sk = p7->d.enveloped->recipientinfo; in PKCS7_add_recipient_info()
506 X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si) in PKCS7_cert_from_signer_info() argument
508 if (PKCS7_type_is_signed(p7)) in PKCS7_cert_from_signer_info()
509 return (X509_find_by_issuer_and_serial(p7->d.sign->cert, in PKCS7_cert_from_signer_info()
517 int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher) in PKCS7_set_cipher() argument
522 i = OBJ_obj2nid(p7->type); in PKCS7_set_cipher()
525 ec = p7->d.signed_and_enveloped->enc_data; in PKCS7_set_cipher()
528 ec = p7->d.enveloped->enc_data; in PKCS7_set_cipher()
547 int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7) in PKCS7_stream() argument
551 switch (OBJ_obj2nid(p7->type)) { in PKCS7_stream()
553 os = p7->d.data; in PKCS7_stream()
557 os = p7->d.signed_and_enveloped->enc_data->enc_data; in PKCS7_stream()
560 p7->d.signed_and_enveloped->enc_data->enc_data = os; in PKCS7_stream()
565 os = p7->d.enveloped->enc_data->enc_data; in PKCS7_stream()
568 p7->d.enveloped->enc_data->enc_data = os; in PKCS7_stream()
573 os = p7->d.sign->contents->d.data; in PKCS7_stream()