libksba
1.5.0
About: KSBA is a library to make the tasks of working with X.509 certificates, CMS data and related objects more easy.
![]() ![]() |
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include "util.h"
#include "cms.h"
#include "convert.h"
#include "keyinfo.h"
#include "der-encoder.h"
#include "ber-help.h"
#include "sexp-parse.h"
#include "cert.h"
#include "der-builder.h"
Go to the source code of this file.
Data Structures | |
struct | attrarray_s |
Variables | |
struct { | |
const char * oid | |
ksba_content_type_t ct | |
gpg_error_t(* parse_handler )(ksba_cms_t) | |
gpg_error_t(* build_handler )(ksba_cms_t) | |
} | content_handlers [] |
static const char | oidstr_contentType [] = "1.2.840.113549.1.9.3" |
static const char | oidstr_messageDigest [] = "1.2.840.113549.1.9.4" |
static const char | oid_messageDigest [9] ="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x04" |
static const char | oidstr_signingTime [] = "1.2.840.113549.1.9.5" |
static const char | oid_signingTime [9] = "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x05" |
static const char | oidstr_smimeCapabilities [] = "1.2.840.113549.1.9.15" |
gpg_error_t _ksba_cms_add_cert | ( | ksba_cms_t | cms, |
ksba_cert_t | cert | ||
) |
ksba_cms_add_cert: @cms: A CMS object @cert: A certificate to be send along with the signed data.
This functions adds a certificate to the list of certificates send along with the signed data. Using this is optional but it is very common to include at least the certificate of the signer it self.
Return value: 0 on success or an error code.
Definition at line 1687 of file cms.c.
References _ksba_cert_cmp(), certlist_s::cert, ksba_cms_s::cert_info_list, GPG_ERR_INV_VALUE, gpg_error, ksba_cert_ref(), certlist_s::next, and xtrycalloc.
gpg_error_t _ksba_cms_add_digest_algo | ( | ksba_cms_t | cms, |
const char * | oid | ||
) |
ksba_cms_add_digest_algo: @cms: A CMS object @oid: A stringified object OID describing the hash algorithm
Set the algorithm to be used for creating the hash. Note, that we currently can't do a per-signer hash.
Return value: 0 on success or an error code
Definition at line 1617 of file cms.c.
References ksba_cms_s::digest_algos, GPG_ERR_INV_VALUE, gpg_error, oidlist_s::next, oid, oidlist_s::oid, xfree, xtrymalloc, and xtrystrdup.
gpg_error_t _ksba_cms_add_recipient | ( | ksba_cms_t | cms, |
ksba_cert_t | cert | ||
) |
ksba_cms_add_recipient: @cms: A CMS object @cert: A certificate used to describe the recipient.
This functions starts assembly of a new enveloped data content or adds another recipient to the list of recipients.
Note: after successful completion of this function ownership of @cert is transferred to @cms.
Return value: 0 on success or an error code.
Definition at line 2264 of file cms.c.
References certlist_s::cert, and ksba_cms_add_signer().
gpg_error_t _ksba_cms_add_signer | ( | ksba_cms_t | cms, |
ksba_cert_t | cert | ||
) |
ksba_cms_add_signer: @cms: A CMS object @cert: A certificate used to describe the signer.
This functions starts assembly of a new signed data content or adds another signer to the list of signers.
Return value: 0 on success or an error code.
Definition at line 1651 of file cms.c.
References certlist_s::cert, ksba_cms_s::cert_list, GPG_ERR_INV_VALUE, gpg_error, ksba_cert_ref(), certlist_s::next, and xtrycalloc.
gpg_error_t _ksba_cms_add_smime_capability | ( | ksba_cms_t | cms, |
const char * | oid, | ||
const unsigned char * | der, | ||
size_t | derlen | ||
) |
Definition at line 1725 of file cms.c.
References ksba_cms_s::capability_list, GPG_ERR_INV_VALUE, gpg_error, oidparmlist_s::next, oid, oidparmlist_s::oid, oidparmlist_s::parm, oidparmlist_s::parmlen, xfree, xtrymalloc, and xtrystrdup.
gpg_error_t _ksba_cms_build | ( | ksba_cms_t | cms, |
ksba_stop_reason_t * | r_stopreason | ||
) |
Definition at line 695 of file cms.c.
References ksba_cms_s::content, GPG_ERR_INV_VALUE, gpg_error, ksba_cms_s::handler, ksba_cms_s::inner_cont_oid, KSBA_SR_GOT_CONTENT, KSBA_SR_RUNNING, ksba_cms_s::stop_reason, and ksba_cms_s::writer.
ksba_cert_t _ksba_cms_get_cert | ( | ksba_cms_t | cms, |
int | idx | ||
) |
ksba_cms_get_cert: @cms: CMS object @idx: enumerator
Get the certificate out of a CMS. The caller should use this in a loop to get all certificates. The returned certificate is a shallow copy of the original one; the caller must still use ksba_cert_release() to free it.
Return value: A Certificate object or NULL for end of list or error
Definition at line 1016 of file cms.c.
References certlist_s::cert, ksba_cms_s::cert_list, ksba_cert_ref(), and certlist_s::next.
gpg_error_t _ksba_cms_get_content_enc_iv | ( | ksba_cms_t | cms, |
void * | iv, | ||
size_t | maxivlen, | ||
size_t * | ivlen | ||
) |
Definition at line 775 of file cms.c.
References ksba_cms_s::encr_iv, ksba_cms_s::encr_ivlen, GPG_ERR_INV_VALUE, and gpg_error.
const char* _ksba_cms_get_content_oid | ( | ksba_cms_t | cms, |
int | what | ||
) |
Definition at line 758 of file cms.c.
References ksba_cms_s::content, ksba_cms_s::encr_algo_oid, ksba_cms_s::inner_cont_oid, and ksba_cms_s::oid.
ksba_content_type_t _ksba_cms_get_content_type | ( | ksba_cms_t | cms, |
int | what | ||
) |
Definition at line 733 of file cms.c.
References ksba_cms_s::content, content_handlers, ksba_cms_s::ct, ksba_cms_s::inner_cont_oid, and oid.
const char* _ksba_cms_get_digest_algo | ( | ksba_cms_t | cms, |
int | idx | ||
) |
ksba_cms_get_digest_algo: @cms: CMS object @idx: index of signer
Figure out the the digest algorithm used by the signer @idx return its OID. This is the algorithm acually used to calculate the signature.
Return value: NULL for no such signer or a constn string valid as long as the CMS object lives.
Definition at line 972 of file cms.c.
References _ksba_asn_find_node(), _ksba_oid_node_to_str(), signer_info_s::cache, signer_info_s::digest_algo, signer_info_s::image, signer_info_s::next, signer_info_s::root, and ksba_cms_s::signer_info.
const char* _ksba_cms_get_digest_algo_list | ( | ksba_cms_t | cms, |
int | idx | ||
) |
ksba_cert_get_digest_algo_list: @cert: Initialized certificate object @idx: enumerator
Figure out the the digest algorithm used for the signature and return its OID. Note that the algos returned are just hints on what to hash.
Return value: NULL for no more algorithms or a string valid as long as the the cms object is valid.
Definition at line 803 of file cms.c.
References ksba_cms_s::digest_algos, oidlist_s::next, and oidlist_s::oid.
ksba_sexp_t _ksba_cms_get_enc_val | ( | ksba_cms_t | cms, |
int | idx | ||
) |
ksba_cms_get_enc_val: @cms: CMS object @idx: index of recipient info
Return the encrypted value (the session key) of recipient @idx in a format suitable to be used as input to Libgcrypt's decryption function. The caller must free the returned string.
Return value: NULL or a string with a S-Exp.
Definition at line 1382 of file cms.c.
References _ksba_asn_find_node(), _ksba_encval_kari_to_sexp(), _ksba_encval_to_sexp(), _ksba_parse_algorithm_identifier(), _ksba_parse_algorithm_identifier2(), gpg_error, value_tree_s::image, asn_node_struct::len, tag_info::length, asn_node_struct::name, value_tree_s::next, asn_node_struct::nhdr, asn_node_struct::off, parse_octet_string, ksba_cms_s::recp_info, asn_node_struct::right, value_tree_s::root, signer_info_s::root, and xfree.
gpg_error_t _ksba_cms_get_issuer_serial | ( | ksba_cms_t | cms, |
int | idx, | ||
char ** | r_issuer, | ||
ksba_sexp_t * | r_serial | ||
) |
ksba_cms_get_issuer_serial: @cms: CMS object @idx: index number @r_issuer: returns the issuer @r_serial: returns the serial number
This functions returns the issuer and serial number either from the sid or the rid elements of a CMS object.
Return value: 0 on success or an error code. An error code of -1 is returned to indicate that there is no issuer with that idx, GPG_ERR_No_Data is returned to indicate that there is no issuer at all.
Definition at line 834 of file cms.c.
References _ksba_asn_find_node(), _ksba_dn_to_str(), asn_node_struct::down, GPG_ERR_GENERAL, GPG_ERR_INV_VALUE, gpg_error, value_tree_s::image, signer_info_s::image, asn_node_struct::len, asn_node_struct::name, value_tree_s::next, signer_info_s::next, asn_node_struct::nhdr, asn_node_struct::off, ksba_cms_s::recp_info, value_tree_s::root, signer_info_s::root, ksba_cms_s::signer_info, and xtrymalloc.
gpg_error_t _ksba_cms_get_message_digest | ( | ksba_cms_t | cms, |
int | idx, | ||
char ** | r_digest, | ||
size_t * | r_digest_len | ||
) |
Definition at line 1036 of file cms.c.
References _ksba_asn_find_node(), _ksba_asn_find_type_value(), DIM, asn_node_struct::down, GPG_ERR_BUG, GPG_ERR_INV_VALUE, gpg_error, signer_info_s::image, asn_node_struct::len, signer_info_s::next, asn_node_struct::nhdr, asn_node_struct::off, oid_messageDigest, asn_node_struct::right, signer_info_s::root, ksba_cms_s::signer_info, asn_node_struct::type, TYPE_OCTET_STRING, TYPE_SET_OF, and xtrymalloc.
ksba_sexp_t _ksba_cms_get_sig_val | ( | ksba_cms_t | cms, |
int | idx | ||
) |
ksba_cms_get_sig_val: @cms: CMS object @idx: index of signer
Return the actual signature of signer @idx in a format suitable to be used as input to Libgcrypt's verification function. The caller must free the returned string.
Return value: NULL or a string with a S-Exp.
Definition at line 1254 of file cms.c.
References _ksba_asn_find_node(), _ksba_sigval_to_sexp(), signer_info_s::image, asn_node_struct::len, signer_info_s::next, asn_node_struct::nhdr, asn_node_struct::off, asn_node_struct::right, signer_info_s::root, and ksba_cms_s::signer_info.
gpg_error_t _ksba_cms_get_sigattr_oids | ( | ksba_cms_t | cms, |
int | idx, | ||
const char * | reqoid, | ||
char ** | r_value | ||
) |
Definition at line 1148 of file cms.c.
References _ksba_asn_find_node(), _ksba_asn_find_type_value(), _ksba_oid_node_to_str(), asn_node_struct::down, GPG_ERR_BUG, GPG_ERR_INV_VALUE, gpg_error, signer_info_s::image, ksba_oid_from_str(), signer_info_s::next, asn_node_struct::off, asn_node_struct::right, signer_info_s::root, ksba_cms_s::signer_info, stpcpy, asn_node_struct::type, TYPE_OBJECT_ID, TYPE_SET_OF, xfree, xtrymalloc, and xtryrealloc.
gpg_error_t _ksba_cms_get_signing_time | ( | ksba_cms_t | cms, |
int | idx, | ||
ksba_isotime_t | r_sigtime | ||
) |
Definition at line 1092 of file cms.c.
References _ksba_asn_find_node(), _ksba_asn_find_type_value(), _ksba_asntime_to_iso(), DIM, asn_node_struct::down, GPG_ERR_BUG, GPG_ERR_INV_VALUE, gpg_error, signer_info_s::image, asn_node_struct::len, signer_info_s::next, asn_node_struct::nhdr, asn_node_struct::off, oid_signingTime, asn_node_struct::right, signer_info_s::root, ksba_cms_s::signer_info, asn_node_struct::type, TYPE_GENERALIZED_TIME, TYPE_SET_OF, and TYPE_UTC_TIME.
gpg_error_t _ksba_cms_hash_signed_attrs | ( | ksba_cms_t | cms, |
int | idx | ||
) |
Definition at line 1523 of file cms.c.
References _ksba_asn_find_node(), GPG_ERR_INV_VALUE, gpg_error, ksba_cms_s::hash_fnc, ksba_cms_s::hash_fnc_arg, signer_info_s::image, asn_node_struct::len, signer_info_s::next, asn_node_struct::nhdr, asn_node_struct::off, signer_info_s::root, and ksba_cms_s::signer_info.
ksba_content_type_t _ksba_cms_identify | ( | ksba_reader_t | reader | ) |
Definition at line 450 of file cms.c.
References _ksba_ber_parse_tl(), tag_info::class, CLASS_UNIVERSAL, content_handlers, ct, tag_info::is_constructed, KSBA_CT_DATA, KSBA_CT_NONE, KSBA_CT_PKCS12, KSBA_CT_SIGNED_DATA, ksba_free(), ksba_oid_to_str(), ksba_reader_read(), ksba_reader_unread(), tag_info::length, oid, tag_info::tag, TYPE_INTEGER, TYPE_OBJECT_ID, and TYPE_SEQUENCE.
gpg_error_t _ksba_cms_new | ( | ksba_cms_t * | r_cms | ) |
ksba_cms_new:
Create a new and empty CMS object
Return value: A CMS object or an error code.
Definition at line 541 of file cms.c.
References xtrycalloc.
gpg_error_t _ksba_cms_parse | ( | ksba_cms_t | cms, |
ksba_stop_reason_t * | r_stopreason | ||
) |
Definition at line 654 of file cms.c.
References _ksba_cms_parse_content_info(), ksba_cms_s::content, content_handlers, ksba_cms_s::ct, GPG_ERR_INV_VALUE, gpg_error, ksba_cms_s::handler, KSBA_SR_GOT_CONTENT, KSBA_SR_RUNNING, oid, ksba_cms_s::oid, parse_handler, and ksba_cms_s::stop_reason.
void _ksba_cms_release | ( | ksba_cms_t | cms | ) |
ksba_cms_release: @cms: A CMS object
Release a CMS object.
Definition at line 570 of file cms.c.
References _ksba_asn_release_nodes(), enc_val_s::algo, sig_val_s::algo, signer_info_s::cache, ksba_cms_s::capability_list, certlist_s::cert, ksba_cms_s::cert_info_list, ksba_cms_s::cert_list, ksba_cms_s::content, ksba_cms_s::data, ksba_cms_s::digest, signer_info_s::digest_algo, ksba_cms_s::digest_algos, enc_val_s::e, sig_val_s::ecc, enc_val_s::ecdh, certlist_s::enc_val, enc_val_s::encr_algo, ksba_cms_s::encr_algo_oid, ksba_cms_s::encr_iv, signer_info_s::image, ksba_cms_s::inner_cont_oid, ksba_cert_release(), oidlist_s::next, oidparmlist_s::next, certlist_s::next, signer_info_s::next, sig_val_s::next, oidlist_s::oid, oidparmlist_s::oid, ksba_cms_s::oid, sig_val_s::r, ksba_cms_s::recp_info, release_value_tree(), signer_info_s::root, ksba_cms_s::sig_val, ksba_cms_s::signer_info, enc_val_s::value, sig_val_s::value, enc_val_s::wrap_algo, and xfree.
gpg_error_t _ksba_cms_set_content_enc_algo | ( | ksba_cms_t | cms, |
const char * | oid, | ||
const void * | iv, | ||
size_t | ivlen | ||
) |
Definition at line 2045 of file cms.c.
References ksba_cms_s::encr_algo_oid, ksba_cms_s::encr_iv, ksba_cms_s::encr_ivlen, GPG_ERR_INV_VALUE, gpg_error, oid, xfree, xtrymalloc, and xtrystrdup.
gpg_error_t _ksba_cms_set_content_type | ( | ksba_cms_t | cms, |
int | what, | ||
ksba_content_type_t | type | ||
) |
ksba_cms_set_content_type: @cms: A CMS object @what: 0 for content type, 1 for inner content type @type: Type constant
Set the content type used for build operations. This should be the first operation before starting to create a CMS message.
Return value: 0 on success or an error code
Definition at line 1570 of file cms.c.
References build_handler, ksba_cms_s::content, content_handlers, ct, ksba_cms_s::ct, GPG_ERR_INV_VALUE, gpg_error, ksba_cms_s::handler, ksba_cms_s::inner_cont_oid, oid, ksba_cms_s::oid, and xtrystrdup.
gpg_error_t _ksba_cms_set_enc_val | ( | ksba_cms_t | cms, |
int | idx, | ||
ksba_const_sexp_t | encval | ||
) |
Definition at line 2090 of file cms.c.
References enc_val_s::algo, ksba_cms_s::cert_list, digitp, enc_val_s::e, enc_val_s::ecdh, enc_val_s::elen, certlist_s::enc_val, enc_val_s::encr_algo, GPG_ERR_INV_VALUE, gpg_error, name, certlist_s::next, enc_val_s::value, enc_val_s::valuelen, enc_val_s::wrap_algo, xfree, xtrymalloc, and xtrystrdup.
void _ksba_cms_set_hash_function | ( | ksba_cms_t | cms, |
void(*)(void *, const void *, size_t) | hash_fnc, | ||
void * | hash_fnc_arg | ||
) |
Definition at line 1509 of file cms.c.
References ksba_cms_s::hash_fnc, and ksba_cms_s::hash_fnc_arg.
gpg_error_t _ksba_cms_set_message_digest | ( | ksba_cms_t | cms, |
int | idx, | ||
const unsigned char * | digest, | ||
size_t | digest_len | ||
) |
ksba_cms_set_message_digest: @cms: A CMS object @idx: The index of the signer @digest: a message digest @digest_len: the length of the message digest
Set a message digest into the signedAttributes of the signer with the index IDX. The index of a signer is determined by the sequence of ksba_cms_add_signer() calls; the first signer has the index 0. This function is to be used when the hash value of the data has been calculated and before the create function requests the sign operation.
Return value: 0 on success or an error code
Definition at line 1784 of file cms.c.
References ksba_cms_s::cert_list, DIM, GPG_ERR_INV_VALUE, gpg_error, certlist_s::msg_digest, certlist_s::msg_digest_len, and certlist_s::next.
gpg_error_t _ksba_cms_set_reader_writer | ( | ksba_cms_t | cms, |
ksba_reader_t | r, | ||
ksba_writer_t | w | ||
) |
Definition at line 639 of file cms.c.
References GPG_ERR_INV_VALUE, gpg_error, ksba_cms_s::reader, and ksba_cms_s::writer.
gpg_error_t _ksba_cms_set_sig_val | ( | ksba_cms_t | cms, |
int | idx, | ||
ksba_const_sexp_t | sigval | ||
) |
Definition at line 1858 of file cms.c.
References sig_val_s::algo, digitp, sig_val_s::ecc, GPG_ERR_INV_VALUE, gpg_error, gpg_error_from_syserror, name, sig_val_s::next, sig_val_s::r, sig_val_s::rlen, ksba_cms_s::sig_val, smatch(), snext(), sig_val_s::value, sig_val_s::valuelen, xfree, xtrycalloc, xtrymalloc, and xtrystrdup.
gpg_error_t _ksba_cms_set_signing_time | ( | ksba_cms_t | cms, |
int | idx, | ||
const ksba_isotime_t | sigtime | ||
) |
ksba_cms_set_signing_time: @cms: A CMS object @idx: The index of the signer @sigtime: a time or an empty value to use the current time
Set a signing time into the signedAttributes of the signer with the index IDX. The index of a signer is determined by the sequence of ksba_cms_add_signer() calls; the first signer has the index 0.
Return value: 0 on success or an error code
Definition at line 1818 of file cms.c.
References _ksba_copy_time(), _ksba_current_time(), ksba_cms_s::cert_list, GPG_ERR_INV_VALUE, gpg_error, certlist_s::next, and certlist_s::signing_time.
|
static |
Definition at line 3406 of file cms.c.
References _ksba_ber_write_tl(), _ksba_cert_get_issuer_dn_ptr(), _ksba_cert_get_serial_ptr(), _ksba_der_add_bts(), _ksba_der_add_der(), _ksba_der_add_end(), _ksba_der_add_oid(), _ksba_der_add_ptr(), _ksba_der_add_tag(), _ksba_der_builder_get(), _ksba_der_builder_new(), _ksba_der_release(), _ksba_der_write_algorithm_identifier(), enc_val_s::algo, certlist_s::cert, ksba_cms_s::cert_list, CLASS_CONTEXT, CLASS_UNIVERSAL, ksba_cms_s::content, enc_val_s::e, enc_val_s::ecdh, enc_val_s::elen, certlist_s::enc_val, enc_val_s::encr_algo, ksba_cms_s::encr_algo_oid, ksba_cms_s::encr_iv, ksba_cms_s::encr_ivlen, GPG_ERR_BUG, gpg_error, gpg_error_from_syserror, certlist_s::image, ksba_cms_s::inner_cont_oid, ksba_oid_from_str(), ksba_writer_write(), certlist_s::next, ksba_cms_s::oid, TYPE_INTEGER, TYPE_NULL, TYPE_OBJECT_ID, TYPE_OCTET_STRING, TYPE_SEQUENCE, TYPE_SET, enc_val_s::value, enc_val_s::valuelen, enc_val_s::wrap_algo, ksba_cms_s::writer, and xfree.
Referenced by ct_build_enveloped_data().
|
static |
Definition at line 2726 of file cms.c.
References _ksba_asn_expand_tree(), _ksba_asn_find_node(), _ksba_asn_insert_copy(), _ksba_asn_release_nodes(), _ksba_ber_write_tl(), _ksba_der_copy_tree(), _ksba_der_encode_tree(), _ksba_der_store_octet_string(), _ksba_der_store_oid(), _ksba_der_store_time(), ksba_cms_s::capability_list, certlist_s::cert, ksba_cms_s::cert_info_list, ksba_cms_s::cert_list, CLASS_CONTEXT, compare_attrarray(), ksba_cms_s::digest_algos, DIM, asn_node_struct::down, free(), GPG_ERR_BUG, GPG_ERR_ELEMENT_NOT_FOUND, GPG_ERR_GENERAL, gpg_error, attrarray_s::image, signer_info_s::image, attrarray_s::imagelen, ksba_cms_s::inner_cont_oid, ksba_asn_create_tree(), ksba_asn_tree_release(), ksba_cert_get_image(), ksba_writer_write(), certlist_s::msg_digest, certlist_s::msg_digest_len, oidlist_s::next, certlist_s::next, signer_info_s::next, oidlist_s::oid, oidstr_contentType, oidstr_messageDigest, oidstr_signingTime, oidstr_smimeCapabilities, ksba_asn_tree_s::parse_tree, asn_node_struct::right, attrarray_s::root, signer_info_s::root, ksba_cms_s::signer_info, certlist_s::signing_time, store_smime_capability_sequence(), asn_node_struct::type, TYPE_SEQUENCE, ksba_cms_s::writer, xfree, and xtrycalloc.
Referenced by ct_build_signed_data().
|
static |
Definition at line 2465 of file cms.c.
References _ksba_ber_write_tl(), _ksba_der_write_algorithm_identifier(), CLASS_CONTEXT, CLASS_UNIVERSAL, ksba_cms_s::content, ksba_cms_s::detached_data, gpg_error, ksba_cms_s::inner_cont_oid, ksba_cms_get_digest_algo_list(), ksba_oid_from_str(), ksba_writer_new(), ksba_writer_release(), ksba_writer_set_mem(), ksba_writer_snatch_mem(), ksba_writer_write(), ksba_cms_s::oid, TYPE_INTEGER, TYPE_OBJECT_ID, TYPE_SEQUENCE, TYPE_SET, ksba_cms_s::writer, and xfree.
Referenced by ct_build_signed_data().
|
static |
Definition at line 3053 of file cms.c.
References _ksba_asn_expand_tree(), _ksba_asn_find_node(), _ksba_asn_release_nodes(), _ksba_ber_write_tl(), _ksba_der_add_end(), _ksba_der_add_int(), _ksba_der_add_tag(), _ksba_der_builder_get(), _ksba_der_builder_new(), _ksba_der_copy_tree(), _ksba_der_encode_tree(), _ksba_der_release(), _ksba_der_store_integer(), _ksba_der_store_null(), _ksba_der_store_octet_string(), _ksba_der_store_oid(), sig_val_s::algo, certlist_s::cert, ksba_cms_s::cert_list, CLASS_UNIVERSAL, ksba_cms_s::digest_algos, asn_node_struct::down, sig_val_s::ecc, GPG_ERR_BUG, GPG_ERR_ELEMENT_NOT_FOUND, gpg_error, gpg_error_from_syserror, signer_info_s::image, ksba_asn_create_tree(), ksba_asn_tree_release(), ksba_writer_new(), ksba_writer_release(), ksba_writer_set_mem(), ksba_writer_snatch_mem(), ksba_writer_write(), oidlist_s::next, certlist_s::next, signer_info_s::next, sig_val_s::next, oid, oidlist_s::oid, ksba_asn_tree_s::parse_tree, sig_val_s::r, sig_val_s::rlen, signer_info_s::root, set_issuer_serial(), ksba_cms_s::sig_val, ksba_cms_s::signer_info, TYPE_SEQUENCE, TYPE_SET, sig_val_s::value, sig_val_s::valuelen, ksba_cms_s::writer, and xfree.
Referenced by ct_build_signed_data().
|
static |
Definition at line 2702 of file cms.c.
References attrarray_s::image, and attrarray_s::imagelen.
Referenced by build_signed_data_attributes().
|
static |
|
static |
|
static |
|
static |
Definition at line 3673 of file cms.c.
References _ksba_ber_write_tl(), build_enveloped_data_header(), GPG_ERR_BUG, gpg_error, KSBA_SR_BEGIN_DATA, KSBA_SR_END_DATA, KSBA_SR_GOT_CONTENT, KSBA_SR_READY, KSBA_SR_RUNNING, ksba_cms_s::stop_reason, write_encrypted_cont(), and ksba_cms_s::writer.
|
static |
Definition at line 3320 of file cms.c.
References _ksba_ber_write_tl(), build_signed_data_attributes(), build_signed_data_header(), build_signed_data_rest(), ksba_cms_s::cert_list, ksba_cms_s::detached_data, GPG_ERR_BUG, gpg_error, KSBA_SR_BEGIN_DATA, KSBA_SR_END_DATA, KSBA_SR_GOT_CONTENT, KSBA_SR_NEED_SIG, KSBA_SR_READY, KSBA_SR_RUNNING, certlist_s::msg_digest_len, ksba_cms_s::sig_val, ksba_cms_s::stop_reason, and ksba_cms_s::writer.
|
static |
|
static |
|
static |
|
static |
Definition at line 2366 of file cms.c.
References _ksba_cms_parse_enveloped_data_part_1(), _ksba_cms_parse_enveloped_data_part_2(), ksba_cms_s::detached_data, GPG_ERR_BUG, gpg_error, KSBA_SR_BEGIN_DATA, KSBA_SR_DETACHED_DATA, KSBA_SR_END_DATA, KSBA_SR_GOT_CONTENT, KSBA_SR_READY, KSBA_SR_RUNNING, read_encrypted_cont(), and ksba_cms_s::stop_reason.
|
static |
Definition at line 2286 of file cms.c.
References _ksba_cms_parse_signed_data_part_1(), _ksba_cms_parse_signed_data_part_2(), ksba_cms_s::data, ksba_cms_s::detached_data, ksba_cms_s::digest, GPG_ERR_BUG, gpg_error, ksba_cms_s::hash_fnc, KSBA_SR_BEGIN_DATA, KSBA_SR_END_DATA, KSBA_SR_GOT_CONTENT, KSBA_SR_NEED_HASH, KSBA_SR_READY, KSBA_SR_RUNNING, read_and_hash_cont(), and ksba_cms_s::stop_reason.
|
static |
Definition at line 206 of file cms.c.
References _ksba_ber_read_tl(), tag_info::class, CLASS_UNIVERSAL, gpg_error, ksba_cms_s::inner_cont_len, ksba_cms_s::inner_cont_ndef, tag_info::is_constructed, tag_info::length, tag_info::nhdr, read_hash_block(), ksba_cms_s::reader, tag_info::tag, and TYPE_OCTET_STRING.
Referenced by ct_parse_signed_data().
|
static |
Definition at line 320 of file cms.c.
References _ksba_ber_read_tl(), tag_info::class, CLASS_UNIVERSAL, gpg_error, ksba_cms_s::inner_cont_len, ksba_cms_s::inner_cont_ndef, tag_info::is_constructed, ksba_reader_read(), ksba_writer_write(), tag_info::length, ksba_cms_s::reader, tag_info::tag, TYPE_OCTET_STRING, and ksba_cms_s::writer.
Referenced by ct_parse_enveloped_data().
|
static |
Definition at line 178 of file cms.c.
References ksba_cms_s::hash_fnc, ksba_cms_s::hash_fnc_arg, ksba_reader_read(), ksba_writer_write(), ksba_cms_s::reader, and ksba_cms_s::writer.
Referenced by read_and_hash_cont().
|
static |
Definition at line 551 of file cms.c.
References _ksba_asn_release_nodes(), value_tree_s::image, value_tree_s::next, value_tree_s::root, and xfree.
Referenced by _ksba_cms_release().
|
static |
Definition at line 2599 of file cms.c.
References _ksba_asn_find_node(), _ksba_der_copy_tree(), certlist_s::cert, GPG_ERR_INV_VALUE, gpg_error, ksba_cert_s::image, and ksba_cert_s::root.
Referenced by build_signed_data_rest().
|
static |
Definition at line 2633 of file cms.c.
References _ksba_der_store_sequence(), _ksba_der_write_algorithm_identifier(), gpg_error, ksba_writer_new(), ksba_writer_release(), ksba_writer_set_mem(), ksba_writer_snatch_mem(), oidparmlist_s::next, oidparmlist_s::oid, oidparmlist_s::parm, oidparmlist_s::parmlen, and xfree.
Referenced by build_signed_data_attributes().
|
static |
Definition at line 416 of file cms.c.
References _ksba_ber_write_tl(), CLASS_UNIVERSAL, ksba_reader_read(), ksba_writer_write(), ksba_cms_s::reader, TYPE_OCTET_STRING, and ksba_cms_s::writer.
Referenced by ct_build_enveloped_data().
gpg_error_t(* build_handler) (ksba_cms_t) |
Definition at line 72 of file cms.c.
Referenced by _ksba_cms_set_content_type().
struct { ... } content_handlers[] |
Referenced by _ksba_cms_get_content_type(), _ksba_cms_identify(), _ksba_cms_parse(), and _ksba_cms_set_content_type().
Definition at line 70 of file cms.c.
Referenced by _ksba_cms_identify(), and _ksba_cms_set_content_type().
const char* oid |
Definition at line 69 of file cms.c.
Referenced by _ksba_cert_get_auth_key_id(), _ksba_cert_get_cert_policies(), _ksba_cert_get_crl_dist_point(), _ksba_cert_get_ext_key_usages(), _ksba_cert_get_key_usage(), _ksba_cert_is_ca(), _ksba_certreq_add_extension(), _ksba_cms_add_digest_algo(), _ksba_cms_add_smime_capability(), _ksba_cms_get_content_type(), _ksba_cms_identify(), _ksba_cms_parse(), _ksba_cms_parse_content_info(), _ksba_cms_parse_signed_data_part_1(), _ksba_cms_set_content_enc_algo(), _ksba_cms_set_content_type(), _ksba_crl_get_extension(), _ksba_der_store_oid(), _ksba_der_write_algorithm_identifier(), _ksba_hash_buffer(), _ksba_ocsp_set_digest_algo(), _ksba_parse_object_id_into_str(), add_general_names_to_extn(), append_cert_policy(), build_signed_data_rest(), get_info_access(), get_name(), get_simple_octet_string_ext(), parse_content_info(), parse_one_extension(), parse_response_extensions(), parse_response_status(), parse_single_extensions(), parse_single_response(), store_one_entry_extension(), and store_one_extension().
|
static |
Definition at line 96 of file cms.c.
Referenced by _ksba_cms_get_message_digest().
|
static |
Definition at line 99 of file cms.c.
Referenced by _ksba_cms_get_signing_time().
|
static |
Definition at line 92 of file cms.c.
Referenced by build_signed_data_attributes().
|
static |
Definition at line 95 of file cms.c.
Referenced by build_signed_data_attributes().
|
static |
Definition at line 98 of file cms.c.
Referenced by build_signed_data_attributes().
|
static |
Definition at line 101 of file cms.c.
Referenced by build_signed_data_attributes().
gpg_error_t(* parse_handler) (ksba_cms_t) |
Definition at line 71 of file cms.c.
Referenced by _ksba_cms_parse().