mirror of
https://github.com/openssl/openssl.git
synced 2024-12-15 06:01:37 +08:00
1d39620b34
This library is meant to be small and quick. It's based on WPACKET, which was extended to support DER writing. The way it's used is a bit unusual, as it's used to write the structures backward into a given buffer. A typical quick call looks like this: /* * Fill in this structure: * * something ::= SEQUENCE { * id OBJECT IDENTIFIER, * x [0] INTEGER OPTIONAL, * y [1] BOOLEAN OPTIONAL, * n INTEGER * } */ unsigned char buf[nnnn], *p = NULL; size_t encoded_len = 0; WPACKET pkt; int ok; ok = WPACKET_init_der(&pkt, buf, sizeof(buf) && DER_w_start_sequence(&pkt, -1) && DER_w_bn(&pkt, -1, bn) && DER_w_boolean(&pkt, 1, bool) && DER_w_precompiled(&pkt, -1, OID, sizeof(OID)) && DER_w_end_sequence(&pkt, -1) && WPACKET_finish(&pkt) && WPACKET_get_total_written(&pkt, &encoded_len) && (p = WPACKET_get_curr(&pkt)) != NULL; Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11450) |
||
---|---|---|
.. | ||
cms_add1_signing_cert.pod | ||
DEFINE_SPARSE_ARRAY_OF.pod | ||
DER_w_begin_sequence.pod | ||
DER_w_bn.pod | ||
DER_w_precompiled.pod | ||
evp_generic_fetch.pod | ||
evp_keymgmt_newdata.pod | ||
evp_keymgmt_util_export_to_provider.pod | ||
evp_pkey_export_to_provider.pod | ||
openssl_ctx_get_data.pod | ||
ossl_algorithm_do_all.pod | ||
ossl_cmp_asn1_octet_string_set1.pod | ||
ossl_cmp_certReq_new.pod | ||
ossl_cmp_ctx_set1_caPubs.pod | ||
ossl_cmp_hdr_init.pod | ||
ossl_cmp_mock_srv_new.pod | ||
ossl_cmp_msg_check_received.pod | ||
ossl_cmp_msg_create.pod | ||
ossl_cmp_msg_protect.pod | ||
ossl_cmp_pkisi_get_status.pod | ||
ossl_cmp_print_log.pod | ||
ossl_cmp_sk_X509_add1_cert.pod | ||
ossl_init_thread_deregister.pod | ||
ossl_method_construct.pod | ||
OSSL_METHOD_STORE.pod | ||
ossl_namemap_new.pod | ||
ossl_prov_util_nid_to_name.pod | ||
ossl_provider_add_conf_module.pod | ||
ossl_provider_new.pod | ||
rsa_get0_all_params.pod | ||
s2i_ASN1_UTF8STRING.pod |