/freebsd/crypto/openssl/crypto/cms/ |
H A D | cms_lib.c | 23 **cms_get0_certificate_choices(CMS_ContentInfo *cms); 76 void CMS_ContentInfo_free(CMS_ContentInfo *cms) in CMS_ContentInfo_free() argument 78 if (cms != NULL) { in CMS_ContentInfo_free() 79 ossl_cms_env_enc_content_free(cms); in CMS_ContentInfo_free() 80 OPENSSL_free(cms->ctx.propq); in CMS_ContentInfo_free() 81 ASN1_item_free((ASN1_VALUE *)cms, ASN1_ITEM_rptr(CMS_ContentInfo)); in CMS_ContentInfo_free() 85 const CMS_CTX *ossl_cms_get0_cmsctx(const CMS_ContentInfo *cms) in ossl_cms_get0_cmsctx() argument 87 return cms != NULL ? &cms->ctx : NULL; in ossl_cms_get0_cmsctx() 122 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms) in CMS_get0_type() argument 124 return cms->contentType; in CMS_get0_type() [all …]
|
H A D | cms_smime.c | 78 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 D | cms_io.c | 18 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms) in CMS_stream() argument 21 pos = CMS_get0_content(cms); in CMS_stream() 36 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms) in d2i_CMS_bio() argument 39 const CMS_CTX *ctx = ossl_cms_get0_cmsctx(cms == NULL ? NULL : *cms); in d2i_CMS_bio() 41 ci = ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms, in d2i_CMS_bio() 52 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms) in i2d_CMS_bio() argument 54 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms); in i2d_CMS_bio() 59 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms) in IMPLEMENT_PEM_rw() 61 return BIO_new_NDEF(out, (ASN1_VALUE *)cms, in IMPLEMENT_PEM_rw() 67 int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags) in i2d_CMS_bio_stream() argument [all …]
|
H A D | cms_env.c | 29 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() 63 CMS_EnvelopedData *ossl_cms_get0_enveloped(CMS_ContentInfo *cms) in ossl_cms_get0_enveloped() argument 65 if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_enveloped) { in ossl_cms_get0_enveloped() 69 return cms->d.envelopedData; in ossl_cms_get0_enveloped() 72 CMS_AuthEnvelopedData *ossl_cms_get0_auth_enveloped(CMS_ContentInfo *cms) in ossl_cms_get0_auth_enveloped() argument 74 if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_authEnvelopedData) { in ossl_cms_get0_auth_enveloped() 78 return cms->d.authEnvelopedData; in ossl_cms_get0_auth_enveloped() [all …]
|
H A D | cms_dd.c | 24 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 D | cms_cd.c | 28 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() 58 return cms; in ossl_cms_CompressedData_create() 61 CMS_ContentInfo_free(cms); in ossl_cms_CompressedData_create() 65 BIO *ossl_cms_CompressedData_init_bio(const CMS_ContentInfo *cms) in ossl_cms_CompressedData_init_bio() argument 70 if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_compressedData) { in ossl_cms_CompressedData_init_bio() 74 cd = cms->d.compressedData; in ossl_cms_CompressedData_init_bio()
|
H A D | cms_sd.c | 27 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 = in cms_signed_data_init() 47 cms->d.signedData->encapContentInfo->partial = 1; in cms_signed_data_init() [all …]
|
H A D | cms_local.h | 391 BIO *ossl_cms_content_bio(CMS_ContentInfo *cms); 392 const CMS_CTX *ossl_cms_get0_cmsctx(const CMS_ContentInfo *cms); 402 BIO *ossl_cms_DigestedData_init_bio(const CMS_ContentInfo *cms); 403 int ossl_cms_DigestedData_do_final(const CMS_ContentInfo *cms, 406 BIO *ossl_cms_SignedData_init_bio(CMS_ContentInfo *cms); 407 int ossl_cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain); 419 BIO *ossl_cms_CompressedData_init_bio(const CMS_ContentInfo *cms); 433 BIO *ossl_cms_EncryptedData_init_bio(const CMS_ContentInfo *cms); 439 int ossl_cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms); 443 BIO *ossl_cms_EnvelopedData_init_bio(CMS_ContentInfo *cms); [all …]
|
H A D | cms_enc.c | 226 int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, in CMS_EncryptedData_set1_key() argument 236 cms->d.encryptedData = M_ASN1_new_of(CMS_EncryptedData); in CMS_EncryptedData_set1_key() 237 if (!cms->d.encryptedData) { in CMS_EncryptedData_set1_key() 241 cms->contentType = OBJ_nid2obj(NID_pkcs7_encrypted); in CMS_EncryptedData_set1_key() 242 cms->d.encryptedData->version = 0; in CMS_EncryptedData_set1_key() 243 } else if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_encrypted) { in CMS_EncryptedData_set1_key() 247 ec = cms->d.encryptedData->encryptedContentInfo; in CMS_EncryptedData_set1_key() 249 ossl_cms_get0_cmsctx(cms)); in CMS_EncryptedData_set1_key() 252 BIO *ossl_cms_EncryptedData_init_bio(const CMS_ContentInfo *cms) in ossl_cms_EncryptedData_init_bio() argument 254 CMS_EncryptedData *enc = cms->d.encryptedData; in ossl_cms_EncryptedData_init_bio() [all …]
|
/freebsd/crypto/heimdal/lib/hx509/ |
H A D | test_cms.in | 55 ${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 D | cms.h.in | 96 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms); 98 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); 99 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); 101 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); 102 int CMS_is_detached(CMS_ContentInfo *cms); 103 int CMS_set_detached(CMS_ContentInfo *cms, int detached); 108 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms); 109 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); 110 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); 112 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); [all …]
|
H A D | cms.h | 194 const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms); 196 BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); 197 int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); 199 ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); 200 int CMS_is_detached(CMS_ContentInfo *cms); 201 int CMS_set_detached(CMS_ContentInfo *cms, int detached); 206 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms); 207 CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); 208 int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); 210 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); [all …]
|
/freebsd/crypto/openssl/doc/man3/ |
H A D | CMS_add0_cert.pod | 10 #include <openssl/cms.h> 12 int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); 13 int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); 14 STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); 16 int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); 17 int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); 18 STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); 22 CMS_add0_cert() and CMS_add1_cert() add certificate I<cert> to I<cms>. 25 I<cms> must be of type signed data or (authenticated) enveloped data. 30 CMS_get1_certs() returns all certificates in I<cms>. [all …]
|
/freebsd/crypto/openssl/apps/ |
H A D | cms.c | 26 static void receipt_request_print(CMS_ContentInfo *cms); 280 CMS_ContentInfo *cms = NULL, *rcms = NULL; in cms_main() local 894 cms = load_content_info(informat, in, flags, &indata, "SMIME"); in cms_main() 895 if (cms == NULL) in cms_main() 906 allcerts = CMS_get1_certs(cms); in cms_main() 947 cms = CMS_data_create_ex(in, flags, libctx, app_get0_propq()); in cms_main() 949 cms = CMS_digest_create_ex(in, sign_md, flags, libctx, app_get0_propq()); in cms_main() 951 cms = CMS_compress(in, -1, flags); in cms_main() 955 cms = CMS_encrypt_ex(NULL, in, cipher, flags, libctx, app_get0_propq()); in cms_main() 956 if (cms == NULL) in cms_main() [all …]
|
/freebsd/crypto/openssl/demos/cms/ |
H A D | cms_sign2.c | 20 CMS_ContentInfo *cms = NULL; in main() local 58 cms = CMS_sign(NULL, NULL, NULL, in, CMS_STREAM | CMS_PARTIAL); in main() 60 if (!cms) in main() 65 if (!CMS_add1_signer(cms, scert, skey, NULL, 0)) in main() 68 if (!CMS_add1_signer(cms, scert2, skey2, NULL, 0)) in main() 77 if (!SMIME_write_CMS(out, cms, in, CMS_STREAM)) in main() 89 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_denc.c | 23 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() 89 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_uncomp.c | 18 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() 54 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_comp.c | 18 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 D | cms_dec.c | 20 CMS_ContentInfo *cms = NULL; in main() local 49 cms = SMIME_read_CMS(in, NULL); in main() 51 if (!cms) in main() 59 if (!CMS_decrypt(cms, rkey, rcert, NULL, out, 0)) in main() 71 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_sign.c | 20 CMS_ContentInfo *cms = NULL; in main() local 56 cms = CMS_sign(scert, skey, NULL, in, flags); in main() 58 if (!cms) in main() 69 if (!SMIME_write_CMS(out, cms, in, flags)) in main() 81 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_ver.c | 20 CMS_ContentInfo *cms = NULL; in main() local 55 cms = SMIME_read_CMS(in, &cont); in main() 57 if (cms == NULL) in main() 65 if (!CMS_verify(cms, NULL, st, cont, out, 0)) { in main() 82 CMS_ContentInfo_free(cms); in main()
|
H A D | cms_ddec.c | 23 CMS_ContentInfo *cms = NULL; in main() local 52 cms = PEM_read_bio_CMS(in, NULL, 0, NULL); in main() 54 if (!cms) in main() 68 if (!CMS_decrypt(cms, rkey, rcert, dcont, out, 0)) in main() 80 CMS_ContentInfo_free(cms); in main()
|
/freebsd/crypto/openssl/fuzz/ |
H A D | cms.c | 30 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()
|
H A D | build.info | 18 IF[{- !$disabled{"cms"} -}] 19 PROGRAMS{noinst}=cms 54 SOURCE[cms]=cms.c driver.c 55 INCLUDE[cms]=../include {- $ex_inc -} 56 DEPEND[cms]=../libcrypto {- $ex_lib -} 86 IF[{- !$disabled{"cms"} -}] 87 PROGRAMS{noinst}=cms-test 123 SOURCE[cms-test]=cms.c test-corpus.c 124 INCLUDE[cms-test]=../include 125 DEPEND[cms-test]=../libcrypto
|
/freebsd/crypto/openssl/test/ |
H A D | cmsapitest.c | 85 CMS_ContentInfo *cms = NULL; in test_d2i_CMS_bio_NULL() local 284 && TEST_ptr(cms = d2i_CMS_bio(bio, NULL)) in test_d2i_CMS_bio_NULL() 285 && TEST_true(CMS_verify(cms, NULL, NULL, NULL, NULL, in test_d2i_CMS_bio_NULL() 287 CMS_ContentInfo_free(cms); in test_d2i_CMS_bio_NULL() 324 CMS_ContentInfo *cms = NULL; in test_d2i_CMS_decode() local 335 if (!TEST_ptr(cms = d2i_CMS_bio(bio, NULL))) in test_d2i_CMS_decode() 342 if (!TEST_ptr(cms = d2i_CMS_ContentInfo(NULL, &tmp, buf_len))) in test_d2i_CMS_decode() 352 CMS_ContentInfo_free(cms); in test_d2i_CMS_decode()
|