mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +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) |
||
---|---|---|
.. | ||
perl | ||
add-depends.pl | ||
build.info | ||
cavs-to-evptest.pl | ||
check-format-test-negatives.c | ||
check-format-test-positives.c | ||
check-format.pl | ||
check-malloc-errs | ||
ck_errf.pl | ||
copy.pl | ||
dofile.pl | ||
echo.pl | ||
engines.num | ||
err-to-raise | ||
find-doc-nits | ||
find-unused-errs | ||
fix-includes | ||
fix-includes.sed | ||
indent.pro | ||
libcrypto.num | ||
libssl.num | ||
local_shlib.com.in | ||
merge-err-lines | ||
missingcrypto111.txt | ||
missingcrypto.txt | ||
missingmacro111.txt | ||
missingmacro.txt | ||
missingssl111.txt | ||
missingssl.txt | ||
mkbuildinf.pl | ||
mkdef.pl | ||
mkdir-p.pl | ||
mkerr.pl | ||
mknum.pl | ||
mkpod2html.pl | ||
mkrc.pl | ||
mktar.sh | ||
openssl-update-copyright | ||
opensslwrap.sh | ||
other.syms | ||
providers.num | ||
shlib_wrap.sh.in | ||
su-filter.pl | ||
unlocal_shlib.com.in | ||
wrap.pl |