|BIO_F_ASN1(3)||Library Functions Manual||BIO_F_ASN1(3)|
BER-encoding filter BIO
const BIO_METHOD *
unsigned char **pbuf, int *plen,
asn1_ps_func *prefix, asn1_ps_func
asn1_ps_func **pprefix, asn1_ps_func
asn1_ps_func *suffix, asn1_ps_func
asn1_ps_func **psuffix, asn1_ps_func
returns the "asn1" BIO method. BIOs created from it with
BIO_new(3) are filter BIOs intended to
BER-encode data written to them and pass the encoded data on to the next BIO
in the chain. Such BIOs operate as follows:
If a prefix
function was installed with
that function is called before writing the object. It may for example
produce additional output. If it fails, writing fails.
If a prefix_free function was installed as well, that function is called after writing any output produced by prefix but before writing the object. Failure of prefix_free is silently ignored.
BIO_C_SET_EX_ARGstores the pointer parg internally such that it will be passed to the
asn1_ps_func() callback functions. With a cmd of
BIO_C_GET_EX_ARG, it retrieves that pointer, storing it in *parg. The commands
BIO_CTRL_FLUSHare used internally to implement
BIO_asn1_get_suffix() and BIO_flush(3) and are not intended for use by application programs. Other commands are merely forwarded to the next BIO in the chain.
If the above description of a function mentions the next BIO in the chain, that function fails if the asn1 BIO is the last BIO in the chain.
install and retrieve the prefix and
prefix_free callback functions in and from the first
asn1 BIO in the given chain. Similarly,
install and retrieve the suffix and
suffix_free callback functions. Passing a
NULL pointer for any of the
asn1_ps_func() arguments disables that particular
BIO_f_asn1() always returns a pointer to a
static built-in object.
Functions of the type
supposed to return 1 on success or 0 on failure.
BIO_asn1_get_suffix() return 1 on success or 0 if
chain is a
NULL pointer or
does not contain any asn1 BIO. They may return -2 if a BIO is encountered in
the chain that is not properly initialized.
These functions first appeared in OpenSSL 1.0.0 and have been available since OpenBSD 4.9.
|December 12, 2021||OpenBSD-current|