Home
last modified time | relevance | path

Searched refs:cms (Results 1 – 25 of 101) sorted by relevance

12345

/freebsd/crypto/openssl/crypto/cms/
H A Dcms_lib.c26 cms_get0_certificate_choices(CMS_ContentInfo *cms);
74 const CMS_CTX *ossl_cms_get0_cmsctx(const CMS_ContentInfo *cms) in ossl_cms_get0_cmsctx() argument
76 return cms != NULL ? &cms->ctx : NULL; in ossl_cms_get0_cmsctx()
111 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms) in CMS_get0_type() argument
113 return cms->contentType; in CMS_get0_type()
118 CMS_ContentInfo *cms = CMS_ContentInfo_new_ex(libctx, propq); in ossl_cms_Data_create() local
120 if (cms != NULL) { in ossl_cms_Data_create()
121 cms->contentType = OBJ_nid2obj(NID_pkcs7_data); in ossl_cms_Data_create()
123 CMS_set_detached(cms, 0); in ossl_cms_Data_create()
125 return cms; in ossl_cms_Data_create()
[all …]
H A Dcms_smime.c78 static int check_content(CMS_ContentInfo *cms) in check_content() argument
80 ASN1_OCTET_STRING **pos = CMS_get0_content(cms); in check_content()
104 int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags) in CMS_data() argument
109 if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_data) { in CMS_data()
113 cont = CMS_dataInit(cms, NULL); in CMS_data()
124 CMS_ContentInfo *cms = ossl_cms_Data_create(libctx, propq); in CMS_data_create_ex() local
126 if (cms == NULL) in CMS_data_create_ex()
129 if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) in CMS_data_create_ex()
130 return cms; in CMS_data_create_ex()
132 CMS_ContentInfo_free(cms); in CMS_data_create_ex()
[all …]
H A Dcms_io.c18 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms) in CMS_stream() argument
22 pos = CMS_get0_content(cms); in CMS_stream()
37 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms) in d2i_CMS_bio() argument
40 const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms == NULL ? NULL : *cms); in d2i_CMS_bio()
42 ci = ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms, in d2i_CMS_bio()
53 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms) in i2d_CMS_bio() argument
55 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms); in i2d_CMS_bio()
60 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms) in IMPLEMENT_PEM_rw()
62 return BIO_new_NDEF(out, (ASN1_VALUE *)cms, in IMPLEMENT_PEM_rw()
68 int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags) in i2d_CMS_bio_stream() argument
[all …]
H A Dcms_env.c29 static int cms_get_enveloped_type_simple(const CMS_ContentInfo *cms) in cms_get_enveloped_type_simple() argument
31 int nid = OBJ_obj2nid(cms->contentType); in cms_get_enveloped_type_simple()
45 static int cms_get_enveloped_type(const CMS_ContentInfo *cms) in cms_get_enveloped_type() argument
47 int ret = cms_get_enveloped_type_simple(cms); in cms_get_enveloped_type()
54 CMS_EnvelopedData *ossl_cms_get0_enveloped(CMS_ContentInfo *cms) in ossl_cms_get0_enveloped() argument
56 if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_enveloped) { in ossl_cms_get0_enveloped()
60 return cms->d.envelopedData; in ossl_cms_get0_enveloped()
63 CMS_AuthEnvelopedData *ossl_cms_get0_auth_enveloped(CMS_ContentInfo *cms) in ossl_cms_get0_auth_enveloped() argument
65 if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_authEnvelopedData) { in ossl_cms_get0_auth_enveloped()
69 return cms->d.authEnvelopedData; in ossl_cms_get0_auth_enveloped()
[all …]
H A Dcms_dd.c24 CMS_ContentInfo *cms; in ossl_cms_DigestedData_create() local
27 cms = CMS_ContentInfo_new_ex(libctx, propq); in ossl_cms_DigestedData_create()
28 if (cms == NULL) in ossl_cms_DigestedData_create()
36 cms->contentType = OBJ_nid2obj(NID_pkcs7_digest); in ossl_cms_DigestedData_create()
37 cms->d.digestedData = dd; in ossl_cms_DigestedData_create()
44 return cms; in ossl_cms_DigestedData_create()
47 CMS_ContentInfo_free(cms); in ossl_cms_DigestedData_create()
51 BIO *ossl_cms_DigestedData_init_bio(const CMS_ContentInfo *cms) in ossl_cms_DigestedData_init_bio() argument
53 CMS_DigestedData *dd = cms->d.digestedData; in ossl_cms_DigestedData_init_bio()
56 ossl_cms_get0_cmsctx(cms)); in ossl_cms_DigestedData_init_bio()
[all …]
H A Dcms_cd.c28 CMS_ContentInfo *cms; in ossl_cms_CompressedData_create() local
39 cms = CMS_ContentInfo_new_ex(libctx, propq); in ossl_cms_CompressedData_create()
40 if (cms == NULL) in ossl_cms_CompressedData_create()
48 cms->contentType = OBJ_nid2obj(NID_id_smime_ct_compressedData); in ossl_cms_CompressedData_create()
49 cms->d.compressedData = cd; in ossl_cms_CompressedData_create()
59 return cms; in ossl_cms_CompressedData_create()
62 CMS_ContentInfo_free(cms); in ossl_cms_CompressedData_create()
66 BIO *ossl_cms_CompressedData_init_bio(const CMS_ContentInfo *cms) in ossl_cms_CompressedData_init_bio() argument
71 if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_compressedData) { in ossl_cms_CompressedData_init_bio()
75 cd = cms->d.compressedData; in ossl_cms_CompressedData_init_bio()
H A Dcms_local.h392 BIO *ossl_cms_content_bio(CMS_ContentInfo *cms);
393 const CMS_CTX *ossl_cms_get0_cmsctx(const CMS_ContentInfo *cms);
399 int ossl_cms_DataFinal(CMS_ContentInfo *cms, BIO *cmsbio,
406 BIO *ossl_cms_DigestedData_init_bio(const CMS_ContentInfo *cms);
407 int ossl_cms_DigestedData_do_final(const CMS_ContentInfo *cms,
410 BIO *ossl_cms_SignedData_init_bio(CMS_ContentInfo *cms);
411 int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain,
425 BIO *ossl_cms_CompressedData_init_bio(const CMS_ContentInfo *cms);
439 BIO *ossl_cms_EncryptedData_init_bio(const CMS_ContentInfo *cms);
445 int ossl_cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms);
[all …]
H A Dcms_enc.c226 int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, in CMS_EncryptedData_set1_key() argument
240 if (cms->d.encryptedData != NULL) { in CMS_EncryptedData_set1_key()
241 M_ASN1_free_of(cms->d.encryptedData, CMS_EncryptedData); in CMS_EncryptedData_set1_key()
242 cms->d.encryptedData = NULL; in CMS_EncryptedData_set1_key()
244 cms->d.encryptedData = M_ASN1_new_of(CMS_EncryptedData); in CMS_EncryptedData_set1_key()
245 if (!cms->d.encryptedData) { in CMS_EncryptedData_set1_key()
249 cms->contentType = OBJ_nid2obj(NID_pkcs7_encrypted); in CMS_EncryptedData_set1_key()
250 cms->d.encryptedData->version = 0; in CMS_EncryptedData_set1_key()
251 } else if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_encrypted) { in CMS_EncryptedData_set1_key()
255 ec = cms->d.encryptedData->encryptedContentInfo; in CMS_EncryptedData_set1_key()
[all …]
H A Dcms_sd.c27 static CMS_SignedData *cms_get0_signed(CMS_ContentInfo *cms) in cms_get0_signed() argument
29 if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_signed) { in cms_get0_signed()
33 return cms->d.signedData; in cms_get0_signed()
36 static CMS_SignedData *cms_signed_data_init(CMS_ContentInfo *cms) in cms_signed_data_init() argument
38 if (cms->d.other == NULL) { in cms_signed_data_init()
39 cms->d.signedData = M_ASN1_new_of(CMS_SignedData); in cms_signed_data_init()
40 if (!cms->d.signedData) { in cms_signed_data_init()
44 cms->d.signedData->version = 1; in cms_signed_data_init()
45 cms->d.signedData->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data); in cms_signed_data_init()
46 cms->d.signedData->encapContentInfo->partial = 1; in cms_signed_data_init()
[all …]
/freebsd/crypto/openssl/test/
H A Dcmsapitest.c94 CMS_ContentInfo *cms = NULL; in test_CMS_add1_cert() local
97 ret = TEST_ptr(cms = CMS_ContentInfo_new()) in test_CMS_add1_cert()
98 && TEST_ptr(CMS_add1_signer(cms, cert, privkey, NULL, 0)) in test_CMS_add1_cert()
99 && TEST_true(CMS_add1_cert(cms, cert)); /* add cert again */ in test_CMS_add1_cert()
101 CMS_ContentInfo_free(cms); in test_CMS_add1_cert()
108 CMS_ContentInfo *cms = NULL; in test_d2i_CMS_bio_NULL() local
308 && TEST_ptr(cms = d2i_CMS_bio(bio, NULL)) in test_d2i_CMS_bio_NULL()
309 && TEST_true(CMS_verify(cms, NULL, NULL, NULL, NULL, flags)) in test_d2i_CMS_bio_NULL()
310 && TEST_ptr(content = CMS_SignedData_verify(cms->d.signedData, NULL, NULL, NULL, in test_d2i_CMS_bio_NULL()
313 CMS_ContentInfo_free(cms); in test_d2i_CMS_bio_NULL()
[all …]
/freebsd/crypto/heimdal/lib/hx509/
H A Dtest_cms.in55 ${hxtool} cms-create-sd \
61 ${hxtool} cms-verify-sd \
69 ${hxtool} cms-create-sd \
75 ${hxtool} cms-verify-sd \
82 ${hxtool} cms-create-sd \
89 ${hxtool} cms-verify-sd \
98 ${hxtool} cms-verify-sd \
105 ${hxtool} cms-create-sd \
112 ${hxtool} cms-verify-sd \
119 ${hxtool} cms-verify-sd \
[all …]
/freebsd/crypto/openssl/include/openssl/
H A Dcms.h.in107 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
109 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
110 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
112 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
113 int CMS_is_detached(CMS_ContentInfo *cms);
114 int CMS_set_detached(CMS_ContentInfo *cms, int detached);
119 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
120 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
121 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
123 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
[all …]
H A Dcms.h205 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
207 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
208 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
210 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
211 int CMS_is_detached(CMS_ContentInfo *cms);
212 int CMS_set_detached(CMS_ContentInfo *cms, int detached);
217 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
218 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
219 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
221 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
[all …]
/freebsd/crypto/openssl/doc/man3/
H A DCMS_add0_cert.pod11 #include <openssl/cms.h>
13 int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
14 int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
15 STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
17 int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
18 int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
19 STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
23 CMS_add0_cert() and CMS_add1_cert() add certificate I<cert> to I<cms>
27 As the 0 implies, CMS_add0_cert() adds I<cert> internally to I<cms>
30 I<cms> must be of type signed data or (authenticated) enveloped data.
[all …]
/freebsd/crypto/openssl/demos/cms/
H A Dcms_ver.c19 static void print_signingTime(CMS_ContentInfo *cms) in print_signingTime() argument
31 sis = CMS_get0_SignerInfos(cms); in print_signingTime()
63 CMS_ContentInfo *cms = NULL; in main() local
97 cms = SMIME_read_CMS(in, &cont); in main()
99 if (cms == NULL) in main()
102 print_signingTime(cms); in main()
109 if (!CMS_verify(cms, NULL, st, cont, out, 0)) { in main()
125 CMS_ContentInfo_free(cms); in main()
H A Dcms_sign2.c20 CMS_ContentInfo *cms = NULL; in main() local
60 cms = CMS_sign(NULL, NULL, NULL, in, CMS_STREAM | CMS_PARTIAL); in main()
62 if (!cms) in main()
67 if (!CMS_add1_signer(cms, scert, skey, NULL, 0)) in main()
70 if (!CMS_add1_signer(cms, scert2, skey2, NULL, 0)) in main()
79 if (!SMIME_write_CMS(out, cms, in, CMS_STREAM)) in main()
91 CMS_ContentInfo_free(cms); in main()
H A Dcms_denc.c23 CMS_ContentInfo *cms = NULL; in main() local
64 cms = CMS_encrypt(recips, in, EVP_des_ede3_cbc(), flags); in main()
66 if (!cms) in main()
73 if (!CMS_final(cms, in, dout, flags)) in main()
77 if (!PEM_write_bio_CMS(out, cms)) in main()
87 CMS_ContentInfo_free(cms); in main()
H A Dcms_uncomp.c18 CMS_ContentInfo *cms = NULL; in main() local
32 cms = SMIME_read_CMS(in, NULL); in main()
34 if (!cms) in main()
42 if (!CMS_uncompress(cms, out, NULL, 0)) in main()
52 CMS_ContentInfo_free(cms); in main()
H A Dcms_comp.c18 CMS_ContentInfo *cms = NULL; in main() local
38 cms = CMS_compress(in, NID_zlib_compression, flags); in main()
40 if (!cms) in main()
48 if (!SMIME_write_CMS(out, cms, in, flags)) in main()
60 CMS_ContentInfo_free(cms); in main()
H A Dcms_dec.c20 CMS_ContentInfo *cms = NULL; in main() local
50 cms = SMIME_read_CMS(in, NULL); in main()
52 if (!cms) in main()
60 if (!CMS_decrypt(cms, rkey, rcert, NULL, out, 0)) in main()
73 CMS_ContentInfo_free(cms); in main()
H A Dcms_enc.c20 CMS_ContentInfo *cms = NULL; in main() local
63 cms = CMS_encrypt(recips, in, EVP_des_ede3_cbc(), flags); in main()
65 if (!cms) in main()
73 if (!SMIME_write_CMS(out, cms, in, flags)) in main()
85 CMS_ContentInfo_free(cms); in main()
H A Dcms_ddec.c23 CMS_ContentInfo *cms = NULL; in main() local
53 cms = PEM_read_bio_CMS(in, NULL, 0, NULL); in main()
55 if (!cms) in main()
69 if (!CMS_decrypt(cms, rkey, rcert, dcont, out, 0)) in main()
81 CMS_ContentInfo_free(cms); in main()
H A Dcms_sign.c20 CMS_ContentInfo *cms = NULL; in main() local
57 cms = CMS_sign(scert, skey, NULL, in, flags); in main()
59 if (!cms) in main()
72 if (!SMIME_write_CMS(out, cms, in, flags)) in main()
82 CMS_ContentInfo_free(cms); in main()
/freebsd/crypto/openssl/apps/
H A Dcms.c26 static void receipt_request_print(CMS_ContentInfo *cms);
347 CMS_ContentInfo *cms = NULL, *rcms = NULL; in cms_main() local
994 cms = load_content_info(informat, in, flags, &indata, "SMIME"); in cms_main()
995 if (cms == NULL) in cms_main()
1006 allcerts = CMS_get1_certs(cms); in cms_main()
1048 cms = CMS_data_create_ex(in, flags, libctx, app_get0_propq()); in cms_main()
1050 cms = CMS_digest_create_ex(in, sign_md, flags, libctx, app_get0_propq()); in cms_main()
1052 cms = CMS_compress(in, -1, flags); in cms_main()
1056 cms = CMS_encrypt_ex(NULL, in, cipher, flags, libctx, app_get0_propq()); in cms_main()
1057 if (cms == NULL) in cms_main()
[all …]
/freebsd/crypto/openssl/fuzz/
H A Dcms.c30 CMS_ContentInfo *cms; in FuzzerTestOneInput() local
38 cms = d2i_CMS_bio(in, NULL); in FuzzerTestOneInput()
39 if (cms != NULL) { in FuzzerTestOneInput()
42 i2d_CMS_bio(out, cms); in FuzzerTestOneInput()
44 CMS_ContentInfo_free(cms); in FuzzerTestOneInput()

12345