OpenBSD manual page server

Manual Page Search Parameters

BIO_NEW_NDEF(3) Library Functions Manual BIO_NEW_NDEF(3)

BIO_new_NDEFgeneric constructor for streaming BIO chains

#include <openssl/asn1.h>

BIO *
BIO_new_NDEF(BIO *out_bio, ASN1_VALUE *val_in, const ASN1_ITEM *it);

() is a wrapper around BIO_new(3) with a BIO type of BIO_f_asn1(3) that supports streaming by providing the following additional functionality.

The data type it needs to support streaming. Of the data types built into the library, currently only CMS_ContentInfo and PKCS7 support that. The argument val_in needs to be of that type.

A structure containing the following data is saved using BIO_ctrl(3) with an argument of BIO_C_SET_EX_ARG as described in BIO_f_asn1(3):

In order to handle the output from the new asn1 BIO, the out_bio is appended to it using BIO_push(3). The out_bio can be a single sink BIO or a BIO chain ending in a sink BIO.

A built-in prefix function is installed with BIO_asn1_set_prefix(3) that encodes val_in using ASN1_item_ndef_i2d(3), and a built-in suffix function is installed that finalizes the written structures in a type-specific way.

BIO_new_NDEF() returns a pointer to the beginning of the constructed BIO chain or NULL if it does not support streaming or if memory allocation fails.

ASN1_item_ndef_i2d(3), BIO_ctrl(3), BIO_f_asn1(3), BIO_new(3), BIO_new_CMS(3), BIO_push(3), i2d_ASN1_bio_stream(3)

BIO_new_NDEF() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.

December 13, 2021 OpenBSD-current