BIO_read_asn1 function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<BIO>, Pointer<Pointer<Uint8>>, Pointer<Size>, Size)>(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>, ffi.Pointer<ffi.Size>, ffi.Size)>(symbol: 'bssl_dart_BIO_read_asn1')
int BIO_read_asn1(
  1. Pointer<BIO> bio,
  2. Pointer<Pointer<Uint8>> out,
  3. Pointer<Size> out_len,
  4. int max_len,
)

BIO_read_asn1 reads a single ASN.1 object from bio. If successful it sets *out to be an allocated buffer (that should be freed with OPENSSL_free), *out_size to the length, in bytes, of that buffer and returns one. Otherwise it returns zero.

If the length of the object is greater than max_len or 2^32 then the function will fail. Long-form tags are not supported. If the length of the object is indefinite the full contents of bio are read, unless it would be greater than max_len, in which case the function fails.

If the function fails then some unknown amount of data may have been read from bio.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<BIO>,
    ffi.Pointer<ffi.Pointer<ffi.Uint8>>,
    ffi.Pointer<ffi.Size>,
    ffi.Size,
  )
>(symbol: 'bssl_dart_BIO_read_asn1')
external int BIO_read_asn1(
  ffi.Pointer<BIO> bio,
  ffi.Pointer<ffi.Pointer<ffi.Uint8>> out,
  ffi.Pointer<ffi.Size> out_len,
  int max_len,
);