| // Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| // AUTO-GENERATED BY tool/ffigen.dart - DO NOT MODIFY. | |
| // ignore_for_file: camel_case_types | |
| // ignore_for_file: constant_identifier_names | |
| // ignore_for_file: non_constant_identifier_names | |
| // ignore_for_file: unused_element | |
| // ignore_for_file: unused_field | |
| // AUTO GENERATED FILE, DO NOT EDIT. | |
| // | |
| // Generated by `package:ffigen`. | |
| // ignore_for_file: type=lint, unused_import, deprecated_member_use_from_same_package | |
| @ffi.DefaultAsset('package:boring/boring.dart') | |
| library; | |
| import 'dart:ffi' as ffi; | |
| import 'package:meta/meta.dart' as meta; | |
| import '' as self; | |
| /// ACCESS_DESCRIPTION_free releases memory associated with `desc`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ACCESS_DESCRIPTION>)>( | |
| symbol: 'bssl_dart_ACCESS_DESCRIPTION_free', | |
| ) | |
| external void ACCESS_DESCRIPTION_free( | |
| ffi.Pointer<ACCESS_DESCRIPTION> desc, | |
| ); | |
| /// ACCESS_DESCRIPTION_new returns a newly-allocated, empty `ACCESS_DESCRIPTION` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ACCESS_DESCRIPTION> Function()>( | |
| symbol: 'bssl_dart_ACCESS_DESCRIPTION_new', | |
| ) | |
| external ffi.Pointer<ACCESS_DESCRIPTION> ACCESS_DESCRIPTION_new(); | |
| /// AES_cbc_encrypt encrypts (or decrypts, if `enc` == `AES_DECRYPT`) `len` | |
| /// bytes from `in` to `out`. The length must be a multiple of the block size. | |
| /// This function may be called in-place with `in` equal to `out`, but otherwise | |
| /// the buffers may not partially overlap. A partial overlap may overwrite input | |
| /// data before it is read. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_AES_cbc_encrypt') | |
| external void AES_cbc_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> ivec, | |
| int enc, | |
| ); | |
| /// AES_cfb128_encrypt encrypts (or decrypts, if `enc` == `AES_DECRYPT`) `len` | |
| /// bytes from `in` to `out`. The `num` parameter must be set to zero on the | |
| /// first call. This function may be called in-place with `in` equal to `out`, | |
| /// but otherwise the buffers may not partially overlap. A partial overlap may | |
| /// overwrite input data before it is read. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_AES_cfb128_encrypt') | |
| external void AES_cfb128_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> ivec, | |
| ffi.Pointer<ffi.Int> num, | |
| int enc, | |
| ); | |
| /// AES_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) `len` | |
| /// bytes from `in` to `out`. The `num` parameter must be set to zero on the | |
| /// first call and `ivec` will be incremented. This function may be called | |
| /// in-place with `in` equal to `out`, but otherwise the buffers may not | |
| /// partially overlap. A partial overlap may overwrite input data before it is | |
| /// read. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_ctr128_encrypt') | |
| external void AES_ctr128_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> ivec, | |
| ffi.Pointer<ffi.Uint8> ecount_buf, | |
| ffi.Pointer<ffi.UnsignedInt> num, | |
| ); | |
| /// AES_decrypt decrypts a single block from `in` to `out` with `key`. The `in` | |
| /// and `out` pointers may overlap. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<AES_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_decrypt') | |
| external void AES_decrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<AES_KEY> key, | |
| ); | |
| /// AES_ecb_encrypt encrypts (or decrypts, if `enc` == `AES_DECRYPT`) a single, | |
| /// 16 byte block from `in` to `out`. This function may be called in-place with | |
| /// `in` equal to `out`, but otherwise the buffers may not partially overlap. A | |
| /// partial overlap may overwrite input data before it is read. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_AES_ecb_encrypt') | |
| external void AES_ecb_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<AES_KEY> key, | |
| int enc, | |
| ); | |
| /// AES_encrypt encrypts a single block from `in` to `out` with `key`. The `in` | |
| /// and `out` pointers may overlap. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<AES_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_encrypt') | |
| external void AES_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<AES_KEY> key, | |
| ); | |
| /// AES_ofb128_encrypt encrypts (or decrypts, it's the same in OFB mode) `len` | |
| /// bytes from `in` to `out`. The `num` parameter must be set to zero on the | |
| /// first call. This function may be called in-place with `in` equal to `out`, | |
| /// but otherwise the buffers may not partially overlap. A partial overlap may | |
| /// overwrite input data before it is read. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_ofb128_encrypt') | |
| external void AES_ofb128_encrypt( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> ivec, | |
| ffi.Pointer<ffi.Int> num, | |
| ); | |
| /// AES_set_decrypt_key configures `aeskey` to decrypt with the `bits`-bit key, | |
| /// `key`. `key` must point to `bits`/8 bytes. It returns zero on success and a | |
| /// negative number if `bits` is an invalid AES key size. | |
| /// | |
| /// WARNING: this function breaks the usual return value convention. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<AES_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_set_decrypt_key') | |
| external int AES_set_decrypt_key( | |
| ffi.Pointer<ffi.Uint8> key, | |
| int bits, | |
| ffi.Pointer<AES_KEY> aeskey, | |
| ); | |
| /// AES_set_encrypt_key configures `aeskey` to encrypt with the `bits`-bit key, | |
| /// `key`. `key` must point to `bits`/8 bytes. It returns zero on success and a | |
| /// negative number if `bits` is an invalid AES key size. | |
| /// | |
| /// WARNING: this function breaks the usual return value convention. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<AES_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_AES_set_encrypt_key') | |
| external int AES_set_encrypt_key( | |
| ffi.Pointer<ffi.Uint8> key, | |
| int bits, | |
| ffi.Pointer<AES_KEY> aeskey, | |
| ); | |
| /// AES_unwrap_key performs AES key unwrap on `in` which must be a multiple of 8 | |
| /// bytes. `iv` must point to an 8 byte value or be NULL to use the default IV. | |
| /// `key` must have been configured for decryption. On success, it writes | |
| /// `in_len` - 8 bytes to `out` and returns `in_len` - 8. Otherwise, it returns | |
| /// -1. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_AES_unwrap_key') | |
| external int AES_unwrap_key( | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// AES_unwrap_key_padded performs a padded AES key unwrap on `in` which must be | |
| /// a multiple of 8 bytes. `key` must have been configured for decryption. On | |
| /// success it writes at most `max_out` bytes to `out`, sets `*out_len` to the | |
| /// number of bytes written, and returns one. On failure it returns zero. Setting | |
| /// `max_out` to `in_len` is a sensible estimate. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_AES_unwrap_key_padded') | |
| external int AES_unwrap_key_padded( | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// AES_wrap_key performs AES key wrap on `in` which must be a multiple of 8 | |
| /// bytes. `iv` must point to an 8 byte value or be NULL to use the default IV. | |
| /// `key` must have been configured for encryption. On success, it writes | |
| /// `in_len` + 8 bytes to `out` and returns `in_len` + 8. Otherwise, it returns | |
| /// -1. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_AES_wrap_key') | |
| external int AES_wrap_key( | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// AES_wrap_key_padded performs a padded AES key wrap on `in` which must be | |
| /// between 1 and 2^32-1 bytes. `key` must have been configured for encryption. | |
| /// On success it writes at most `max_out` bytes of ciphertext to `out`, sets | |
| /// `*out_len` to the number of bytes written, and returns one. On failure it | |
| /// returns zero. To ensure success, set `max_out` to at least `in_len` + 15. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AES_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_AES_wrap_key_padded') | |
| external int AES_wrap_key_padded( | |
| ffi.Pointer<AES_KEY> key, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// ASN1_BIT_STRING_check returns one if `str` only contains bits that are set in | |
| /// the `flags_len` bytes pointed by `flags`. Otherwise it returns zero. Bits in | |
| /// `flags` are arranged according to the DER representation, so bit 0 | |
| /// corresponds to the MSB of `flags[0]`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_BIT_STRING_check') | |
| external int ASN1_BIT_STRING_check( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ffi.Pointer<ffi.UnsignedChar> flags, | |
| int flags_len, | |
| ); | |
| /// ASN1_BIT_STRING_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_BIT_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_BIT_STRING_free', | |
| ) | |
| external void ASN1_BIT_STRING_free( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ); | |
| /// ASN1_BIT_STRING_get_bit returns one if bit `n` of `a` is in bounds and set, | |
| /// and zero otherwise. `n` is indexed beginning from zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_BIT_STRING>, ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_BIT_STRING_get_bit', | |
| ) | |
| external int ASN1_BIT_STRING_get_bit( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| int n, | |
| ); | |
| /// ASN1_BIT_STRING_new calls `ASN1_STRING_type_new` with `V_ASN1_BIT_STRING`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_BIT_STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_BIT_STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_BIT_STRING> ASN1_BIT_STRING_new(); | |
| /// ASN1_BIT_STRING_num_bytes computes the length of `str` in bytes. If `str`'s | |
| /// bit length is a multiple of 8, it sets `*out` to the byte length and returns | |
| /// one. Otherwise, it returns zero. | |
| /// | |
| /// This function may be used with `ASN1_STRING_get0_data` to interpret `str` as | |
| /// a byte string. | |
| /// | |
| /// This function is no longer necessary. The byte length is always equal to | |
| /// `ASN1_STRING_length` and callers can check for a whole number of bytes by | |
| /// checking if `ASN1_BIT_STRING_unused_bits` is zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_BIT_STRING>, ffi.Pointer<ffi.Size>) | |
| >(symbol: 'bssl_dart_ASN1_BIT_STRING_num_bytes') | |
| external int ASN1_BIT_STRING_num_bytes( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ffi.Pointer<ffi.Size> out, | |
| ); | |
| /// ASN1_BIT_STRING_set calls `ASN1_STRING_set`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_BIT_STRING_set') | |
| external int ASN1_BIT_STRING_set( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int length, | |
| ); | |
| /// ASN1_BIT_STRING_set1 sets `str` to a BIT STRING containing `length` bytes | |
| /// from `data`. It returns one on success and zero on error. The least | |
| /// significant `unused_bits` of the last byte of `data` are removed from the bit | |
| /// string. The removed bits must all be zero. `unused_bits` must be between 0 | |
| /// and 7, and must be 0 if `length` is zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_BIT_STRING_set1') | |
| external int ASN1_BIT_STRING_set1( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int length, | |
| int unused_bits, | |
| ); | |
| /// ASN1_BIT_STRING_set_bit sets bit `n` of `str` to one if `value` is non-zero | |
| /// and zero if `value` is zero, resizing `str` as needed. It then truncates | |
| /// trailing zeros in `str` to align with the DER representation for a bit string | |
| /// with named bits. It returns one on success and zero on error. `n` is indexed | |
| /// beginning from zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_BIT_STRING>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_BIT_STRING_set_bit', | |
| ) | |
| external int ASN1_BIT_STRING_set_bit( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| int n, | |
| int value, | |
| ); | |
| /// ASN1_BIT_STRING_unused_bits returns the number of unused bits in the last | |
| /// byte of `str`. If `str` is empty (i.e. `ASN1_STRING_length` is zero), this | |
| /// always returns zero. Otherwise it returns a number between 0 and 7. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint8 Function(ffi.Pointer<ASN1_BIT_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_BIT_STRING_unused_bits', | |
| ) | |
| external int ASN1_BIT_STRING_unused_bits( | |
| ffi.Pointer<ASN1_BIT_STRING> str, | |
| ); | |
| /// The following functions call `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_BMPSTRING>)>( | |
| symbol: 'bssl_dart_ASN1_BMPSTRING_free', | |
| ) | |
| external void ASN1_BMPSTRING_free( | |
| ffi.Pointer<ASN1_BMPSTRING> str, | |
| ); | |
| /// The following functions call `ASN1_STRING_type_new` with the corresponding | |
| /// `V_ASN1_*` constant. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_BMPSTRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_BMPSTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_BMPSTRING> ASN1_BMPSTRING_new(); | |
| /// ASN1_ENUMERATED_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_ENUMERATED>)>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_free', | |
| ) | |
| external void ASN1_ENUMERATED_free( | |
| ffi.Pointer<ASN1_ENUMERATED> str, | |
| ); | |
| /// ASN1_ENUMERATED_get returns the value of `a` as a `long`, or -1 if `a` is out | |
| /// of range or the wrong type. | |
| /// | |
| /// WARNING: This function's return value cannot distinguish errors from -1. | |
| /// Use `ASN1_ENUMERATED_get_uint64` and `ASN1_ENUMERATED_get_int64` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<ASN1_ENUMERATED>)>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_get', | |
| ) | |
| external int ASN1_ENUMERATED_get( | |
| ffi.Pointer<ASN1_ENUMERATED> a, | |
| ); | |
| /// ASN1_ENUMERATED_get_int64 converts `a` to a `int64_t`. On success, it | |
| /// returns one and sets `*out` to the result. If `a` did not fit or has the | |
| /// wrong type, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Int64>, ffi.Pointer<ASN1_ENUMERATED>) | |
| >(symbol: 'bssl_dart_ASN1_ENUMERATED_get_int64') | |
| external int ASN1_ENUMERATED_get_int64( | |
| ffi.Pointer<ffi.Int64> out, | |
| ffi.Pointer<ASN1_ENUMERATED> a, | |
| ); | |
| /// ASN1_ENUMERATED_get_uint64 converts `a` to a `uint64_t`. On success, it | |
| /// returns one and sets `*out` to the result. If `a` did not fit or has the | |
| /// wrong type, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint64>, ffi.Pointer<ASN1_ENUMERATED>) | |
| >(symbol: 'bssl_dart_ASN1_ENUMERATED_get_uint64') | |
| external int ASN1_ENUMERATED_get_uint64( | |
| ffi.Pointer<ffi.Uint64> out, | |
| ffi.Pointer<ASN1_ENUMERATED> a, | |
| ); | |
| /// ASN1_ENUMERATED_new calls `ASN1_STRING_type_new` with `V_ASN1_ENUMERATED`. | |
| /// The resulting object has value zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_ENUMERATED> Function()>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_new', | |
| ) | |
| external ffi.Pointer<ASN1_ENUMERATED> ASN1_ENUMERATED_new(); | |
| /// ASN1_ENUMERATED_set sets `a` to an ENUMERATED with value `v`. It returns one | |
| /// on success and zero on error. | |
| /// | |
| /// Use `ASN1_ENUMERATED_set_uint64` and `ASN1_ENUMERATED_set_int64` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_ENUMERATED>, ffi.Long)>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_set', | |
| ) | |
| external int ASN1_ENUMERATED_set( | |
| ffi.Pointer<ASN1_ENUMERATED> a, | |
| int v, | |
| ); | |
| /// ASN1_ENUMERATED_set_int64 sets `a` to an ENUMERATED with value `v`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_ENUMERATED>, ffi.Int64)>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_set_int64', | |
| ) | |
| external int ASN1_ENUMERATED_set_int64( | |
| ffi.Pointer<ASN1_ENUMERATED> out, | |
| int v, | |
| ); | |
| /// ASN1_ENUMERATED_set_uint64 sets `a` to an ENUMERATED with value `v`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_ENUMERATED>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_ASN1_ENUMERATED_set_uint64', | |
| ) | |
| external int ASN1_ENUMERATED_set_uint64( | |
| ffi.Pointer<ASN1_ENUMERATED> out, | |
| int v, | |
| ); | |
| /// ASN1_ENUMERATED_to_BN sets `bn` to the value of `ai` and returns `bn` on | |
| /// success or NULL or error. If `bn` is NULL, it returns a newly-allocated | |
| /// `BIGNUM` on success instead, which the caller must release with `BN_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<ASN1_ENUMERATED>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_ENUMERATED_to_BN') | |
| external ffi.Pointer<BIGNUM> ASN1_ENUMERATED_to_BN( | |
| ffi.Pointer<ASN1_ENUMERATED> ai, | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_adj adds `offset_day` days and `offset_sec` seconds to | |
| /// `posix_time` and writes the result to `s` as a GeneralizedTime. It returns | |
| /// `s` on success and NULL on error. If `s` is NULL, it returns a | |
| /// newly-allocated `ASN1_GENERALIZEDTIME` instead. | |
| /// | |
| /// Note this function may fail if the time overflows or is out of range for | |
| /// GeneralizedTime. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> Function( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME>, | |
| ffi.Int64, | |
| ffi.Int, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_adj') | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> ASN1_GENERALIZEDTIME_adj( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> s, | |
| int posix_time, | |
| int offset_day, | |
| int offset_sec, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_check returns one if `a` is a valid GeneralizedTime and | |
| /// zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_GENERALIZEDTIME>)>( | |
| symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_check', | |
| ) | |
| external int ASN1_GENERALIZEDTIME_check( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> a, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_GENERALIZEDTIME>)>( | |
| symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_free', | |
| ) | |
| external void ASN1_GENERALIZEDTIME_free( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> str, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_new calls `ASN1_STRING_type_new` with | |
| /// `V_ASN1_GENERALIZEDTIME`. The resulting object contains empty contents and | |
| /// must be initialized to be a valid GeneralizedTime. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_GENERALIZEDTIME> Function()>( | |
| symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_new', | |
| ) | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> ASN1_GENERALIZEDTIME_new(); | |
| /// ASN1_GENERALIZEDTIME_print writes a human-readable representation of `a` to | |
| /// `out`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_GENERALIZEDTIME>) | |
| >(symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_print') | |
| external int ASN1_GENERALIZEDTIME_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> a, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_set represents `posix_time` as a GeneralizedTime and | |
| /// writes the result to `s`. It returns `s` on success and NULL on error. If `s` | |
| /// is NULL, it returns a newly-allocated `ASN1_GENERALIZEDTIME` instead. | |
| /// | |
| /// Note this function may fail if the time is out of range for GeneralizedTime. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> Function( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME>, | |
| ffi.Int64, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_set') | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> ASN1_GENERALIZEDTIME_set( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> s, | |
| int posix_time, | |
| ); | |
| /// ASN1_GENERALIZEDTIME_set_string sets `s` to a GeneralizedTime whose contents | |
| /// are a copy of `str`. It returns one on success and zero on error or if `str` | |
| /// is not a valid GeneralizedTime. | |
| /// | |
| /// If `s` is NULL, this function validates `str` without copying it. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_GENERALIZEDTIME>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_set_string') | |
| external int ASN1_GENERALIZEDTIME_set_string( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> s, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_GENERALSTRING>)>( | |
| symbol: 'bssl_dart_ASN1_GENERALSTRING_free', | |
| ) | |
| external void ASN1_GENERALSTRING_free( | |
| ffi.Pointer<ASN1_GENERALSTRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_GENERALSTRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_GENERALSTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_GENERALSTRING> ASN1_GENERALSTRING_new(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_IA5STRING>)>( | |
| symbol: 'bssl_dart_ASN1_IA5STRING_free', | |
| ) | |
| external void ASN1_IA5STRING_free( | |
| ffi.Pointer<ASN1_IA5STRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_IA5STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_IA5STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_IA5STRING> ASN1_IA5STRING_new(); | |
| /// ASN1_INTEGER_cmp compares the values of `x` and `y`. It returns an integer | |
| /// equal to, less than, or greater than zero if `x` is equal to, less than, or | |
| /// greater than `y`, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_INTEGER>, ffi.Pointer<ASN1_INTEGER>) | |
| >(symbol: 'bssl_dart_ASN1_INTEGER_cmp') | |
| external int ASN1_INTEGER_cmp( | |
| ffi.Pointer<ASN1_INTEGER> x, | |
| ffi.Pointer<ASN1_INTEGER> y, | |
| ); | |
| /// ASN1_INTEGER_dup calls `ASN1_STRING_dup`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function(ffi.Pointer<ASN1_INTEGER>)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_dup', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> ASN1_INTEGER_dup( | |
| ffi.Pointer<ASN1_INTEGER> x, | |
| ); | |
| /// ASN1_INTEGER_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_INTEGER>)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_free', | |
| ) | |
| external void ASN1_INTEGER_free( | |
| ffi.Pointer<ASN1_INTEGER> str, | |
| ); | |
| /// ASN1_INTEGER_get returns the value of `a` as a `long`, or -1 if `a` is out of | |
| /// range or the wrong type. | |
| /// | |
| /// WARNING: This function's return value cannot distinguish errors from -1. | |
| /// Use `ASN1_INTEGER_get_uint64` and `ASN1_INTEGER_get_int64` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<ASN1_INTEGER>)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_get', | |
| ) | |
| external int ASN1_INTEGER_get( | |
| ffi.Pointer<ASN1_INTEGER> a, | |
| ); | |
| /// ASN1_INTEGER_get_int64 converts `a` to a `int64_t`. On success, it returns | |
| /// one and sets `*out` to the result. If `a` did not fit or has the wrong type, | |
| /// it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Int64>, ffi.Pointer<ASN1_INTEGER>) | |
| >(symbol: 'bssl_dart_ASN1_INTEGER_get_int64') | |
| external int ASN1_INTEGER_get_int64( | |
| ffi.Pointer<ffi.Int64> out, | |
| ffi.Pointer<ASN1_INTEGER> a, | |
| ); | |
| /// ASN1_INTEGER_get_uint64 converts `a` to a `uint64_t`. On success, it returns | |
| /// one and sets `*out` to the result. If `a` did not fit or has the wrong type, | |
| /// it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint64>, ffi.Pointer<ASN1_INTEGER>) | |
| >(symbol: 'bssl_dart_ASN1_INTEGER_get_uint64') | |
| external int ASN1_INTEGER_get_uint64( | |
| ffi.Pointer<ffi.Uint64> out, | |
| ffi.Pointer<ASN1_INTEGER> a, | |
| ); | |
| /// ASN1_INTEGER_new calls `ASN1_STRING_type_new` with `V_ASN1_INTEGER`. The | |
| /// resulting object has value zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function()>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_new', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> ASN1_INTEGER_new(); | |
| /// ASN1_INTEGER_set sets `a` to an INTEGER with value `v`. It returns one on | |
| /// success and zero on error. | |
| /// | |
| /// Use `ASN1_INTEGER_set_uint64` and `ASN1_INTEGER_set_int64` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_INTEGER>, ffi.Long)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_set', | |
| ) | |
| external int ASN1_INTEGER_set( | |
| ffi.Pointer<ASN1_INTEGER> a, | |
| int v, | |
| ); | |
| /// ASN1_INTEGER_set_int64 sets `a` to an INTEGER with value `v`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_INTEGER>, ffi.Int64)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_set_int64', | |
| ) | |
| external int ASN1_INTEGER_set_int64( | |
| ffi.Pointer<ASN1_INTEGER> out, | |
| int v, | |
| ); | |
| /// ASN1_INTEGER_set_uint64 sets `a` to an INTEGER with value `v`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_INTEGER>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_ASN1_INTEGER_set_uint64', | |
| ) | |
| external int ASN1_INTEGER_set_uint64( | |
| ffi.Pointer<ASN1_INTEGER> out, | |
| int v, | |
| ); | |
| /// ASN1_INTEGER_to_BN sets `bn` to the value of `ai` and returns `bn` on success | |
| /// or NULL or error. If `bn` is NULL, it returns a newly-allocated `BIGNUM` on | |
| /// success instead, which the caller must release with `BN_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function(ffi.Pointer<ASN1_INTEGER>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_ASN1_INTEGER_to_BN') | |
| external ffi.Pointer<BIGNUM> ASN1_INTEGER_to_BN( | |
| ffi.Pointer<ASN1_INTEGER> ai, | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// ASN1_NULL_free does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_NULL>)>( | |
| symbol: 'bssl_dart_ASN1_NULL_free', | |
| ) | |
| external void ASN1_NULL_free( | |
| ffi.Pointer<ASN1_NULL> null$, | |
| ); | |
| /// ASN1_NULL_new returns an opaque, non-NULL pointer. It is safe to call | |
| /// `ASN1_NULL_free` on the result, but not necessary. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_NULL> Function()>( | |
| symbol: 'bssl_dart_ASN1_NULL_new', | |
| ) | |
| external ffi.Pointer<ASN1_NULL> ASN1_NULL_new(); | |
| /// ASN1_OBJECT_create returns a newly-allocated `ASN1_OBJECT` with `len` bytes | |
| /// from `data` as the encoded OID, or NULL on error. `data` should contain the | |
| /// DER-encoded identifier, excluding the tag and length. | |
| /// | |
| /// `nid` should be `NID_undef`. Passing a NID value that does not match `data` | |
| /// will cause some functions to misbehave. `sn` and `ln` should be NULL. If | |
| /// non-NULL, they are stored as short and long names, respectively, but these | |
| /// values have no effect for `ASN1_OBJECT`s created through this function. | |
| /// | |
| /// TODO(davidben): Should we just ignore all those parameters? NIDs and names | |
| /// are only relevant for `ASN1_OBJECT`s in the obj.h table. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OBJECT> Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_OBJECT_create') | |
| external ffi.Pointer<ASN1_OBJECT> ASN1_OBJECT_create( | |
| int nid, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ffi.Pointer<ffi.Char> sn, | |
| ffi.Pointer<ffi.Char> ln, | |
| ); | |
| /// ASN1_OBJECT_free releases memory associated with `a`. If `a` is a static | |
| /// `ASN1_OBJECT`, returned from `OBJ_nid2obj`, this function does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_ASN1_OBJECT_free', | |
| ) | |
| external void ASN1_OBJECT_free( | |
| ffi.Pointer<ASN1_OBJECT> a, | |
| ); | |
| /// ASN1_OCTET_STRING_cmp calls `ASN1_STRING_cmp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_OCTET_STRING_cmp') | |
| external int ASN1_OCTET_STRING_cmp( | |
| ffi.Pointer<ASN1_OCTET_STRING> a, | |
| ffi.Pointer<ASN1_OCTET_STRING> b, | |
| ); | |
| /// ASN1_OCTET_STRING_dup calls `ASN1_STRING_dup`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<ASN1_OCTET_STRING>) | |
| >(symbol: 'bssl_dart_ASN1_OCTET_STRING_dup') | |
| external ffi.Pointer<ASN1_OCTET_STRING> ASN1_OCTET_STRING_dup( | |
| ffi.Pointer<ASN1_OCTET_STRING> a, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_OCTET_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_OCTET_STRING_free', | |
| ) | |
| external void ASN1_OCTET_STRING_free( | |
| ffi.Pointer<ASN1_OCTET_STRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OCTET_STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_OCTET_STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_OCTET_STRING> ASN1_OCTET_STRING_new(); | |
| /// ASN1_OCTET_STRING_set calls `ASN1_STRING_set`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_OCTET_STRING_set') | |
| external int ASN1_OCTET_STRING_set( | |
| ffi.Pointer<ASN1_OCTET_STRING> str, | |
| ffi.Pointer<ffi.UnsignedChar> data, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_PRINTABLESTRING>)>( | |
| symbol: 'bssl_dart_ASN1_PRINTABLESTRING_free', | |
| ) | |
| external void ASN1_PRINTABLESTRING_free( | |
| ffi.Pointer<ASN1_PRINTABLESTRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_PRINTABLESTRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_PRINTABLESTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_PRINTABLESTRING> ASN1_PRINTABLESTRING_new(); | |
| /// ASN1_STRING_TABLE_add registers the corresponding parameters with `nid`, for | |
| /// use with `ASN1_STRING_set_by_NID`. It returns one on success and zero on | |
| /// error. It is an error to call this function if `nid` is a built-in NID, or | |
| /// was already registered by a previous call. | |
| /// | |
| /// WARNING: This function affects global state in the library. If two libraries | |
| /// in the same address space register information for the same OID, one call | |
| /// will fail. Prefer directly passing the desired parameters to | |
| /// `ASN1_mbstring_copy` or `ASN1_mbstring_ncopy` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Long, | |
| ffi.UnsignedLong, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_STRING_TABLE_add') | |
| external int ASN1_STRING_TABLE_add( | |
| int nid, | |
| int minsize, | |
| int maxsize, | |
| int mask, | |
| int flags, | |
| ); | |
| /// ASN1_STRING_TABLE_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ASN1_STRING_TABLE_cleanup') | |
| external void ASN1_STRING_TABLE_cleanup(); | |
| /// ASN1_STRING_cmp compares `a` and `b`'s type and contents. It returns an | |
| /// integer equal to, less than, or greater than zero if `a` is equal to, less | |
| /// than, or greater than `b`, respectively. This function compares by length, | |
| /// then data, then type. Note the data compared is the `ASN1_STRING` internal | |
| /// representation and the type order is arbitrary. While this comparison is | |
| /// suitable for sorting, callers should not rely on the exact order when `a` | |
| /// and `b` are different types. | |
| /// | |
| /// Note that, if `a` and `b` are INTEGERs, this comparison does not order the | |
| /// values numerically. For a numerical comparison, use `ASN1_INTEGER_cmp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_STRING>, ffi.Pointer<ASN1_STRING>) | |
| >(symbol: 'bssl_dart_ASN1_STRING_cmp') | |
| external int ASN1_STRING_cmp( | |
| ffi.Pointer<ASN1_STRING> a, | |
| ffi.Pointer<ASN1_STRING> b, | |
| ); | |
| /// ASN1_STRING_copy sets `dst` to a copy of `str`. It returns one on success and | |
| /// zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_STRING>, ffi.Pointer<ASN1_STRING>) | |
| >(symbol: 'bssl_dart_ASN1_STRING_copy') | |
| external int ASN1_STRING_copy( | |
| ffi.Pointer<ASN1_STRING> dst, | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_data returns a mutable pointer to `str`'s contents. Callers | |
| /// should use `ASN1_STRING_length` to determine the length of the string. The | |
| /// string may have embedded NUL bytes and may not be NUL-terminated. | |
| /// | |
| /// The contents of an `ASN1_STRING` encode the value in some type-specific | |
| /// representation that does not always correspond to the DER encoding of the | |
| /// type. See the documentation for `ASN1_STRING` for details. | |
| /// | |
| /// Prefer `ASN1_STRING_get0_data`. See crbug.com/574019297. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.UnsignedChar> Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_data', | |
| ) | |
| external ffi.Pointer<ffi.UnsignedChar> ASN1_STRING_data( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_dup returns a newly-allocated copy of `str`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_dup', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> ASN1_STRING_dup( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_free releases memory associated with `str`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_free', | |
| ) | |
| external void ASN1_STRING_free( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_get0_data returns a pointer to `str`'s contents. Callers should | |
| /// use `ASN1_STRING_length` to determine the length of the string. The string | |
| /// may have embedded NUL bytes and may not be NUL-terminated. | |
| /// | |
| /// The contents of an `ASN1_STRING` encode the value in some type-specific | |
| /// representation that does not always correspond to the DER encoding of the | |
| /// type. See the documentation for `ASN1_STRING` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.UnsignedChar> Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_get0_data', | |
| ) | |
| external ffi.Pointer<ffi.UnsignedChar> ASN1_STRING_get0_data( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_get_default_mask returns `B_ASN1_UTF8STRING`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedLong Function()>( | |
| symbol: 'bssl_dart_ASN1_STRING_get_default_mask', | |
| ) | |
| external int ASN1_STRING_get_default_mask(); | |
| /// ASN1_STRING_get_length returns the length of `str`, in bytes. | |
| /// | |
| /// The contents of an `ASN1_STRING` encode the value in some type-specific | |
| /// representation that does not always correspond to the DER encoding of the | |
| /// type. See the documentation for `ASN1_STRING` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_get_length', | |
| ) | |
| external int ASN1_STRING_get_length( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_length returns the length of `str`, in bytes. Prefer | |
| /// `ASN1_STRING_get_length`. | |
| /// | |
| /// The contents of an `ASN1_STRING` encode the value in some type-specific | |
| /// representation that does not always correspond to the DER encoding of the | |
| /// type. See the documentation for `ASN1_STRING` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_length', | |
| ) | |
| external int ASN1_STRING_length( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_new returns a newly-allocated empty `ASN1_STRING` object with an | |
| /// arbitrary type. Prefer one of the type-specific constructors, such as | |
| /// `ASN1_OCTET_STRING_new`, or `ASN1_STRING_type_new`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> ASN1_STRING_new(); | |
| /// ASN1_STRING_print writes a human-readable representation of `str` to `out`. | |
| /// It returns one on success and zero on error. Unprintable characters are | |
| /// replaced with '.'. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_print', | |
| ) | |
| external int ASN1_STRING_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_print_ex writes a human-readable representation of `str` to | |
| /// `out`. It returns the number of bytes written on success and -1 on error. If | |
| /// `out` is NULL, it returns the number of bytes it would have written, without | |
| /// writing anything. | |
| /// | |
| /// The `flags` should be a combination of combination of `ASN1_STRFLGS_*` | |
| /// constants. See the documentation for each flag for how it controls the | |
| /// output. If unsure, use `ASN1_STRFLGS_RFC2253`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_STRING>, ffi.UnsignedLong) | |
| >(symbol: 'bssl_dart_ASN1_STRING_print_ex') | |
| external int ASN1_STRING_print_ex( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ASN1_STRING> str, | |
| int flags, | |
| ); | |
| /// ASN1_STRING_print_ex_fp behaves like `ASN1_STRING_print_ex` but writes to a | |
| /// `FILE` rather than a `BIO`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ASN1_STRING>, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_STRING_print_ex_fp') | |
| external int ASN1_STRING_print_ex_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ASN1_STRING> str, | |
| int flags, | |
| ); | |
| /// ASN1_STRING_set behaves like `ASN1_STRING_set1_data` except that, if `len` is | |
| /// negative, it implicitly calls `strlen` on data to determine the length. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_STRING>, | |
| ffi.Pointer<ffi.Void>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_STRING_set') | |
| external int ASN1_STRING_set( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// ASN1_STRING_set0 sets the contents of `str` to `len` bytes from `data`. It | |
| /// takes ownership of `data`, which must have been allocated with | |
| /// `OPENSSL_malloc`. | |
| /// | |
| /// If `str` is a BIT STRING, this function sets the number of unused bits to | |
| /// zero. `ASN1_BIT_STRING_set1` may be used to set a BIT STRING that is not a | |
| /// whole number of bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<ASN1_STRING>, ffi.Pointer<ffi.Void>, ffi.Int) | |
| >(symbol: 'bssl_dart_ASN1_STRING_set0') | |
| external void ASN1_STRING_set0( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// ASN1_STRING_set1_data sets the contents of `str` to `len` bytes from `data`. | |
| /// | |
| /// If `str` is a BIT STRING, this function sets the number of unused bits to | |
| /// zero. `ASN1_BIT_STRING_set1` may be used to set a BIT STRING that is not a | |
| /// whole number of bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_STRING>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_ASN1_STRING_set1_data') | |
| external int ASN1_STRING_set1_data( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| /// ASN1_STRING_set_by_NID behaves like `ASN1_mbstring_ncopy`, but determines | |
| /// `mask`, `minsize`, and `maxsize` based on `nid`. When `nid` is a recognized | |
| /// X.509 attribute type, it will pick a suitable ASN.1 string type and bounds. | |
| /// For most attribute types, it preferentially chooses UTF8String. If `nid` is | |
| /// unrecognized, it uses UTF8String by default. This function will also enforce | |
| /// any known attribute-specific constraints on the sizes of the string and fail | |
| /// if the size is invalid. In RFC 5280, these bounds are specified by | |
| /// constraints like "SIZE (1..ub-common-name)" in ASN.1. | |
| /// | |
| /// Slightly unlike `ASN1_mbstring_ncopy`, this function interprets `out` and | |
| /// returns its result as follows: If `out` is NULL, it returns a newly-allocated | |
| /// `ASN1_STRING` containing the result. If `out` is non-NULL and | |
| /// `*out` is NULL, it additionally sets `*out` to the result. If both `out` and | |
| /// `*out` are non-NULL, it instead updates the object at `*out` and returns | |
| /// `*out`. In all cases, it returns NULL on error. | |
| /// | |
| /// This function supports the following NIDs: `NID_countryName`, | |
| /// `NID_dnQualifier`, `NID_domainComponent`, `NID_friendlyName`, | |
| /// `NID_givenName`, `NID_initials`, `NID_localityName`, `NID_ms_csp_name`, | |
| /// `NID_name`, `NID_organizationalUnitName`, `NID_organizationName`, | |
| /// `NID_pkcs9_challengePassword`, `NID_pkcs9_emailAddress`, | |
| /// `NID_pkcs9_unstructuredAddress`, `NID_pkcs9_unstructuredName`, | |
| /// `NID_serialNumber`, `NID_stateOrProvinceName`, and `NID_surname`. Additional | |
| /// NIDs may be registered with `ASN1_STRING_set_by_NID`, but it is recommended | |
| /// to call `ASN1_mbstring_ncopy` directly instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_STRING_set_by_NID') | |
| external ffi.Pointer<ASN1_STRING> ASN1_STRING_set_by_NID( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ffi.Pointer<ffi.UnsignedChar> in$, | |
| int len, | |
| int inform, | |
| int nid, | |
| ); | |
| /// ASN1_STRING_set_default_mask does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_ASN1_STRING_set_default_mask', | |
| ) | |
| external void ASN1_STRING_set_default_mask( | |
| int mask, | |
| ); | |
| /// ASN1_STRING_set_default_mask_asc returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_set_default_mask_asc', | |
| ) | |
| external int ASN1_STRING_set_default_mask_asc( | |
| ffi.Pointer<ffi.Char> p, | |
| ); | |
| /// ASN1_STRING_to_UTF8 converts `in` to UTF-8. On success, sets `*out` to a | |
| /// newly-allocated buffer containing the resulting string and returns the length | |
| /// of the string. The caller must call `OPENSSL_free` to release `*out` when | |
| /// done. On error, it returns a negative number. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Pointer<ASN1_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_STRING_to_UTF8') | |
| external int ASN1_STRING_to_UTF8( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> out, | |
| ffi.Pointer<ASN1_STRING> in$, | |
| ); | |
| /// ASN1_STRING_type returns the type of `str`. This value will be one of the | |
| /// `V_ASN1_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_ASN1_STRING_type', | |
| ) | |
| external int ASN1_STRING_type( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// ASN1_STRING_type_new returns a newly-allocated empty `ASN1_STRING` object of | |
| /// type `type`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_STRING_type_new', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> ASN1_STRING_type_new( | |
| int type, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_T61STRING>)>( | |
| symbol: 'bssl_dart_ASN1_T61STRING_free', | |
| ) | |
| external void ASN1_T61STRING_free( | |
| ffi.Pointer<ASN1_T61STRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_T61STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_T61STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_T61STRING> ASN1_T61STRING_new(); | |
| /// ASN1_TIME_adj adds `offset_day` days and `offset_sec` seconds to | |
| /// `posix_time` and writes the result to `s`. As in RFC 5280, section 4.1.2.5, | |
| /// it uses UTCTime when the time fits and GeneralizedTime otherwise. It returns | |
| /// `s` on success and NULL on error. If `s` is NULL, it returns a | |
| /// newly-allocated `ASN1_GENERALIZEDTIME` instead. | |
| /// | |
| /// Note this function may fail if the time overflows or is out of range for | |
| /// GeneralizedTime. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TIME> Function( | |
| ffi.Pointer<ASN1_TIME>, | |
| ffi.Int64, | |
| ffi.Int, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_TIME_adj') | |
| external ffi.Pointer<ASN1_TIME> ASN1_TIME_adj( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int posix_time, | |
| int offset_day, | |
| int offset_sec, | |
| ); | |
| /// ASN1_TIME_check returns one if `t` is a valid UTCTime or GeneralizedTime, and | |
| /// zero otherwise. `t`'s type determines which check is performed. This | |
| /// function does not enforce that UTCTime was used when possible. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_check', | |
| ) | |
| external int ASN1_TIME_check( | |
| ffi.Pointer<ASN1_TIME> t, | |
| ); | |
| /// ASN1_TIME_diff computes `to` - `from`. On success, it sets `*out_days` to the | |
| /// difference in days, rounded towards zero, sets `*out_seconds` to the | |
| /// remainder, and returns one. On error, it returns zero. | |
| /// | |
| /// If `from` is before `to`, both outputs will be <= 0, with at least one | |
| /// negative. If `from` is after `to`, both will be >= 0, with at least one | |
| /// positive. If they are equal, ignoring fractional seconds, both will be zero. | |
| /// | |
| /// Note this function may fail on overflow, or if `from` or `to` cannot be | |
| /// decoded. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ASN1_TIME>, | |
| ffi.Pointer<ASN1_TIME>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_TIME_diff') | |
| external int ASN1_TIME_diff( | |
| ffi.Pointer<ffi.Int> out_days, | |
| ffi.Pointer<ffi.Int> out_seconds, | |
| ffi.Pointer<ASN1_TIME> from, | |
| ffi.Pointer<ASN1_TIME> to, | |
| ); | |
| /// ASN1_TIME_free releases memory associated with `str`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_free', | |
| ) | |
| external void ASN1_TIME_free( | |
| ffi.Pointer<ASN1_TIME> str, | |
| ); | |
| /// ASN1_TIME_new returns a newly-allocated `ASN1_TIME` with type -1, or NULL on | |
| /// error. The resulting `ASN1_TIME` is not a valid X.509 Time until initialized | |
| /// with a value. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function()>( | |
| symbol: 'bssl_dart_ASN1_TIME_new', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> ASN1_TIME_new(); | |
| /// ASN1_TIME_print writes a human-readable representation of `a` to `out`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_print', | |
| ) | |
| external int ASN1_TIME_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ASN1_TIME> a, | |
| ); | |
| /// ASN1_TIME_set is exactly the same as `ASN1_TIME_set_posix` but with a | |
| /// time_t as input for compatibility. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<ASN1_TIME>, time_t)>( | |
| symbol: 'bssl_dart_ASN1_TIME_set', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> ASN1_TIME_set( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int time, | |
| ); | |
| /// ASN1_TIME_set_posix represents `posix_time` as a GeneralizedTime or UTCTime | |
| /// and writes the result to `s`. As in RFC 5280, section 4.1.2.5, it uses | |
| /// UTCTime when the time fits and GeneralizedTime otherwise. It returns `s` on | |
| /// success and NULL on error. If `s` is NULL, it returns a newly-allocated | |
| /// `ASN1_TIME` instead. | |
| /// | |
| /// Note this function may fail if the time is out of range for GeneralizedTime. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<ASN1_TIME>, ffi.Int64)>( | |
| symbol: 'bssl_dart_ASN1_TIME_set_posix', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> ASN1_TIME_set_posix( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int posix_time, | |
| ); | |
| /// ASN1_TIME_set_string behaves like `ASN1_UTCTIME_set_string` if `str` is a | |
| /// valid UTCTime, and `ASN1_GENERALIZEDTIME_set_string` if `str` is a valid | |
| /// GeneralizedTime. If `str` is neither, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_set_string', | |
| ) | |
| external int ASN1_TIME_set_string( | |
| ffi.Pointer<ASN1_TIME> s, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| /// ASN1_TIME_set_string_X509 behaves like `ASN1_TIME_set_string` except it | |
| /// additionally converts GeneralizedTime to UTCTime if it is in the range where | |
| /// UTCTime is used. See RFC 5280, section 4.1.2.5. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_set_string_X509', | |
| ) | |
| external int ASN1_TIME_set_string_X509( | |
| ffi.Pointer<ASN1_TIME> s, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| /// ASN1_TIME_to_generalizedtime converts `t` to a GeneralizedTime. If `out` is | |
| /// NULL, it returns a newly-allocated `ASN1_GENERALIZEDTIME` on success, or NULL | |
| /// on error. If `out` is non-NULL and `*out` is NULL, it additionally sets | |
| /// `*out` to the result. If `out` and `*out` are non-NULL, it instead updates | |
| /// the object pointed by `*out` and returns `*out` on success or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> Function( | |
| ffi.Pointer<ASN1_TIME>, | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALIZEDTIME>>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_TIME_to_generalizedtime') | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> ASN1_TIME_to_generalizedtime( | |
| ffi.Pointer<ASN1_TIME> t, | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALIZEDTIME>> out, | |
| ); | |
| /// ASN1_TIME_to_posix converts `t` to a POSIX time value in `out`. On | |
| /// success, one is returned. On failure, zero is returned. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<ffi.Int64>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_to_posix', | |
| ) | |
| external int ASN1_TIME_to_posix( | |
| ffi.Pointer<ASN1_TIME> t, | |
| ffi.Pointer<ffi.Int64> out, | |
| ); | |
| /// ASN1_TIME_to_posix_nonstandard converts `t` to a POSIX time value in | |
| /// `out`. It is exactly the same as `ASN1_TIME_to_posix` but allows for | |
| /// non-standard four-digit timezone offsets on UTC times. On success, one is | |
| /// returned. On failure, zero is returned. `ASN1_TIME_to_posix` should normally | |
| /// be used instead of this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<ffi.Int64>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_to_posix_nonstandard', | |
| ) | |
| external int ASN1_TIME_to_posix_nonstandard( | |
| ffi.Pointer<ASN1_TIME> t, | |
| ffi.Pointer<ffi.Int64> out, | |
| ); | |
| /// ASN1_TIME_to_time_t converts `t` to a time_t value in `out`. On | |
| /// success, one is returned. On failure, zero is returned. This function | |
| /// will fail if the time can not be represented in a time_t. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<time_t>)>( | |
| symbol: 'bssl_dart_ASN1_TIME_to_time_t', | |
| ) | |
| external int ASN1_TIME_to_time_t( | |
| ffi.Pointer<ASN1_TIME> t, | |
| ffi.Pointer<time_t> out, | |
| ); | |
| /// ASN1_TYPE_cmp compares `a` and `b`. It returns zero if they are equal, and a | |
| /// negative or positive value if `a` sorts before or after `b`, respectively. | |
| /// NULL sorts before any non-NULL value. Otherwise, values are ordered first by | |
| /// type, then by contents. The order is arbitrary but suitable for sorting. | |
| /// Callers should not rely on the exact order. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TYPE>, ffi.Pointer<ASN1_TYPE>)>( | |
| symbol: 'bssl_dart_ASN1_TYPE_cmp', | |
| ) | |
| external int ASN1_TYPE_cmp( | |
| ffi.Pointer<ASN1_TYPE> a, | |
| ffi.Pointer<ASN1_TYPE> b, | |
| ); | |
| /// ASN1_TYPE_free releases memory associated with `a`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_TYPE>)>( | |
| symbol: 'bssl_dart_ASN1_TYPE_free', | |
| ) | |
| external void ASN1_TYPE_free( | |
| ffi.Pointer<ASN1_TYPE> a, | |
| ); | |
| /// ASN1_TYPE_get returns the type of `a`, which will be one of the `V_ASN1_*` | |
| /// constants, or zero if `a` is not fully initialized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TYPE>)>( | |
| symbol: 'bssl_dart_ASN1_TYPE_get', | |
| ) | |
| external int ASN1_TYPE_get( | |
| ffi.Pointer<ASN1_TYPE> a, | |
| ); | |
| /// ASN1_TYPE_new returns a newly-allocated `ASN1_TYPE`, or NULL on allocation | |
| /// failure. The resulting object has type -1 and must be initialized to be | |
| /// a valid ANY value. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TYPE> Function()>( | |
| symbol: 'bssl_dart_ASN1_TYPE_new', | |
| ) | |
| external ffi.Pointer<ASN1_TYPE> ASN1_TYPE_new(); | |
| /// ASN1_TYPE_set sets `a` to an `ASN1_TYPE` of type `type` and value `value`, | |
| /// releasing the previous contents of `a`. | |
| /// | |
| /// If `type` is `V_ASN1_BOOLEAN`, `a` is set to FALSE if `value` is NULL and | |
| /// TRUE otherwise. If setting `a` to TRUE, `value` may be an invalid pointer, | |
| /// such as (void*)1. | |
| /// | |
| /// If `type` is `V_ASN1_NULL`, `value` must be NULL. | |
| /// | |
| /// For other values of `type`, this function takes ownership of `value`, which | |
| /// must point to an object of the corresponding type. See `ASN1_TYPE` for | |
| /// details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<ASN1_TYPE>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_ASN1_TYPE_set') | |
| external void ASN1_TYPE_set( | |
| ffi.Pointer<ASN1_TYPE> a, | |
| int type, | |
| ffi.Pointer<ffi.Void> value, | |
| ); | |
| /// ASN1_TYPE_set1 behaves like `ASN1_TYPE_set` except it does not take ownership | |
| /// of `value`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_TYPE>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_ASN1_TYPE_set1') | |
| external int ASN1_TYPE_set1( | |
| ffi.Pointer<ASN1_TYPE> a, | |
| int type, | |
| ffi.Pointer<ffi.Void> value, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_UNIVERSALSTRING>)>( | |
| symbol: 'bssl_dart_ASN1_UNIVERSALSTRING_free', | |
| ) | |
| external void ASN1_UNIVERSALSTRING_free( | |
| ffi.Pointer<ASN1_UNIVERSALSTRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_UNIVERSALSTRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_UNIVERSALSTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_UNIVERSALSTRING> ASN1_UNIVERSALSTRING_new(); | |
| /// ASN1_UTCTIME_adj adds `offset_day` days and `offset_sec` seconds to | |
| /// `posix_time` and writes the result to `s` as a UTCTime. It returns `s` on | |
| /// success and NULL on error. If `s` is NULL, it returns a newly-allocated | |
| /// `ASN1_UTCTIME` instead. | |
| /// | |
| /// Note this function may fail if the time overflows or is out of range for | |
| /// UTCTime. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_UTCTIME> Function( | |
| ffi.Pointer<ASN1_UTCTIME>, | |
| ffi.Int64, | |
| ffi.Int, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_UTCTIME_adj') | |
| external ffi.Pointer<ASN1_UTCTIME> ASN1_UTCTIME_adj( | |
| ffi.Pointer<ASN1_UTCTIME> s, | |
| int posix_time, | |
| int offset_day, | |
| int offset_sec, | |
| ); | |
| /// ASN1_UTCTIME_check returns one if `a` is a valid UTCTime and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_UTCTIME>)>( | |
| symbol: 'bssl_dart_ASN1_UTCTIME_check', | |
| ) | |
| external int ASN1_UTCTIME_check( | |
| ffi.Pointer<ASN1_UTCTIME> a, | |
| ); | |
| /// ASN1_UTCTIME_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_UTCTIME>)>( | |
| symbol: 'bssl_dart_ASN1_UTCTIME_free', | |
| ) | |
| external void ASN1_UTCTIME_free( | |
| ffi.Pointer<ASN1_UTCTIME> str, | |
| ); | |
| /// ASN1_UTCTIME_new calls `ASN1_STRING_type_new` with `V_ASN1_UTCTIME`. The | |
| /// resulting object contains empty contents and must be initialized to be a | |
| /// valid UTCTime. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_UTCTIME> Function()>( | |
| symbol: 'bssl_dart_ASN1_UTCTIME_new', | |
| ) | |
| external ffi.Pointer<ASN1_UTCTIME> ASN1_UTCTIME_new(); | |
| /// ASN1_UTCTIME_print writes a human-readable representation of `a` to `out`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_UTCTIME>)>( | |
| symbol: 'bssl_dart_ASN1_UTCTIME_print', | |
| ) | |
| external int ASN1_UTCTIME_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ASN1_UTCTIME> a, | |
| ); | |
| /// ASN1_UTCTIME_set represents `posix_time` as a UTCTime and writes the result | |
| /// to `s`. It returns `s` on success and NULL on error. If `s` is NULL, it | |
| /// returns a newly-allocated `ASN1_UTCTIME` instead. | |
| /// | |
| /// Note this function may fail if the time is out of range for UTCTime. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_UTCTIME> Function(ffi.Pointer<ASN1_UTCTIME>, ffi.Int64) | |
| >(symbol: 'bssl_dart_ASN1_UTCTIME_set') | |
| external ffi.Pointer<ASN1_UTCTIME> ASN1_UTCTIME_set( | |
| ffi.Pointer<ASN1_UTCTIME> s, | |
| int posix_time, | |
| ); | |
| /// ASN1_UTCTIME_set_string sets `s` to a UTCTime whose contents are a copy of | |
| /// `str`. It returns one on success and zero on error or if `str` is not a valid | |
| /// UTCTime. | |
| /// | |
| /// If `s` is NULL, this function validates `str` without copying it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_UTCTIME>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ASN1_UTCTIME_set_string', | |
| ) | |
| external int ASN1_UTCTIME_set_string( | |
| ffi.Pointer<ASN1_UTCTIME> s, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_UTF8STRING>)>( | |
| symbol: 'bssl_dart_ASN1_UTF8STRING_free', | |
| ) | |
| external void ASN1_UTF8STRING_free( | |
| ffi.Pointer<ASN1_UTF8STRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_UTF8STRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_UTF8STRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_UTF8STRING> ASN1_UTF8STRING_new(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_VISIBLESTRING>)>( | |
| symbol: 'bssl_dart_ASN1_VISIBLESTRING_free', | |
| ) | |
| external void ASN1_VISIBLESTRING_free( | |
| ffi.Pointer<ASN1_VISIBLESTRING> str, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_VISIBLESTRING> Function()>( | |
| symbol: 'bssl_dart_ASN1_VISIBLESTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_VISIBLESTRING> ASN1_VISIBLESTRING_new(); | |
| /// ASN1_digest serializes `data` with `i2d` and then hashes the result with | |
| /// `type`. On success, it returns one, writes the digest to `md`, and sets | |
| /// `*len` to the digest length if non-NULL. On error, it returns zero. | |
| /// | |
| /// `EVP_MD_CTX_size` bytes are written, which is at most `EVP_MAX_MD_SIZE`. The | |
| /// buffer must have sufficient space for this output. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<i2d_of_void>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_digest') | |
| external int ASN1_digest( | |
| ffi.Pointer<i2d_of_void> i2d, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ffi.Char> data, | |
| ffi.Pointer<ffi.UnsignedChar> md, | |
| ffi.Pointer<ffi.UnsignedInt> len, | |
| ); | |
| /// ASN1_get_object parses a BER element from up to `max_len` bytes at `*inp`. It | |
| /// returns `V_ASN1_CONSTRUCTED` if it successfully parsed a constructed element, | |
| /// zero if it successfully parsed a primitive element, and 0x80 on error. On | |
| /// success, it additionally advances `*inp` to the element body, sets | |
| /// `*out_length`, `*out_tag`, and `*out_class` to the element's length, tag | |
| /// number, and tag class, respectively, | |
| /// | |
| /// Unlike OpenSSL, this function only supports DER. Indefinite and non-minimal | |
| /// lengths are rejected. | |
| /// | |
| /// This function is difficult to use correctly. Use `CBS_get_asn1` and related | |
| /// functions from bytestring.h. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Pointer<ffi.Long>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_get_object') | |
| external int ASN1_get_object( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> inp, | |
| ffi.Pointer<ffi.Long> out_length, | |
| ffi.Pointer<ffi.Int> out_tag, | |
| ffi.Pointer<ffi.Int> out_class, | |
| int max_len, | |
| ); | |
| /// ASN1_item_d2i parses the ASN.1 type `it` from up to `len` bytes at `*inp`. | |
| /// It behaves like `d2i_SAMPLE`, except that `out` and the return value are cast | |
| /// to `ASN1_VALUE` pointers. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Casting the result of this function to the wrong type, or passing a | |
| /// pointer of the wrong type into this function, are potentially exploitable | |
| /// memory errors. Callers must ensure `out` is consistent with `it`. Prefer | |
| /// using type-specific functions such as `d2i_ASN1_OCTET_STRING`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_VALUE> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_VALUE>>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Long, | |
| ffi.Pointer<ASN1_ITEM>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_d2i') | |
| external ffi.Pointer<ASN1_VALUE> ASN1_item_d2i( | |
| ffi.Pointer<ffi.Pointer<ASN1_VALUE>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> inp, | |
| int len, | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_d2i_bio') | |
| external ffi.Pointer<ffi.Void> ASN1_item_d2i_bio( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<BIO> in$, | |
| ffi.Pointer<ffi.Void> out, | |
| ); | |
| /// The following functions behave like `ASN1_item_d2i` but read from `in` | |
| /// instead. `out` is the same parameter as in `ASN1_item_d2i`, but written with | |
| /// `void*` instead. The return values similarly match. | |
| /// | |
| /// These functions may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: These functions do not bound how much data is read from `in`. | |
| /// Parsing an untrusted input could consume unbounded memory. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_d2i_fp') | |
| external ffi.Pointer<ffi.Void> ASN1_item_d2i_fp( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<FILE> in$, | |
| ffi.Pointer<ffi.Void> out, | |
| ); | |
| /// ASN1_item_digest serializes `data` with `it` and then hashes the result with | |
| /// `type`. On success, it returns one, writes the digest to `md`, and sets | |
| /// `*len` to the digest length if non-NULL. On error, it returns zero. | |
| /// | |
| /// `EVP_MD_CTX_size` bytes are written, which is at most `EVP_MAX_MD_SIZE`. The | |
| /// buffer must have sufficient space for this output. | |
| /// | |
| /// WARNING: `data` must be a pointer with the same type as `it`'s corresponding | |
| /// C type. Using the wrong type is a potentially exploitable memory error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_digest') | |
| external int ASN1_item_digest( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ffi.Void> data, | |
| ffi.Pointer<ffi.UnsignedChar> md, | |
| ffi.Pointer<ffi.UnsignedInt> len, | |
| ); | |
| /// ASN1_item_dup returns a newly-allocated copy of `x`, or NULL on error. `x` | |
| /// must be an object of `it`'s C type. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Casting the result of this function to the wrong type, or passing a | |
| /// pointer of the wrong type into this function, are potentially exploitable | |
| /// memory errors. Prefer using type-specific functions such as | |
| /// `ASN1_STRING_dup`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Pointer<ASN1_ITEM>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_ASN1_item_dup') | |
| external ffi.Pointer<ffi.Void> ASN1_item_dup( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<ffi.Void> x, | |
| ); | |
| /// ASN1_item_free releases memory associated with `val`, which must be an object | |
| /// of the C type corresponding to `it`. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Passing a pointer of the wrong type into this function is a | |
| /// potentially exploitable memory error. Callers must ensure `val` is consistent | |
| /// with `it`. Prefer using type-specific functions such as | |
| /// `ASN1_OCTET_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_VALUE>, ffi.Pointer<ASN1_ITEM>)>( | |
| symbol: 'bssl_dart_ASN1_item_free', | |
| ) | |
| external void ASN1_item_free( | |
| ffi.Pointer<ASN1_VALUE> val, | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ); | |
| /// ASN1_item_i2d marshals `val` as the ASN.1 type associated with `it`, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Passing a pointer of the wrong type into this function is a | |
| /// potentially exploitable memory error. Callers must ensure `val` is consistent | |
| /// with `it`. Prefer using type-specific functions such as | |
| /// `i2d_ASN1_OCTET_STRING`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_VALUE>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Pointer<ASN1_ITEM>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_i2d') | |
| external int ASN1_item_i2d( | |
| ffi.Pointer<ASN1_VALUE> val, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_i2d_bio') | |
| external int ASN1_item_i2d_bio( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ffi.Void> in$, | |
| ); | |
| /// The following functions behave like `ASN1_item_i2d` but write to `out` | |
| /// instead. `in` is the same parameter as in `ASN1_item_i2d`, but written with | |
| /// `void*` instead. | |
| /// | |
| /// These functions may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_i2d_fp') | |
| external int ASN1_item_i2d_fp( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<FILE> out, | |
| ffi.Pointer<ffi.Void> in$, | |
| ); | |
| /// ASN1_item_new allocates a new value of the C type corresponding to `it`, or | |
| /// NULL on error. On success, the caller must release the value with | |
| /// `ASN1_item_free`, or the corresponding C type's free function, when done. The | |
| /// new value will initialize fields of the value to some default state, such as | |
| /// an empty string. Note, however, that this default state sometimes omits | |
| /// required values, such as with CHOICE types. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Casting the result of this function to the wrong type is a | |
| /// potentially exploitable memory error. Callers must ensure the value is used | |
| /// consistently with `it`. Prefer using type-specific functions such as | |
| /// `ASN1_OCTET_STRING_new`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_VALUE> Function(ffi.Pointer<ASN1_ITEM>)>( | |
| symbol: 'bssl_dart_ASN1_item_new', | |
| ) | |
| external ffi.Pointer<ASN1_VALUE> ASN1_item_new( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ); | |
| /// ASN1_item_pack marshals `obj` as `it`'s ASN.1 type. If `out` is NULL, it | |
| /// returns a newly-allocated `ASN1_STRING` with the result, or NULL on error. | |
| /// If `out` is non-NULL, but `*out` is NULL, it does the same but additionally | |
| /// sets `*out` to the result. If both `out` and `*out` are non-NULL, it writes | |
| /// the result to `*out` and returns `*out` on success or NULL on error. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Passing a pointer of the wrong type into this function is a | |
| /// potentially exploitable memory error. Callers must ensure `val` is consistent | |
| /// with `it`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_STRING> Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_pack') | |
| external ffi.Pointer<ASN1_STRING> ASN1_item_pack( | |
| ffi.Pointer<ffi.Void> obj, | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ); | |
| /// ASN1_item_sign serializes `data` with `it` and then signs the result with | |
| /// the private key `pkey`. It returns the length of the signature on success and | |
| /// zero on error. On success, it writes the signature to `signature` and the | |
| /// signature algorithm to each of `algor1` and `algor2`. Either of `algor1` or | |
| /// `algor2` may be NULL to ignore them. This function uses digest algorithm | |
| /// `md`, or `pkey`'s default if NULL. Other signing parameters use `pkey`'s | |
| /// defaults. To customize them, use `ASN1_item_sign_ctx`. | |
| /// | |
| /// `algor1` and `algor2` may point into part of `asn` and will be updated before | |
| /// `asn` is serialized. | |
| /// | |
| /// WARNING: `data` must be a pointer with the same type as `it`'s corresponding | |
| /// C type. Using the wrong type is a potentially exploitable memory error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_sign') | |
| external int ASN1_item_sign( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<X509_ALGOR> algor1, | |
| ffi.Pointer<X509_ALGOR> algor2, | |
| ffi.Pointer<ASN1_BIT_STRING> signature, | |
| ffi.Pointer<ffi.Void> data, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EVP_MD> type, | |
| ); | |
| /// ASN1_item_sign_ctx behaves like `ASN1_item_sign` except the signature is | |
| /// signed with `ctx`, `ctx`, which must have been initialized with | |
| /// `EVP_DigestSignInit`. The caller should configure the corresponding | |
| /// `EVP_PKEY_CTX` with any additional parameters before calling this function. | |
| /// | |
| /// On success or failure, this function mutates `ctx` and resets it to the empty | |
| /// state. Caller should not rely on its contents after the function returns. | |
| /// | |
| /// `algor1` and `algor2` may point into part of `asn` and will be updated before | |
| /// `asn` is serialized. | |
| /// | |
| /// WARNING: `data` must be a pointer with the same type as `it`'s corresponding | |
| /// C type. Using the wrong type is a potentially exploitable memory error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_sign_ctx') | |
| external int ASN1_item_sign_ctx( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<X509_ALGOR> algor1, | |
| ffi.Pointer<X509_ALGOR> algor2, | |
| ffi.Pointer<ASN1_BIT_STRING> signature, | |
| ffi.Pointer<ffi.Void> asn, | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// ASN1_item_unpack parses `oct`'s contents as `it`'s ASN.1 type. It returns a | |
| /// newly-allocated instance of `it`'s C type on success, or NULL on error. | |
| /// | |
| /// This function may not be used with `ASN1_ITEM`s whose C type is | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// WARNING: Casting the result of this function to the wrong type is a | |
| /// potentially exploitable memory error. Callers must ensure the value is used | |
| /// consistently with `it`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ASN1_STRING>, | |
| ffi.Pointer<ASN1_ITEM>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_unpack') | |
| external ffi.Pointer<ffi.Void> ASN1_item_unpack( | |
| ffi.Pointer<ASN1_STRING> oct, | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ); | |
| /// ASN1_item_verify serializes `data` with `it` and then verifies `signature` is | |
| /// a valid signature for the result with `algor1` and `pkey`. It returns one on | |
| /// success and zero on error. The signature and algorithm are interpreted as in | |
| /// X.509. | |
| /// | |
| /// WARNING: `data` must be a pointer with the same type as `it`'s corresponding | |
| /// C type. Using the wrong type is a potentially exploitable memory error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ITEM>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_item_verify') | |
| external int ASN1_item_verify( | |
| ffi.Pointer<ASN1_ITEM> it, | |
| ffi.Pointer<X509_ALGOR> algor1, | |
| ffi.Pointer<ASN1_BIT_STRING> signature, | |
| ffi.Pointer<ffi.Void> data, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// ASN1_mbstring_copy converts `len` bytes from `in` to an ASN.1 string. If | |
| /// `len` is -1, `in` must be NUL-terminated and the length is determined by | |
| /// `strlen`. `in` is decoded according to `inform`, which must be one of | |
| /// `MBSTRING_*`. `mask` determines the set of valid output types and is a | |
| /// bitmask containing a subset of `B_ASN1_PRINTABLESTRING`, `B_ASN1_IA5STRING`, | |
| /// `B_ASN1_T61STRING`, `B_ASN1_BMPSTRING`, `B_ASN1_UNIVERSALSTRING`, and | |
| /// `B_ASN1_UTF8STRING`, in that preference order. This function chooses the | |
| /// first output type in `mask` which can represent `in`. It interprets T61String | |
| /// as Latin-1, rather than T.61. | |
| /// | |
| /// If `mask` is zero, `DIRSTRING_TYPE` is used by default. | |
| /// | |
| /// On success, this function returns the `V_ASN1_*` constant corresponding to | |
| /// the selected output type and, if `out` and `*out` are both non-NULL, updates | |
| /// the object at `*out` with the result. If `out` is non-NULL and `*out` is | |
| /// NULL, it instead sets `*out` to a newly-allocated `ASN1_STRING` containing | |
| /// the result. If `out` is NULL, it returns the selected output type without | |
| /// constructing an `ASN1_STRING`. On error, this function returns -1. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_mbstring_copy') | |
| external int ASN1_mbstring_copy( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| int inform, | |
| int mask, | |
| ); | |
| /// ASN1_mbstring_ncopy behaves like `ASN1_mbstring_copy` but returns an error if | |
| /// the input is less than `minsize` or greater than `maxsize` codepoints long. A | |
| /// `maxsize` value of zero is ignored. Note the sizes are measured in | |
| /// codepoints, not output bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ossl_ssize_t, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_mbstring_ncopy') | |
| external int ASN1_mbstring_ncopy( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| int inform, | |
| int mask, | |
| int minsize, | |
| int maxsize, | |
| ); | |
| /// ASN1_object_size returns the number of bytes needed to encode a DER or BER | |
| /// value with length `length` and tag number `tag`, or -1 on error. `tag` should | |
| /// not include the constructed bit or tag class. If `constructed` is zero or | |
| /// one, the result uses a definite-length encoding with minimally-encoded | |
| /// length, as in DER. If `constructed` is two, the result uses BER | |
| /// indefinite-length encoding. | |
| /// | |
| /// Use `CBB_add_asn1` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_object_size', | |
| ) | |
| external int ASN1_object_size( | |
| int constructed, | |
| int length, | |
| int tag, | |
| ); | |
| /// ASN1_put_eoc writes two zero bytes to `*outp`, advances `*outp` to point past | |
| /// those bytes, and returns two. | |
| /// | |
| /// Use definite-length encoding instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>)>( | |
| symbol: 'bssl_dart_ASN1_put_eoc', | |
| ) | |
| external int ASN1_put_eoc( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| /// ASN1_put_object writes the header for a DER or BER element to `*outp` and | |
| /// advances `*outp` by the number of bytes written. The caller is responsible | |
| /// for ensuring `*outp` has enough space for the output. The header describes an | |
| /// element with length `length`, tag number `tag`, and class `xclass`. `xclass` | |
| /// should be one of the `V_ASN1_*` tag class constants. The element is primitive | |
| /// if `constructed` is zero and constructed if it is one or two. If | |
| /// `constructed` is two, `length` is ignored and the element uses | |
| /// indefinite-length encoding. | |
| /// | |
| /// Use `CBB_add_asn1` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_ASN1_put_object') | |
| external void ASN1_put_object( | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| int constructed, | |
| int length, | |
| int tag, | |
| int xclass, | |
| ); | |
| /// ASN1_tag2bit converts `tag` from the tag number of a universal type to a | |
| /// corresponding `B_ASN1_*` constant, or zero if `tag` has no bitmask. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedLong Function(ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_tag2bit', | |
| ) | |
| external int ASN1_tag2bit( | |
| int tag, | |
| ); | |
| /// ASN1_tag2str returns a string representation of `tag`, interpret as a tag | |
| /// number for a universal type, or `V_ASN1_NEG_*`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_ASN1_tag2str', | |
| ) | |
| external ffi.Pointer<ffi.Char> ASN1_tag2str( | |
| int tag, | |
| ); | |
| /// AUTHORITY_INFO_ACCESS_free releases memory associated with `aia`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<AUTHORITY_INFO_ACCESS>)>( | |
| symbol: 'bssl_dart_AUTHORITY_INFO_ACCESS_free', | |
| ) | |
| external void AUTHORITY_INFO_ACCESS_free( | |
| ffi.Pointer<AUTHORITY_INFO_ACCESS> aia, | |
| ); | |
| /// AUTHORITY_INFO_ACCESS_new returns a newly-allocated, empty | |
| /// `AUTHORITY_INFO_ACCESS` object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<AUTHORITY_INFO_ACCESS> Function()>( | |
| symbol: 'bssl_dart_AUTHORITY_INFO_ACCESS_new', | |
| ) | |
| external ffi.Pointer<AUTHORITY_INFO_ACCESS> AUTHORITY_INFO_ACCESS_new(); | |
| /// AUTHORITY_KEYID_free releases memory associated with `akid`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<AUTHORITY_KEYID>)>( | |
| symbol: 'bssl_dart_AUTHORITY_KEYID_free', | |
| ) | |
| external void AUTHORITY_KEYID_free( | |
| ffi.Pointer<AUTHORITY_KEYID> akid, | |
| ); | |
| /// AUTHORITY_KEYID_new returns a newly-allocated, empty `AUTHORITY_KEYID` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<AUTHORITY_KEYID> Function()>( | |
| symbol: 'bssl_dart_AUTHORITY_KEYID_new', | |
| ) | |
| external ffi.Pointer<AUTHORITY_KEYID> AUTHORITY_KEYID_new(); | |
| /// BASIC_CONSTRAINTS_free releases memory associated with `bcons`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BASIC_CONSTRAINTS>)>( | |
| symbol: 'bssl_dart_BASIC_CONSTRAINTS_free', | |
| ) | |
| external void BASIC_CONSTRAINTS_free( | |
| ffi.Pointer<BASIC_CONSTRAINTS> bcons, | |
| ); | |
| /// BASIC_CONSTRAINTS_new returns a newly-allocated, empty `BASIC_CONSTRAINTS` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BASIC_CONSTRAINTS> Function()>( | |
| symbol: 'bssl_dart_BASIC_CONSTRAINTS_new', | |
| ) | |
| external ffi.Pointer<BASIC_CONSTRAINTS> BASIC_CONSTRAINTS_new(); | |
| /// BIO_append_filename opens `filename` for appending and sets the result as | |
| /// the `FILE` for `bio`. It returns one on success and zero otherwise. The | |
| /// `FILE` will be closed when `bio` is freed. On Windows, the file is opened in | |
| /// binary mode. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_append_filename', | |
| ) | |
| external int BIO_append_filename( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> filename, | |
| ); | |
| /// BIO_callback_ctrl allows the callback function to be manipulated. The `cmd` | |
| /// arg will generally be `BIO_CTRL_SET_CALLBACK` but arbitrary command values | |
| /// can be interpreted by the `BIO`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<BIO_info_cb>) | |
| >(symbol: 'bssl_dart_BIO_callback_ctrl') | |
| external int BIO_callback_ctrl( | |
| ffi.Pointer<BIO> bio, | |
| int cmd, | |
| ffi.Pointer<BIO_info_cb> fp, | |
| ); | |
| /// BIO_clear_flags ANDs `bio->flags` with the bitwise-complement of `flags`. | |
| /// Unless otherwise documented, flags are private to either BoringSSL or the | |
| /// custom `BIO_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_clear_flags', | |
| ) | |
| external void BIO_clear_flags( | |
| ffi.Pointer<BIO> bio, | |
| int flags, | |
| ); | |
| /// BIO_clear_retry_flags clears the `BIO_FLAGS_READ`, `BIO_FLAGS_WRITE`, | |
| /// `BIO_FLAGS_IO_SPECIAL` and `BIO_FLAGS_SHOULD_RETRY` flags from `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_clear_retry_flags', | |
| ) | |
| external void BIO_clear_retry_flags( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_copy_next_retry sets the retry flags and `retry_reason` of `bio` from | |
| /// the next BIO in the chain. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_copy_next_retry', | |
| ) | |
| external void BIO_copy_next_retry( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_ctrl sends the control request `cmd` to `bio`. The `cmd` argument should | |
| /// be one of the `BIO_C_*` values. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Long, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_BIO_ctrl') | |
| external int BIO_ctrl( | |
| ffi.Pointer<BIO> bio, | |
| int cmd, | |
| int larg, | |
| ffi.Pointer<ffi.Void> parg, | |
| ); | |
| /// BIO_ctrl_get_read_request returns the number of bytes that the other side of | |
| /// `bio` tried (unsuccessfully) to read. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_ctrl_get_read_request', | |
| ) | |
| external int BIO_ctrl_get_read_request( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_ctrl_get_write_guarantee returns the number of bytes that `bio` (which | |
| /// must have been returned by `BIO_new_bio_pair`) will accept on the next | |
| /// `BIO_write` call. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_ctrl_get_write_guarantee', | |
| ) | |
| external int BIO_ctrl_get_write_guarantee( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_ctrl_pending calls `BIO_pending` and exists only for compatibility with | |
| /// OpenSSL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_ctrl_pending', | |
| ) | |
| external int BIO_ctrl_pending( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_do_connect connects `bio` if it has not been connected yet. It returns | |
| /// one on success and <= 0 otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_do_connect', | |
| ) | |
| external int BIO_do_connect( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_dup_ref increments the reference count of `bio` and returns the same | |
| /// handle. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_dup_ref', | |
| ) | |
| external ffi.Pointer<BIO> BIO_dup_ref( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_eof returns non-zero when `bio` has reached end-of-file. The precise | |
| /// meaning of which depends on the concrete type of `bio`. Note that in the | |
| /// case of BIO_pair this always returns non-zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_eof') | |
| external int BIO_eof( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_find_type walks a chain of BIOs and returns the first that matches | |
| /// `type`, which is one of the `BIO_TYPE_*` values. | |
| /// | |
| /// If `type & 0xff` is non-zero, i.e. `type` is a complete type and contains an | |
| /// "index" component, the function looks for an exact match. If `type & 0xff` is | |
| /// zero, i.e. `type` just specifies `BIO_TYPE_DESCRIPTOR`, `BIO_TYPE_FILTER`, | |
| /// and `BIO_TYPE_SOURCE_SINK` bits, the function looks for any BIO whose type | |
| /// contains at least one of those bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_find_type', | |
| ) | |
| external ffi.Pointer<BIO> BIO_find_type( | |
| ffi.Pointer<BIO> bio, | |
| int type, | |
| ); | |
| /// BIO_flush flushes any buffered output. It returns one on success and <= 0 on | |
| /// error. Callers that support non-blocking I/O should call `BIO_should_write` | |
| /// on error to check if the error is fatal or retryable. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_flush') | |
| external int BIO_flush( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_free decrements the reference count of `bio`. If the reference count | |
| /// drops to zero, it calls the destroy callback, if present, on the method and | |
| /// frees `bio` itself. If `bio` is part of a chain (see `BIO_push`), this will | |
| /// also free the next `BIO` in the chain, and so on. | |
| /// | |
| /// It returns one if `bio` was NULL or freed. It returns zero if `bio` was | |
| /// shared and some other owner still owns a reference count to it. | |
| /// | |
| /// WARNING: Do not use the return value. Returning zero is not a sign of an | |
| /// error, nor an indication to retry the operation. `BIO` is a reference-counted | |
| /// type. A given `BIO` object may be shared between multiple parts of an | |
| /// application. To correctly track the reference count, without leaks or | |
| /// use-after-free, each part of the application must release only the reference | |
| /// counts it owns. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_free') | |
| external int BIO_free( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_free_all calls `BIO_free`. Code that targets BoringSSL does not need to | |
| /// call a separate free function for `BIO`s that are part of a chain. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_free_all', | |
| ) | |
| external void BIO_free_all( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_get_data returns custom data on `bio` set by `BIO_get_data`. | |
| /// | |
| /// This function should only be called by the implementation of a custom `BIO`. | |
| /// In particular, the data pointer of a built-in `BIO` is private to the | |
| /// library. For other uses, see `BIO_get_ex_data` and `BIO_get_app_data`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_get_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> BIO_get_data( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_get_ex_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> BIO_get_ex_data( | |
| ffi.Pointer<BIO> bio, | |
| int idx, | |
| ); | |
| /// ex_data functions. | |
| /// | |
| /// See `ex_data.h` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_get_ex_new_index') | |
| external int BIO_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// BIO_get_fd returns the file descriptor currently in use by `bio` or -1 if | |
| /// `bio` does not wrap a file descriptor. If there is a file descriptor and | |
| /// `out_fd` is not NULL, it also sets `*out_fd` to the file descriptor. | |
| /// | |
| /// This function may also be used with socket BIOs (see `BIO_s_socket` and | |
| /// `BIO_new_socket`). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_BIO_get_fd', | |
| ) | |
| external int BIO_get_fd( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Int> out_fd, | |
| ); | |
| /// BIO_get_fp sets `*out_file` to the current `FILE` for `bio`. It returns one | |
| /// on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<FILE>>)>( | |
| symbol: 'bssl_dart_BIO_get_fp', | |
| ) | |
| external int BIO_get_fp( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<FILE>> out_file, | |
| ); | |
| /// BIO_get_init returns whether `bio` has been fully initialized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_get_init', | |
| ) | |
| external int BIO_get_init( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_get_mem_data sets `*contents` to point to the current contents of `bio` | |
| /// and returns the length of the data. | |
| /// | |
| /// WARNING: don't use this, use `BIO_mem_contents`. A return value of zero from | |
| /// this function can mean either that it failed or that the memory buffer is | |
| /// empty. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<ffi.Char>>) | |
| >(symbol: 'bssl_dart_BIO_get_mem_data') | |
| external int BIO_get_mem_data( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> contents, | |
| ); | |
| /// BIO_get_mem_ptr sets `*out` to a BUF_MEM containing the current contents of | |
| /// `bio`. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<BUF_MEM>>) | |
| >(symbol: 'bssl_dart_BIO_get_mem_ptr') | |
| external int BIO_get_mem_ptr( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<BUF_MEM>> out, | |
| ); | |
| /// BIO_get_new_index returns a new "type" value for a custom `BIO`, or -1 on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_BIO_get_new_index') | |
| external int BIO_get_new_index(); | |
| /// BIO_get_retry_flags gets the `BIO_FLAGS_READ`, `BIO_FLAGS_WRITE`, | |
| /// `BIO_FLAGS_IO_SPECIAL` and `BIO_FLAGS_SHOULD_RETRY` flags from `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_get_retry_flags', | |
| ) | |
| external int BIO_get_retry_flags( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_get_retry_reason returns the special I/O operation that needs to be | |
| /// retried. The return value is one of the `BIO_RR_*` values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_get_retry_reason', | |
| ) | |
| external int BIO_get_retry_reason( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_get_shutdown returns the method-specific "shutdown" bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_get_shutdown', | |
| ) | |
| external int BIO_get_shutdown( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_gets reads a line from `bio` and writes at most `size` bytes into `buf`. | |
| /// It returns the number of bytes read or a negative number on error. This | |
| /// function's output always includes a trailing NUL byte, so it will read at | |
| /// most `size - 1` bytes. | |
| /// | |
| /// If the function read a complete line, the output will include the newline | |
| /// character, '\n'. If no newline was found before `size - 1` bytes or EOF, it | |
| /// outputs the bytes which were available. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_gets', | |
| ) | |
| external int BIO_gets( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> buf, | |
| int size, | |
| ); | |
| /// BIO_hexdump writes a hex dump of `data` to `bio`. Each line will be indented | |
| /// by `indent` spaces. It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_hexdump') | |
| external int BIO_hexdump( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| int indent, | |
| ); | |
| /// BIO_indent prints min(`indent`, `max_indent`) spaces. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.UnsignedInt, ffi.UnsignedInt) | |
| >(symbol: 'bssl_dart_BIO_indent') | |
| external int BIO_indent( | |
| ffi.Pointer<BIO> bio, | |
| int indent, | |
| int max_indent, | |
| ); | |
| /// BIO_int_ctrl acts like `BIO_ctrl` but passes the address of a copy of `iarg` | |
| /// as `parg`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Long, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_int_ctrl', | |
| ) | |
| external int BIO_int_ctrl( | |
| ffi.Pointer<BIO> bp, | |
| int cmd, | |
| int larg, | |
| int iarg, | |
| ); | |
| /// BIO_mem_contents sets `*out_contents` to point to the current contents of | |
| /// `bio` and `*out_len` to contain the length of that data. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_mem_contents') | |
| external int BIO_mem_contents( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_contents, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// BIO_meth_free releases memory associated with `method`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO_METHOD>)>( | |
| symbol: 'bssl_dart_BIO_meth_free', | |
| ) | |
| external void BIO_meth_free( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<BIO_info_cb>) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_callback_ctrl') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<BIO_info_cb>) | |
| > | |
| > | |
| BIO_meth_get_callback_ctrl( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_get_create') | |
| external ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> | |
| BIO_meth_get_create( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_ctrl') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| > | |
| > | |
| BIO_meth_get_ctrl( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_get_destroy') | |
| external ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> | |
| BIO_meth_get_destroy( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_gets') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| BIO_meth_get_gets( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_puts') | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)> | |
| > | |
| BIO_meth_get_puts( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_read') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| BIO_meth_get_read( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| /// The following functions return function pointers, possibly NULL, which are | |
| /// compatible with the corresponding `BIO_meth_set_*` function. `method` must be | |
| /// `BIO_s_socket` or the program will abort. | |
| /// | |
| /// Using these functions is inherently unsafe and fragile. It is not possible to | |
| /// use them in a future-proof way. See | |
| /// https://github.com/openssl/openssl/issues/26047 for details. BoringSSL | |
| /// implements them solely for compatibility with Folly and older versions of | |
| /// PostgreSQL. To work around the future-proofing problems, the return values | |
| /// may diverge from the true implementation of `BIO_s_socket`. | |
| /// | |
| /// Caller should not use these functions. They are not necessary to define | |
| /// custom `BIO_METHOD`s. Instead, callers should either: | |
| /// | |
| /// - Define a custom `BIO_METHOD` that owns a socket `BIO` somewhere in the | |
| /// custom data. See `BIO_set_data`. | |
| /// | |
| /// - Define a custom `BIO_METHOD` that wraps a socket `BIO` as a filter. See | |
| /// `BIO_push` and `BIO_next`. | |
| /// | |
| /// - Define a custom `BIO_METHOD` without `BIO_s_socket` at all. If not using | |
| /// the built-in read or write functions, `BIO_s_socket` only provides a no-op | |
| /// `BIO_CTRL_FLUSH` implementation. This can be implemented by the caller. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| Function(ffi.Pointer<BIO_METHOD>) | |
| >(symbol: 'bssl_dart_BIO_meth_get_write') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| BIO_meth_get_write( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| /// BIO_meth_new returns a newly-allocated `BIO_METHOD` or NULL on allocation | |
| /// error. `type` and `name` optionally identify the `BIO_METHOD`. Most callers | |
| /// will not need to inspect the type of their own `BIO`s and can pass zero and | |
| /// NULL, respectively, to skip this mechanism. | |
| /// | |
| /// `type` specifies the type that will be returned by `BIO_method_type` and | |
| /// matched by `BIO_find_type`. If used, it should be a combination of an index, | |
| /// allocated by `BIO_get_new_index`, and optionally the `BIO_TYPE_DESCRIPTOR`, | |
| /// `BIO_TYPE_FILTER`, and `BIO_TYPE_SOURCE_SINK` flags. If `BIO_TYPE_DESCRIPTOR` | |
| /// is set, the `BIO_METHOD` must implement `BIO_C_GET_FD`. | |
| /// | |
| /// `name` is unused. BoringSSL does not currently implement `BIO_method_name`. | |
| /// | |
| /// Use the `BIO_meth_set_*` functions below to initialize the `BIO_METHOD`. The | |
| /// function implementations may use `BIO_set_data` and `BIO_get_data` to add | |
| /// method-specific state to associated `BIO`s. Additionally, `BIO_set_init` must | |
| /// be called after an associated `BIO` is fully initialized. State set via | |
| /// `BIO_set_data` may be released by configuring a destructor with | |
| /// `BIO_meth_set_destroy`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function(ffi.Int, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_meth_new', | |
| ) | |
| external ffi.Pointer<BIO_METHOD> BIO_meth_new( | |
| int type, | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// BIO_meth_set_callback_ctrl sets the implementation of `BIO_callback_ctrl` for | |
| /// `method` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<BIO_info_cb>) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_callback_ctrl') | |
| external int BIO_meth_set_callback_ctrl( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<BIO_info_cb>) | |
| > | |
| > | |
| callback_ctrl_func, | |
| ); | |
| /// BIO_meth_set_create sets a function to be called on `BIO_new` for `method` | |
| /// and returns one. The function should return one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_create') | |
| external int BIO_meth_set_create( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> | |
| create_func, | |
| ); | |
| /// BIO_meth_set_ctrl sets the implementation of `BIO_ctrl` for `method` and | |
| /// returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_ctrl') | |
| external int BIO_meth_set_ctrl( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Long Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| > | |
| > | |
| ctrl_func, | |
| ); | |
| /// BIO_meth_set_destroy sets a function to release data associated with a `BIO` | |
| /// and returns one. The function's return value is ignored. | |
| /// | |
| /// As the `BIO` is about to be destroyed, it is not necessary for `destroy_func` | |
| /// to clear the BIO's state with `BIO_set_data` or `BIO_set_init`. There is no | |
| /// harm in clearing them, but the `BIO` will not be passed to `BIO` operations, | |
| /// unless `destroy_func` itself does so. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_destroy') | |
| external int BIO_meth_set_destroy( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> | |
| destroy_func, | |
| ); | |
| /// BIO_meth_set_gets sets the implementation of `BIO_gets` for `method` and | |
| /// returns one. | |
| /// | |
| /// `gets_func` can assume `BIO_get_init` returns one and the output size is | |
| /// greater than zero. Those cases are handled before calling into the | |
| /// `BIO_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_gets') | |
| external int BIO_meth_set_gets( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| gets_func, | |
| ); | |
| /// BIO_meth_set_puts returns one. `BIO_puts` is implemented with `BIO_write` in | |
| /// BoringSSL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_puts') | |
| external int BIO_meth_set_puts( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>) | |
| > | |
| > | |
| puts, | |
| ); | |
| /// BIO_meth_set_read sets the implementation of `BIO_read` for `method` and | |
| /// returns one. | |
| /// | |
| /// `read_func` can assume `BIO_get_init` returns one and the output size is | |
| /// greater than zero. Those cases are handled before calling into the | |
| /// `BIO_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_read') | |
| external int BIO_meth_set_read( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| read_func, | |
| ); | |
| /// BIO_meth_set_write sets the implementation of `BIO_write` for `method` and | |
| /// returns one. `BIO_METHOD`s which implement `BIO_write` should also implement | |
| /// `BIO_CTRL_FLUSH`. (See `BIO_meth_set_ctrl`.) | |
| /// | |
| /// `write_func` can assume `BIO_get_init` returns one and the input size is | |
| /// greater than zero. Those cases are handled before calling into the | |
| /// `BIO_METHOD`. | |
| /// | |
| /// If configured, `write_func` will also be used to implement `BIO_write_ex`, | |
| /// with the `BIO` framework converting the conventions. `BIO_meth_set_write_ex` | |
| /// and `BIO_meth_set_write` should not be configured on the same `BIO_METHOD`. | |
| /// Prefer `BIO_meth_set_write_ex` for a `size_t`-based API. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_write') | |
| external int BIO_meth_set_write( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| write_func, | |
| ); | |
| /// BIO_meth_set_write_ex sets the implementation of `BIO_write_ex` for `method` | |
| /// and returns one. `BIO_METHOD`s which implement `BIO_write_ex` should also | |
| /// implement `BIO_CTRL_FLUSH`. (See `BIO_meth_set_ctrl`.) | |
| /// | |
| /// `write_ex_func` can assume `BIO_get_init` returns one, the input size is | |
| /// greater than zero, and `out_written` is non-NULL. Those cases are handled | |
| /// before calling into the `BIO_METHOD`. | |
| /// | |
| /// If configured, `write_ex_func` will also be used to implement `BIO_write`, | |
| /// with the `BIO` framework converting the conventions. `BIO_meth_set_write_ex` | |
| /// and `BIO_meth_set_write` should not be configured on the same `BIO_METHOD`. | |
| /// Prefer `BIO_meth_set_write_ex` for a `size_t`-based API. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO_METHOD>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_meth_set_write_ex') | |
| external int BIO_meth_set_write_ex( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| > | |
| > | |
| write_ex_func, | |
| ); | |
| /// BIO_method_type returns the type of `bio`, which is one of the `BIO_TYPE_*` | |
| /// values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_method_type', | |
| ) | |
| external int BIO_method_type( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_new creates a new BIO with the given method and a reference count of one. | |
| /// It returns the fresh `BIO`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO_METHOD>)>( | |
| symbol: 'bssl_dart_BIO_new', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new( | |
| ffi.Pointer<BIO_METHOD> method, | |
| ); | |
| /// BIO_new_bio_pair sets `*out1` and `*out2` to two freshly created BIOs where | |
| /// data written to one can be read from the other and vice versa. The | |
| /// `writebuf1` argument gives the size of the buffer used in `*out1` and | |
| /// `writebuf2` for `*out2`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_new_bio_pair') | |
| external int BIO_new_bio_pair( | |
| ffi.Pointer<ffi.Pointer<BIO>> out1, | |
| int writebuf1, | |
| ffi.Pointer<ffi.Pointer<BIO>> out2, | |
| int writebuf2, | |
| ); | |
| /// BIO_new_connect returns a BIO that connects to the given hostname and port. | |
| /// The `host_and_optional_port` argument should be of the form | |
| /// "www.example.com" or "www.example.com:443". If the port is omitted, it must | |
| /// be provided with `BIO_set_conn_port`. | |
| /// | |
| /// It returns the new BIO on success, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_new_connect', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new_connect( | |
| ffi.Pointer<ffi.Char> host_and_optional_port, | |
| ); | |
| /// BIO_new_fd creates a new file descriptor BIO wrapping `fd`. If `close_flag` | |
| /// is non-zero, then `fd` will be closed when the BIO is. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_new_fd', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new_fd( | |
| int fd, | |
| int close_flag, | |
| ); | |
| /// BIO_new_file creates a file BIO by opening `filename` with the given mode. | |
| /// See the `fopen` manual page for details of the mode argument. On Windows, | |
| /// files may be opened in either binary or text mode so, as in `fopen`, callers | |
| /// must specify the desired option in `mode`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIO> Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_BIO_new_file') | |
| external ffi.Pointer<BIO> BIO_new_file( | |
| ffi.Pointer<ffi.Char> filename, | |
| ffi.Pointer<ffi.Char> mode, | |
| ); | |
| /// BIO_new_fp creates a new file BIO that wraps `file`. If `flags` contains | |
| /// `BIO_CLOSE`, then `fclose` will be called on `file` when the BIO is closed. | |
| /// | |
| /// On Windows, if `flags` contains `BIO_FP_TEXT`, this function will | |
| /// additionally switch `file` to text mode. This is not recommended, but may be | |
| /// required for OpenSSL compatibility. If `file` was not already in text mode, | |
| /// mode changes can cause unflushed data in `file` to be written in unexpected | |
| /// ways. See `_setmode` in Windows documentation for details. | |
| /// | |
| /// Unlike OpenSSL, if `flags` does not contain `BIO_FP_TEXT`, the translation | |
| /// mode of `file` is left as-is. In OpenSSL, `file` will be set to binary, with | |
| /// the same pitfalls as above. BoringSSL does not do this so that wrapping a | |
| /// `FILE` in a `BIO` will not inadvertently change its state. | |
| /// | |
| /// To avoid these pitfalls, callers should set the desired translation mode when | |
| /// opening the file. If targeting just BoringSSL, this is sufficient. If | |
| /// targeting both OpenSSL and BoringSSL, callers should set `BIO_FP_TEXT` to | |
| /// match the desired state of the file. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<FILE>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_new_fp', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new_fp( | |
| ffi.Pointer<FILE> file, | |
| int flags, | |
| ); | |
| /// BIO_new_mem_buf creates read-only BIO that reads from `len` bytes at `buf`. | |
| /// It returns the BIO or NULL on error. This function does not copy or take | |
| /// ownership of `buf`. The caller must ensure the memory pointed to by `buf` | |
| /// outlives the `BIO`. | |
| /// | |
| /// If `len` is negative, then `buf` is treated as a NUL-terminated string, but | |
| /// don't depend on this in new code. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<ffi.Void>, ossl_ssize_t)>( | |
| symbol: 'bssl_dart_BIO_new_mem_buf', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new_mem_buf( | |
| ffi.Pointer<ffi.Void> buf, | |
| int len, | |
| ); | |
| /// BIO_new_socket allocates and initialises a fresh BIO which will read and | |
| /// write to the socket `fd`. If `close_flag` is `BIO_CLOSE` then closing the | |
| /// BIO will close `fd`. It returns the fresh `BIO` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_new_socket', | |
| ) | |
| external ffi.Pointer<BIO> BIO_new_socket( | |
| int fd, | |
| int close_flag, | |
| ); | |
| /// BIO_next returns the next BIO in the chain after `bio`, or NULL if there is | |
| /// no such BIO. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_next', | |
| ) | |
| external ffi.Pointer<BIO> BIO_next( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_number_read returns the number of bytes that have been read from | |
| /// `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint64 Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_number_read', | |
| ) | |
| external int BIO_number_read( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_number_written returns the number of bytes that have been written to | |
| /// `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint64 Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_number_written', | |
| ) | |
| external int BIO_number_written( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_pending returns the number of bytes pending to be read. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_pending', | |
| ) | |
| external int BIO_pending( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_pop removes `bio` from the head of a chain and returns the next BIO in | |
| /// the chain, or NULL if there is no next BIO. | |
| /// | |
| /// The caller takes ownership of the chain's reference to `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_pop', | |
| ) | |
| external ffi.Pointer<BIO> BIO_pop( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_printf behaves like `printf` but outputs to `bio` rather than a `FILE`. | |
| /// It returns the number of bytes written or a negative number on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_printf', | |
| ) | |
| external int BIO_printf( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> format, | |
| ); | |
| /// BIO_ptr_ctrl acts like `BIO_ctrl` but passes the address of a `void*` | |
| /// pointer as `parg` and returns the value that is written to it, or NULL if | |
| /// the control request returns <= 0. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function(ffi.Pointer<BIO>, ffi.Int, ffi.Long) | |
| >(symbol: 'bssl_dart_BIO_ptr_ctrl') | |
| external ffi.Pointer<ffi.Char> BIO_ptr_ctrl( | |
| ffi.Pointer<BIO> bp, | |
| int cmd, | |
| int larg, | |
| ); | |
| /// BIO_push adds `appended_bio` to the end of the chain with `bio` at the head. | |
| /// It returns `bio`. Note that `appended_bio` may be the head of a chain itself | |
| /// and thus this function can be used to join two chains. | |
| /// | |
| /// BIO_push takes ownership of the caller's reference to `appended_bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO> Function(ffi.Pointer<BIO>, ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_push', | |
| ) | |
| external ffi.Pointer<BIO> BIO_push( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<BIO> appended_bio, | |
| ); | |
| /// BIO_puts writes a NUL terminated string from `buf` to `bio`. It returns the | |
| /// number of bytes written or a negative number on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_puts', | |
| ) | |
| external int BIO_puts( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> buf, | |
| ); | |
| /// BIO_read attempts to read `len` bytes into `data`. It returns the number of | |
| /// bytes read, zero on EOF, or a negative number on error. Callers that support | |
| /// non-blocking I/O should call `BIO_should_read` on error to check if the error | |
| /// is fatal or retryable. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Void>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_read', | |
| ) | |
| external int BIO_read( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> data, | |
| int 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`. | |
| @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, | |
| ); | |
| /// BIO_read_filename opens `filename` for reading and sets the result as the | |
| /// `FILE` for `bio`. It returns one on success and zero otherwise. The `FILE` | |
| /// will be closed when `bio` is freed. On Windows, the file is opened in binary | |
| /// mode. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_read_filename', | |
| ) | |
| external int BIO_read_filename( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> filename, | |
| ); | |
| /// BIO_reset resets `bio` to its initial state, the precise meaning of which | |
| /// depends on the concrete type of `bio`. It normally returns one on success and | |
| /// <= 0 otherwise. However, for file and fd BIOs, it returns zero on success and | |
| /// a negative number on error. | |
| /// | |
| /// WARNING: This function's return value conventions differs from most functions | |
| /// in this library. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_reset') | |
| external int BIO_reset( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_rw_filename opens `filename` for reading and writing and sets the result | |
| /// as the `FILE` for `bio`. It returns one on success and zero otherwise. The | |
| /// `FILE` will be closed when `bio` is freed. On Windows, the file is opened in | |
| /// binary mode. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_rw_filename', | |
| ) | |
| external int BIO_rw_filename( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> filename, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function()>( | |
| symbol: 'bssl_dart_BIO_s_connect', | |
| ) | |
| external ffi.Pointer<BIO_METHOD> BIO_s_connect(); | |
| /// BIO_s_fd returns a `BIO_METHOD` for file descriptor fds. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function()>(symbol: 'bssl_dart_BIO_s_fd') | |
| external ffi.Pointer<BIO_METHOD> BIO_s_fd(); | |
| /// BIO_s_file returns a BIO_METHOD that wraps a `FILE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function()>(symbol: 'bssl_dart_BIO_s_file') | |
| external ffi.Pointer<BIO_METHOD> BIO_s_file(); | |
| /// BIO_s_mem returns a `BIO_METHOD` that uses an in-memory buffer. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function()>(symbol: 'bssl_dart_BIO_s_mem') | |
| external ffi.Pointer<BIO_METHOD> BIO_s_mem(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIO_METHOD> Function()>( | |
| symbol: 'bssl_dart_BIO_s_socket', | |
| ) | |
| external ffi.Pointer<BIO_METHOD> BIO_s_socket(); | |
| /// BIO_seek sets the file offset of `bio` to `offset`. It returns a non-negative | |
| /// number on success and a negative number on error. If `bio` is a file | |
| /// descriptor `BIO`, it returns the resulting file offset on success. If `bio` | |
| /// is a file `BIO`, it returns zero on success. | |
| /// | |
| /// WARNING: This function's return value conventions differs from most functions | |
| /// in this library. | |
| /// | |
| /// TODO(crbug.com/42290329): On platforms where `long` is 32-bit, this function | |
| /// cannot handle 64-bit offsets. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<BIO>, ffi.Long)>( | |
| symbol: 'bssl_dart_BIO_seek', | |
| ) | |
| external int BIO_seek( | |
| ffi.Pointer<BIO> bio, | |
| int offset, | |
| ); | |
| /// BIO_set_close sets the close flag for `bio`. The meaning of which depends on | |
| /// the type of `bio` but, for example, a memory BIO interprets the close flag | |
| /// as meaning that it owns its buffer. It returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_close', | |
| ) | |
| external int BIO_set_close( | |
| ffi.Pointer<BIO> bio, | |
| int close_flag, | |
| ); | |
| /// BIO_set_conn_hostname sets `host_and_optional_port` as the hostname and | |
| /// optional port that `bio` will connect to. If the port is omitted, it must be | |
| /// provided with `BIO_set_conn_port`. | |
| /// | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_set_conn_hostname', | |
| ) | |
| external int BIO_set_conn_hostname( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> host_and_optional_port, | |
| ); | |
| /// BIO_set_conn_int_port sets `*port` as the port that `bio` will connect to. | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_BIO_set_conn_int_port', | |
| ) | |
| external int BIO_set_conn_int_port( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Int> port, | |
| ); | |
| /// BIO_set_conn_port sets `port_str` as the port or service name that `bio` | |
| /// will connect to. It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_set_conn_port', | |
| ) | |
| external int BIO_set_conn_port( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> port_str, | |
| ); | |
| /// BIO_set_data sets custom data on `bio`. It may be retried with | |
| /// `BIO_get_data`. | |
| /// | |
| /// This function should only be called by the implementation of a custom `BIO`. | |
| /// In particular, the data pointer of a built-in `BIO` is private to the | |
| /// library. For other uses, see `BIO_set_ex_data` and `BIO_set_app_data`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_BIO_set_data', | |
| ) | |
| external void BIO_set_data( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_BIO_set_ex_data', | |
| ) | |
| external int BIO_set_ex_data( | |
| ffi.Pointer<BIO> bio, | |
| int idx, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// BIO_set_fd sets the file descriptor of `bio` to `fd`. If `close_flag` is | |
| /// non-zero then `fd` will be closed when `bio` is. It returns one on success | |
| /// or zero on error. | |
| /// | |
| /// This function may also be used with socket BIOs (see `BIO_s_socket` and | |
| /// `BIO_new_socket`). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_fd', | |
| ) | |
| external int BIO_set_fd( | |
| ffi.Pointer<BIO> bio, | |
| int fd, | |
| int close_flag, | |
| ); | |
| /// BIO_set_flags ORs `flags` with `bio->flags`. Unless otherwise documented, | |
| /// flags are private to either BoringSSL or the custom `BIO_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_flags', | |
| ) | |
| external void BIO_set_flags( | |
| ffi.Pointer<BIO> bio, | |
| int flags, | |
| ); | |
| /// BIO_set_fp sets the `FILE` for `bio`. If `flags` contains `BIO_CLOSE` then | |
| /// `fclose` will be called on `file` when `bio` is closed. It returns one on | |
| /// success and zero otherwise. | |
| /// | |
| /// On Windows, if `flags` contains `BIO_FP_TEXT`, this function will | |
| /// additionally switch `file` to text mode. This is not recommended, but may be | |
| /// required for OpenSSL compatibility. If `file` was not already in text mode, | |
| /// mode changes can cause unflushed data in `file` to be written in unexpected | |
| /// ways. See `_setmode` in Windows documentation for details. | |
| /// | |
| /// Unlike OpenSSL, if `flags` does not contain `BIO_FP_TEXT`, the translation | |
| /// mode of `file` is left as-is. In OpenSSL, `file` will be set to binary, with | |
| /// the same pitfalls as above. BoringSSL does not do this so that wrapping a | |
| /// `FILE` in a `BIO` will not inadvertently change its state. | |
| /// | |
| /// To avoid these pitfalls, callers should set the desired translation mode when | |
| /// opening the file. If targeting just BoringSSL, this is sufficient. If | |
| /// targeting both OpenSSL and BoringSSL, callers should set `BIO_FP_TEXT` to | |
| /// match the desired state of the file. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<FILE>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_fp', | |
| ) | |
| external int BIO_set_fp( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<FILE> file, | |
| int flags, | |
| ); | |
| /// BIO_set_init sets whether `bio` has been fully initialized. Until fully | |
| /// initialized, `BIO_read` and `BIO_write` will fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_init', | |
| ) | |
| external void BIO_set_init( | |
| ffi.Pointer<BIO> bio, | |
| int init, | |
| ); | |
| /// BIO_set_mem_buf sets `b` as the contents of `bio`. If `take_ownership` is | |
| /// non-zero, then `b` will be freed when `bio` is closed. Returns one on | |
| /// success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<BUF_MEM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_mem_buf', | |
| ) | |
| external int BIO_set_mem_buf( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<BUF_MEM> b, | |
| int take_ownership, | |
| ); | |
| /// BIO_set_mem_eof_return sets the value that will be returned from reading | |
| /// `bio` when empty. If `eof_value` is zero then an empty memory BIO will | |
| /// return EOF (that is it will return zero and `BIO_should_retry` will be | |
| /// false). If `eof_value` is non zero then it will return `eof_value` when it | |
| /// is empty and it will set the read retry flag (that is `BIO_read_retry` is | |
| /// true). To avoid ambiguity with a normal positive return value, `eof_value` | |
| /// should be set to a negative value, typically -1. | |
| /// | |
| /// For a read-only BIO, the default is zero (EOF). For a writable BIO, the | |
| /// default is -1 so that additional data can be written once exhausted. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_mem_eof_return', | |
| ) | |
| external int BIO_set_mem_eof_return( | |
| ffi.Pointer<BIO> bio, | |
| int eof_value, | |
| ); | |
| /// BIO_set_nbio sets whether `bio` will use non-blocking I/O operations. It | |
| /// returns one on success and zero otherwise. This only works for connect BIOs | |
| /// and must be called before `bio` is connected to take effect. | |
| /// | |
| /// For socket and fd BIOs, callers must configure blocking vs. non-blocking I/O | |
| /// using the underlying platform APIs. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_nbio', | |
| ) | |
| external int BIO_set_nbio( | |
| ffi.Pointer<BIO> bio, | |
| int on, | |
| ); | |
| /// BIO_set_retry_read sets the `BIO_FLAGS_READ` and `BIO_FLAGS_SHOULD_RETRY` | |
| /// flags on `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_set_retry_read', | |
| ) | |
| external void BIO_set_retry_read( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_set_retry_reason sets the special I/O operation that needs to be retried | |
| /// to `reason`, which should be one of the `BIO_RR_*` values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_retry_reason', | |
| ) | |
| external void BIO_set_retry_reason( | |
| ffi.Pointer<BIO> bio, | |
| int reason, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_set_retry_special', | |
| ) | |
| external void BIO_set_retry_special( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_set_retry_write sets the `BIO_FLAGS_WRITE` and `BIO_FLAGS_SHOULD_RETRY` | |
| /// flags on `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_set_retry_write', | |
| ) | |
| external void BIO_set_retry_write( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_set_shutdown sets a method-specific "shutdown" bit on `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_shutdown', | |
| ) | |
| external void BIO_set_shutdown( | |
| ffi.Pointer<BIO> bio, | |
| int shutdown, | |
| ); | |
| /// BIO_set_write_buffer_size returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_set_write_buffer_size', | |
| ) | |
| external int BIO_set_write_buffer_size( | |
| ffi.Pointer<BIO> bio, | |
| int buffer_size, | |
| ); | |
| /// BIO_should_io_special returns non-zero if `bio` encountered a temporary | |
| /// error while performing a special I/O operation, indicating that the caller | |
| /// should retry. The operation that caused the error is returned by | |
| /// `BIO_get_retry_reason`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_should_io_special', | |
| ) | |
| external int BIO_should_io_special( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_should_read returns non-zero if `bio` encountered a temporary error | |
| /// while reading (i.e. EAGAIN), indicating that the caller should retry the | |
| /// read. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_should_read', | |
| ) | |
| external int BIO_should_read( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_should_retry returns non-zero if the reason that caused a failed I/O | |
| /// operation is temporary and thus the operation should be retried. Otherwise, | |
| /// it was a permanent error and it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_should_retry', | |
| ) | |
| external int BIO_should_retry( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_should_write returns non-zero if `bio` encountered a temporary error | |
| /// while writing (i.e. EAGAIN), indicating that the caller should retry the | |
| /// write. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_should_write', | |
| ) | |
| external int BIO_should_write( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_shutdown_wr marks `bio` as closed, from the point of view of the other | |
| /// side of the pair. Future `BIO_write` calls on `bio` will fail. It returns | |
| /// one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_shutdown_wr', | |
| ) | |
| external int BIO_shutdown_wr( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_snprintf has the same behavior as snprintf(3). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Size, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_BIO_snprintf') | |
| external int BIO_snprintf( | |
| ffi.Pointer<ffi.Char> buf, | |
| int n, | |
| ffi.Pointer<ffi.Char> format, | |
| ); | |
| /// BIO_tell returns the file offset of `bio`, or a negative number on error or | |
| /// if `bio` does not support the operation. | |
| /// | |
| /// TODO(crbug.com/42290329): On platforms where `long` is 32-bit, this function | |
| /// cannot report 64-bit offsets. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_tell') | |
| external int BIO_tell( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_test_flags returns `bio->flags` AND `flags`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_test_flags', | |
| ) | |
| external int BIO_test_flags( | |
| ffi.Pointer<BIO> bio, | |
| int flags, | |
| ); | |
| /// BIO_up_ref increments the reference count of `bio` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_up_ref') | |
| external int BIO_up_ref( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_vfree performs the same actions as `BIO_free`, but has a void return | |
| /// value. This is provided for API-compat. | |
| /// | |
| /// TODO(fork): remove. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>(symbol: 'bssl_dart_BIO_vfree') | |
| external void BIO_vfree( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_wpending returns the number of bytes pending to be written. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_BIO_wpending', | |
| ) | |
| external int BIO_wpending( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// BIO_write writes `len` bytes from `data` to `bio`. It returns the number of | |
| /// bytes written or a negative number on error. Callers that support | |
| /// non-blocking I/O should call `BIO_should_write` on error to check if the | |
| /// error is fatal or retryable. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Void>, ffi.Int)>( | |
| symbol: 'bssl_dart_BIO_write', | |
| ) | |
| external int BIO_write( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// BIO_write_all writes `len` bytes from `data` to `bio`, looping as necessary. | |
| /// It returns one if all bytes were successfully written and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_BIO_write_all') | |
| external int BIO_write_all( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// BIO_write_ex writes `len` bytes from `data` to `bio`. On success, it returns | |
| /// one and sets `*out_written` to the number of bytes written. Otherwise, it | |
| /// returns zero. `out_written` may be NULL to ignore the value. Callers that | |
| /// support non-blocking I/O should call `BIO_should_write` on error to check if | |
| /// the error is fatal or retryable. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_BIO_write_ex') | |
| external int BIO_write_ex( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ffi.Pointer<ffi.Size> out_written, | |
| ); | |
| /// BIO_write_filename opens `filename` for writing and sets the result as the | |
| /// `FILE` for `bio`. It returns one on success and zero otherwise. The `FILE` | |
| /// will be closed when `bio` is freed. On Windows, the file is opened in binary | |
| /// mode. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BIO_write_filename', | |
| ) | |
| external int BIO_write_filename( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> filename, | |
| ); | |
| /// BN_CTX_end invalidates all `BIGNUM`s returned from `BN_CTX_get` since the | |
| /// matching `BN_CTX_start` call. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BN_CTX>)>( | |
| symbol: 'bssl_dart_BN_CTX_end', | |
| ) | |
| external void BN_CTX_end( | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_CTX_free frees all BIGNUMs contained in `ctx` and then frees `ctx` | |
| /// itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BN_CTX>)>( | |
| symbol: 'bssl_dart_BN_CTX_free', | |
| ) | |
| external void BN_CTX_free( | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_CTX_get returns a new `BIGNUM`, or NULL on allocation failure. Once | |
| /// `BN_CTX_get` has returned NULL, all future calls will also return NULL until | |
| /// `BN_CTX_end` is called. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BN_CTX>)>( | |
| symbol: 'bssl_dart_BN_CTX_get', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_CTX_get( | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_CTX_new returns a new, empty BN_CTX or NULL on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BN_CTX> Function()>(symbol: 'bssl_dart_BN_CTX_new') | |
| external ffi.Pointer<BN_CTX> BN_CTX_new(); | |
| /// BN_CTX_start "pushes" a new entry onto the `ctx` stack and allows future | |
| /// calls to `BN_CTX_get`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BN_CTX>)>( | |
| symbol: 'bssl_dart_BN_CTX_start', | |
| ) | |
| external void BN_CTX_start( | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_GENCB_call calls `callback`, if not NULL, and returns the return value of | |
| /// the callback, or 1 if `callback` is NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BN_GENCB>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_GENCB_call', | |
| ) | |
| external int BN_GENCB_call( | |
| ffi.Pointer<BN_GENCB> callback, | |
| int event, | |
| int n, | |
| ); | |
| /// BN_GENCB_free releases memory associated with `callback`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BN_GENCB>)>( | |
| symbol: 'bssl_dart_BN_GENCB_free', | |
| ) | |
| external void BN_GENCB_free( | |
| ffi.Pointer<BN_GENCB> callback, | |
| ); | |
| /// BN_GENCB_get_arg returns `callback->arg`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<BN_GENCB>)>( | |
| symbol: 'bssl_dart_BN_GENCB_get_arg', | |
| ) | |
| external ffi.Pointer<ffi.Void> BN_GENCB_get_arg( | |
| ffi.Pointer<BN_GENCB> callback, | |
| ); | |
| /// BN_GENCB_new returns a newly-allocated `BN_GENCB` object, or NULL on | |
| /// allocation failure. The result must be released with `BN_GENCB_free` when | |
| /// done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BN_GENCB> Function()>(symbol: 'bssl_dart_BN_GENCB_new') | |
| external ffi.Pointer<BN_GENCB> BN_GENCB_new(); | |
| /// BN_GENCB_set configures `callback` to call `f` and sets `callout->arg` to | |
| /// `arg`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<BN_GENCB>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int, ffi.Int, ffi.Pointer<BN_GENCB>) | |
| > | |
| >, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_GENCB_set') | |
| external void BN_GENCB_set( | |
| ffi.Pointer<BN_GENCB> callback, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int, ffi.Int, ffi.Pointer<BN_GENCB>) | |
| > | |
| > | |
| f, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// BN_MONT_CTX_copy sets `to` equal to `from`. It returns `to` on success or | |
| /// NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BN_MONT_CTX> Function( | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_MONT_CTX_copy') | |
| external ffi.Pointer<BN_MONT_CTX> BN_MONT_CTX_copy( | |
| ffi.Pointer<BN_MONT_CTX> to, | |
| ffi.Pointer<BN_MONT_CTX> from, | |
| ); | |
| /// BN_MONT_CTX_free frees memory associated with `mont`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BN_MONT_CTX>)>( | |
| symbol: 'bssl_dart_BN_MONT_CTX_free', | |
| ) | |
| external void BN_MONT_CTX_free( | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ); | |
| /// BN_MONT_CTX_new returns a fresh `BN_MONT_CTX` or NULL on allocation failure. | |
| /// Use `BN_MONT_CTX_new_for_modulus` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BN_MONT_CTX> Function()>( | |
| symbol: 'bssl_dart_BN_MONT_CTX_new', | |
| ) | |
| external ffi.Pointer<BN_MONT_CTX> BN_MONT_CTX_new(); | |
| /// BN_MONT_CTX_new_consttime behaves like `BN_MONT_CTX_new_for_modulus` but | |
| /// treats `mod` as secret. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BN_MONT_CTX> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BN_CTX>) | |
| >(symbol: 'bssl_dart_BN_MONT_CTX_new_consttime') | |
| external ffi.Pointer<BN_MONT_CTX> BN_MONT_CTX_new_consttime( | |
| ffi.Pointer<BIGNUM> mod, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_MONT_CTX_new_for_modulus returns a fresh `BN_MONT_CTX` given the modulus, | |
| /// `mod` or NULL on error. Note this function assumes `mod` is public. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BN_MONT_CTX> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BN_CTX>) | |
| >(symbol: 'bssl_dart_BN_MONT_CTX_new_for_modulus') | |
| external ffi.Pointer<BN_MONT_CTX> BN_MONT_CTX_new_for_modulus( | |
| ffi.Pointer<BIGNUM> mod, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_MONT_CTX_set sets up a Montgomery context given the modulus, `mod`. It | |
| /// returns one on success and zero on error. Use `BN_MONT_CTX_new_for_modulus` | |
| /// instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_MONT_CTX_set') | |
| external int BN_MONT_CTX_set( | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ffi.Pointer<BIGNUM> mod, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_abs_is_word returns one if the absolute value of `bn` equals `w` and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_abs_is_word', | |
| ) | |
| external int BN_abs_is_word( | |
| ffi.Pointer<BIGNUM> bn, | |
| int w, | |
| ); | |
| /// BN_add sets `r` = `a` + `b`, where `r` may be the same pointer as either `a` | |
| /// or `b`. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_add') | |
| external int BN_add( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_add_word adds `w` to `a`. It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_add_word', | |
| ) | |
| external int BN_add_word( | |
| ffi.Pointer<BIGNUM> a, | |
| int w, | |
| ); | |
| /// BN_asc2bn acts like `BN_dec2bn` or `BN_hex2bn` depending on whether `in` | |
| /// begins with "0X" or "0x" (indicating hex) or not (indicating decimal). A | |
| /// leading '-' is still permitted and comes before the optional 0X/0x. It | |
| /// returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<BIGNUM>>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_BN_asc2bn') | |
| external int BN_asc2bn( | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> outp, | |
| ffi.Pointer<ffi.Char> in$, | |
| ); | |
| /// BN_bin2bn sets `*ret` to the value of `len` bytes from `in`, interpreted as | |
| /// a big-endian number, and returns `ret`. If `ret` is NULL then a fresh | |
| /// `BIGNUM` is allocated and returned. It returns NULL on allocation | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_bin2bn') | |
| external ffi.Pointer<BIGNUM> BN_bin2bn( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_bn2bin serialises the absolute value of `in` to `out` as a big-endian | |
| /// integer, which must have `BN_num_bytes` of space available. It returns the | |
| /// number of bytes written. Note this function leaks the magnitude of `in`. If | |
| /// `in` is secret, use `BN_bn2bin_padded` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_BN_bn2bin', | |
| ) | |
| external int BN_bn2bin( | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ); | |
| /// BN_bn2bin_padded serialises the absolute value of `in` to `out` as a | |
| /// big-endian integer. The integer is padded with leading zeros up to size | |
| /// `len`. If `len` is smaller than `BN_num_bytes`, the function fails and | |
| /// returns 0. Otherwise, it returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_BN_bn2bin_padded') | |
| external int BN_bn2bin_padded( | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<BIGNUM> in$, | |
| ); | |
| /// BN_bn2binpad behaves like `BN_bn2bin_padded`, but it returns `len` on success | |
| /// and -1 on error. | |
| /// | |
| /// Use `BN_bn2bin_padded` instead. It is `size_t`-clean. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Uint8>, ffi.Int) | |
| >(symbol: 'bssl_dart_BN_bn2binpad') | |
| external int BN_bn2binpad( | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ); | |
| /// BN_bn2cbb_padded behaves like `BN_bn2bin_padded` but writes to a `CBB`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Size, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_bn2cbb_padded', | |
| ) | |
| external int BN_bn2cbb_padded( | |
| ffi.Pointer<CBB> out, | |
| int len, | |
| ffi.Pointer<BIGNUM> in$, | |
| ); | |
| /// BN_bn2dec returns an allocated string that contains a NUL-terminated, | |
| /// decimal representation of `bn`. If `bn` is negative, the first char in the | |
| /// resulting string will be '-'. Returns NULL on allocation failure. The | |
| /// resulting string must be freed with `OPENSSL_free`. | |
| /// | |
| /// Converting an arbitrarily large integer to decimal is quadratic in the bit | |
| /// length of `a`. This function assumes the caller has capped the input within | |
| /// performance tolerances. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_bn2dec', | |
| ) | |
| external ffi.Pointer<ffi.Char> BN_bn2dec( | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_bn2hex returns an allocated string that contains a NUL-terminated, hex | |
| /// representation of `bn`. If `bn` is negative, the first char in the resulting | |
| /// string will be '-'. Returns NULL on allocation failure. The resulting string | |
| /// must be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_bn2hex', | |
| ) | |
| external ffi.Pointer<ffi.Char> BN_bn2hex( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_bn2le_padded serialises the absolute value of `in` to `out` as a | |
| /// little-endian integer, which must have `len` of space available, padding | |
| /// out the remainder of out with zeros. If `len` is smaller than `BN_num_bytes`, | |
| /// the function fails and returns 0. Otherwise, it returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_BN_bn2le_padded') | |
| external int BN_bn2le_padded( | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ffi.Pointer<BIGNUM> in$, | |
| ); | |
| /// BN_bn2lebinpad behaves like `BN_bn2le_padded`, but it returns `len` on | |
| /// success and -1 on error. | |
| /// | |
| /// Use `BN_bn2le_padded` instead. It is `size_t`-clean. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Uint8>, ffi.Int) | |
| >(symbol: 'bssl_dart_BN_bn2lebinpad') | |
| external int BN_bn2lebinpad( | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ); | |
| /// BN_bn2mpi serialises the value of `in` to `out`, using a format that consists | |
| /// of the number's length in bytes represented as a 4-byte big-endian number, | |
| /// and the number itself in big-endian format, where the most significant bit | |
| /// signals a negative number. (The representation of numbers with the MSB set is | |
| /// prefixed with null byte). `out` must have sufficient space available; to | |
| /// find the needed amount of space, call the function with `out` set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_BN_bn2mpi', | |
| ) | |
| external int BN_bn2mpi( | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ); | |
| /// BN_clear sets `bn` to zero and erases the old data. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_clear', | |
| ) | |
| external void BN_clear( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_clear_bit clears the `n`th, least-significant bit in `a`. For example, if | |
| /// `a` is 3, clearing bit zero will make it two. It returns one on success or | |
| /// zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_clear_bit', | |
| ) | |
| external int BN_clear_bit( | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_clear_free erases and frees the data referenced by `bn` and, if `bn` was | |
| /// originally allocated on the heap, frees `bn` also. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_clear_free', | |
| ) | |
| external void BN_clear_free( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_cmp returns a value less than, equal to or greater than zero if `a` is | |
| /// less than, equal to or greater than `b`, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_cmp', | |
| ) | |
| external int BN_cmp( | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_cmp_word is like `BN_cmp` except it takes its second argument as a | |
| /// `BN_ULONG` instead of a `BIGNUM`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_cmp_word', | |
| ) | |
| external int BN_cmp_word( | |
| ffi.Pointer<BIGNUM> a, | |
| int b, | |
| ); | |
| /// BN_copy sets `dest` equal to `src` and returns `dest` or NULL on allocation | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_BN_copy') | |
| external ffi.Pointer<BIGNUM> BN_copy( | |
| ffi.Pointer<BIGNUM> dest, | |
| ffi.Pointer<BIGNUM> src, | |
| ); | |
| /// BN_count_low_zero_bits returns the number of low-order zero bits in `bn`, or | |
| /// the number of factors of two which divide it. It returns zero if `bn` is | |
| /// zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_count_low_zero_bits', | |
| ) | |
| external int BN_count_low_zero_bits( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_dec2bn parses the leading decimal number from `in`, which may be | |
| /// proceeded by a '-' to indicate a negative number and may contain trailing, | |
| /// non-decimal data. If `outp` is not NULL, it constructs a BIGNUM equal to the | |
| /// decimal number and stores it in `*outp`. If `*outp` is NULL then it | |
| /// allocates a new BIGNUM and updates `*outp`. It returns the number of bytes | |
| /// of `in` processed or zero on error. | |
| /// | |
| /// Converting an arbitrarily large integer to decimal is quadratic in the bit | |
| /// length of `a`. This function assumes the caller has capped the input within | |
| /// performance tolerances. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<BIGNUM>>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_BN_dec2bn') | |
| external int BN_dec2bn( | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> outp, | |
| ffi.Pointer<ffi.Char> in$, | |
| ); | |
| /// BN_div divides `numerator` by `divisor` and places the result in `quotient` | |
| /// and the remainder in `rem`. Either of `quotient` or `rem` may be NULL, in | |
| /// which case the respective value is not returned. It returns one on success or | |
| /// zero on error. It is an error condition if `divisor` is zero. | |
| /// | |
| /// The outputs will be such that `quotient` * `divisor` + `rem` = `numerator`, | |
| /// with the quotient rounded towards zero. Thus, if `numerator` is negative, | |
| /// `rem` will be zero or negative. If `divisor` is negative, the sign of | |
| /// `quotient` will be flipped to compensate but otherwise rounding will be as if | |
| /// `divisor` were its absolute value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_div') | |
| external int BN_div( | |
| ffi.Pointer<BIGNUM> quotient, | |
| ffi.Pointer<BIGNUM> rem, | |
| ffi.Pointer<BIGNUM> numerator, | |
| ffi.Pointer<BIGNUM> divisor, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_div_word sets `numerator` = `numerator`/`divisor` and returns the | |
| /// remainder or (BN_ULONG)-1 on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UintPtr Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_div_word', | |
| ) | |
| external int BN_div_word( | |
| ffi.Pointer<BIGNUM> numerator, | |
| int divisor, | |
| ); | |
| /// BN_dup allocates a new BIGNUM and sets it equal to `src`. It returns the | |
| /// allocated BIGNUM on success or NULL otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_dup', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_dup( | |
| ffi.Pointer<BIGNUM> src, | |
| ); | |
| /// BN_enhanced_miller_rabin_primality_test tests whether `w` is probably a prime | |
| /// number using the Enhanced Miller-Rabin Test (FIPS 186-5 B.3.2) with | |
| /// `checks` iterations and returns the result in `out_result`. Enhanced | |
| /// Miller-Rabin tests primality for odd integers greater than 3, returning | |
| /// `bn_probably_prime` if the number is probably prime, | |
| /// `bn_non_prime_power_composite` if the number is a composite that is not the | |
| /// power of a single prime, and `bn_composite` otherwise. It returns one on | |
| /// success and zero on failure. If `cb` is not NULL, then it is called during | |
| /// each iteration of the primality test. | |
| /// | |
| /// See `BN_prime_checks_for_validation` and `BN_prime_checks_for_generation` for | |
| /// recommended values of `checks`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_enhanced_miller_rabin_primality_test') | |
| external int BN_enhanced_miller_rabin_primality_test( | |
| ffi.Pointer<ffi.UnsignedInt> out_result, | |
| ffi.Pointer<BIGNUM> w, | |
| int checks, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// BN_equal_consttime returns one if `a` is equal to `b`, and zero otherwise. | |
| /// It takes an amount of time dependent on the sizes of `a` and `b`, but | |
| /// independent of the contents (including the signs) of `a` and `b`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_equal_consttime', | |
| ) | |
| external int BN_equal_consttime( | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_exp sets `r` equal to `a`^{`p`}. It does so with a square-and-multiply | |
| /// algorithm that leaks side-channel information. It returns one on success or | |
| /// zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_exp') | |
| external int BN_exp( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_free frees the data referenced by `bn` and, if `bn` was originally | |
| /// allocated on the heap, frees `bn` also. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>)>(symbol: 'bssl_dart_BN_free') | |
| external void BN_free( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_from_montgomery sets `ret` equal to `a` * R^-1, i.e. translates values out | |
| /// of the Montgomery domain. `a` is assumed to be in the range [0, n*R), where | |
| /// `n` is the Montgomery modulus. Note n < R, so inputs in the range [0, n*n) | |
| /// are valid. This function returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_from_montgomery') | |
| external int BN_from_montgomery( | |
| ffi.Pointer<BIGNUM> ret, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_gcd sets `r` = gcd(`a`, `b`). It returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_gcd') | |
| external int BN_gcd( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_generate_prime_ex sets `ret` to a prime number of `bits` length. If safe | |
| /// is non-zero then the prime will be such that (ret-1)/2 is also a prime. | |
| /// (This is needed for Diffie-Hellman groups to ensure that the only subgroups | |
| /// are of size 2 and (p-1)/2.). | |
| /// | |
| /// If `add` is not NULL, the prime will fulfill the condition `ret` % `add` == | |
| /// `rem` in order to suit a given generator. (If `rem` is NULL then `ret` % | |
| /// `add` == 1.) | |
| /// | |
| /// If `cb` is not NULL, it will be called during processing to give an | |
| /// indication of progress. See the comments for `BN_GENCB`. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_generate_prime_ex') | |
| external int BN_generate_prime_ex( | |
| ffi.Pointer<BIGNUM> ret, | |
| int bits, | |
| int safe, | |
| ffi.Pointer<BIGNUM> add, | |
| ffi.Pointer<BIGNUM> rem, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// BN_get_rfc3526_prime_1536 sets `*ret` to the 1536-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_1536', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_1536( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_rfc3526_prime_2048 sets `*ret` to the 2048-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_2048', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_2048( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_rfc3526_prime_3072 sets `*ret` to the 3072-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_3072', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_3072( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_rfc3526_prime_4096 sets `*ret` to the 4096-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_4096', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_4096( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_rfc3526_prime_6144 sets `*ret` to the 6144-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_6144', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_6144( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_rfc3526_prime_8192 sets `*ret` to the 8192-bit MODP group from RFC | |
| /// 3526 and returns `ret`. If `ret` is NULL then a fresh `BIGNUM` is allocated | |
| /// and returned. It returns NULL on allocation failure. The generator for this | |
| /// group is 2. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_rfc3526_prime_8192', | |
| ) | |
| external ffi.Pointer<BIGNUM> BN_get_rfc3526_prime_8192( | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_get_u64 sets `*out` to the absolute value of `bn` as a `uint64_t` and | |
| /// returns one. If `bn` is too large to be represented as a `uint64_t`, it | |
| /// returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_BN_get_u64', | |
| ) | |
| external int BN_get_u64( | |
| ffi.Pointer<BIGNUM> bn, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// BN_get_word returns the absolute value of `bn` as a single word. If `bn` is | |
| /// too large to be represented as a single word, the maximum possible value | |
| /// will be returned. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UintPtr Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_get_word', | |
| ) | |
| external int BN_get_word( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_hex2bn parses the leading hex number from `in`, which may be proceeded by | |
| /// a '-' to indicate a negative number and may contain trailing, non-hex data. | |
| /// If `outp` is not NULL, it constructs a BIGNUM equal to the hex number and | |
| /// stores it in `*outp`. If `*outp` is NULL then it allocates a new BIGNUM and | |
| /// updates `*outp`. It returns the number of bytes of `in` processed or zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<BIGNUM>>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_BN_hex2bn') | |
| external int BN_hex2bn( | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> outp, | |
| ffi.Pointer<ffi.Char> in$, | |
| ); | |
| /// BN_init initialises a stack allocated `BIGNUM`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>)>(symbol: 'bssl_dart_BN_init') | |
| external void BN_init( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_is_bit_set returns one if the `n`th least-significant bit in `a` exists | |
| /// and is set. Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_is_bit_set', | |
| ) | |
| external int BN_is_bit_set( | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_is_negative returns one if `bn` is negative and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_is_negative', | |
| ) | |
| external int BN_is_negative( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_is_odd returns one if `bn` is odd and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_is_odd', | |
| ) | |
| external int BN_is_odd( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_is_one returns one if `bn` equals one and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_is_one', | |
| ) | |
| external int BN_is_one( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_is_pow2 returns 1 if `a` is a power of two, and 0 otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_is_pow2', | |
| ) | |
| external int BN_is_pow2( | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_is_prime_ex acts the same as `BN_is_prime_fasttest_ex` with | |
| /// `do_trial_division` set to zero. | |
| /// | |
| /// WARNING: deprecated: Use `BN_primality_test`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_is_prime_ex') | |
| external int BN_is_prime_ex( | |
| ffi.Pointer<BIGNUM> candidate, | |
| int checks, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// BN_is_prime_fasttest_ex returns one if `candidate` is probably a prime | |
| /// number by the Miller-Rabin test, zero if it's certainly not and -1 on error. | |
| /// | |
| /// If `do_trial_division` is non-zero then `candidate` will be tested against a | |
| /// list of small primes before Miller-Rabin tests. The probability of this | |
| /// function returning one when `candidate` is composite is at most 2^{2*checks}. | |
| /// See `BN_prime_checks_for_validation` and `BN_prime_checks_for_generation` for | |
| /// recommended values of `checks`. | |
| /// | |
| /// If `cb` is not NULL then it is called during the checking process. See the | |
| /// comment above `BN_GENCB`. | |
| /// | |
| /// WARNING: deprecated. Use `BN_primality_test`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Int, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_is_prime_fasttest_ex') | |
| external int BN_is_prime_fasttest_ex( | |
| ffi.Pointer<BIGNUM> candidate, | |
| int checks, | |
| ffi.Pointer<BN_CTX> ctx, | |
| int do_trial_division, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// BN_is_word returns one if `bn` is exactly `w` and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_is_word', | |
| ) | |
| external int BN_is_word( | |
| ffi.Pointer<BIGNUM> bn, | |
| int w, | |
| ); | |
| /// BN_is_zero returns one if `bn` is zero and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_is_zero', | |
| ) | |
| external int BN_is_zero( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_le2bn calls `BN_lebin2bn`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_le2bn') | |
| external ffi.Pointer<BIGNUM> BN_le2bn( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_lebin2bn sets `*ret` to the value of `len` bytes from `in`, interpreted as | |
| /// a little-endian number, and returns `ret`. If `ret` is NULL then a fresh | |
| /// `BIGNUM` is allocated and returned. It returns NULL on allocation | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_lebin2bn') | |
| external ffi.Pointer<BIGNUM> BN_lebin2bn( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_lshift sets `r` equal to `a` << n. The `a` and `r` arguments may be the | |
| /// same `BIGNUM`. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>, ffi.Int) | |
| >(symbol: 'bssl_dart_BN_lshift') | |
| external int BN_lshift( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_lshift1 sets `r` equal to `a` << 1, where `r` and `a` may be the same | |
| /// pointer. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_lshift1', | |
| ) | |
| external int BN_lshift1( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_marshal_asn1 marshals `bn` as a non-negative DER INTEGER and appends the | |
| /// result to `cbb`. It returns one on success and zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_marshal_asn1', | |
| ) | |
| external int BN_marshal_asn1( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_mask_bits truncates `a` so that it is only `n` bits long. It returns one | |
| /// on success or zero if `n` is negative. | |
| /// | |
| /// This differs from OpenSSL which additionally returns zero if `a`'s word | |
| /// length is less than or equal to `n`, rounded down to a number of words. Note | |
| /// word size is platform-dependent, so this behavior is also difficult to rely | |
| /// on in OpenSSL and not very useful. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_mask_bits', | |
| ) | |
| external int BN_mask_bits( | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_mod_add sets `r` = `a` + `b` mod `m`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_add') | |
| external int BN_mod_add( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_add_quick acts like `BN_mod_add` but requires that `a` and `b` be | |
| /// non-negative and less than `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_add_quick') | |
| external int BN_mod_add_quick( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BIGNUM> m, | |
| ); | |
| /// BN_mod_exp sets `r` equal to `a`^{`p`} mod `m`. It does so with the best | |
| /// algorithm for the values provided. It returns one on success or zero | |
| /// otherwise. The `BN_mod_exp_mont_consttime` variant must be used if the | |
| /// exponent is secret. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_exp') | |
| external int BN_mod_exp( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_exp2_mont calculates (a1^p1) * (a2^p2) mod m. It returns 1 on success | |
| /// or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_exp2_mont') | |
| external int BN_mod_exp2_mont( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a1, | |
| ffi.Pointer<BIGNUM> p1, | |
| ffi.Pointer<BIGNUM> a2, | |
| ffi.Pointer<BIGNUM> p2, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ); | |
| /// BN_mod_exp_mont behaves like `BN_mod_exp` but treats `a` as secret and | |
| /// requires 0 <= `a` < `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_exp_mont') | |
| external int BN_mod_exp_mont( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ); | |
| /// BN_mod_exp_mont_consttime behaves like `BN_mod_exp` but treats `a`, `p`, and | |
| /// `m` as secret and requires 0 <= `a` < `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_exp_mont_consttime') | |
| external int BN_mod_exp_mont_consttime( | |
| ffi.Pointer<BIGNUM> rr, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ); | |
| /// BN_mod_exp_mont_word is like `BN_mod_exp_mont` except that the base `a` is | |
| /// given as a `BN_ULONG` instead of a `BIGNUM *`. It returns one on success | |
| /// or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.UintPtr, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_exp_mont_word') | |
| external int BN_mod_exp_mont_word( | |
| ffi.Pointer<BIGNUM> r, | |
| int a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ); | |
| /// BN_mod_inverse sets `out` equal to `a`^-1, mod `n`. If `out` is NULL, a | |
| /// fresh BIGNUM is allocated. It returns the result or NULL on error. | |
| /// | |
| /// If `n` is even then the operation is performed using an algorithm that avoids | |
| /// some branches but which isn't constant-time. This function shouldn't be used | |
| /// for secret values; use `BN_mod_inverse_blinded` instead. Or, if `n` is | |
| /// guaranteed to be prime, use | |
| /// `BN_mod_exp_mont_consttime(out, a, m_minus_2, m, ctx, m_mont)`, taking | |
| /// advantage of Fermat's Little Theorem. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_inverse') | |
| external ffi.Pointer<BIGNUM> BN_mod_inverse( | |
| ffi.Pointer<BIGNUM> out, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_inverse_blinded sets `out` equal to `a`^-1, mod `n`, where `n` is the | |
| /// Montgomery modulus for `mont`. `a` must be non-negative and must be less | |
| /// than `n`. `n` must be greater than 1. `a` is blinded (masked by a random | |
| /// value) to protect it against side-channel attacks. On failure, if the failure | |
| /// was caused by `a` having no inverse mod `n` then `*out_no_inverse` will be | |
| /// set to one; otherwise it will be set to zero. | |
| /// | |
| /// Note this function may incorrectly report `a` has no inverse if the random | |
| /// blinding value has no inverse. It should only be used when `n` has few | |
| /// non-invertible elements, such as an RSA modulus. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_inverse_blinded') | |
| external int BN_mod_inverse_blinded( | |
| ffi.Pointer<BIGNUM> out, | |
| ffi.Pointer<ffi.Int> out_no_inverse, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_inverse_odd sets `out` equal to `a`^-1, mod `n`. `a` must be | |
| /// non-negative and must be less than `n`. `n` must be odd. This function | |
| /// shouldn't be used for secret values; use `BN_mod_inverse_blinded` instead. | |
| /// Or, if `n` is guaranteed to be prime, use | |
| /// `BN_mod_exp_mont_consttime(out, a, m_minus_2, m, ctx, m_mont)`, taking | |
| /// advantage of Fermat's Little Theorem. It returns one on success or zero on | |
| /// failure. On failure, if the failure was caused by `a` having no inverse mod | |
| /// `n` then `*out_no_inverse` will be set to one; otherwise it will be set to | |
| /// zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_inverse_odd') | |
| external int BN_mod_inverse_odd( | |
| ffi.Pointer<BIGNUM> out, | |
| ffi.Pointer<ffi.Int> out_no_inverse, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_lshift sets `r` = (`a` << n) mod `m`, where `r` and `a` may be the | |
| /// same pointer. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_lshift') | |
| external int BN_mod_lshift( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_lshift1 sets `r` = (`a` << 1) mod `m`, where `r` and `a` may be the | |
| /// same pointer. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_lshift1') | |
| external int BN_mod_lshift1( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_lshift1_quick acts like `BN_mod_lshift1` but requires that `a` be | |
| /// non-negative and less than `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_lshift1_quick') | |
| external int BN_mod_lshift1_quick( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> m, | |
| ); | |
| /// BN_mod_lshift_quick acts like `BN_mod_lshift` but requires that `a` be | |
| /// non-negative and less than `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_lshift_quick') | |
| external int BN_mod_lshift_quick( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ffi.Pointer<BIGNUM> m, | |
| ); | |
| /// BN_mod_mul sets `r` = `a`*`b` mod `m`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_mul') | |
| external int BN_mod_mul( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_mul_montgomery set `r` equal to `a` * `b`, in the Montgomery domain. | |
| /// Both `a` and `b` must already be in the Montgomery domain (by | |
| /// `BN_to_montgomery`). In particular, `a` and `b` are assumed to be in the | |
| /// range [0, n), where `n` is the Montgomery modulus. It returns one on success | |
| /// or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_mul_montgomery') | |
| external int BN_mod_mul_montgomery( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_pow2 sets `r` = `a` mod 2^`e`. It returns 1 on success and | |
| /// 0 on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>, ffi.Size) | |
| >(symbol: 'bssl_dart_BN_mod_pow2') | |
| external int BN_mod_pow2( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int e, | |
| ); | |
| /// BN_mod_sqr sets `r` = `a`^2 mod `m`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_sqr') | |
| external int BN_mod_sqr( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_sqrt returns a newly-allocated `BIGNUM`, r, such that | |
| /// r^2 == a (mod p). It returns NULL on error or if `a` is not a square mod `p`. | |
| /// In the latter case, it will add `BN_R_NOT_A_SQUARE` to the error queue. | |
| /// If `a` is a square and `p` > 2, there are two possible square roots. This | |
| /// function may return either and may even select one non-deterministically. | |
| /// | |
| /// If `in` is non-NULL, the function, instead of allocating the result, stores | |
| /// the result in `in` and returns `in` on success or NULL on failure. | |
| /// | |
| /// This function only works if `p` is a prime. If `p` is composite, it may fail | |
| /// or return an arbitrary value. Callers should not pass attacker-controlled | |
| /// values of `p`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_sqrt') | |
| external ffi.Pointer<BIGNUM> BN_mod_sqrt( | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_sub sets `r` = `a` - `b` mod `m`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_sub') | |
| external int BN_mod_sub( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mod_sub_quick acts like `BN_mod_sub` but requires that `a` and `b` be | |
| /// non-negative and less than `m`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mod_sub_quick') | |
| external int BN_mod_sub_quick( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BIGNUM> m, | |
| ); | |
| /// BN_mod_word returns `a` mod `w` or (BN_ULONG)-1 on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UintPtr Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_mod_word', | |
| ) | |
| external int BN_mod_word( | |
| ffi.Pointer<BIGNUM> a, | |
| int w, | |
| ); | |
| /// BN_mpi2bn parses `len` bytes from `in` and returns the resulting value. The | |
| /// bytes at `in` are expected to be in the format emitted by `BN_bn2mpi`. | |
| /// | |
| /// If `out` is NULL then a fresh `BIGNUM` is allocated and returned, otherwise | |
| /// `out` is reused and returned. On error, NULL is returned and the error queue | |
| /// is updated. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BIGNUM> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mpi2bn') | |
| external ffi.Pointer<BIGNUM> BN_mpi2bn( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<BIGNUM> out, | |
| ); | |
| /// BN_mul sets `r` = `a` * `b`, where `r` may be the same pointer as `a` or | |
| /// `b`. Returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_mul') | |
| external int BN_mul( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_mul_word sets `bn` = `bn` * `w`. It returns one on success or zero on | |
| /// allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_mul_word', | |
| ) | |
| external int BN_mul_word( | |
| ffi.Pointer<BIGNUM> bn, | |
| int w, | |
| ); | |
| /// BN_new creates a new, allocated BIGNUM and initialises it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function()>(symbol: 'bssl_dart_BN_new') | |
| external ffi.Pointer<BIGNUM> BN_new(); | |
| /// BN_nnmod is a non-negative modulo function. It acts like `BN_mod`, but 0 <= | |
| /// `rem` < `divisor` is always true. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_nnmod') | |
| external int BN_nnmod( | |
| ffi.Pointer<BIGNUM> rem, | |
| ffi.Pointer<BIGNUM> numerator, | |
| ffi.Pointer<BIGNUM> divisor, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_nnmod_pow2 sets `r` = `a` mod 2^`e` where `r` is always positive. | |
| /// It returns 1 on success and 0 on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>, ffi.Size) | |
| >(symbol: 'bssl_dart_BN_nnmod_pow2') | |
| external int BN_nnmod_pow2( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int e, | |
| ); | |
| /// BN_num_bits returns the minimum number of bits needed to represent the | |
| /// absolute value of `bn`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_num_bits', | |
| ) | |
| external int BN_num_bits( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_num_bits_word', | |
| ) | |
| external int BN_num_bits_word( | |
| int l, | |
| ); | |
| /// BN_num_bytes returns the minimum number of bytes needed to represent the | |
| /// absolute value of `bn`. | |
| /// | |
| /// While `size_t` is the preferred type for byte counts, callers can assume that | |
| /// `BIGNUM`s are bounded such that this value, and its corresponding bit count, | |
| /// will always fit in `int`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_num_bytes', | |
| ) | |
| external int BN_num_bytes( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_one sets `bn` to one. It returns one on success or zero on allocation | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>)>(symbol: 'bssl_dart_BN_one') | |
| external int BN_one( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BN_parse_asn1_unsigned parses a non-negative DER INTEGER from `cbs` writes | |
| /// the result to `ret`. It returns one on success and zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_parse_asn1_unsigned', | |
| ) | |
| external int BN_parse_asn1_unsigned( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<BIGNUM> ret, | |
| ); | |
| /// BN_primality_test sets `*is_probably_prime` to one if `candidate` is | |
| /// probably a prime number by the Miller-Rabin test or zero if it's certainly | |
| /// not. | |
| /// | |
| /// If `do_trial_division` is non-zero then `candidate` will be tested against a | |
| /// list of small primes before Miller-Rabin tests. The probability of this | |
| /// function returning a false positive is at most 2^{2*checks}. See | |
| /// `BN_prime_checks_for_validation` and `BN_prime_checks_for_generation` for | |
| /// recommended values of `checks`. | |
| /// | |
| /// If `cb` is not NULL then it is called during the checking process. See the | |
| /// comment above `BN_GENCB`. | |
| /// | |
| /// The function returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BN_CTX>, | |
| ffi.Int, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_primality_test') | |
| external int BN_primality_test( | |
| ffi.Pointer<ffi.Int> is_probably_prime, | |
| ffi.Pointer<BIGNUM> candidate, | |
| int checks, | |
| ffi.Pointer<BN_CTX> ctx, | |
| int do_trial_division, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// BN_print writes a hex encoding of `a` to `bio`. It returns one on success | |
| /// and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_print', | |
| ) | |
| external int BN_print( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_print_fp acts like `BIO_print`, but wraps `fp` in a `BIO` first. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_print_fp', | |
| ) | |
| external int BN_print_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_pseudo_rand is an alias for `BN_rand`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_pseudo_rand', | |
| ) | |
| external int BN_pseudo_rand( | |
| ffi.Pointer<BIGNUM> rnd, | |
| int bits, | |
| int top, | |
| int bottom, | |
| ); | |
| /// BN_pseudo_rand_range is an alias for BN_rand_range. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_pseudo_rand_range', | |
| ) | |
| external int BN_pseudo_rand_range( | |
| ffi.Pointer<BIGNUM> rnd, | |
| ffi.Pointer<BIGNUM> range, | |
| ); | |
| /// BN_rand sets `rnd` to a random number of length `bits`. It returns one on | |
| /// success and zero otherwise. | |
| /// | |
| /// `top` must be one of the `BN_RAND_TOP_*` values. If `BN_RAND_TOP_ONE`, the | |
| /// most-significant bit, if any, will be set. If `BN_RAND_TOP_TWO`, the two | |
| /// most significant bits, if any, will be set. If `BN_RAND_TOP_ANY`, no extra | |
| /// action will be taken and `BN_num_bits(rnd)` may not equal `bits` if the most | |
| /// significant bits randomly ended up as zeros. | |
| /// | |
| /// `bottom` must be one of the `BN_RAND_BOTTOM_*` values. If | |
| /// `BN_RAND_BOTTOM_ODD`, the least-significant bit, if any, will be set. If | |
| /// `BN_RAND_BOTTOM_ANY`, no extra action will be taken. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_rand', | |
| ) | |
| external int BN_rand( | |
| ffi.Pointer<BIGNUM> rnd, | |
| int bits, | |
| int top, | |
| int bottom, | |
| ); | |
| /// BN_rand_range is equivalent to `BN_rand_range_ex` with `min_inclusive` set | |
| /// to zero and `max_exclusive` set to `range`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_rand_range', | |
| ) | |
| external int BN_rand_range( | |
| ffi.Pointer<BIGNUM> rnd, | |
| ffi.Pointer<BIGNUM> range, | |
| ); | |
| /// BN_rand_range_ex sets `rnd` to a random value in | |
| /// [min_inclusive..max_exclusive). It returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_BN_rand_range_ex') | |
| external int BN_rand_range_ex( | |
| ffi.Pointer<BIGNUM> r, | |
| int min_inclusive, | |
| ffi.Pointer<BIGNUM> max_exclusive, | |
| ); | |
| /// BN_rshift sets `r` equal to `a` >> n, where `r` and `a` may be the same | |
| /// pointer. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>, ffi.Int) | |
| >(symbol: 'bssl_dart_BN_rshift') | |
| external int BN_rshift( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_rshift1 sets `r` equal to `a` >> 1, where `r` and `a` may be the same | |
| /// pointer. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_rshift1', | |
| ) | |
| external int BN_rshift1( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ); | |
| /// BN_secure_new calls `BN_new`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function()>(symbol: 'bssl_dart_BN_secure_new') | |
| external ffi.Pointer<BIGNUM> BN_secure_new(); | |
| /// BN_set_bit sets the `n`th, least-significant bit in `a`. For example, if `a` | |
| /// is 2 then setting bit zero will make it 3. It returns one on success or zero | |
| /// on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_set_bit', | |
| ) | |
| external int BN_set_bit( | |
| ffi.Pointer<BIGNUM> a, | |
| int n, | |
| ); | |
| /// BN_set_negative sets the sign of `bn`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>, ffi.Int)>( | |
| symbol: 'bssl_dart_BN_set_negative', | |
| ) | |
| external void BN_set_negative( | |
| ffi.Pointer<BIGNUM> bn, | |
| int sign, | |
| ); | |
| /// BN_set_u64 sets `bn` to `value`. It returns one on success or zero on | |
| /// allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_BN_set_u64', | |
| ) | |
| external int BN_set_u64( | |
| ffi.Pointer<BIGNUM> bn, | |
| int value, | |
| ); | |
| /// BN_set_word sets `bn` to `value`. It returns one on success or zero on | |
| /// allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_set_word', | |
| ) | |
| external int BN_set_word( | |
| ffi.Pointer<BIGNUM> bn, | |
| int value, | |
| ); | |
| /// BN_sqr sets `r` = `a`^2 (i.e. squares), where `r` may be the same pointer as | |
| /// `a`. Returns one on success and zero otherwise. This is more efficient than | |
| /// BN_mul(r, a, a, ctx). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_sqr') | |
| external int BN_sqr( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_sqrt sets `*out_sqrt` (which may be the same `BIGNUM` as `in`) to the | |
| /// square root of `in`, using `ctx`. It returns one on success or zero on | |
| /// error. Negative numbers and non-square numbers will result in an error with | |
| /// appropriate errors on the error queue. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_sqrt') | |
| external int BN_sqrt( | |
| ffi.Pointer<BIGNUM> out_sqrt, | |
| ffi.Pointer<BIGNUM> in$, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_sub sets `r` = `a` - `b`, where `r` may be the same pointer as either `a` | |
| /// or `b`. It returns one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_sub') | |
| external int BN_sub( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_sub_word subtracts `w` from `a`. It returns one on success and zero on | |
| /// allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.UintPtr)>( | |
| symbol: 'bssl_dart_BN_sub_word', | |
| ) | |
| external int BN_sub_word( | |
| ffi.Pointer<BIGNUM> a, | |
| int w, | |
| ); | |
| /// BN_to_ASN1_ENUMERATED sets `ai` to an ENUMERATED with value `bn` and returns | |
| /// `ai` on success or NULL or error. If `ai` is NULL, it returns a | |
| /// newly-allocated `ASN1_ENUMERATED` on success instead, which the caller must | |
| /// release with `ASN1_ENUMERATED_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_ENUMERATED> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<ASN1_ENUMERATED>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_to_ASN1_ENUMERATED') | |
| external ffi.Pointer<ASN1_ENUMERATED> BN_to_ASN1_ENUMERATED( | |
| ffi.Pointer<BIGNUM> bn, | |
| ffi.Pointer<ASN1_ENUMERATED> ai, | |
| ); | |
| /// BN_to_ASN1_INTEGER sets `ai` to an INTEGER with value `bn` and returns `ai` | |
| /// on success or NULL or error. If `ai` is NULL, it returns a newly-allocated | |
| /// `ASN1_INTEGER` on success instead, which the caller must release with | |
| /// `ASN1_INTEGER_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_INTEGER> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_to_ASN1_INTEGER') | |
| external ffi.Pointer<ASN1_INTEGER> BN_to_ASN1_INTEGER( | |
| ffi.Pointer<BIGNUM> bn, | |
| ffi.Pointer<ASN1_INTEGER> ai, | |
| ); | |
| /// BN_to_montgomery sets `ret` equal to `a` in the Montgomery domain. `a` is | |
| /// assumed to be in the range [0, n), where `n` is the Montgomery modulus. It | |
| /// returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_MONT_CTX>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_to_montgomery') | |
| external int BN_to_montgomery( | |
| ffi.Pointer<BIGNUM> ret, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BN_MONT_CTX> mont, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// BN_uadd sets `r` = `a` + `b`, considering only the absolute values of `a` and | |
| /// `b`. `r` may be the same pointer as either `a` or `b`. It returns one on | |
| /// success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_uadd') | |
| external int BN_uadd( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_ucmp returns a value less than, equal to or greater than zero if the | |
| /// absolute value of `a` is less than, equal to or greater than the absolute | |
| /// value of `b`, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_BN_ucmp', | |
| ) | |
| external int BN_ucmp( | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_usub sets `r` = `a` - `b`, considering only the absolute values of `a` and | |
| /// `b`. The result must be non-negative, i.e. `b` <= `a`. `r` may be the same | |
| /// pointer as either `a` or `b`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_BN_usub') | |
| external int BN_usub( | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ); | |
| /// BN_value_one returns a static BIGNUM with value 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function()>(symbol: 'bssl_dart_BN_value_one') | |
| external ffi.Pointer<BIGNUM> BN_value_one(); | |
| /// BN_zero sets `bn` to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIGNUM>)>(symbol: 'bssl_dart_BN_zero') | |
| external void BN_zero( | |
| ffi.Pointer<BIGNUM> bn, | |
| ); | |
| /// BORINGSSL_self_test triggers most of the FIPS KAT-based self tests. It | |
| /// returns one on success and zero on error. It currently skips the SLH-DSA | |
| /// tests, which take a really long time to run. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_BORINGSSL_self_test') | |
| external int BORINGSSL_self_test(); | |
| /// BORINGSSL_self_test_all triggers all of the FIPS KAT-based self tests. This | |
| /// is the 'self-test' entry point required by FIPS 140. It returns one on | |
| /// success and zero on error. This test will take a very long time to run. You | |
| /// probably do not want to run this in a resource or time constrained test. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_BORINGSSL_self_test_all') | |
| external int BORINGSSL_self_test_all(); | |
| /// BUF_MEM_append appends `in` to `buf`. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BUF_MEM>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_BUF_MEM_append') | |
| external int BUF_MEM_append( | |
| ffi.Pointer<BUF_MEM> buf, | |
| ffi.Pointer<ffi.Void> in$, | |
| int len, | |
| ); | |
| /// BUF_MEM_free frees `buf->data` if needed and then frees `buf` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BUF_MEM>)>( | |
| symbol: 'bssl_dart_BUF_MEM_free', | |
| ) | |
| external void BUF_MEM_free( | |
| ffi.Pointer<BUF_MEM> buf, | |
| ); | |
| /// BUF_MEM_grow ensures that `buf` has length `len` and allocates memory if | |
| /// needed. If the length of `buf` increased, the new bytes are filled with | |
| /// zeros. It returns the length of `buf`, or zero if there's an error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BUF_MEM>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_MEM_grow', | |
| ) | |
| external int BUF_MEM_grow( | |
| ffi.Pointer<BUF_MEM> buf, | |
| int len, | |
| ); | |
| /// BUF_MEM_grow_clean calls `BUF_MEM_grow`. BoringSSL always zeros memory | |
| /// allocated memory on free. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<BUF_MEM>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_MEM_grow_clean', | |
| ) | |
| external int BUF_MEM_grow_clean( | |
| ffi.Pointer<BUF_MEM> buf, | |
| int len, | |
| ); | |
| /// BUF_MEM_new creates a new BUF_MEM which has no allocated data buffer. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BUF_MEM> Function()>(symbol: 'bssl_dart_BUF_MEM_new') | |
| external ffi.Pointer<BUF_MEM> BUF_MEM_new(); | |
| /// BUF_MEM_reserve ensures `buf` has capacity `cap` and allocates memory if | |
| /// needed. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BUF_MEM>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_MEM_reserve', | |
| ) | |
| external int BUF_MEM_reserve( | |
| ffi.Pointer<BUF_MEM> buf, | |
| int cap, | |
| ); | |
| /// BUF_memdup calls `OPENSSL_memdup`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_memdup', | |
| ) | |
| external ffi.Pointer<ffi.Void> BUF_memdup( | |
| ffi.Pointer<ffi.Void> data, | |
| int size, | |
| ); | |
| /// BUF_strdup calls `OPENSSL_strdup`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_BUF_strdup', | |
| ) | |
| external ffi.Pointer<ffi.Char> BUF_strdup( | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| /// BUF_strlcat calls `OPENSSL_strlcat`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_BUF_strlcat') | |
| external int BUF_strlcat( | |
| ffi.Pointer<ffi.Char> dst, | |
| ffi.Pointer<ffi.Char> src, | |
| int dst_size, | |
| ); | |
| /// BUF_strlcpy calls `OPENSSL_strlcpy`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_BUF_strlcpy') | |
| external int BUF_strlcpy( | |
| ffi.Pointer<ffi.Char> dst, | |
| ffi.Pointer<ffi.Char> src, | |
| int dst_size, | |
| ); | |
| /// BUF_strndup calls `OPENSSL_strndup`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Char>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_strndup', | |
| ) | |
| external ffi.Pointer<ffi.Char> BUF_strndup( | |
| ffi.Pointer<ffi.Char> str, | |
| int size, | |
| ); | |
| /// BUF_strnlen calls `OPENSSL_strnlen`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Size)>( | |
| symbol: 'bssl_dart_BUF_strnlen', | |
| ) | |
| external int BUF_strnlen( | |
| ffi.Pointer<ffi.Char> str, | |
| int max_len, | |
| ); | |
| /// CBB_add_asn1 sets `*out_contents` to a `CBB` into which the contents of an | |
| /// ASN.1 object can be written. The `tag` argument will be used as the tag for | |
| /// the object. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<CBB>, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBB_add_asn1', | |
| ) | |
| external int CBB_add_asn1( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<CBB> out_contents, | |
| int tag, | |
| ); | |
| /// CBB_add_asn1_bool writes an ASN.1 BOOLEAN into `cbb` which is true iff | |
| /// `value` is non-zero. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Int)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_bool', | |
| ) | |
| external int CBB_add_asn1_bool( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_asn1_element adds an ASN.1 element with the specified tag and | |
| /// contents. It returns one on success and zero on error. This is a convenience | |
| /// function over `CBB_add_asn1` when the data is already available. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBB>, | |
| CBS_ASN1_TAG, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_CBB_add_asn1_element') | |
| external int CBB_add_asn1_element( | |
| ffi.Pointer<CBB> cbb, | |
| int tag, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ); | |
| /// CBB_add_asn1_int64 writes an ASN.1 INTEGER into `cbb` using `CBB_add_asn1` | |
| /// and writes `value` in its contents. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Int64)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_int64', | |
| ) | |
| external int CBB_add_asn1_int64( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_asn1_int64_with_tag behaves like `CBB_add_asn1_int64` but uses `tag` | |
| /// as the tag instead of INTEGER. This is useful if the INTEGER type uses | |
| /// implicit tagging. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Int64, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_int64_with_tag', | |
| ) | |
| external int CBB_add_asn1_int64_with_tag( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| int tag, | |
| ); | |
| /// CBB_add_asn1_octet_string writes an ASN.1 OCTET STRING into `cbb` with the | |
| /// given contents. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_add_asn1_octet_string') | |
| external int CBB_add_asn1_octet_string( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ); | |
| /// CBB_add_asn1_oid_component appends a single OID component to `cbb`. | |
| /// It returns one on success and zero on error. | |
| /// | |
| /// Specifically, this encodes `value` as a non-empty, minimal-width, base-128, | |
| /// big-endian integer. The high bit of each byte is set for continuation bytes | |
| /// and unset for the final byte. This encoding is also used for DER tag numbers | |
| /// 31 and up. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_oid_component', | |
| ) | |
| external int CBB_add_asn1_oid_component( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_asn1_oid_from_text decodes `len` bytes from `text` as an ASCII OID | |
| /// representation, e.g. "1.2.840.113554.4.1.72585", and writes the DER-encoded | |
| /// contents to `cbb`. It returns one on success and zero on malloc failure or if | |
| /// `text` was invalid. It does not include the OBJECT IDENTIFIER framing, only | |
| /// the element's contents. | |
| /// | |
| /// This function considers OID strings with components which do not fit in a | |
| /// `uint64_t` to be invalid. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_add_asn1_oid_from_text') | |
| external int CBB_add_asn1_oid_from_text( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Char> text, | |
| int len, | |
| ); | |
| /// CBB_add_asn1_relative_oid_from_der_to_text reads `data_len` bytes of | |
| /// DER-encoded ASN.1 RELATIVE-OID contents (not including the element framing) | |
| /// from `data` and writes the ASCII representation (e.g., "32473.1") to `cbb` | |
| /// (without a trailing NUL byte). It returns one on success and zero on | |
| /// failure. | |
| /// | |
| /// This function may fail if `data` is an invalid RELATIVE-OID, or if any OID | |
| /// components are too large. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_add_asn1_relative_oid_from_der_to_text') | |
| external int CBB_add_asn1_relative_oid_from_der_to_text( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ); | |
| /// CBB_add_asn1_relative_oid_from_text decodes `len` bytes from `text` as an | |
| /// ASCII RELATIVE-OID representation, e.g. "32473.1", and writes the | |
| /// DER-encoded contents to `cbb`. It returns one on success and zero on malloc | |
| /// failure or if `text` was invalid. It does not include any framing, only the | |
| /// element's contents. | |
| /// | |
| /// This function considers OID strings with components which do not fit in a | |
| /// `uint64_t` to be invalid. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_add_asn1_relative_oid_from_text') | |
| external int CBB_add_asn1_relative_oid_from_text( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Char> text, | |
| int len, | |
| ); | |
| /// CBB_add_asn1_uint64 writes an ASN.1 INTEGER into `cbb` using `CBB_add_asn1` | |
| /// and writes `value` in its contents. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_uint64', | |
| ) | |
| external int CBB_add_asn1_uint64( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_asn1_uint64_with_tag behaves like `CBB_add_asn1_uint64` but uses | |
| /// `tag` as the tag instead of INTEGER. This is useful if the INTEGER type uses | |
| /// implicit tagging. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBB_add_asn1_uint64_with_tag', | |
| ) | |
| external int CBB_add_asn1_uint64_with_tag( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| int tag, | |
| ); | |
| /// CBB_add_bytes appends `len` bytes from `data` to `cbb`. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_add_bytes') | |
| external int CBB_add_bytes( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_latin1', | |
| ) | |
| external int CBB_add_latin1( | |
| ffi.Pointer<CBB> cbb, | |
| int u, | |
| ); | |
| /// CBB_add_space appends `len` bytes to `cbb` and sets `*out_data` to point to | |
| /// the beginning of that space. The caller must then write `len` bytes of | |
| /// actual contents to `*out_data`. It returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBB>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_CBB_add_space') | |
| external int CBB_add_space( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| int len, | |
| ); | |
| /// CBB_add_u16 appends a 16-bit, big-endian number from `value` to `cbb`. It | |
| /// returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint16)>( | |
| symbol: 'bssl_dart_CBB_add_u16', | |
| ) | |
| external int CBB_add_u16( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u16_length_prefixed sets `*out_contents` to a new child of `cbb`. | |
| /// The data written to `*out_contents` will be prefixed in `cbb` with a 16-bit, | |
| /// big-endian length. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_add_u16_length_prefixed', | |
| ) | |
| external int CBB_add_u16_length_prefixed( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<CBB> out_contents, | |
| ); | |
| /// CBB_add_u16le appends a 16-bit, little-endian number from `value` to `cbb`. | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint16)>( | |
| symbol: 'bssl_dart_CBB_add_u16le', | |
| ) | |
| external int CBB_add_u16le( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u24 appends a 24-bit, big-endian number from `value` to `cbb`. It | |
| /// returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_u24', | |
| ) | |
| external int CBB_add_u24( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u24_length_prefixed sets `*out_contents` to a new child of `cbb`. | |
| /// The data written to `*out_contents` will be prefixed in `cbb` with a 24-bit, | |
| /// big-endian length. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_add_u24_length_prefixed', | |
| ) | |
| external int CBB_add_u24_length_prefixed( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<CBB> out_contents, | |
| ); | |
| /// CBB_add_u32 appends a 32-bit, big-endian number from `value` to `cbb`. It | |
| /// returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_u32', | |
| ) | |
| external int CBB_add_u32( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u32le appends a 32-bit, little-endian number from `value` to `cbb`. | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_u32le', | |
| ) | |
| external int CBB_add_u32le( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u48 appends a 48-bit, big-endian number from `value` to `cbb`. It | |
| /// returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_CBB_add_u48', | |
| ) | |
| external int CBB_add_u48( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u64 appends a 64-bit, big-endian number from `value` to `cbb`. It | |
| /// returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_CBB_add_u64', | |
| ) | |
| external int CBB_add_u64( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u64le appends a 64-bit, little-endian number from `value` to `cbb`. | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint64)>( | |
| symbol: 'bssl_dart_CBB_add_u64le', | |
| ) | |
| external int CBB_add_u64le( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u8 appends an 8-bit number from `value` to `cbb`. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint8)>( | |
| symbol: 'bssl_dart_CBB_add_u8', | |
| ) | |
| external int CBB_add_u8( | |
| ffi.Pointer<CBB> cbb, | |
| int value, | |
| ); | |
| /// CBB_add_u8_length_prefixed sets `*out_contents` to a new child of `cbb`. The | |
| /// data written to `*out_contents` will be prefixed in `cbb` with an 8-bit | |
| /// length. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_add_u8_length_prefixed', | |
| ) | |
| external int CBB_add_u8_length_prefixed( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<CBB> out_contents, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_ucs2_be', | |
| ) | |
| external int CBB_add_ucs2_be( | |
| ffi.Pointer<CBB> cbb, | |
| int u, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_utf32_be', | |
| ) | |
| external int CBB_add_utf32_be( | |
| ffi.Pointer<CBB> cbb, | |
| int u, | |
| ); | |
| /// The following functions encode `u` to `cbb` with the corresponding | |
| /// encoding. They return one on success and zero on error. Error conditions | |
| /// include `u` being an invalid code point, or `u` being unencodable in the | |
| /// specified encoding. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_CBB_add_utf8', | |
| ) | |
| external int CBB_add_utf8( | |
| ffi.Pointer<CBB> cbb, | |
| int u, | |
| ); | |
| /// CBB_add_zeros append `len` bytes with value zero to `cbb`. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBB_add_zeros', | |
| ) | |
| external int CBB_add_zeros( | |
| ffi.Pointer<CBB> cbb, | |
| int len, | |
| ); | |
| /// CBB_cleanup frees all resources owned by `cbb` and other `CBB` objects | |
| /// writing to the same buffer. This should be used in an error case where a | |
| /// serialisation is abandoned. | |
| /// | |
| /// This function can only be called on a "top level" `CBB`, i.e. one initialised | |
| /// with `CBB_init` or `CBB_init_fixed`, or a `CBB` set to the zero state with | |
| /// `CBB_zero`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_cleanup', | |
| ) | |
| external void CBB_cleanup( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_data returns a pointer to the bytes written to `cbb`. It does not flush | |
| /// `cbb`. The pointer is valid until the next operation to `cbb`. | |
| /// | |
| /// To avoid unfinalized length prefixes, it is a fatal error to call this on a | |
| /// CBB with any active children. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_data', | |
| ) | |
| external ffi.Pointer<ffi.Uint8> CBB_data( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_did_write advances `cbb` by `len` bytes, assuming the space has been | |
| /// written to by the caller. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBB_did_write', | |
| ) | |
| external int CBB_did_write( | |
| ffi.Pointer<CBB> cbb, | |
| int len, | |
| ); | |
| /// CBB_discard discards the last `len` bytes written to `cbb`. The process will | |
| /// abort if `cbb` has an unflushed child, or its length is smaller than `len`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CBB>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBB_discard', | |
| ) | |
| external void CBB_discard( | |
| ffi.Pointer<CBB> cbb, | |
| int len, | |
| ); | |
| /// CBB_discard_child discards the current unflushed child of `cbb`. Neither the | |
| /// child's contents nor the length prefix will be included in the output. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_discard_child', | |
| ) | |
| external void CBB_discard_child( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_finish completes any pending length prefix and sets `*out_data` to a | |
| /// malloced buffer and `*out_len` to the length of that buffer. The caller | |
| /// takes ownership of the buffer and, unless the buffer was fixed with | |
| /// `CBB_init_fixed`, must call `OPENSSL_free` when done. | |
| /// | |
| /// It can only be called on a "top level" `CBB`, i.e. one initialised with | |
| /// `CBB_init` or `CBB_init_fixed`. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBB>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_CBB_finish') | |
| external int CBB_finish( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// CBB_flush causes any pending length prefixes to be written out and any child | |
| /// `CBB` objects of `cbb` to be invalidated. This allows `cbb` to continue to be | |
| /// used after the children go out of scope, e.g. when local `CBB` objects are | |
| /// added as children to a `CBB` that persists after a function returns. This | |
| /// function returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>)>(symbol: 'bssl_dart_CBB_flush') | |
| external int CBB_flush( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_flush_asn1_set_of calls `CBB_flush` on `cbb` and then reorders the | |
| /// contents for a DER-encoded ASN.1 SET OF type. It returns one on success and | |
| /// zero on failure. DER canonicalizes SET OF contents by sorting | |
| /// lexicographically by encoding. Call this function when encoding a SET OF | |
| /// type in an order that is not already known to be canonical. | |
| /// | |
| /// Note a SET type has a slightly different ordering than a SET OF. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>)>( | |
| symbol: 'bssl_dart_CBB_flush_asn1_set_of', | |
| ) | |
| external int CBB_flush_asn1_set_of( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_get_utf8_len returns the number of bytes needed to represent `u` in | |
| /// UTF-8. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Uint32)>(symbol: 'bssl_dart_CBB_get_utf8_len') | |
| external int CBB_get_utf8_len( | |
| int u, | |
| ); | |
| /// CBB_init initialises `cbb` with `initial_capacity`. Since a `CBB` grows as | |
| /// needed, the `initial_capacity` is just a hint. It returns one on success or | |
| /// zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBB_init', | |
| ) | |
| external int CBB_init( | |
| ffi.Pointer<CBB> cbb, | |
| int initial_capacity, | |
| ); | |
| /// CBB_init_fixed initialises `cbb` to write to `len` bytes at `buf`. Since | |
| /// `buf` cannot grow, trying to write more than `len` bytes will cause CBB | |
| /// functions to fail. This function is infallible and always returns one. It is | |
| /// safe, but not necessary, to call `CBB_cleanup` on `cbb`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBB_init_fixed') | |
| external int CBB_init_fixed( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int len, | |
| ); | |
| /// CBB_len returns the number of bytes written to `cbb`. It does not flush | |
| /// `cbb`. | |
| /// | |
| /// To avoid unfinalized length prefixes, it is a fatal error to call this on a | |
| /// CBB with any active children. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<CBB>)>(symbol: 'bssl_dart_CBB_len') | |
| external int CBB_len( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBB_reserve ensures `cbb` has room for `len` additional bytes and sets | |
| /// `*out_data` to point to the beginning of that space. It returns one on | |
| /// success and zero otherwise. The caller may write up to `len` bytes to | |
| /// `*out_data` and call `CBB_did_write` to complete the write. `*out_data` is | |
| /// valid until the next operation on `cbb` or an ancestor `CBB`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBB>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_CBB_reserve') | |
| external int CBB_reserve( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| int len, | |
| ); | |
| /// CBB_zero sets an uninitialised `cbb` to the zero state. It must be | |
| /// initialised with `CBB_init` or `CBB_init_fixed` before use, but it is safe to | |
| /// call `CBB_cleanup` without a successful `CBB_init`. This may be used for more | |
| /// uniform cleanup of a `CBB`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CBB>)>(symbol: 'bssl_dart_CBB_zero') | |
| external void CBB_zero( | |
| ffi.Pointer<CBB> cbb, | |
| ); | |
| /// CBS_asn1_bitstring_has_bit returns one if `cbs` is a valid ASN.1 BIT STRING | |
| /// body and the specified bit is present and set. Otherwise, it returns zero. | |
| /// `bit` is indexed starting from zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_CBS_asn1_bitstring_has_bit', | |
| ) | |
| external int CBS_asn1_bitstring_has_bit( | |
| ffi.Pointer<CBS> cbs, | |
| int bit, | |
| ); | |
| /// CBS_asn1_oid_to_text interprets `cbs` as DER-encoded ASN.1 OBJECT IDENTIFIER | |
| /// contents (not including the element framing) and returns the ASCII | |
| /// representation (e.g., "1.2.840.113554.4.1.72585") in a newly-allocated | |
| /// string, or NULL on failure. The caller must release the result with | |
| /// `OPENSSL_free`. | |
| /// | |
| /// This function may fail if `cbs` is an invalid OBJECT IDENTIFIER, or if any | |
| /// OID components are too large. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_asn1_oid_to_text', | |
| ) | |
| external ffi.Pointer<ffi.Char> CBS_asn1_oid_to_text( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_asn1_relative_oid_to_text interprets `cbs` as DER-encoded ASN.1 | |
| /// RELATIVE-OID contents (not including the element framing) and returns the | |
| /// ASCII representation (e.g., "32473.1") in a newly-allocated string, or NULL | |
| /// on failure. The caller must release the result with `OPENSSL_free`. | |
| /// | |
| /// This function may fail if `cbs` is an invalid RELATIVE-OID, or if any | |
| /// OID components are too large. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_asn1_relative_oid_to_text', | |
| ) | |
| external ffi.Pointer<ffi.Char> CBS_asn1_relative_oid_to_text( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_contains_zero_byte returns one if the current contents of `cbs` contains | |
| /// a NUL byte and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_contains_zero_byte', | |
| ) | |
| external int CBS_contains_zero_byte( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_copy_bytes copies the next `len` bytes from `cbs` to `out` and advances | |
| /// `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBS_copy_bytes') | |
| external int CBS_copy_bytes( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ); | |
| /// CBS_get_any_asn1 sets `*out` to contain the next ASN.1 element from `*cbs` | |
| /// (not including tag and length bytes), sets `*out_tag` to the tag number, and | |
| /// advances `*cbs`. It returns one on success and zero on error. Either of `out` | |
| /// and `out_tag` may be NULL to ignore the value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS_ASN1_TAG>, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_any_asn1') | |
| external int CBS_get_any_asn1( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<CBS_ASN1_TAG> out_tag, | |
| ); | |
| /// CBS_get_any_asn1_element sets `*out` to contain the next ASN.1 element from | |
| /// `*cbs` (including header bytes) and advances `*cbs`. It sets `*out_tag` to | |
| /// the tag number and `*out_header_len` to the length of the ASN.1 header. Each | |
| /// of `out`, `out_tag`, and `out_header_len` may be NULL to ignore the value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS_ASN1_TAG>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_any_asn1_element') | |
| external int CBS_get_any_asn1_element( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<CBS_ASN1_TAG> out_tag, | |
| ffi.Pointer<ffi.Size> out_header_len, | |
| ); | |
| /// CBS_get_any_ber_asn1_element acts the same as `CBS_get_any_asn1_element` but | |
| /// also allows indefinite-length elements to be returned and does not enforce | |
| /// that lengths are minimal. It sets `*out_indefinite` to one if the length was | |
| /// indefinite and zero otherwise. If indefinite, `*out_header_len` and | |
| /// `CBS_len(out)` will be equal as only the header is returned (although this is | |
| /// also true for empty elements so `*out_indefinite` should be checked). If | |
| /// `out_ber_found` is not NULL then it is set to one if any case of invalid DER | |
| /// but valid BER is found, and to zero otherwise. | |
| /// | |
| /// This function will not successfully parse an end-of-contents (EOC) as an | |
| /// element. Callers parsing indefinite-length encoding must check for EOC | |
| /// separately. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS_ASN1_TAG>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_any_ber_asn1_element') | |
| external int CBS_get_any_ber_asn1_element( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<CBS_ASN1_TAG> out_tag, | |
| ffi.Pointer<ffi.Size> out_header_len, | |
| ffi.Pointer<ffi.Int> out_ber_found, | |
| ffi.Pointer<ffi.Int> out_indefinite, | |
| ); | |
| /// CBS_get_asn1 sets `*out` to the contents of DER-encoded, ASN.1 element (not | |
| /// including tag and length bytes) and advances `cbs` over it. The ASN.1 | |
| /// element must match `tag_value`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBS_get_asn1', | |
| ) | |
| external int CBS_get_asn1( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| int tag_value, | |
| ); | |
| /// CBS_get_asn1_bool gets an ASN.1 BOOLEAN from `cbs` and sets `*out` to zero | |
| /// or one based on its value. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_CBS_get_asn1_bool', | |
| ) | |
| external int CBS_get_asn1_bool( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Int> out, | |
| ); | |
| /// CBS_get_asn1_element acts like `CBS_get_asn1` but `out` will include the | |
| /// ASN.1 header bytes too. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBS_get_asn1_element', | |
| ) | |
| external int CBS_get_asn1_element( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| int tag_value, | |
| ); | |
| /// CBS_get_asn1_int64 gets an ASN.1 INTEGER from `cbs` using `CBS_get_asn1` | |
| /// and sets `*out` to its value. It returns one on success and zero on error, | |
| /// where error includes the integer being too large to represent in 64 bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Int64>)>( | |
| symbol: 'bssl_dart_CBS_get_asn1_int64', | |
| ) | |
| external int CBS_get_asn1_int64( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Int64> out, | |
| ); | |
| /// CBS_get_asn1_int64_with_tag gets an ASN.1 INTEGER from `cbs` using | |
| /// `CBS_get_asn1` and sets `*out` to its value. `tag` is used to handle to | |
| /// handle implicitly tagged INTEGER fields. It returns one on success and zero | |
| /// on error, where error includes the integer being too large to represent in 64 | |
| /// bits. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Int64>, CBS_ASN1_TAG) | |
| >(symbol: 'bssl_dart_CBS_get_asn1_int64_with_tag') | |
| external int CBS_get_asn1_int64_with_tag( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Int64> out, | |
| int tag, | |
| ); | |
| /// CBS_get_asn1_oid_component gets a single OID component from `cbs`. On | |
| /// success, it sets `*out` to the value, advances `cbs` past the component, and | |
| /// returns one. If the input does not contain a valid OID component or if the | |
| /// OID component is bigger than `uint64_t`, it returns zero. | |
| /// | |
| /// Specifically, this decodes a non-empty, minimal-width, base-128, big-endian | |
| /// integer. The high bit of each byte is set for continuation bytes and unset | |
| /// for the final byte. This encoding is also used for DER tag numbers 31 and up. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_asn1_oid_component', | |
| ) | |
| external int CBS_get_asn1_oid_component( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_asn1_uint64 gets an ASN.1 INTEGER from `cbs` using `CBS_get_asn1` | |
| /// and sets `*out` to its value. It returns one on success and zero on error, | |
| /// where error includes the integer being negative, or too large to represent | |
| /// in 64 bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_asn1_uint64', | |
| ) | |
| external int CBS_get_asn1_uint64( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_asn1_uint64_with_tag gets an ASN.1 INTEGER from `cbs` using | |
| /// `CBS_get_asn1` and sets `*out` to its value. `tag` is used to handle to | |
| /// handle implicitly tagged INTEGER fields. It returns one on success and zero | |
| /// on error, where error includes the integer being negative, or too large to | |
| /// represent in 64 bits. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>, CBS_ASN1_TAG) | |
| >(symbol: 'bssl_dart_CBS_get_asn1_uint64_with_tag') | |
| external int CBS_get_asn1_uint64_with_tag( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| int tag, | |
| ); | |
| /// CBS_get_bytes sets `*out` to the next `len` bytes from `cbs` and advances | |
| /// `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBS_get_bytes', | |
| ) | |
| external int CBS_get_bytes( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| int len, | |
| ); | |
| /// CBS_get_last_u8 sets `*out` to the last uint8_t from `cbs` and shortens | |
| /// `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_CBS_get_last_u8', | |
| ) | |
| external int CBS_get_last_u8( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_latin1', | |
| ) | |
| external int CBS_get_latin1( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_get_optional_asn1 gets an optional explicitly-tagged element from `cbs` | |
| /// tagged with `tag` and sets `*out` to its contents, or ignores it if `out` is | |
| /// NULL. If present and if `out_present` is not NULL, it sets `*out_present` to | |
| /// one, otherwise zero. It returns one on success, whether or not the element | |
| /// was present, and zero on decode failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<ffi.Int>, | |
| CBS_ASN1_TAG, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_optional_asn1') | |
| external int CBS_get_optional_asn1( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<ffi.Int> out_present, | |
| int tag, | |
| ); | |
| /// CBS_get_optional_asn1_bool gets an optional, explicitly-tagged BOOLEAN from | |
| /// `cbs`. If present, it sets `*out` to either zero or one, based on the | |
| /// boolean. Otherwise, it sets `*out` to `default_value`. It returns one on | |
| /// success, whether or not the element was present, and zero on decode | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<ffi.Int>, | |
| CBS_ASN1_TAG, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_optional_asn1_bool') | |
| external int CBS_get_optional_asn1_bool( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Int> out, | |
| int tag, | |
| int default_value, | |
| ); | |
| /// CBS_get_optional_asn1_octet_string gets an optional | |
| /// explicitly-tagged OCTET STRING from `cbs`. If present, it sets | |
| /// `*out` to the string and `*out_present` to one. Otherwise, it sets | |
| /// `*out` to empty and `*out_present` to zero. `out_present` may be | |
| /// NULL. It returns one on success, whether or not the element was | |
| /// present, and zero on decode failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<ffi.Int>, | |
| CBS_ASN1_TAG, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_optional_asn1_octet_string') | |
| external int CBS_get_optional_asn1_octet_string( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<ffi.Int> out_present, | |
| int tag, | |
| ); | |
| /// CBS_get_optional_asn1_uint64 gets an optional explicitly-tagged | |
| /// INTEGER from `cbs`. If present, it sets `*out` to the | |
| /// value. Otherwise, it sets `*out` to `default_value`. It returns one | |
| /// on success, whether or not the element was present, and zero on | |
| /// decode failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<ffi.Uint64>, | |
| CBS_ASN1_TAG, | |
| ffi.Uint64, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_get_optional_asn1_uint64') | |
| external int CBS_get_optional_asn1_uint64( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| int tag, | |
| int default_value, | |
| ); | |
| /// CBS_get_u16 sets `*out` to the next, big-endian uint16_t from `cbs` and | |
| /// advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint16>)>( | |
| symbol: 'bssl_dart_CBS_get_u16', | |
| ) | |
| external int CBS_get_u16( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint16> out, | |
| ); | |
| /// CBS_get_u16_length_prefixed sets `*out` to the contents of a 16-bit, | |
| /// big-endian, length-prefixed value from `cbs` and advances `cbs` over it. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_get_u16_length_prefixed', | |
| ) | |
| external int CBS_get_u16_length_prefixed( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ); | |
| /// CBS_get_u16le sets `*out` to the next, little-endian uint16_t from `cbs` and | |
| /// advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint16>)>( | |
| symbol: 'bssl_dart_CBS_get_u16le', | |
| ) | |
| external int CBS_get_u16le( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint16> out, | |
| ); | |
| /// CBS_get_u24 sets `*out` to the next, big-endian 24-bit value from `cbs` and | |
| /// advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_u24', | |
| ) | |
| external int CBS_get_u24( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_get_u24_length_prefixed sets `*out` to the contents of a 24-bit, | |
| /// big-endian, length-prefixed value from `cbs` and advances `cbs` over it. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_get_u24_length_prefixed', | |
| ) | |
| external int CBS_get_u24_length_prefixed( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ); | |
| /// CBS_get_u32 sets `*out` to the next, big-endian uint32_t value from `cbs` | |
| /// and advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_u32', | |
| ) | |
| external int CBS_get_u32( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_get_u32le sets `*out` to the next, little-endian uint32_t value from | |
| /// `cbs` and advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_u32le', | |
| ) | |
| external int CBS_get_u32le( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_get_u48 sets `*out` to the next, big-endian 48-bit value from `cbs` and | |
| /// advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_u48', | |
| ) | |
| external int CBS_get_u48( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_u64 sets `*out` to the next, big-endian uint64_t value from `cbs` | |
| /// and advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_u64', | |
| ) | |
| external int CBS_get_u64( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_u64_decimal reads a decimal integer from `cbs` and writes it to | |
| /// `*out`. It stops reading at the end of the string, or the first non-digit | |
| /// character. It returns one on success and zero on error. This function behaves | |
| /// analogously to `strtoul` except it does not accept empty inputs, leading | |
| /// zeros, or negative values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_u64_decimal', | |
| ) | |
| external int CBS_get_u64_decimal( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_u64le sets `*out` to the next, little-endian uint64_t value from | |
| /// `cbs` and advances `cbs`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint64>)>( | |
| symbol: 'bssl_dart_CBS_get_u64le', | |
| ) | |
| external int CBS_get_u64le( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint64> out, | |
| ); | |
| /// CBS_get_u8 sets `*out` to the next uint8_t from `cbs` and advances `cbs`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_CBS_get_u8', | |
| ) | |
| external int CBS_get_u8( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ); | |
| /// CBS_get_u8_length_prefixed sets `*out` to the contents of an 8-bit, | |
| /// length-prefixed value from `cbs` and advances `cbs` over it. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_get_u8_length_prefixed', | |
| ) | |
| external int CBS_get_u8_length_prefixed( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_ucs2_be', | |
| ) | |
| external int CBS_get_ucs2_be( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_get_until_first finds the first instance of `c` in `cbs`. If found, it | |
| /// sets `*out` to the text before the match, advances `cbs` over it, and returns | |
| /// one. Otherwise, it returns zero and leaves `cbs` unmodified. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, ffi.Uint8)>( | |
| symbol: 'bssl_dart_CBS_get_until_first', | |
| ) | |
| external int CBS_get_until_first( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| int c, | |
| ); | |
| /// CBS_get_until_first_not_of finds the first byte in `cbs` that does not match | |
| /// any of the characters in `chars`, which is a NUL-terminated C string. If | |
| /// found, it sets `*out` to the text before the match, advances `cbs` over it, | |
| /// and returns one. Otherwise, it returns zero and leaves `cbs` unmodified. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_CBS_get_until_first_not_of') | |
| external int CBS_get_until_first_not_of( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<ffi.Char> chars, | |
| ); | |
| /// CBS_get_until_first_of finds the first byte in `cbs` matching one of the | |
| /// characters in `chars`, which is a NUL-terminated C string. If found, it sets | |
| /// `*out` to the text before the match, advances `cbs` over it, and returns one. | |
| /// Otherwise, it returns zero and leaves `cbs` unmodified. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<CBS>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_CBS_get_until_first_of') | |
| external int CBS_get_until_first_of( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CBS> out, | |
| ffi.Pointer<ffi.Char> chars, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_utf32_be', | |
| ) | |
| external int CBS_get_utf32_be( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// The following functions read one Unicode code point from `cbs` with the | |
| /// corresponding encoding and store it in `*out`. They return one on success and | |
| /// zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint32>)>( | |
| symbol: 'bssl_dart_CBS_get_utf8', | |
| ) | |
| external int CBS_get_utf8( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint32> out, | |
| ); | |
| /// CBS_is_unsigned_asn1_integer returns one if `cbs` is a valid non-negative | |
| /// ASN.1 INTEGER body and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_is_unsigned_asn1_integer', | |
| ) | |
| external int CBS_is_unsigned_asn1_integer( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_is_valid_asn1_bitstring returns one if `cbs` is a valid ASN.1 BIT STRING | |
| /// body and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_is_valid_asn1_bitstring', | |
| ) | |
| external int CBS_is_valid_asn1_bitstring( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_is_valid_asn1_integer returns one if `cbs` is a valid ASN.1 INTEGER, | |
| /// body and zero otherwise. On success, if `out_is_negative` is non-NULL, | |
| /// `*out_is_negative` will be set to one if `cbs` is negative and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_CBS_is_valid_asn1_integer', | |
| ) | |
| external int CBS_is_valid_asn1_integer( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Int> out_is_negative, | |
| ); | |
| /// CBS_is_valid_asn1_oid returns one if `cbs` is a valid DER-encoded ASN.1 | |
| /// OBJECT IDENTIFIER contents (not including the element framing) and zero | |
| /// otherwise. This function tolerates arbitrarily large OID components. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_is_valid_asn1_oid', | |
| ) | |
| external int CBS_is_valid_asn1_oid( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_is_valid_asn1_relative_oid returns one if `cbs` is a valid DER-encoded | |
| /// ASN.1 RELATIVE-OID contents (not including the element framing) and zero | |
| /// otherwise. This function tolerates arbitrarily large OID components. | |
| /// | |
| /// (This is actually the same as `CBS_is_valid_asn1_oid`, but is also exposed | |
| /// under the relative_oid name for API symmetry.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_is_valid_asn1_relative_oid', | |
| ) | |
| external int CBS_is_valid_asn1_relative_oid( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_is_valid_asn1_set_of returns one if `cbs` is an ASN.1 SET OF contents | |
| /// (not including the element framing) with members sorted in nondescending | |
| /// order according to DER rules, and zero otherwise. This function does not | |
| /// parse the members and does not check that they are of any particular type. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_is_valid_asn1_set_of', | |
| ) | |
| external int CBS_is_valid_asn1_set_of( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_mem_equal compares the current contents of `cbs` with the `len` bytes | |
| /// starting at `data`. If they're equal, it returns one, otherwise zero. If the | |
| /// lengths match, it uses a constant-time comparison. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_CBS_mem_equal') | |
| external int CBS_mem_equal( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| /// CBS_parse_generalized_time returns one if `cbs` is a valid DER-encoded, ASN.1 | |
| /// GeneralizedTime body within the limitations imposed by RFC 5280, or zero | |
| /// otherwise. If `allow_timezone_offset` is non-zero, four-digit timezone | |
| /// offsets, which would not be allowed by DER, are permitted. On success, if | |
| /// `out_tm` is non-NULL, `*out_tm` will be zeroed, and then set to the | |
| /// corresponding time in UTC. This function does not compute `out_tm->tm_wday` | |
| /// or `out_tm->tm_yday`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<tm>, ffi.Int)>( | |
| symbol: 'bssl_dart_CBS_parse_generalized_time', | |
| ) | |
| external int CBS_parse_generalized_time( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<tm> out_tm, | |
| int allow_timezone_offset, | |
| ); | |
| /// CBS_parse_utc_time returns one if `cbs` is a valid DER-encoded, ASN.1 | |
| /// UTCTime body within the limitations imposed by RFC 5280, or zero otherwise. | |
| /// If `allow_timezone_offset` is non-zero, four-digit timezone offsets, which | |
| /// would not be allowed by DER, are permitted. On success, if `out_tm` is | |
| /// non-NULL, `*out_tm` will be zeroed, and then set to the corresponding time | |
| /// in UTC. This function does not compute `out_tm->tm_wday` or | |
| /// `out_tm->tm_yday`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<tm>, ffi.Int)>( | |
| symbol: 'bssl_dart_CBS_parse_utc_time', | |
| ) | |
| external int CBS_parse_utc_time( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<tm> out_tm, | |
| int allow_timezone_offset, | |
| ); | |
| /// CBS_peek_any_asn1_tag looks ahead at the next ASN.1 tag and returns it. If a | |
| /// tag could not be parsed, it returns zero, which is never a valid tag. Note: | |
| /// if it returns non-zero, `CBS_get_asn1` may still fail if the rest of the | |
| /// element is malformed. | |
| @meta.RecordUse() | |
| @ffi.Native<CBS_ASN1_TAG Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CBS_peek_any_asn1_tag', | |
| ) | |
| external int CBS_peek_any_asn1_tag( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// CBS_peek_asn1_tag looks ahead at the next ASN.1 tag and returns one if the | |
| /// next ASN.1 element on `cbs` would have tag `tag_value`. If `cbs` is empty or | |
| /// the tag does not match, it returns zero. Note: if it returns one, | |
| /// `CBS_get_asn1` may still fail if the rest of the element is malformed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, CBS_ASN1_TAG)>( | |
| symbol: 'bssl_dart_CBS_peek_asn1_tag', | |
| ) | |
| external int CBS_peek_asn1_tag( | |
| ffi.Pointer<CBS> cbs, | |
| int tag_value, | |
| ); | |
| /// CBS_skip advances `cbs` by `len` bytes. It returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>, ffi.Size)>( | |
| symbol: 'bssl_dart_CBS_skip', | |
| ) | |
| external int CBS_skip( | |
| ffi.Pointer<CBS> cbs, | |
| int len, | |
| ); | |
| /// CBS_stow copies the current contents of `cbs` into `*out_ptr` and | |
| /// `*out_len`. If `*out_ptr` is not NULL, the contents are freed with | |
| /// OPENSSL_free. It returns one on success and zero on allocation failure. On | |
| /// success, `*out_ptr` should be freed with OPENSSL_free. If `cbs` is empty, | |
| /// `*out_ptr` will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_CBS_stow') | |
| external int CBS_stow( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_ptr, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// CBS_strdup copies the current contents of `cbs` into `*out_ptr` as a | |
| /// NUL-terminated C string. If `*out_ptr` is not NULL, the contents are freed | |
| /// with OPENSSL_free. It returns one on success and zero on allocation | |
| /// failure. On success, `*out_ptr` should be freed with OPENSSL_free. | |
| /// | |
| /// NOTE: If `cbs` contains NUL bytes, the string will be truncated. Call | |
| /// `CBS_contains_zero_byte(cbs)` to check for NUL bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBS>, ffi.Pointer<ffi.Pointer<ffi.Char>>) | |
| >(symbol: 'bssl_dart_CBS_strdup') | |
| external int CBS_strdup( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_ptr, | |
| ); | |
| /// CERTIFICATEPOLICIES_free releases memory associated with `policies`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CERTIFICATEPOLICIES>)>( | |
| symbol: 'bssl_dart_CERTIFICATEPOLICIES_free', | |
| ) | |
| external void CERTIFICATEPOLICIES_free( | |
| ffi.Pointer<CERTIFICATEPOLICIES> policies, | |
| ); | |
| /// CERTIFICATEPOLICIES_new returns a newly-allocated, empty | |
| /// `CERTIFICATEPOLICIES` object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<CERTIFICATEPOLICIES> Function()>( | |
| symbol: 'bssl_dart_CERTIFICATEPOLICIES_new', | |
| ) | |
| external ffi.Pointer<CERTIFICATEPOLICIES> CERTIFICATEPOLICIES_new(); | |
| /// CONF_modules_free does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_CONF_modules_free') | |
| external void CONF_modules_free(); | |
| /// CONF_modules_load_file returns one. BoringSSL is defined to have no config | |
| /// file options, thus loading from `filename` always succeeds by doing nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_CONF_modules_load_file') | |
| external int CONF_modules_load_file( | |
| ffi.Pointer<ffi.Char> filename, | |
| ffi.Pointer<ffi.Char> appname, | |
| int flags, | |
| ); | |
| /// CONF_modules_unload does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Int)>(symbol: 'bssl_dart_CONF_modules_unload') | |
| external void CONF_modules_unload( | |
| int all, | |
| ); | |
| /// CPACE_CTX_free frees `ctx` and all the resources that it has allocated. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CPACE_CTX>)>( | |
| symbol: 'bssl_dart_CPACE_CTX_free', | |
| ) | |
| external void CPACE_CTX_free( | |
| ffi.Pointer<CPACE_CTX> ctx, | |
| ); | |
| /// CPACE_CTX_new returns a newly-allocated `CPACE_CTX` object that implements | |
| /// one side of the CPace protocol, or nullptr on error. This function implements | |
| /// CPACE-X25519-SHA512 in initiator-responder mode, acting as `role` and with | |
| /// `password` as the password-related string (PRS). | |
| /// | |
| /// `channel_id` and `session_id` are the channel identifier (CI) and session | |
| /// identifier (sid) values, respectively. Both values must match for the | |
| /// exchange to proceed. `assoc_data` is the cleartext associated data (ADa or | |
| /// ADb) to be sent to the peer. These values may be empty if not used. See | |
| /// Section 4.1 of draft-irtf-cfrg-cpace-21 for details. | |
| /// | |
| /// The application-level identities of each party in the protocol should be | |
| /// incorporated into either `channel_id` or each party's respective `assoc_data` | |
| /// values. See Section 10.1 of draft-irtf-cfrg-cpace-21. | |
| /// | |
| /// Once a `CPACE_CTX` is successfully created, the caller should call | |
| /// `CPACE_generate_msg` to generate the message to send to the peer. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CPACE_CTX> Function( | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_CPACE_CTX_new') | |
| external ffi.Pointer<CPACE_CTX> CPACE_CTX_new( | |
| int role, | |
| ffi.Pointer<ffi.Uint8> password, | |
| int password_len, | |
| ffi.Pointer<ffi.Uint8> channel_id, | |
| int channel_id_len, | |
| ffi.Pointer<ffi.Uint8> assoc_data, | |
| int assoc_data_len, | |
| ffi.Pointer<ffi.Uint8> session_id, | |
| int session_id_len, | |
| ); | |
| /// CPACE_generate_msg generates the message to be sent to the peer. On success, | |
| /// it writes the message to `out_msg` and returns one. Otherwise, it returns | |
| /// zero. `ctx` must have been allocated by `CPACE_CTX_new`, with no subsequent | |
| /// functions called on it. | |
| /// | |
| /// `out_msg` only contains the Ya or Yb value. It does not include ADa or ADb. | |
| /// On success, the caller should separately send `out_msg` and their | |
| /// `assoc_data` value to the peer. It is the caller's responsibility to send | |
| /// `assoc_data` together with `out_msg`. After receiving the peer's reply, the | |
| /// caller should call `CPACE_process_msg` to complete the protocol. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CPACE_CTX>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_CPACE_generate_msg', | |
| ) | |
| external int CPACE_generate_msg( | |
| ffi.Pointer<CPACE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_msg, | |
| ); | |
| /// CPACE_process_msg processes `msg` and `peer_assoc_data` from the peer and | |
| /// computes the shared secret, or intermediate session key (ISK). On success, it | |
| /// writes the secret to `out_shared_secret` and returns one; it also writes a | |
| /// derived session ID if `out_sid` is not NULL. Otherwise, it returns zero. | |
| /// `ctx` must have successfully been passed to `CPACE_generate_msg`, with no | |
| /// subsequent functions called on it. | |
| /// | |
| /// `msg` should contain the peer's Ya or Yb value, and `peer_assoc_data` the | |
| /// peer's ADa or ADb value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CPACE_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_CPACE_process_msg') | |
| external int CPACE_process_msg( | |
| ffi.Pointer<CPACE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> in_msg, | |
| ffi.Pointer<ffi.Uint8> peer_assoc_data, | |
| int peer_assoc_data_len, | |
| ffi.Pointer<ffi.Uint8> shared_secret, | |
| ffi.Pointer<ffi.Uint8> sid_out, | |
| ); | |
| /// CRL_DIST_POINTS_free releases memory associated with `crldp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRL_DIST_POINTS>)>( | |
| symbol: 'bssl_dart_CRL_DIST_POINTS_free', | |
| ) | |
| external void CRL_DIST_POINTS_free( | |
| ffi.Pointer<CRL_DIST_POINTS> crldp, | |
| ); | |
| /// CRL_DIST_POINTS_new returns a newly-allocated, empty `CRL_DIST_POINTS` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<CRL_DIST_POINTS> Function()>( | |
| symbol: 'bssl_dart_CRL_DIST_POINTS_new', | |
| ) | |
| external ffi.Pointer<CRL_DIST_POINTS> CRL_DIST_POINTS_new(); | |
| /// CRYPTO_BUFFER_POOL_dup_ref increments the reference count of `pool` and | |
| /// returns the same handle. It does not mutate `pool` for thread-safety purposes | |
| /// and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> Function(ffi.Pointer<CRYPTO_BUFFER_POOL>) | |
| >(symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_dup_ref') | |
| external ffi.Pointer<CRYPTO_BUFFER_POOL> CRYPTO_BUFFER_POOL_dup_ref( | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_POOL_free decrements the reference count of `pool` and frees it | |
| /// if the reference count drops to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_BUFFER_POOL>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_free', | |
| ) | |
| external void CRYPTO_BUFFER_POOL_free( | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_POOL_new returns a freshly allocated `CRYPTO_BUFFER_POOL` or | |
| /// NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<CRYPTO_BUFFER_POOL> Function()>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_new', | |
| ) | |
| external ffi.Pointer<CRYPTO_BUFFER_POOL> CRYPTO_BUFFER_POOL_new(); | |
| /// CRYPTO_BUFFER_POOL_up_ref increments the reference count of `pool` and | |
| /// returns one. It does not mutate `pool` for thread-safety purposes and may be | |
| /// used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CRYPTO_BUFFER_POOL>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_up_ref', | |
| ) | |
| external int CRYPTO_BUFFER_POOL_up_ref( | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_alloc creates an unpooled `CRYPTO_BUFFER` of the given size and | |
| /// writes the underlying data pointer to `*out_data`. It returns NULL on error. | |
| /// | |
| /// After calling this function, `len` bytes of contents must be written to | |
| /// `out_data` before passing the returned pointer to any other BoringSSL | |
| /// functions. Once initialized, the `CRYPTO_BUFFER` should be treated as | |
| /// immutable. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRYPTO_BUFFER> Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_BUFFER_alloc') | |
| external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_alloc( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| int len, | |
| ); | |
| /// CRYPTO_BUFFER_data returns a pointer to the data contained in `buf`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_data', | |
| ) | |
| external ffi.Pointer<ffi.Uint8> CRYPTO_BUFFER_data( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// CRYPTO_BUFFER_dup_ref increments the reference count of `buf` and returns | |
| /// `buf`. The caller must call `CRYPTO_BUFFER_free` on the result to release the | |
| /// reference. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<CRYPTO_BUFFER> Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_dup_ref', | |
| ) | |
| external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_dup_ref( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// CRYPTO_BUFFER_free decrements the reference count of `buf`. If there are no | |
| /// other references, or if the only remaining reference is from a pool, then | |
| /// `buf` will be freed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_free', | |
| ) | |
| external void CRYPTO_BUFFER_free( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// CRYPTO_BUFFER_init_CBS initialises `out` to point at the data from `buf`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_BUFFER>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_init_CBS', | |
| ) | |
| external void CRYPTO_BUFFER_init_CBS( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ffi.Pointer<CBS> out, | |
| ); | |
| /// CRYPTO_BUFFER_len returns the length, in bytes, of the data contained in | |
| /// `buf`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_len', | |
| ) | |
| external int CRYPTO_BUFFER_len( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// CRYPTO_BUFFER_new returns a `CRYPTO_BUFFER` containing a copy of `data`, or | |
| /// else NULL on error. If `pool` is not NULL then the returned value may be a | |
| /// reference to a previously existing `CRYPTO_BUFFER` that contained the same | |
| /// data. Otherwise, the returned, fresh `CRYPTO_BUFFER` will be added to the | |
| /// pool. | |
| /// | |
| /// There is no requirement that `pool` outlive the `CRYPTO_BUFFER`, or vice | |
| /// versa. If the `CRYPTO_BUFFER` is released first, it will be removed from | |
| /// `pool`. If `pool` is released first, the `CRYPTO_BUFFER` remains valid. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRYPTO_BUFFER> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL>, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_BUFFER_new') | |
| external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_new( | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_new_from_CBS acts the same as `CRYPTO_BUFFER_new`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRYPTO_BUFFER> Function( | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL>, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_BUFFER_new_from_CBS') | |
| external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_new_from_CBS( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_new_from_static_data_unsafe behaves like `CRYPTO_BUFFER_new` | |
| /// but does not copy `data`. `data` must be immutable and last for the lifetime | |
| /// of the address space. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRYPTO_BUFFER> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL>, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_BUFFER_new_from_static_data_unsafe') | |
| external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_new_from_static_data_unsafe( | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// CRYPTO_BUFFER_up_ref increments the reference count of `buf` and returns | |
| /// one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_CRYPTO_BUFFER_up_ref', | |
| ) | |
| external int CRYPTO_BUFFER_up_ref( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// CRYPTO_THREADID_current does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_THREADID>)>( | |
| symbol: 'bssl_dart_CRYPTO_THREADID_current', | |
| ) | |
| external void CRYPTO_THREADID_current( | |
| ffi.Pointer<CRYPTO_THREADID> id, | |
| ); | |
| /// CRYPTO_THREADID_set_callback returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<CRYPTO_THREADID> threadid) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_THREADID_set_callback') | |
| external int CRYPTO_THREADID_set_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CRYPTO_THREADID> threadid)> | |
| > | |
| threadid_func, | |
| ); | |
| /// CRYPTO_THREADID_set_numeric does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_THREADID>, ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_CRYPTO_THREADID_set_numeric', | |
| ) | |
| external void CRYPTO_THREADID_set_numeric( | |
| ffi.Pointer<CRYPTO_THREADID> id, | |
| int val, | |
| ); | |
| /// CRYPTO_THREADID_set_pointer does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<CRYPTO_THREADID>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_CRYPTO_THREADID_set_pointer') | |
| external void CRYPTO_THREADID_set_pointer( | |
| ffi.Pointer<CRYPTO_THREADID> id, | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| /// CRYPTO_cleanup_all_ex_data does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_CRYPTO_cleanup_all_ex_data') | |
| external void CRYPTO_cleanup_all_ex_data(); | |
| /// CRYPTO_fips_186_2_prf derives `out_len` bytes from `xkey` using the PRF | |
| /// defined in FIPS 186-2, Appendix 3.1, with change notice 1 applied. The b | |
| /// parameter is 160 and seed, XKEY, is also 160 bits. The optional XSEED user | |
| /// input is all zeros. | |
| /// | |
| /// The PRF generates a sequence of 320-bit numbers. Each number is encoded as a | |
| /// 40-byte string in big-endian and then concatenated to form `out`. If | |
| /// `out_len` is not a multiple of 40, the result is truncated. This matches the | |
| /// construction used in Section 7 of RFC 4186 and Section 7 of RFC 4187. | |
| /// | |
| /// This PRF is based on SHA-1, a weak hash function, and should not be used | |
| /// in new protocols. It is provided for compatibility with some legacy EAP | |
| /// methods. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<ffi.Uint8>) | |
| >(symbol: 'bssl_dart_CRYPTO_fips_186_2_prf') | |
| external void CRYPTO_fips_186_2_prf( | |
| ffi.Pointer<ffi.Uint8> out, | |
| int out_len, | |
| ffi.Pointer<ffi.Uint8> xkey, | |
| ); | |
| /// CRYPTO_free calls `OPENSSL_free`. `file` and `line` are ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_CRYPTO_free') | |
| external void CRYPTO_free( | |
| ffi.Pointer<ffi.Void> ptr, | |
| ffi.Pointer<ffi.Char> file, | |
| int line, | |
| ); | |
| /// CRYPTO_get_dynlock_create_callback returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<CRYPTO_dynlock_value> Function(ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| Function() | |
| >(symbol: 'bssl_dart_CRYPTO_get_dynlock_create_callback') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<CRYPTO_dynlock_value> Function(ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| CRYPTO_get_dynlock_create_callback(); | |
| /// CRYPTO_get_dynlock_destroy_callback returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<CRYPTO_dynlock_value>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| > | |
| > | |
| Function() | |
| >(symbol: 'bssl_dart_CRYPTO_get_dynlock_destroy_callback') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<CRYPTO_dynlock_value>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| > | |
| > | |
| CRYPTO_get_dynlock_destroy_callback(); | |
| /// CRYPTO_get_dynlock_lock_callback returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int, | |
| ffi.Pointer<CRYPTO_dynlock_value>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| > | |
| > | |
| Function() | |
| >(symbol: 'bssl_dart_CRYPTO_get_dynlock_lock_callback') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int, | |
| ffi.Pointer<CRYPTO_dynlock_value>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| > | |
| > | |
| CRYPTO_get_dynlock_lock_callback(); | |
| /// CRYPTO_get_lock_name returns a fixed, dummy string. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_CRYPTO_get_lock_name', | |
| ) | |
| external ffi.Pointer<ffi.Char> CRYPTO_get_lock_name( | |
| int lock_num, | |
| ); | |
| /// CRYPTO_get_locking_callback returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Int, ffi.Int, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| Function() | |
| >(symbol: 'bssl_dart_CRYPTO_get_locking_callback') | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Int, ffi.Int, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| CRYPTO_get_locking_callback(); | |
| /// CRYPTO_has_asm returns one unless BoringSSL was built with OPENSSL_NO_ASM, | |
| /// in which case it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_CRYPTO_has_asm') | |
| external int CRYPTO_has_asm(); | |
| /// CRYPTO_is_confidential_build returns one if the linked version of BoringSSL | |
| /// has been built with the BORINGSSL_CONFIDENTIAL define and zero otherwise. | |
| /// | |
| /// This is used by some consumers to identify whether they are using an | |
| /// internal version of BoringSSL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>( | |
| symbol: 'bssl_dart_CRYPTO_is_confidential_build', | |
| ) | |
| external int CRYPTO_is_confidential_build(); | |
| /// CRYPTO_library_init does nothing. Historically, it was needed in some build | |
| /// configurations to initialization the library. This is no longer necessary. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_CRYPTO_library_init') | |
| external void CRYPTO_library_init(); | |
| /// CRYPTO_malloc calls `OPENSSL_malloc`. `file` and `line` are ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Size, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_CRYPTO_malloc') | |
| external ffi.Pointer<ffi.Void> CRYPTO_malloc( | |
| int size, | |
| ffi.Pointer<ffi.Char> file, | |
| int line, | |
| ); | |
| /// CRYPTO_malloc_init returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_CRYPTO_malloc_init') | |
| external int CRYPTO_malloc_init(); | |
| /// CRYPTO_memcmp returns zero iff the `len` bytes at `a` and `b` are equal. It | |
| /// takes an amount of time dependent on `len`, but independent of the contents | |
| /// of `a` and `b`. Unlike memcmp, it cannot be used to put elements into a | |
| /// defined order as the return value when a != b is undefined, other than to be | |
| /// non-zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_CRYPTO_memcmp') | |
| external int CRYPTO_memcmp( | |
| ffi.Pointer<ffi.Void> a, | |
| ffi.Pointer<ffi.Void> b, | |
| int len, | |
| ); | |
| /// CRYPTO_num_locks returns one. (This is non-zero that callers who allocate | |
| /// sizeof(lock) times this value don't get zero and then fail because malloc(0) | |
| /// returned NULL.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_CRYPTO_num_locks') | |
| external int CRYPTO_num_locks(); | |
| /// CRYPTO_pre_sandbox_init initializes the crypto library, pre-acquiring some | |
| /// unusual resources to aid running in sandboxed environments. It is safe to | |
| /// call this function multiple times and concurrently from multiple threads. | |
| /// | |
| /// For more details on using BoringSSL in a sandboxed environment, see | |
| /// SANDBOXING.md in the source tree. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_CRYPTO_pre_sandbox_init') | |
| external void CRYPTO_pre_sandbox_init(); | |
| /// CRYPTO_realloc calls `OPENSSL_realloc`. `file` and `line` are ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_realloc') | |
| external ffi.Pointer<ffi.Void> CRYPTO_realloc( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int new_size, | |
| ffi.Pointer<ffi.Char> file, | |
| int line, | |
| ); | |
| /// CRYPTO_secure_malloc_init returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Size, ffi.Size)>( | |
| symbol: 'bssl_dart_CRYPTO_secure_malloc_init', | |
| ) | |
| external int CRYPTO_secure_malloc_init( | |
| int size, | |
| int min_size, | |
| ); | |
| /// CRYPTO_secure_malloc_initialized returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>( | |
| symbol: 'bssl_dart_CRYPTO_secure_malloc_initialized', | |
| ) | |
| external int CRYPTO_secure_malloc_initialized(); | |
| /// CRYPTO_secure_used returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function()>(symbol: 'bssl_dart_CRYPTO_secure_used') | |
| external int CRYPTO_secure_used(); | |
| /// CRYPTO_set_add_lock_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int> num, | |
| ffi.Int amount, | |
| ffi.Int lock_num, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_add_lock_callback') | |
| external void CRYPTO_set_add_lock_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int> num, | |
| ffi.Int amount, | |
| ffi.Int lock_num, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| > | |
| func, | |
| ); | |
| /// CRYPTO_set_dynlock_create_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<CRYPTO_dynlock_value> Function( | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_dynlock_create_callback') | |
| external void CRYPTO_set_dynlock_create_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<CRYPTO_dynlock_value> Function( | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| > | |
| dyn_create_function, | |
| ); | |
| /// CRYPTO_set_dynlock_destroy_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<CRYPTO_dynlock_value> l, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_dynlock_destroy_callback') | |
| external void CRYPTO_set_dynlock_destroy_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<CRYPTO_dynlock_value> l, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| > | |
| dyn_destroy_function, | |
| ); | |
| /// CRYPTO_set_dynlock_lock_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int mode, | |
| ffi.Pointer<CRYPTO_dynlock_value> l, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_dynlock_lock_callback') | |
| external void CRYPTO_set_dynlock_lock_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int mode, | |
| ffi.Pointer<CRYPTO_dynlock_value> l, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| > | |
| dyn_lock_function, | |
| ); | |
| /// CRYPTO_set_id_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.NativeFunction<ffi.UnsignedLong Function()>>, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_id_callback') | |
| external void CRYPTO_set_id_callback( | |
| ffi.Pointer<ffi.NativeFunction<ffi.UnsignedLong Function()>> func, | |
| ); | |
| /// CRYPTO_set_locking_callback does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int mode, | |
| ffi.Int lock_num, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_CRYPTO_set_locking_callback') | |
| external void CRYPTO_set_locking_callback( | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Int mode, | |
| ffi.Int lock_num, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Int line, | |
| ) | |
| > | |
| > | |
| func, | |
| ); | |
| /// DH_bits returns the size of `dh`'s group modulus, in bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_bits', | |
| ) | |
| external int DH_bits( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_check checks the suitability of `dh` as a Diffie-Hellman group. and sets | |
| /// `DH_CHECK_*` flags in `*out_flags` if it finds any errors. It returns one if | |
| /// `*out_flags` was successfully set and zero on error. | |
| /// | |
| /// Note: these checks may be quite computationally expensive. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DH>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_DH_check', | |
| ) | |
| external int DH_check( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<ffi.Int> out_flags, | |
| ); | |
| /// DH_check_pub_key checks the suitability of `pub_key` as a public key for the | |
| /// DH group in `dh` and sets `DH_CHECK_PUBKEY_*` flags in `*out_flags` if it | |
| /// finds any errors. It returns one if `*out_flags` was successfully set and | |
| /// zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DH>, ffi.Pointer<BIGNUM>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_DH_check_pub_key') | |
| external int DH_check_pub_key( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<BIGNUM> pub_key, | |
| ffi.Pointer<ffi.Int> out_flags, | |
| ); | |
| /// DH_compute_key behaves like `DH_compute_key_padded` but, contrary to PKCS #3, | |
| /// returns a variable-length shared key with leading zeros. It returns the | |
| /// number of bytes written, or a negative number on error. `out` must have | |
| /// `DH_size` bytes of space. | |
| /// | |
| /// WARNING: this differs from the usual BoringSSL return-value convention. | |
| /// | |
| /// Note this function's running time and memory access pattern leaks information | |
| /// about the shared secret. Particularly if `dh` is reused, this may result in | |
| /// side channel attacks such as https://raccoon-attack.com/. | |
| /// | |
| /// `DH_compute_key_padded` is the preferred variant and avoids the above | |
| /// attacks. However, the two functions are not drop-in replacements for each | |
| /// other. Using a different variant than the application expects will result in | |
| /// sporadic key mismatches. | |
| /// | |
| /// Callers that expect a fixed-width secret should use `DH_compute_key_padded` | |
| /// instead. Callers that use either function should migrate to a modern | |
| /// primitive such as X25519 or ECDH with P-256 instead. | |
| /// | |
| /// This function does not mutate `dh` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<BIGNUM>, ffi.Pointer<DH>) | |
| >(symbol: 'bssl_dart_DH_compute_key') | |
| external int DH_compute_key( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<BIGNUM> peers_key, | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_compute_key_hashed calculates the shared key between `dh` and `peers_key` | |
| /// and hashes it with the given `digest`. If the hash output is less than | |
| /// `max_out_len` bytes then it writes the hash output to `out` and sets | |
| /// `*out_len` to the number of bytes written. Otherwise it signals an error. It | |
| /// returns one on success or zero on error. | |
| /// | |
| /// NOTE: this follows the usual BoringSSL return-value convention, but that's | |
| /// different from `DH_compute_key` and `DH_compute_key_padded`. | |
| /// | |
| /// This function does not mutate `dh` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<DH>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_DH_compute_key_hashed') | |
| external int DH_compute_key_hashed( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<BIGNUM> peers_key, | |
| ffi.Pointer<EVP_MD> digest, | |
| ); | |
| /// DH_compute_key_padded calculates the shared key between `dh` and `peers_key` | |
| /// and writes it as a big-endian integer into `out`, padded up to `DH_size` | |
| /// bytes. It returns the number of bytes written, which is always `DH_size`, or | |
| /// a negative number on error. `out` must have `DH_size` bytes of space. | |
| /// | |
| /// WARNING: this differs from the usual BoringSSL return-value convention. | |
| /// | |
| /// Note this function differs from `DH_compute_key` in that it preserves leading | |
| /// zeros in the secret. This function is the preferred variant. It matches PKCS | |
| /// #3 and avoids some side channel attacks. However, the two functions are not | |
| /// drop-in replacements for each other. Using a different variant than the | |
| /// application expects will result in sporadic key mismatches. | |
| /// | |
| /// Callers that expect a fixed-width secret should use this function over | |
| /// `DH_compute_key`. Callers that use either function should migrate to a modern | |
| /// primitive such as X25519 or ECDH with P-256 instead. | |
| /// | |
| /// This function does not mutate `dh` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<BIGNUM>, ffi.Pointer<DH>) | |
| >(symbol: 'bssl_dart_DH_compute_key_padded') | |
| external int DH_compute_key_padded( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<BIGNUM> peers_key, | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_dup_ref increments the reference count of `dh` and returns the same | |
| /// handle. It does not mutate `dh` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_dup_ref', | |
| ) | |
| external ffi.Pointer<DH> DH_dup_ref( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_free decrements the reference count of `dh` and frees it if the reference | |
| /// count drops to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<DH>)>(symbol: 'bssl_dart_DH_free') | |
| external void DH_free( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_generate_key generates a new, random, private key and stores it in | |
| /// `dh`, if `dh` does not already have a private key. Otherwise, it updates | |
| /// `dh`'s public key to match the private key. It returns one on success and | |
| /// zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_generate_key', | |
| ) | |
| external int DH_generate_key( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_generate_parameters_ex generates a suitable Diffie-Hellman group with a | |
| /// prime that is `prime_bits` long and stores it in `dh`. The generator of the | |
| /// group will be `generator`, which should be `DH_GENERATOR_2` unless there's a | |
| /// good reason to use a different value. The `cb` argument contains a callback | |
| /// function that will be called during the generation. See the documentation in | |
| /// `bn.h` about this. In addition to the callback invocations from `BN`, `cb` | |
| /// will also be called with `event` equal to three when the generation is | |
| /// complete. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DH>, ffi.Int, ffi.Int, ffi.Pointer<BN_GENCB>) | |
| >(symbol: 'bssl_dart_DH_generate_parameters_ex') | |
| external int DH_generate_parameters_ex( | |
| ffi.Pointer<DH> dh, | |
| int prime_bits, | |
| int generator, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// DH_get0_g returns `dh`'s group generator. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_get0_g', | |
| ) | |
| external ffi.Pointer<BIGNUM> DH_get0_g( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_get0_key sets `*out_pub_key` and `*out_priv_key`, if non-NULL, to `dh`'s | |
| /// public and private key, respectively. If `dh` is a public key, the private | |
| /// key will be set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<DH>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_DH_get0_key') | |
| external void DH_get0_key( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_pub_key, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_priv_key, | |
| ); | |
| /// DH_get0_p returns `dh`'s group modulus. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_get0_p', | |
| ) | |
| external ffi.Pointer<BIGNUM> DH_get0_p( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_get0_pqg sets `*out_p`, `*out_q`, and `*out_g`, if non-NULL, to `dh`'s p, | |
| /// q, and g parameters, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<DH>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_DH_get0_pqg') | |
| external void DH_get0_pqg( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_p, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_q, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_g, | |
| ); | |
| /// DH_get0_priv_key returns `dh`'s private key, or NULL if `dh` is a public key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_get0_priv_key', | |
| ) | |
| external ffi.Pointer<BIGNUM> DH_get0_priv_key( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_get0_pub_key returns `dh`'s public key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_get0_pub_key', | |
| ) | |
| external ffi.Pointer<BIGNUM> DH_get0_pub_key( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_get0_q returns the size of `dh`'s subgroup, or NULL if it is unset. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_get0_q', | |
| ) | |
| external ffi.Pointer<BIGNUM> DH_get0_q( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_get_rfc7919_2048 returns the group `ffdhe2048` from | |
| /// https://tools.ietf.org/html/rfc7919#appendix-A.1. It returns NULL if out | |
| /// of memory. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function()>(symbol: 'bssl_dart_DH_get_rfc7919_2048') | |
| external ffi.Pointer<DH> DH_get_rfc7919_2048(); | |
| /// DH_marshal_parameters marshals `dh` as a DER-encoded DHParameter structure | |
| /// (PKCS #3) and appends the result to `cbb`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DH_marshal_parameters', | |
| ) | |
| external int DH_marshal_parameters( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_new returns a new, empty DH object or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function()>(symbol: 'bssl_dart_DH_new') | |
| external ffi.Pointer<DH> DH_new(); | |
| /// DH_parse_parameters decodes a DER-encoded DHParameter structure (PKCS #3) | |
| /// from `cbs` and advances `cbs`. It returns a newly-allocated `DH` or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_DH_parse_parameters', | |
| ) | |
| external ffi.Pointer<DH> DH_parse_parameters( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// DH_set0_key sets `dh`'s public and private key to the specified values. If | |
| /// NULL, the field is left unchanged. On success, it takes ownership of each | |
| /// argument and returns one. Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DH>, ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_DH_set0_key') | |
| external int DH_set0_key( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<BIGNUM> pub_key, | |
| ffi.Pointer<BIGNUM> priv_key, | |
| ); | |
| /// DH_set0_pqg sets `dh`'s p, q, and g parameters to the specified values. If | |
| /// NULL, the field is left unchanged. On success, it takes ownership of each | |
| /// argument and returns one. Otherwise, it returns zero. `q` may be NULL, but | |
| /// `p` and `g` must either be specified or already configured on `dh`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<DH>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_DH_set0_pqg') | |
| external int DH_set0_pqg( | |
| ffi.Pointer<DH> dh, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> q, | |
| ffi.Pointer<BIGNUM> g, | |
| ); | |
| /// DH_set_length sets the number of bits to use for the secret exponent when | |
| /// calling `DH_generate_key` on `dh` and returns one. If unset, | |
| /// `DH_generate_key` will use the bit length of p. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DH>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_DH_set_length', | |
| ) | |
| external int DH_set_length( | |
| ffi.Pointer<DH> dh, | |
| int priv_length, | |
| ); | |
| /// DH_size returns the number of bytes in the DH group's prime. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DH>)>(symbol: 'bssl_dart_DH_size') | |
| external int DH_size( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DH_up_ref increments the reference count of `dh` and returns one. It does not | |
| /// mutate `dh` for thread-safety purposes and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DH>)>(symbol: 'bssl_dart_DH_up_ref') | |
| external int DH_up_ref( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DHparams_dup allocates a fresh `DH` and copies the parameters from `dh` into | |
| /// it. It returns the new `DH` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_DHparams_dup', | |
| ) | |
| external ffi.Pointer<DH> DHparams_dup( | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// DIRECTORYSTRING_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_DIRECTORYSTRING_free', | |
| ) | |
| external void DIRECTORYSTRING_free( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// DIRECTORYSTRING_new returns a newly-allocated `ASN1_STRING` with type -1, or | |
| /// NULL on error. The resulting `ASN1_STRING` is not a valid X.509 | |
| /// DirectoryString until initialized with a value. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function()>( | |
| symbol: 'bssl_dart_DIRECTORYSTRING_new', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> DIRECTORYSTRING_new(); | |
| /// DISPLAYTEXT_free calls `ASN1_STRING_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>( | |
| symbol: 'bssl_dart_DISPLAYTEXT_free', | |
| ) | |
| external void DISPLAYTEXT_free( | |
| ffi.Pointer<ASN1_STRING> str, | |
| ); | |
| /// DISPLAYTEXT_new returns a newly-allocated `ASN1_STRING` with type -1, or NULL | |
| /// on error. The resulting `ASN1_STRING` is not a valid X.509 DisplayText until | |
| /// initialized with a value. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function()>( | |
| symbol: 'bssl_dart_DISPLAYTEXT_new', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> DISPLAYTEXT_new(); | |
| /// DIST_POINT_NAME_free releases memory associated with `name`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<DIST_POINT_NAME>)>( | |
| symbol: 'bssl_dart_DIST_POINT_NAME_free', | |
| ) | |
| external void DIST_POINT_NAME_free( | |
| ffi.Pointer<DIST_POINT_NAME> name, | |
| ); | |
| /// DIST_POINT_NAME_new returns a newly-allocated, empty `DIST_POINT_NAME` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DIST_POINT_NAME> Function()>( | |
| symbol: 'bssl_dart_DIST_POINT_NAME_new', | |
| ) | |
| external ffi.Pointer<DIST_POINT_NAME> DIST_POINT_NAME_new(); | |
| /// DIST_POINT_free releases memory associated with `dp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<DIST_POINT>)>( | |
| symbol: 'bssl_dart_DIST_POINT_free', | |
| ) | |
| external void DIST_POINT_free( | |
| ffi.Pointer<DIST_POINT> dp, | |
| ); | |
| /// DIST_POINT_new returns a newly-allocated, empty `DIST_POINT` object, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DIST_POINT> Function()>( | |
| symbol: 'bssl_dart_DIST_POINT_new', | |
| ) | |
| external ffi.Pointer<DIST_POINT> DIST_POINT_new(); | |
| /// DSA_SIG_free frees the contents of `sig` and then frees `sig` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<DSA_SIG>)>( | |
| symbol: 'bssl_dart_DSA_SIG_free', | |
| ) | |
| external void DSA_SIG_free( | |
| ffi.Pointer<DSA_SIG> sig, | |
| ); | |
| /// DSA_SIG_get0 sets `*out_r` and `*out_s`, if non-NULL, to the two components | |
| /// of `sig`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<DSA_SIG>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_SIG_get0') | |
| external void DSA_SIG_get0( | |
| ffi.Pointer<DSA_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_r, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_s, | |
| ); | |
| /// DSA_SIG_marshal marshals `sig` as a DER-encoded DSA-Sig-Value and appends the | |
| /// result to `cbb`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<DSA_SIG>)>( | |
| symbol: 'bssl_dart_DSA_SIG_marshal', | |
| ) | |
| external int DSA_SIG_marshal( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<DSA_SIG> sig, | |
| ); | |
| /// DSA_SIG_new returns a freshly allocated, DIG_SIG structure or NULL on error. | |
| /// Both `r` and `s` in the signature will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA_SIG> Function()>(symbol: 'bssl_dart_DSA_SIG_new') | |
| external ffi.Pointer<DSA_SIG> DSA_SIG_new(); | |
| /// DSA_SIG_parse parses a DER-encoded DSA-Sig-Value structure from `cbs` and | |
| /// advances `cbs`. It returns a newly-allocated `DSA_SIG` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA_SIG> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_DSA_SIG_parse', | |
| ) | |
| external ffi.Pointer<DSA_SIG> DSA_SIG_parse( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// DSA_SIG_set0 sets `sig`'s components to `r` and `s`, neither of which may be | |
| /// NULL. On success, it takes ownership of each argument and returns one. | |
| /// Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<DSA_SIG>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_SIG_set0') | |
| external int DSA_SIG_set0( | |
| ffi.Pointer<DSA_SIG> sig, | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> s, | |
| ); | |
| /// DSA_bits returns the size of `dsa`'s group modulus, in bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_bits', | |
| ) | |
| external int DSA_bits( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_check_signature sets `*out_valid` to zero. Then it verifies that `sig` | |
| /// is a valid, ASN.1 signature, by the public key in `dsa`, of the hash in | |
| /// `digest`. If so, it sets `*out_valid` to one. | |
| /// | |
| /// It returns one if it was able to verify the signature as valid or invalid, | |
| /// and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_check_signature') | |
| external int DSA_check_signature( | |
| ffi.Pointer<ffi.Int> out_valid, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_do_check_signature sets `*out_valid` to zero. Then it verifies that `sig` | |
| /// is a valid signature, by the public key in `dsa` of the hash in `digest` | |
| /// and, if so, it sets `*out_valid` to one. | |
| /// | |
| /// It returns one if it was able to verify the signature as valid or invalid, | |
| /// and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<DSA_SIG>, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_do_check_signature') | |
| external int DSA_do_check_signature( | |
| ffi.Pointer<ffi.Int> out_valid, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<DSA_SIG> sig, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_do_sign returns a signature of the hash in `digest` by the key in `dsa` | |
| /// and returns an allocated, DSA_SIG structure, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA_SIG> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_do_sign') | |
| external ffi.Pointer<DSA_SIG> DSA_do_sign( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_do_verify verifies that `sig` is a valid signature, by the public key in | |
| /// `dsa`, of the hash in `digest`. It returns one if so, zero if invalid and -1 | |
| /// on error. | |
| /// | |
| /// WARNING: do not use. This function returns -1 for error, 0 for invalid and 1 | |
| /// for valid. However, this is dangerously different to the usual OpenSSL | |
| /// convention and could be a disaster if a user did `if (DSA_do_verify(...))`. | |
| /// Because of this, `DSA_check_signature` is a safer version of this. | |
| /// | |
| /// TODO(fork): deprecate. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<DSA_SIG>, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_do_verify') | |
| external int DSA_do_verify( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<DSA_SIG> sig, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_dup_DH returns a `DH` constructed from the parameters of `dsa`. This is | |
| /// sometimes needed when Diffie-Hellman parameters are stored in the form of | |
| /// DSA parameters. It returns an allocated `DH` on success or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_dup_DH', | |
| ) | |
| external ffi.Pointer<DH> DSA_dup_DH( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_dup_ref increments the reference count of `dsa` and returns the same | |
| /// handle. It does not mutate `dsa` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_dup_ref', | |
| ) | |
| external ffi.Pointer<DSA> DSA_dup_ref( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_free decrements the reference count of `dsa` and frees it if the | |
| /// reference count drops to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<DSA>)>(symbol: 'bssl_dart_DSA_free') | |
| external void DSA_free( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_generate_key generates a public/private key pair in `dsa`, which must | |
| /// already have parameters setup. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_generate_key', | |
| ) | |
| external int DSA_generate_key( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_generate_parameters_ex generates a set of DSA parameters by following | |
| /// the procedure given in FIPS 186-4, appendix A. | |
| /// (http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf) | |
| /// | |
| /// The larger prime will have a length of `bits` (e.g. 2048). The `seed` value | |
| /// allows others to generate and verify the same parameters and should be | |
| /// random input which is kept for reference. If `out_counter` or `out_h` are | |
| /// not NULL then the counter and h value used in the generation are written to | |
| /// them. | |
| /// | |
| /// The `cb` argument is passed to `BN_generate_prime_ex` and is thus called | |
| /// during the generation process in order to indicate progress. See the | |
| /// comments for that function for details. In addition to the calls made by | |
| /// `BN_generate_prime_ex`, `DSA_generate_parameters_ex` will call it with | |
| /// `event` equal to 2 and 3 at different stages of the process. | |
| /// | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<DSA>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.UnsignedLong>, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_generate_parameters_ex') | |
| external int DSA_generate_parameters_ex( | |
| ffi.Pointer<DSA> dsa, | |
| int bits, | |
| ffi.Pointer<ffi.Uint8> seed, | |
| int seed_len, | |
| ffi.Pointer<ffi.Int> out_counter, | |
| ffi.Pointer<ffi.UnsignedLong> out_h, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// DSA_get0_g returns `dsa`'s group generator. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_get0_g', | |
| ) | |
| external ffi.Pointer<BIGNUM> DSA_get0_g( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_get0_key sets `*out_pub_key` and `*out_priv_key`, if non-NULL, to `dsa`'s | |
| /// public and private key, respectively. If `dsa` is a public key, the private | |
| /// key will be set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<DSA>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_get0_key') | |
| external void DSA_get0_key( | |
| ffi.Pointer<DSA> dsa, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_pub_key, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_priv_key, | |
| ); | |
| /// DSA_get0_p returns `dsa`'s group modulus. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_get0_p', | |
| ) | |
| external ffi.Pointer<BIGNUM> DSA_get0_p( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_get0_pqg sets `*out_p`, `*out_q`, and `*out_g`, if non-NULL, to `dsa`'s | |
| /// p, q, and g parameters, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<DSA>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_get0_pqg') | |
| external void DSA_get0_pqg( | |
| ffi.Pointer<DSA> dsa, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_p, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_q, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_g, | |
| ); | |
| /// DSA_get0_priv_key returns `dsa`'s private key, or NULL if `dsa` is a public | |
| /// key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_get0_priv_key', | |
| ) | |
| external ffi.Pointer<BIGNUM> DSA_get0_priv_key( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_get0_pub_key returns `dsa`'s public key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_get0_pub_key', | |
| ) | |
| external ffi.Pointer<BIGNUM> DSA_get0_pub_key( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_get0_q returns the size of `dsa`'s subgroup. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_get0_q', | |
| ) | |
| external ffi.Pointer<BIGNUM> DSA_get0_q( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<DSA>, ffi.Int)>( | |
| symbol: 'bssl_dart_DSA_get_ex_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> DSA_get_ex_data( | |
| ffi.Pointer<DSA> dsa, | |
| int idx, | |
| ); | |
| /// ex_data functions. | |
| /// | |
| /// See `ex_data.h` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_get_ex_new_index') | |
| external int DSA_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// DSA_marshal_parameters marshals `dsa` as a DER-encoded Dss-Parms structure | |
| /// (RFC 3279) and appends the result to `cbb`. It returns one on success and | |
| /// zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_marshal_parameters', | |
| ) | |
| external int DSA_marshal_parameters( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_marshal_private_key marshals `dsa` as a DER-encoded DSA private key and | |
| /// appends the result to `cbb`. It returns one on success and zero on | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_marshal_private_key', | |
| ) | |
| external int DSA_marshal_private_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_marshal_public_key marshals `dsa` as a DER-encoded DSA public key and | |
| /// appends the result to `cbb`. It returns one on success and zero on | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSA_marshal_public_key', | |
| ) | |
| external int DSA_marshal_public_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_new returns a new, empty DSA object or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function()>(symbol: 'bssl_dart_DSA_new') | |
| external ffi.Pointer<DSA> DSA_new(); | |
| /// DSA_parse_parameters parses a DER-encoded Dss-Parms structure (RFC 3279) | |
| /// from `cbs` and advances `cbs`. It returns a newly-allocated `DSA` or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_DSA_parse_parameters', | |
| ) | |
| external ffi.Pointer<DSA> DSA_parse_parameters( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// DSA_parse_private_key parses a DER-encoded DSA private key from `cbs` and | |
| /// advances `cbs`. It returns a newly-allocated `DSA` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_DSA_parse_private_key', | |
| ) | |
| external ffi.Pointer<DSA> DSA_parse_private_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// DSA_parse_public_key parses a DER-encoded DSA public key from `cbs` and | |
| /// advances `cbs`. It returns a newly-allocated `DSA` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_DSA_parse_public_key', | |
| ) | |
| external ffi.Pointer<DSA> DSA_parse_public_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// DSA_set0_key sets `dsa`'s public and private key to `pub_key` and `priv_key`, | |
| /// respectively, if non-NULL. On success, it takes ownership of each argument | |
| /// and returns one. Otherwise, it returns zero. | |
| /// | |
| /// `priv_key` may be NULL, but `pub_key` must either be non-NULL or already | |
| /// configured on `dsa`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA>, ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_DSA_set0_key') | |
| external int DSA_set0_key( | |
| ffi.Pointer<DSA> dsa, | |
| ffi.Pointer<BIGNUM> pub_key, | |
| ffi.Pointer<BIGNUM> priv_key, | |
| ); | |
| /// DSA_set0_pqg sets `dsa`'s parameters to `p`, `q`, and `g`, if non-NULL, and | |
| /// takes ownership of them. On success, it takes ownership of each argument and | |
| /// returns one. Otherwise, it returns zero. | |
| /// | |
| /// Each argument must either be non-NULL or already configured on `dsa`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<DSA>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_set0_pqg') | |
| external int DSA_set0_pqg( | |
| ffi.Pointer<DSA> dsa, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> q, | |
| ffi.Pointer<BIGNUM> g, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DSA>, ffi.Int, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_DSA_set_ex_data', | |
| ) | |
| external int DSA_set_ex_data( | |
| ffi.Pointer<DSA> dsa, | |
| int idx, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// DSA_sign signs `digest` with the key in `dsa` and writes the resulting | |
| /// signature, in ASN.1 form, to `out_sig` and the length of the signature to | |
| /// `*out_siglen`. There must be, at least, `DSA_size(dsa)` bytes of space in | |
| /// `out_sig`. It returns one on success and zero otherwise. | |
| /// | |
| /// (The `type` argument is ignored.) | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_sign') | |
| external int DSA_sign( | |
| int type, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> out_sig, | |
| ffi.Pointer<ffi.UnsignedInt> out_siglen, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_size returns the size, in bytes, of an ASN.1 encoded, DSA signature | |
| /// generated by `dsa`. Parameters must already have been setup in `dsa`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DSA>)>(symbol: 'bssl_dart_DSA_size') | |
| external int DSA_size( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_up_ref increments the reference count of `dsa` and returns one. It does | |
| /// not mutate `dsa` for thread-safety purposes and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DSA>)>(symbol: 'bssl_dart_DSA_up_ref') | |
| external int DSA_up_ref( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSA_verify verifies that `sig` is a valid, ASN.1 signature, by the public | |
| /// key in `dsa`, of the hash in `digest`. It returns one if so, zero if invalid | |
| /// and -1 on error. | |
| /// | |
| /// (The `type` argument is ignored.) | |
| /// | |
| /// WARNING: do not use. This function returns -1 for error, 0 for invalid and 1 | |
| /// for valid. However, this is dangerously different to the usual OpenSSL | |
| /// convention and could be a disaster if a user did `if (DSA_do_verify(...))`. | |
| /// Because of this, `DSA_check_signature` is a safer version of this. | |
| /// | |
| /// TODO(fork): deprecate. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<DSA>, | |
| ) | |
| >(symbol: 'bssl_dart_DSA_verify') | |
| external int DSA_verify( | |
| int type, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// DSAparams_dup returns a freshly allocated `DSA` that contains a copy of the | |
| /// parameters from `dsa`. It returns NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_DSAparams_dup', | |
| ) | |
| external ffi.Pointer<DSA> DSAparams_dup( | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// ECDH_compute_key calculates the shared key between `pub_key` and `priv_key`. | |
| /// If `kdf` is not NULL, then it is called with the bytes of the shared key and | |
| /// the parameter `out`. When `kdf` returns, the value of `*outlen` becomes the | |
| /// return value. Otherwise, as many bytes of the shared key as will fit are | |
| /// copied directly to, at most, `outlen` bytes at `out`. It returns the number | |
| /// of bytes written to `out`, or -1 on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void> in$, | |
| ffi.Size inlen, | |
| ffi.Pointer<ffi.Void> out, | |
| ffi.Pointer<ffi.Size> outlen, | |
| ) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_ECDH_compute_key') | |
| external int ECDH_compute_key( | |
| ffi.Pointer<ffi.Void> out, | |
| int outlen, | |
| ffi.Pointer<EC_POINT> pub_key, | |
| ffi.Pointer<EC_KEY> priv_key, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void> in$, | |
| ffi.Size inlen, | |
| ffi.Pointer<ffi.Void> out, | |
| ffi.Pointer<ffi.Size> outlen, | |
| ) | |
| > | |
| > | |
| kdf, | |
| ); | |
| /// ECDH_compute_key_fips calculates the shared key between `pub_key` and | |
| /// `priv_key` and hashes it with the appropriate SHA function for `out_len`. The | |
| /// only value values for `out_len` are thus 24 (SHA-224), 32 (SHA-256), 48 | |
| /// (SHA-384), and 64 (SHA-512). It returns one on success and zero on error. | |
| /// | |
| /// Note that the return value is different to `ECDH_compute_key`: it returns an | |
| /// error flag (as is common for BoringSSL) rather than the number of bytes | |
| /// written. | |
| /// | |
| /// This function allows the FIPS module to compute an ECDH and KDF within the | |
| /// module boundary without taking an arbitrary function pointer for the KDF, | |
| /// which isn't very FIPSy. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDH_compute_key_fips') | |
| external int ECDH_compute_key_fips( | |
| ffi.Pointer<ffi.Uint8> out, | |
| int out_len, | |
| ffi.Pointer<EC_POINT> pub_key, | |
| ffi.Pointer<EC_KEY> priv_key, | |
| ); | |
| /// ECDSA_SIG_free frees `sig` its member `BIGNUM`s. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ECDSA_SIG>)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_free', | |
| ) | |
| external void ECDSA_SIG_free( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ); | |
| /// ECDSA_SIG_from_bytes parses `in` as a DER-encoded ECDSA-Sig-Value structure. | |
| /// It returns a newly-allocated `ECDSA_SIG` structure or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ECDSA_SIG> Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_from_bytes', | |
| ) | |
| external ffi.Pointer<ECDSA_SIG> ECDSA_SIG_from_bytes( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// ECDSA_SIG_get0 sets `*out_r` and `*out_s`, if non-NULL, to the two | |
| /// components of `sig`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ECDSA_SIG>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_SIG_get0') | |
| external void ECDSA_SIG_get0( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_r, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_s, | |
| ); | |
| /// ECDSA_SIG_get0_r returns the r component of `sig`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<ECDSA_SIG>)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_get0_r', | |
| ) | |
| external ffi.Pointer<BIGNUM> ECDSA_SIG_get0_r( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ); | |
| /// ECDSA_SIG_get0_s returns the s component of `sig`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<ECDSA_SIG>)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_get0_s', | |
| ) | |
| external ffi.Pointer<BIGNUM> ECDSA_SIG_get0_s( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ); | |
| /// ECDSA_SIG_marshal marshals `sig` as a DER-encoded ECDSA-Sig-Value and appends | |
| /// the result to `cbb`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<ECDSA_SIG>)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_marshal', | |
| ) | |
| external int ECDSA_SIG_marshal( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ); | |
| /// ECDSA_SIG_max_len returns the maximum length of a DER-encoded ECDSA-Sig-Value | |
| /// structure for a group whose order is represented in `order_len` bytes, or | |
| /// zero on overflow. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Size)>(symbol: 'bssl_dart_ECDSA_SIG_max_len') | |
| external int ECDSA_SIG_max_len( | |
| int order_len, | |
| ); | |
| /// ECDSA_SIG_new returns a fresh `ECDSA_SIG` structure or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ECDSA_SIG> Function()>( | |
| symbol: 'bssl_dart_ECDSA_SIG_new', | |
| ) | |
| external ffi.Pointer<ECDSA_SIG> ECDSA_SIG_new(); | |
| /// ECDSA_SIG_parse parses a DER-encoded ECDSA-Sig-Value structure from `cbs` and | |
| /// advances `cbs`. It returns a newly-allocated `ECDSA_SIG` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ECDSA_SIG> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_ECDSA_SIG_parse', | |
| ) | |
| external ffi.Pointer<ECDSA_SIG> ECDSA_SIG_parse( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// ECDSA_SIG_set0 sets `sig`'s components to `r` and `s`, neither of which may | |
| /// be NULL. On success, it takes ownership of each argument and returns one. | |
| /// Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ECDSA_SIG>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_SIG_set0') | |
| external int ECDSA_SIG_set0( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ffi.Pointer<BIGNUM> r, | |
| ffi.Pointer<BIGNUM> s, | |
| ); | |
| /// ECDSA_SIG_to_bytes marshals `sig` as a DER-encoded ECDSA-Sig-Value and, on | |
| /// success, sets `*out_bytes` to a newly allocated buffer containing the result | |
| /// and returns one. Otherwise, it returns zero. The result should be freed with | |
| /// `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ECDSA_SIG>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_SIG_to_bytes') | |
| external int ECDSA_SIG_to_bytes( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_bytes, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ); | |
| /// ECDSA_do_sign signs `digest_len` bytes from `digest` with `key` and returns | |
| /// the resulting signature structure, or NULL on error. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// signed. Passing unhashed inputs will not result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ECDSA_SIG> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_do_sign') | |
| external ffi.Pointer<ECDSA_SIG> ECDSA_do_sign( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_do_verify verifies that `sig` constitutes a valid signature by `key` | |
| /// of `digest`. It returns one on success or zero if the signature is invalid | |
| /// or on error. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// verified. Passing unhashed inputs will not result in a secure signature | |
| /// scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ECDSA_SIG>, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_do_verify') | |
| external int ECDSA_do_verify( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_sign signs `digest_len` bytes from `digest` with `key` and writes the | |
| /// resulting ASN.1-based signature to `sig`, which must have `ECDSA_size(key)` | |
| /// bytes of space. On successful exit, `*sig_len` is set to the actual number of | |
| /// bytes written. The `type` argument should be zero. It returns one on success | |
| /// and zero otherwise. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// signed. Passing unhashed inputs will not result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_sign') | |
| external int ECDSA_sign( | |
| int type, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| ffi.Pointer<ffi.UnsignedInt> sig_len, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_sign_p1363 signs `digest_len` bytes from `digest` with `key` and writes | |
| /// the resulting P1363-based signature to `sig`, which must have | |
| /// `ECDSA_size_p1363(key)` bytes of space. On successful exit, `*out_sig_len` is | |
| /// set to the actual number of bytes written, which will always match | |
| /// `ECDSA_size_p1363(key)`. It returns one on success and zero otherwise. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// signed. Passing unhashed inputs will not result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_sign_p1363') | |
| external int ECDSA_sign_p1363( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| ffi.Pointer<ffi.Size> out_sig_len, | |
| int max_sig_len, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_sign_with_nonce_and_leak_private_key_for_testing behaves like | |
| /// `ECDSA_do_sign` but uses `nonce` for the ECDSA nonce 'k', instead of a random | |
| /// value. `nonce` is interpreted as a big-endian integer. It must be reduced | |
| /// modulo the group order and padded with zeros up to `BN_num_bytes(order)` | |
| /// bytes. | |
| /// | |
| /// WARNING: This function is only exported for testing purposes, when using test | |
| /// vectors or fuzzing strategies. It must not be used outside tests and may leak | |
| /// any private keys it is used with. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ECDSA_SIG> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_sign_with_nonce_and_leak_private_key_for_testing') | |
| external ffi.Pointer<ECDSA_SIG> | |
| ECDSA_sign_with_nonce_and_leak_private_key_for_testing( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ); | |
| /// ECDSA_size returns the maximum size of an ASN.1-based ECDSA signature using | |
| /// `key`. It returns zero if `key` is NULL or if it doesn't have a group set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_ECDSA_size', | |
| ) | |
| external int ECDSA_size( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_size_p1363 returns the size of a P1363-based ECDSA signature using | |
| /// `key`. It returns zero if `key` is NULL or if it doesn't have a group set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_ECDSA_size_p1363', | |
| ) | |
| external int ECDSA_size_p1363( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_verify verifies that `sig_len` bytes from `sig` constitute a valid | |
| /// ASN.1-based signature by `key` of `digest`. (The `type` argument should be | |
| /// zero.) It returns one on success or zero if the signature is invalid or an | |
| /// error occurred. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// verified. Passing unhashed inputs will not result in a secure signature | |
| /// scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_verify') | |
| external int ECDSA_verify( | |
| int type, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// ECDSA_verify_p1363 verifies that `sig_len` bytes from `sig` constitute a | |
| /// valid P1363-based signature by `key` of `digest`. It returns one on success | |
| /// or zero if the signature is invalid or an error occurred. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// verified. Passing unhashed inputs will not result in a secure signature | |
| /// scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EC_KEY>, | |
| ) | |
| >(symbol: 'bssl_dart_ECDSA_verify_p1363') | |
| external int ECDSA_verify_p1363( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_GROUP_cmp returns zero if `a` and `b` are the same group and non-zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_cmp') | |
| external int EC_GROUP_cmp( | |
| ffi.Pointer<EC_GROUP> a, | |
| ffi.Pointer<EC_GROUP> b, | |
| ffi.Pointer<BN_CTX> ignored, | |
| ); | |
| /// EC_GROUP_dup increments `group`'s reference count and returns it, if `group` | |
| /// was created by `EC_GROUP_new_curve_GFp`. If `group` is static, it simply | |
| /// returns `group`. | |
| /// | |
| /// This function exists for OpenSSL compatibility, and to manage dynamic | |
| /// `EC_GROUP`s constructed by `EC_GROUP_new_curve_GFp`. Callers that do not need | |
| /// either may ignore this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_dup', | |
| ) | |
| external ffi.Pointer<EC_GROUP> EC_GROUP_dup( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_free releases a reference to `group`, if `group` was created by | |
| /// `EC_GROUP_new_curve_GFp`. If `group` is static, it does nothing. | |
| /// | |
| /// This function exists for OpenSSL compatibility, and to manage dynamic | |
| /// `EC_GROUP`s constructed by `EC_GROUP_new_curve_GFp`. Callers that do not need | |
| /// either may ignore this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_free', | |
| ) | |
| external void EC_GROUP_free( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get0_generator returns a pointer to the internal `EC_POINT` object | |
| /// in `group` that specifies the generator for the group. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_POINT> Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_get0_generator', | |
| ) | |
| external ffi.Pointer<EC_POINT> EC_GROUP_get0_generator( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get0_order returns a pointer to the internal `BIGNUM` object in | |
| /// `group` that specifies the order of the group. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_get0_order', | |
| ) | |
| external ffi.Pointer<BIGNUM> EC_GROUP_get0_order( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get_asn1_flag returns `OPENSSL_EC_NAMED_CURVE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_get_asn1_flag', | |
| ) | |
| external int EC_GROUP_get_asn1_flag( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get_cofactor sets `*cofactor` to the cofactor of `group`. It returns | |
| /// one on success and zero otherwise. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_get_cofactor') | |
| external int EC_GROUP_get_cofactor( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<BIGNUM> cofactor, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_GROUP_get_curve_GFp gets various parameters about a group. It sets | |
| /// `*out_p` to the order of the coordinate field and `*out_a` and `*out_b` to | |
| /// the parameters of the curve when expressed as y² = x³ + ax + b. Any of the | |
| /// output parameters can be NULL. It returns one on success and zero on | |
| /// error. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_get_curve_GFp') | |
| external int EC_GROUP_get_curve_GFp( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<BIGNUM> out_p, | |
| ffi.Pointer<BIGNUM> out_a, | |
| ffi.Pointer<BIGNUM> out_b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_GROUP_get_curve_name returns a NID that identifies `group`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_get_curve_name', | |
| ) | |
| external int EC_GROUP_get_curve_name( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get_degree returns the number of bits needed to represent an | |
| /// element of the field underlying `group`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_get_degree', | |
| ) | |
| external int EC_GROUP_get_degree( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_get_order sets `*order` to the order of `group`, if it's not | |
| /// NULL. It returns one on success and zero otherwise. `ctx` is ignored and may | |
| /// be NULL. Use `EC_GROUP_get0_order` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_get_order') | |
| external int EC_GROUP_get_order( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<BIGNUM> order, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_GROUP_method_of returns a dummy non-NULL pointer. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_METHOD> Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_method_of', | |
| ) | |
| external ffi.Pointer<EC_METHOD> EC_GROUP_method_of( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_new_by_curve_name returns the `EC_GROUP` object for the elliptic | |
| /// curve specified by `nid`, or NULL on unsupported NID. For OpenSSL | |
| /// compatibility, this function returns a non-const pointer which may be passed | |
| /// to `EC_GROUP_free`. However, the resulting object is actually static and | |
| /// calling `EC_GROUP_free` is optional. | |
| /// | |
| /// The supported NIDs are: | |
| /// - `NID_secp224r1` (P-224) | |
| /// - `NID_X9_62_prime256v1` (P-256) | |
| /// - `NID_secp384r1` (P-384) | |
| /// - `NID_secp521r1` (P-521) | |
| /// | |
| /// Calling this function causes all four curves to be linked into the binary. | |
| /// Prefer calling `EC_group_*` to allow the static linker to drop unused curves. | |
| /// | |
| /// If in doubt, use `NID_X9_62_prime256v1`, or see the curve25519.h header for | |
| /// more modern primitives. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_EC_GROUP_new_by_curve_name', | |
| ) | |
| external ffi.Pointer<EC_GROUP> EC_GROUP_new_by_curve_name( | |
| int nid, | |
| ); | |
| /// EC_GROUP_new_curve_GFp creates a new, arbitrary elliptic curve group based | |
| /// on the equation y² = x³ + a·x + b. It returns the new group or NULL on | |
| /// error. The lifetime of the resulting object must be managed with | |
| /// `EC_GROUP_dup` and `EC_GROUP_free`. | |
| /// | |
| /// This new group has no generator. It is an error to use a generator-less group | |
| /// with any functions except for `EC_GROUP_free`, `EC_POINT_new`, | |
| /// `EC_POINT_set_affine_coordinates_GFp`, and `EC_GROUP_set_generator`. | |
| /// | |
| /// `EC_GROUP`s returned by this function will always compare as unequal via | |
| /// `EC_GROUP_cmp` (even to themselves). `EC_GROUP_get_curve_name` will always | |
| /// return `NID_undef`. | |
| /// | |
| /// This function is provided for compatibility with some legacy applications | |
| /// only. Avoid using arbitrary curves and use `EC_GROUP_new_by_curve_name` | |
| /// instead. This ensures the result meets preconditions necessary for | |
| /// elliptic curve algorithms to function correctly and securely. | |
| /// | |
| /// Given invalid parameters, this function may fail or it may return an | |
| /// `EC_GROUP` which breaks these preconditions. Subsequent operations may then | |
| /// return arbitrary, incorrect values. Callers should not pass | |
| /// attacker-controlled values to this function. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_GROUP> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_new_curve_GFp') | |
| external ffi.Pointer<EC_GROUP> EC_GROUP_new_curve_GFp( | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> a, | |
| ffi.Pointer<BIGNUM> b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_GROUP_order_bits returns the number of bits of the order of `group`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_GROUP_order_bits', | |
| ) | |
| external int EC_GROUP_order_bits( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_GROUP_set_asn1_flag does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_GROUP>, ffi.Int)>( | |
| symbol: 'bssl_dart_EC_GROUP_set_asn1_flag', | |
| ) | |
| external void EC_GROUP_set_asn1_flag( | |
| ffi.Pointer<EC_GROUP> group, | |
| int flag, | |
| ); | |
| /// EC_GROUP_set_generator sets the generator for `group` to `generator`, which | |
| /// must have the given order and cofactor. It may only be used with `EC_GROUP` | |
| /// objects returned by `EC_GROUP_new_curve_GFp` and may only be used once on | |
| /// each group. `generator` must have been created using `group`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_GROUP_set_generator') | |
| external int EC_GROUP_set_generator( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> generator, | |
| ffi.Pointer<BIGNUM> order, | |
| ffi.Pointer<BIGNUM> cofactor, | |
| ); | |
| /// EC_GROUP_set_point_conversion_form aborts the process if `form` is not | |
| /// `POINT_CONVERSION_UNCOMPRESSED` and otherwise does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_GROUP>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_EC_GROUP_set_point_conversion_form', | |
| ) | |
| external void EC_GROUP_set_point_conversion_form( | |
| ffi.Pointer<EC_GROUP> group, | |
| int form, | |
| ); | |
| /// EC_KEY_check_fips performs both a signing pairwise consistency test | |
| /// (FIPS 140-2 4.9.2) and the consistency test from SP 800-56Ar3 section | |
| /// 5.6.2.1.4. It returns one if it passes and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_check_fips', | |
| ) | |
| external int EC_KEY_check_fips( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_check_key performs several checks on `key` (possibly including an | |
| /// expensive check that the public key is in the primary subgroup). It returns | |
| /// one if all checks pass and zero otherwise. If it returns zero then detail | |
| /// about the problem can be found on the error stack. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_check_key', | |
| ) | |
| external int EC_KEY_check_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_derive_from_secret deterministically derives a private key for `group` | |
| /// from an input secret using HKDF-SHA256. It returns a newly-allocated `EC_KEY` | |
| /// on success or NULL on error. `secret` must not be used in any other | |
| /// algorithm. If using a base secret for multiple operations, derive separate | |
| /// values with a KDF such as HKDF first. | |
| /// | |
| /// Note this function implements an arbitrary derivation scheme, rather than any | |
| /// particular standard one. New protocols are recommended to use X25519 and | |
| /// Ed25519, which have standard byte import functions. See | |
| /// `X25519_public_from_private` and `ED25519_keypair_from_seed`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_KEY_derive_from_secret') | |
| external ffi.Pointer<EC_KEY> EC_KEY_derive_from_secret( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<ffi.Uint8> secret, | |
| int secret_len, | |
| ); | |
| /// EC_KEY_dup returns a fresh copy of `src` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_dup', | |
| ) | |
| external ffi.Pointer<EC_KEY> EC_KEY_dup( | |
| ffi.Pointer<EC_KEY> src, | |
| ); | |
| /// EC_KEY_dup_ref increases the reference count of `key` and returns the same | |
| /// handle. It does not mutate `key` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_dup_ref', | |
| ) | |
| external ffi.Pointer<EC_KEY> EC_KEY_dup_ref( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_free frees all the data owned by `key` and `key` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_free', | |
| ) | |
| external void EC_KEY_free( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_generate_key generates a random, private key, calculates the | |
| /// corresponding public key and stores both in `key`. It returns one on success | |
| /// or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_generate_key', | |
| ) | |
| external int EC_KEY_generate_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_generate_key_fips behaves like `EC_KEY_generate_key` but performs | |
| /// additional checks for FIPS compliance. This function is applicable when | |
| /// generating keys for either signing/verification or key agreement because | |
| /// both types of consistency check (PCT) are performed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_generate_key_fips', | |
| ) | |
| external int EC_KEY_generate_key_fips( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_get0_group returns a pointer to the `EC_GROUP` object inside `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_get0_group', | |
| ) | |
| external ffi.Pointer<EC_GROUP> EC_KEY_get0_group( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_get0_private_key returns a pointer to the private key inside `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_get0_private_key', | |
| ) | |
| external ffi.Pointer<BIGNUM> EC_KEY_get0_private_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_get0_public_key returns a pointer to the public key point inside | |
| /// `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_POINT> Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_get0_public_key', | |
| ) | |
| external ffi.Pointer<EC_POINT> EC_KEY_get0_public_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_get_conv_form returns the conversion form that will be used by | |
| /// `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_get_conv_form', | |
| ) | |
| external int EC_KEY_get_conv_form( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_get_enc_flags returns the encoding flags for `key`, which is a | |
| /// bitwise-OR of `EC_PKEY_*` values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_get_enc_flags', | |
| ) | |
| external int EC_KEY_get_enc_flags( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<EC_KEY>, ffi.Int)>( | |
| symbol: 'bssl_dart_EC_KEY_get_ex_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> EC_KEY_get_ex_data( | |
| ffi.Pointer<EC_KEY> r, | |
| int idx, | |
| ); | |
| /// ex_data functions. | |
| /// | |
| /// These functions are wrappers. See `ex_data.h` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_KEY_get_ex_new_index') | |
| external int EC_KEY_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// EC_KEY_is_opaque returns one if `key` is opaque and doesn't expose its key | |
| /// material. Otherwise it return zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_is_opaque', | |
| ) | |
| external int EC_KEY_is_opaque( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_KEY_key2buf behaves like `EC_POINT_point2buf`, except it encodes the | |
| /// public key in `key`. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function( | |
| ffi.Pointer<EC_KEY>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_KEY_key2buf') | |
| external int EC_KEY_key2buf( | |
| ffi.Pointer<EC_KEY> key, | |
| int form, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_buf, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_KEY_marshal_curve_name marshals `group` as a DER-encoded OBJECT IDENTIFIER | |
| /// and appends the result to `cbb`. It returns one on success and zero on | |
| /// failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_KEY_marshal_curve_name', | |
| ) | |
| external int EC_KEY_marshal_curve_name( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_KEY_marshal_private_key marshals `key` as a DER-encoded ECPrivateKey | |
| /// structure (RFC 5915) and appends the result to `cbb`. It returns one on | |
| /// success and zero on failure. `enc_flags` is a combination of `EC_PKEY_*` | |
| /// values and controls whether corresponding fields are omitted. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EC_KEY>, ffi.UnsignedInt) | |
| >(symbol: 'bssl_dart_EC_KEY_marshal_private_key') | |
| external int EC_KEY_marshal_private_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EC_KEY> key, | |
| int enc_flags, | |
| ); | |
| /// EC_KEY_new returns a fresh `EC_KEY` object or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function()>(symbol: 'bssl_dart_EC_KEY_new') | |
| external ffi.Pointer<EC_KEY> EC_KEY_new(); | |
| /// EC_KEY_new_by_curve_name returns a fresh EC_KEY for group specified by `nid` | |
| /// or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_EC_KEY_new_by_curve_name', | |
| ) | |
| external ffi.Pointer<EC_KEY> EC_KEY_new_by_curve_name( | |
| int nid, | |
| ); | |
| /// EC_KEY_new_method acts the same as `EC_KEY_new`, but takes an explicit | |
| /// `ENGINE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_EC_KEY_new_method', | |
| ) | |
| external ffi.Pointer<EC_KEY> EC_KEY_new_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| /// EC_KEY_oct2key decodes `len` bytes from `in` as an EC public key in X9.62 | |
| /// form. `key` must already have a group configured. On success, it sets the | |
| /// public key in `key` to the result and returns one. Otherwise, it returns | |
| /// zero. `ctx` may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_KEY_oct2key') | |
| external int EC_KEY_oct2key( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_KEY_oct2priv decodes a big-endian, zero-padded integer from `len` bytes | |
| /// from `in` and sets `key`'s private key to the result. It returns one on | |
| /// success and zero on error. The input must be padded to the size of `key`'s | |
| /// group order. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EC_KEY_oct2priv') | |
| external int EC_KEY_oct2priv( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EC_KEY_parse_curve_name parses a DER-encoded OBJECT IDENTIFIER as a curve | |
| /// name from `cbs` and advances `cbs`. It returns the decoded `EC_GROUP` or NULL | |
| /// on error. | |
| /// | |
| /// This function returns a non-const pointer which may be passed to | |
| /// `EC_GROUP_free`. However, the resulting object is actually static and calling | |
| /// `EC_GROUP_free` is optional. | |
| /// | |
| /// TODO(davidben): Make this return a const pointer, if it does not break too | |
| /// many callers. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EC_KEY_parse_curve_name', | |
| ) | |
| external ffi.Pointer<EC_GROUP> EC_KEY_parse_curve_name( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EC_KEY_parse_parameters parses a DER-encoded ECParameters structure (RFC | |
| /// 5480) from `cbs` and advances `cbs`. It returns the resulting `EC_GROUP` or | |
| /// NULL on error. It supports the namedCurve and specifiedCurve options, but use | |
| /// of specifiedCurve is deprecated. Use `EC_KEY_parse_curve_name` instead. | |
| /// | |
| /// This function returns a non-const pointer which may be passed to | |
| /// `EC_GROUP_free`. However, the resulting object is actually static and calling | |
| /// `EC_GROUP_free` is optional. | |
| /// | |
| /// TODO(davidben): Make this return a const pointer, if it does not break too | |
| /// many callers. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EC_KEY_parse_parameters', | |
| ) | |
| external ffi.Pointer<EC_GROUP> EC_KEY_parse_parameters( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EC_KEY_parse_private_key parses a DER-encoded ECPrivateKey structure (RFC | |
| /// 5915) from `cbs` and advances `cbs`. It returns a newly-allocated `EC_KEY` or | |
| /// NULL on error. If `group` is non-null, the parameters field of the | |
| /// ECPrivateKey may be omitted (but must match `group` if present). Otherwise, | |
| /// the parameters field is required. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function(ffi.Pointer<CBS>, ffi.Pointer<EC_GROUP>) | |
| >(symbol: 'bssl_dart_EC_KEY_parse_private_key') | |
| external ffi.Pointer<EC_KEY> EC_KEY_parse_private_key( | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_KEY_priv2buf behaves like `EC_KEY_priv2oct` but sets `*out_buf` to a | |
| /// newly-allocated buffer containing the result. It returns the size of the | |
| /// result on success and zero on error. The caller must release `*out_buf` with | |
| /// `OPENSSL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_EC_KEY_priv2buf') | |
| external int EC_KEY_priv2buf( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_buf, | |
| ); | |
| /// EC_KEY_priv2oct serializes `key`'s private key as a big-endian integer, | |
| /// zero-padded to the size of `key`'s group order and writes the result to at | |
| /// most `max_out` bytes of `out`. It returns the number of bytes written on | |
| /// success and zero on error. If `out` is NULL, it returns the number of bytes | |
| /// needed without writing anything. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EC_KEY_priv2oct') | |
| external int EC_KEY_priv2oct( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ); | |
| /// EC_KEY_set_asn1_flag does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_KEY>, ffi.Int)>( | |
| symbol: 'bssl_dart_EC_KEY_set_asn1_flag', | |
| ) | |
| external void EC_KEY_set_asn1_flag( | |
| ffi.Pointer<EC_KEY> key, | |
| int flag, | |
| ); | |
| /// EC_KEY_set_conv_form sets the conversion form to be used by `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_KEY>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_EC_KEY_set_conv_form', | |
| ) | |
| external void EC_KEY_set_conv_form( | |
| ffi.Pointer<EC_KEY> key, | |
| int cform, | |
| ); | |
| /// EC_KEY_set_enc_flags sets the encoding flags for `key`, which is a | |
| /// bitwise-OR of `EC_PKEY_*` values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_KEY>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_EC_KEY_set_enc_flags', | |
| ) | |
| external void EC_KEY_set_enc_flags( | |
| ffi.Pointer<EC_KEY> key, | |
| int flags, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_EC_KEY_set_ex_data') | |
| external int EC_KEY_set_ex_data( | |
| ffi.Pointer<EC_KEY> r, | |
| int idx, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// EC_KEY_set_group sets the `EC_GROUP` object that `key` will use to `group`. | |
| /// It returns one on success and zero if `key` is already configured with a | |
| /// different group. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_KEY_set_group', | |
| ) | |
| external int EC_KEY_set_group( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_KEY_set_private_key sets the private key of `key` to `priv`. It returns | |
| /// one on success and zero otherwise. `key` must already have had a group | |
| /// configured (see `EC_KEY_set_group` and `EC_KEY_new_by_curve_name`). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_EC_KEY_set_private_key', | |
| ) | |
| external int EC_KEY_set_private_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<BIGNUM> priv, | |
| ); | |
| /// EC_KEY_set_public_key sets the public key of `key` to `pub`, by copying it. | |
| /// It returns one on success and zero otherwise. `key` must already have had a | |
| /// group configured (see `EC_KEY_set_group` and `EC_KEY_new_by_curve_name`), and | |
| /// `pub` must also belong to that group, and must not be the point at infinity. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_KEY_set_public_key', | |
| ) | |
| external int EC_KEY_set_public_key( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<EC_POINT> pub, | |
| ); | |
| /// EC_KEY_set_public_key_affine_coordinates sets the public key in `key` to | |
| /// (`x`, `y`). It returns one on success and zero on error. It's considered an | |
| /// error if `x` and `y` do not represent a point on `key`'s curve. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_KEY_set_public_key_affine_coordinates') | |
| external int EC_KEY_set_public_key_affine_coordinates( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<BIGNUM> x, | |
| ffi.Pointer<BIGNUM> y, | |
| ); | |
| /// EC_KEY_up_ref increases the reference count of `key` and returns one. It does | |
| /// not mutate `key` for thread-safety purposes and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EC_KEY_up_ref', | |
| ) | |
| external int EC_KEY_up_ref( | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// EC_METHOD_get_field_type returns NID_X9_62_prime_field. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_METHOD>)>( | |
| symbol: 'bssl_dart_EC_METHOD_get_field_type', | |
| ) | |
| external int EC_METHOD_get_field_type( | |
| ffi.Pointer<EC_METHOD> meth, | |
| ); | |
| /// EC_POINT_add sets `r` equal to `a` plus `b`. It returns one on success and | |
| /// zero otherwise. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_add') | |
| external int EC_POINT_add( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> r, | |
| ffi.Pointer<EC_POINT> a, | |
| ffi.Pointer<EC_POINT> b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_clear_free calls `EC_POINT_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_POINT_clear_free', | |
| ) | |
| external void EC_POINT_clear_free( | |
| ffi.Pointer<EC_POINT> point, | |
| ); | |
| /// EC_POINT_cmp returns zero if `a` is equal to `b`, greater than zero if | |
| /// not equal and -1 on error. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_cmp') | |
| external int EC_POINT_cmp( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> a, | |
| ffi.Pointer<EC_POINT> b, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_copy sets `*dest` equal to `*src`. It returns one on success and | |
| /// zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_POINT>, ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_POINT_copy', | |
| ) | |
| external int EC_POINT_copy( | |
| ffi.Pointer<EC_POINT> dest, | |
| ffi.Pointer<EC_POINT> src, | |
| ); | |
| /// EC_POINT_dbl sets `r` equal to `a` plus `a`. It returns one on success and | |
| /// zero otherwise. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_dbl') | |
| external int EC_POINT_dbl( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> r, | |
| ffi.Pointer<EC_POINT> a, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_dup returns a fresh `EC_POINT` that contains the same values as | |
| /// `src`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_POINT> Function(ffi.Pointer<EC_POINT>, ffi.Pointer<EC_GROUP>) | |
| >(symbol: 'bssl_dart_EC_POINT_dup') | |
| external ffi.Pointer<EC_POINT> EC_POINT_dup( | |
| ffi.Pointer<EC_POINT> src, | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_POINT_free frees `point` and the data that it points to. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_POINT_free', | |
| ) | |
| external void EC_POINT_free( | |
| ffi.Pointer<EC_POINT> point, | |
| ); | |
| /// EC_POINT_get_affine_coordinates is an alias of | |
| /// `EC_POINT_get_affine_coordinates_GFp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_get_affine_coordinates') | |
| external int EC_POINT_get_affine_coordinates( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BIGNUM> x, | |
| ffi.Pointer<BIGNUM> y, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_get_affine_coordinates_GFp sets `x` and `y` to the affine value of | |
| /// `point`. It returns one on success and zero otherwise. `ctx` is ignored and | |
| /// may be NULL. | |
| /// | |
| /// Either `x` or `y` may be NULL to skip computing that coordinate. This is | |
| /// slightly faster in the common case where only the x-coordinate is needed. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_get_affine_coordinates_GFp') | |
| external int EC_POINT_get_affine_coordinates_GFp( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BIGNUM> x, | |
| ffi.Pointer<BIGNUM> y, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_invert sets `a` equal to minus `a`. It returns one on success and | |
| /// zero otherwise. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_invert') | |
| external int EC_POINT_invert( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> a, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_is_at_infinity returns one iff `point` is the point at infinity and | |
| /// zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_GROUP>, ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_POINT_is_at_infinity', | |
| ) | |
| external int EC_POINT_is_at_infinity( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ); | |
| /// EC_POINT_is_on_curve returns one if `point` is an element of `group` and | |
| /// and zero otherwise or when an error occurs. This is different from OpenSSL, | |
| /// which returns -1 on error. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_is_on_curve') | |
| external int EC_POINT_is_on_curve( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_mul sets r = generator*n + q*m. It returns one on success and zero | |
| /// otherwise. `ctx` may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_mul') | |
| external int EC_POINT_mul( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> r, | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<EC_POINT> q, | |
| ffi.Pointer<BIGNUM> m, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_new returns a fresh `EC_POINT` object in the given group, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_POINT> Function(ffi.Pointer<EC_GROUP>)>( | |
| symbol: 'bssl_dart_EC_POINT_new', | |
| ) | |
| external ffi.Pointer<EC_POINT> EC_POINT_new( | |
| ffi.Pointer<EC_GROUP> group, | |
| ); | |
| /// EC_POINT_oct2point sets `point` from `len` bytes of X9.62 format | |
| /// serialisation in `buf`. It returns one on success and zero on error. `ctx` | |
| /// may be NULL. It's considered an error if `buf` does not represent a point on | |
| /// the curve. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_oct2point') | |
| external int EC_POINT_oct2point( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int len, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_point2buf serialises `point` into the X9.62 form given by `form` to | |
| /// a newly-allocated buffer and sets `*out_buf` to point to it. It returns the | |
| /// length of the result on success or zero on error. The caller must release | |
| /// `*out_buf` with `OPENSSL_free` when done. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_point2buf') | |
| external int EC_POINT_point2buf( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| int form, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_buf, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_point2cbb behaves like `EC_POINT_point2oct` but appends the | |
| /// serialised point to `cbb`. It returns one on success and zero on error. `ctx` | |
| /// is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CBB>, | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_point2cbb') | |
| external int EC_POINT_point2cbb( | |
| ffi.Pointer<CBB> out, | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| int form, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_point2oct serialises `point` into the X9.62 form given by `form` | |
| /// into, at most, `max_out` bytes at `buf`. It returns the number of bytes | |
| /// written or zero on error if `buf` is non-NULL, else the number of bytes | |
| /// needed. `ctx` is ignored and may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_point2oct') | |
| external int EC_POINT_point2oct( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| int form, | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int max_out, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_set_affine_coordinates is an alias of | |
| /// `EC_POINT_set_affine_coordinates_GFp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_set_affine_coordinates') | |
| external int EC_POINT_set_affine_coordinates( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BIGNUM> x, | |
| ffi.Pointer<BIGNUM> y, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_set_affine_coordinates_GFp sets the value of `point` to be | |
| /// (`x`, `y`). `ctx` is ignored and may be NULL. It returns one on success or | |
| /// zero on error. It's considered an error if the point is not on the curve. | |
| /// | |
| /// Note that the corresponding function in OpenSSL versions prior to 1.0.2s does | |
| /// not check if the point is on the curve. This is a security-critical check, so | |
| /// code additionally supporting OpenSSL should repeat the check with | |
| /// `EC_POINT_is_on_curve` or check for older OpenSSL versions with | |
| /// `OPENSSL_VERSION_NUMBER`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_set_affine_coordinates_GFp') | |
| external int EC_POINT_set_affine_coordinates_GFp( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BIGNUM> x, | |
| ffi.Pointer<BIGNUM> y, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_set_compressed_coordinates_GFp sets `point` to equal the point with | |
| /// the given `x` coordinate and the y coordinate specified by `y_bit` (see | |
| /// X9.62). It returns one on success and zero otherwise. `ctx` may be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Int, | |
| ffi.Pointer<BN_CTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EC_POINT_set_compressed_coordinates_GFp') | |
| external int EC_POINT_set_compressed_coordinates_GFp( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ffi.Pointer<BIGNUM> x, | |
| int y_bit, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// EC_POINT_set_to_infinity sets `point` to be the "point at infinity" for the | |
| /// given group. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EC_GROUP>, ffi.Pointer<EC_POINT>)>( | |
| symbol: 'bssl_dart_EC_POINT_set_to_infinity', | |
| ) | |
| external int EC_POINT_set_to_infinity( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> point, | |
| ); | |
| /// EC_curve_nid2nist returns the NIST name of the elliptic curve specified by | |
| /// `nid`, or NULL if `nid` is not a NIST curve. For example, it returns "P-256" | |
| /// for `NID_X9_62_prime256v1`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_EC_curve_nid2nist', | |
| ) | |
| external ffi.Pointer<ffi.Char> EC_curve_nid2nist( | |
| int nid, | |
| ); | |
| /// EC_curve_nist2nid returns the NID of the elliptic curve specified by the NIST | |
| /// name `name`, or `NID_undef` if `name` is not a recognized name. For example, | |
| /// it returns `NID_X9_62_prime256v1` for "P-256". | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_EC_curve_nist2nid', | |
| ) | |
| external int EC_curve_nist2nid( | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// EC_encode_to_curve_p256_xmd_sha256_sswu hashes `msg` to a point on `group` | |
| /// and writes the result to `out`, implementing the P256_XMD:SHA-256_SSWU_NU_ | |
| /// suite from RFC 9380. It returns one on success and zero on error. | |
| /// | |
| /// This is a nonuniform encoding from byte strings to points in `group`. That | |
| /// is, the set of possible outputs is only a fraction of the points in `group`, | |
| /// and some points in this set are more likely to be output than others. See | |
| /// also RFC 9380, section 10.4 | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_encode_to_curve_p256_xmd_sha256_sswu') | |
| external int EC_encode_to_curve_p256_xmd_sha256_sswu( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> dst, | |
| int dst_len, | |
| ffi.Pointer<ffi.Uint8> msg, | |
| int msg_len, | |
| ); | |
| /// EC_encode_to_curve_p384_xmd_sha384_sswu hashes `msg` to a point on `group` | |
| /// and writes the result to `out`, implementing the P384_XMD:SHA-384_SSWU_NU_ | |
| /// suite from RFC 9380. It returns one on success and zero on error. | |
| /// | |
| /// This is a nonuniform encoding from byte strings to points in `group`. That | |
| /// is, the set of possible outputs is only a fraction of the points in `group`, | |
| /// and some points in this set are more likely to be output than others. See | |
| /// also RFC 9380, section 10.4 | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_encode_to_curve_p384_xmd_sha384_sswu') | |
| external int EC_encode_to_curve_p384_xmd_sha384_sswu( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> dst, | |
| int dst_len, | |
| ffi.Pointer<ffi.Uint8> msg, | |
| int msg_len, | |
| ); | |
| /// EC_get_builtin_curves writes at most `max_num_curves` elements to | |
| /// `out_curves` and returns the total number that it would have written, had | |
| /// `max_num_curves` been large enough. | |
| /// | |
| /// The `EC_builtin_curve` items describe the supported elliptic curves. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EC_builtin_curve>, ffi.Size)>( | |
| symbol: 'bssl_dart_EC_get_builtin_curves', | |
| ) | |
| external int EC_get_builtin_curves( | |
| ffi.Pointer<EC_builtin_curve> out_curves, | |
| int max_num_curves, | |
| ); | |
| /// EC_group_p224 returns an `EC_GROUP` for P-224, also known as secp224r1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function()>(symbol: 'bssl_dart_EC_group_p224') | |
| external ffi.Pointer<EC_GROUP> EC_group_p224(); | |
| /// EC_group_p256 returns an `EC_GROUP` for P-256, also known as secp256r1 or | |
| /// prime256v1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function()>(symbol: 'bssl_dart_EC_group_p256') | |
| external ffi.Pointer<EC_GROUP> EC_group_p256(); | |
| /// EC_group_p384 returns an `EC_GROUP` for P-384, also known as secp384r1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function()>(symbol: 'bssl_dart_EC_group_p384') | |
| external ffi.Pointer<EC_GROUP> EC_group_p384(); | |
| /// EC_group_p521 returns an `EC_GROUP` for P-521, also known as secp521r1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_GROUP> Function()>(symbol: 'bssl_dart_EC_group_p521') | |
| external ffi.Pointer<EC_GROUP> EC_group_p521(); | |
| /// EC_hash_to_curve_p256_xmd_sha256_sswu hashes `msg` to a point on `group` and | |
| /// writes the result to `out`, implementing the P256_XMD:SHA-256_SSWU_RO_ suite | |
| /// from RFC 9380. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_hash_to_curve_p256_xmd_sha256_sswu') | |
| external int EC_hash_to_curve_p256_xmd_sha256_sswu( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> dst, | |
| int dst_len, | |
| ffi.Pointer<ffi.Uint8> msg, | |
| int msg_len, | |
| ); | |
| /// EC_hash_to_curve_p384_xmd_sha384_sswu hashes `msg` to a point on `group` and | |
| /// writes the result to `out`, implementing the P384_XMD:SHA-384_SSWU_RO_ suite | |
| /// from RFC 9380. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_hash_to_curve_p384_xmd_sha384_sswu') | |
| external int EC_hash_to_curve_p384_xmd_sha384_sswu( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> dst, | |
| int dst_len, | |
| ffi.Pointer<ffi.Uint8> msg, | |
| int msg_len, | |
| ); | |
| /// EC_wpa3_sae_hash_to_curve_p256 hashes `salt` and `ikm` to a point on `group` | |
| /// and writes the result to `out`, implementing the WPA3 SAE hash-to-curve | |
| /// variant for P-256 defined in IEEE Std 802.11-2020, Section 12.4.4.2.3. It | |
| /// returns one on success and zero on error. `salt` is the HKDF-Extract salt, | |
| /// which is the SSID. `ikm` is the HKDF-Extract input, or password and | |
| /// identifier concatenation. | |
| /// | |
| /// This generates the PT value. The PWE value still requires multiplication by | |
| /// the hashed MAC addresses. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EC_wpa3_sae_hash_to_curve_p256') | |
| external int EC_wpa3_sae_hash_to_curve_p256( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| ffi.Pointer<ffi.Uint8> ikm, | |
| int ikm_len, | |
| ); | |
| /// EC_wpa3_sae_hunt_and_peck_p256 hashes `salt` and `password` to a point on | |
| /// `group` and writes the result to `out`, using the WPA3 "hunt and peck" | |
| /// algorithm defined in IEEE Std 802.11-2020, Section 12.4.4.2.2. It returns one | |
| /// on success and zero on error. `group` must be P-256. `salt` is the | |
| /// HKDF-Extract salt, which is the MAC concatenation. `password` is the | |
| /// password, used to compute the HKDF-Extract input. | |
| /// | |
| /// Unlike a proper hash-to-curve construction, this algorithm is based on | |
| /// rejection sampling and cannot run in time independent of `in`. To reduce | |
| /// information leakage, the number of iterations is blinded up to | |
| /// `min_iterations`. If at most `min_iterations` are needed to find a point, | |
| /// only this fact is leaked. However, past `min_iterations`, the number of | |
| /// iterations used may be leaked as a side channel. | |
| /// | |
| /// Each iteration has a roughly 50% probability of finding an output. For | |
| /// example, a 64 iteration minimum reduces the chance of leak to 2^-64. However, | |
| /// running time scales linearly with `min_iterations`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_GROUP>, | |
| ffi.Pointer<EC_POINT>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Uint8, | |
| ) | |
| >(symbol: 'bssl_dart_EC_wpa3_sae_hunt_and_peck_p256') | |
| external int EC_wpa3_sae_hunt_and_peck_p256( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<EC_POINT> out, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| ffi.Pointer<ffi.Uint8> password, | |
| int password_len, | |
| int min_iterations, | |
| ); | |
| /// ED25519_keypair sets `out_public_key` and `out_private_key` to a freshly | |
| /// generated, public–private key pair. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_ED25519_keypair', | |
| ) | |
| external void ED25519_keypair( | |
| ffi.Pointer<ffi.Uint8> out_public_key, | |
| ffi.Pointer<ffi.Uint8> out_private_key, | |
| ); | |
| /// ED25519_keypair_from_seed calculates a public and private key from an | |
| /// Ed25519 “seed”. Seed values are not exposed by this API (although they | |
| /// happen to be the first 32 bytes of a private key) so this function is for | |
| /// interoperating with systems that may store just a seed instead of a full | |
| /// private key. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_ED25519_keypair_from_seed') | |
| external void ED25519_keypair_from_seed( | |
| ffi.Pointer<ffi.Uint8> out_public_key, | |
| ffi.Pointer<ffi.Uint8> out_private_key, | |
| ffi.Pointer<ffi.Uint8> seed, | |
| ); | |
| /// ED25519_sign sets `out_sig` to be a signature of `message_len` bytes from | |
| /// `message` using `private_key`. It returns one on success or zero on | |
| /// allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_ED25519_sign') | |
| external int ED25519_sign( | |
| ffi.Pointer<ffi.Uint8> out_sig, | |
| ffi.Pointer<ffi.Uint8> message, | |
| int message_len, | |
| ffi.Pointer<ffi.Uint8> private_key, | |
| ); | |
| /// ED25519_sign_prehashed sets `out_sig` to be a signature of `sha512_digest` | |
| /// using `private_key` following the Ed25519ph algorithm. It returns one on | |
| /// success, or zero otherwise. `sha512_digest` must be the 64-byte result of | |
| /// hashing the input message with SHA-512. `context` allows for domain | |
| /// separation; see https://www.rfc-editor.org/info/rfc8032/#section-8.3. | |
| /// | |
| /// This function can return zero either on allocation failure, or if | |
| /// `context_len` is greater than 255. | |
| /// | |
| /// Note that Ed25519ph (pre-hashed) and "pure" Ed25519 are different algorithms, | |
| /// calling `ED25519_sign` with the digest of a message will *not* return the | |
| /// same output as `ED25519_sign_prehashed`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_ED25519_sign_prehashed') | |
| external int ED25519_sign_prehashed( | |
| ffi.Pointer<ffi.Uint8> out_sig, | |
| ffi.Pointer<ffi.Uint8> context, | |
| int context_len, | |
| ffi.Pointer<ffi.Uint8> sha512_digest, | |
| ffi.Pointer<ffi.Uint8> private_key, | |
| ); | |
| /// ED25519_verify returns one iff `signature` is a valid signature, by | |
| /// `public_key` of `message_len` bytes from `message`. It returns zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_ED25519_verify') | |
| external int ED25519_verify( | |
| ffi.Pointer<ffi.Uint8> message, | |
| int message_len, | |
| ffi.Pointer<ffi.Uint8> signature, | |
| ffi.Pointer<ffi.Uint8> public_key, | |
| ); | |
| /// ED25519_verify_prehashed returns one if `signature` is a valid signature, by | |
| /// `public_key`, of `sha512_digest` following the Ed25519ph algorithm. It | |
| /// returns zero otherwise. `sha512_digest` must be the 64-byte result of hashing | |
| /// the input message with SHA-512. `context` allows for domain separation; see | |
| /// https://www.rfc-editor.org/info/rfc8032/#section-8.3. | |
| /// | |
| /// This function can return zero either if the signature is invalid, or if | |
| /// `context_len` is greater than 255. | |
| /// | |
| /// Note that Ed25519ph (pre-hashed) and "pure" Ed25519 are different algorithms, | |
| /// calling `ED25519_verify` with the digest of a message will *not* return the | |
| /// same output as `ED25519_verify_prehashed`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_ED25519_verify_prehashed') | |
| external int ED25519_verify_prehashed( | |
| ffi.Pointer<ffi.Uint8> context, | |
| int context_len, | |
| ffi.Pointer<ffi.Uint8> sha512_digest, | |
| ffi.Pointer<ffi.Uint8> signature, | |
| ffi.Pointer<ffi.Uint8> public_key, | |
| ); | |
| /// EDIPARTYNAME_free releases memory associated with `name`. EDIPartyName is | |
| /// rarely used in practice, so callers are unlikely to need this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EDIPARTYNAME>)>( | |
| symbol: 'bssl_dart_EDIPARTYNAME_free', | |
| ) | |
| external void EDIPARTYNAME_free( | |
| ffi.Pointer<EDIPARTYNAME> name, | |
| ); | |
| /// EDIPARTYNAME_new returns a new, empty `EDIPARTYNAME`, or NULL on error. | |
| /// EDIPartyName is rarely used in practice, so callers are unlikely to need this | |
| /// function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EDIPARTYNAME> Function()>( | |
| symbol: 'bssl_dart_EDIPARTYNAME_new', | |
| ) | |
| external ffi.Pointer<EDIPARTYNAME> EDIPARTYNAME_new(); | |
| /// ENGINE_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ENGINE_cleanup') | |
| external void ENGINE_cleanup(); | |
| /// ENGINE_free decrements the reference counts for all methods linked from | |
| /// `engine` and frees `engine` itself. It returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_ENGINE_free', | |
| ) | |
| external int ENGINE_free( | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ECDSA_METHOD> Function(ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_ENGINE_get_ECDSA_method', | |
| ) | |
| external ffi.Pointer<ECDSA_METHOD> ENGINE_get_ECDSA_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA_METHOD> Function(ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_ENGINE_get_RSA_method', | |
| ) | |
| external ffi.Pointer<RSA_METHOD> ENGINE_get_RSA_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| /// ENGINE_load_builtin_engines does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>( | |
| symbol: 'bssl_dart_ENGINE_load_builtin_engines', | |
| ) | |
| external void ENGINE_load_builtin_engines(); | |
| /// ENGINE_new returns an empty ENGINE that uses the default method for all | |
| /// algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ENGINE> Function()>(symbol: 'bssl_dart_ENGINE_new') | |
| external ffi.Pointer<ENGINE> ENGINE_new(); | |
| /// ENGINE_register_all_complete returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>( | |
| symbol: 'bssl_dart_ENGINE_register_all_complete', | |
| ) | |
| external int ENGINE_register_all_complete(); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ENGINE>, ffi.Pointer<ECDSA_METHOD>, ffi.Size) | |
| >(symbol: 'bssl_dart_ENGINE_set_ECDSA_method') | |
| external int ENGINE_set_ECDSA_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ffi.Pointer<ECDSA_METHOD> method, | |
| int method_size, | |
| ); | |
| /// Method accessors. | |
| /// | |
| /// Method accessors take a method pointer and the size of the structure. The | |
| /// size allows for ABI compatibility in the case that the method structure is | |
| /// extended with extra elements at the end. Methods are always copied by the | |
| /// set functions. | |
| /// | |
| /// Set functions return one on success and zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ENGINE>, ffi.Pointer<RSA_METHOD>, ffi.Size) | |
| >(symbol: 'bssl_dart_ENGINE_set_RSA_method') | |
| external int ENGINE_set_RSA_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ffi.Pointer<RSA_METHOD> method, | |
| int method_size, | |
| ); | |
| /// ERR_add_error_data takes a variable number (`count`) of const char* | |
| /// pointers, concatenates them and sets the result as the data on the most | |
| /// recent error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_ERR_add_error_data', | |
| ) | |
| external void ERR_add_error_data( | |
| int count, | |
| ); | |
| /// ERR_add_error_dataf takes a printf-style format and arguments, and sets the | |
| /// result as the data on the most recent error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ERR_add_error_dataf', | |
| ) | |
| external void ERR_add_error_dataf( | |
| ffi.Pointer<ffi.Char> format, | |
| ); | |
| /// ERR_clear_error clears the error queue for the current thread. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_clear_error') | |
| external void ERR_clear_error(); | |
| /// ERR_clear_system_error clears the system's error value (i.e. errno). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_clear_system_error') | |
| external void ERR_clear_system_error(); | |
| /// ERR_error_string behaves like `ERR_error_string_n` but `len` is implicitly | |
| /// `ERR_ERROR_STRING_BUF_LEN`. | |
| /// | |
| /// Additionally, if `buf` is NULL, the error string is placed in a static buffer | |
| /// which is returned. This is not thread-safe and only exists for backwards | |
| /// compatibility with legacy callers. The static buffer will be overridden by | |
| /// calls in other threads. | |
| /// | |
| /// Use `ERR_error_string_n` instead. | |
| /// | |
| /// TODO(fork): remove this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_ERR_error_string', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_error_string( | |
| int packed_error, | |
| ffi.Pointer<ffi.Char> buf, | |
| ); | |
| /// ERR_error_string_n generates a human-readable string representing | |
| /// `packed_error`, places it at `buf`, and returns `buf`. It writes at most | |
| /// `len` bytes (including the terminating NUL) and truncates the string if | |
| /// necessary. If `len` is greater than zero then `buf` is always NUL terminated. | |
| /// | |
| /// The string will have the following format: | |
| /// | |
| /// error:[error code]:[library name]:OPENSSL_internal:[reason string] | |
| /// | |
| /// error code is an 8 digit hexadecimal number; library name and reason string | |
| /// are ASCII text. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function(ffi.Uint32, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_ERR_error_string_n') | |
| external ffi.Pointer<ffi.Char> ERR_error_string_n( | |
| int packed_error, | |
| ffi.Pointer<ffi.Char> buf, | |
| int len, | |
| ); | |
| /// ERR_free_strings does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_free_strings') | |
| external void ERR_free_strings(); | |
| /// ERR_func_error_string returns the string "OPENSSL_internal". | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32)>( | |
| symbol: 'bssl_dart_ERR_func_error_string', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_func_error_string( | |
| int packed_error, | |
| ); | |
| /// ERR_get_error gets the packed error code for the least recent error and | |
| /// removes that error from the queue. If there are no errors in the queue then | |
| /// it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function()>(symbol: 'bssl_dart_ERR_get_error') | |
| external int ERR_get_error(); | |
| /// ERR_get_error_line acts like `ERR_get_error`, except that the file and line | |
| /// number of the call that added the error are also returned. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function(ffi.Pointer<ffi.Pointer<ffi.Char>>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_ERR_get_error_line') | |
| external int ERR_get_error_line( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ); | |
| /// ERR_get_error_line_data acts like `ERR_get_error_line`, but also returns the | |
| /// error-specific data pointer and flags. The flags are a bitwise-OR of | |
| /// `ERR_FLAG_*` values. The error-specific data is owned by the error queue | |
| /// and the pointer becomes invalid after the next call that affects the same | |
| /// thread's error queue. If `*flags` contains `ERR_FLAG_STRING` then `*data` is | |
| /// human-readable. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_ERR_get_error_line_data') | |
| external int ERR_get_error_line_data( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> data, | |
| ffi.Pointer<ffi.Int> flags, | |
| ); | |
| /// ERR_get_next_error_library returns a value suitable for passing as the | |
| /// `library` argument to `ERR_put_error`. This is intended for code that wishes | |
| /// to push its own, non-standard errors to the error queue. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_ERR_get_next_error_library') | |
| external int ERR_get_next_error_library(); | |
| /// ERR_lib_error_string returns a string representation of the library that | |
| /// generated `packed_error`, or a placeholder string is the library is | |
| /// unrecognized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32)>( | |
| symbol: 'bssl_dart_ERR_lib_error_string', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_lib_error_string( | |
| int packed_error, | |
| ); | |
| /// ERR_lib_symbol_name returns the symbol name of library that generated | |
| /// `packed_error`, or NULL if unrecognized. For example, an error from | |
| /// `ERR_LIB_EVP` would return "EVP". | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32)>( | |
| symbol: 'bssl_dart_ERR_lib_symbol_name', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_lib_symbol_name( | |
| int packed_error, | |
| ); | |
| /// ERR_load_BIO_strings does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_load_BIO_strings') | |
| external void ERR_load_BIO_strings(); | |
| /// ERR_load_ERR_strings does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_load_ERR_strings') | |
| external void ERR_load_ERR_strings(); | |
| /// ERR_load_RAND_strings does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_load_RAND_strings') | |
| external void ERR_load_RAND_strings(); | |
| /// ERR_load_crypto_strings does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_ERR_load_crypto_strings') | |
| external void ERR_load_crypto_strings(); | |
| /// The "peek" functions act like the `ERR_get_error` functions, above, but they | |
| /// do not remove the error from the queue. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function()>(symbol: 'bssl_dart_ERR_peek_error') | |
| external int ERR_peek_error(); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function(ffi.Pointer<ffi.Pointer<ffi.Char>>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_ERR_peek_error_line') | |
| external int ERR_peek_error_line( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_ERR_peek_error_line_data') | |
| external int ERR_peek_error_line_data( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> data, | |
| ffi.Pointer<ffi.Int> flags, | |
| ); | |
| /// The "peek last" functions act like the "peek" functions, above, except that | |
| /// they return the most recent error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function()>(symbol: 'bssl_dart_ERR_peek_last_error') | |
| external int ERR_peek_last_error(); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function(ffi.Pointer<ffi.Pointer<ffi.Char>>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_ERR_peek_last_error_line') | |
| external int ERR_peek_last_error_line( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Uint32 Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_ERR_peek_last_error_line_data') | |
| external int ERR_peek_last_error_line_data( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> file, | |
| ffi.Pointer<ffi.Int> line, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> data, | |
| ffi.Pointer<ffi.Int> flags, | |
| ); | |
| /// ERR_pop_to_mark removes errors from the most recent to the least recent | |
| /// until (and not including) a "marked" error. It returns zero if no marked | |
| /// error was found (and thus all errors were removed) and one otherwise. Errors | |
| /// are marked using `ERR_set_mark`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_ERR_pop_to_mark') | |
| external int ERR_pop_to_mark(); | |
| /// ERR_print_errors prints the current contents of the error stack to `bio` | |
| /// using human readable strings where possible. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_ERR_print_errors', | |
| ) | |
| external void ERR_print_errors( | |
| ffi.Pointer<BIO> bio, | |
| ); | |
| /// ERR_print_errors_cb clears the current thread's error queue, calling | |
| /// `callback` with a string representation of each error, from the least recent | |
| /// to the most recent error. | |
| /// | |
| /// The string will have the following format (which differs from | |
| /// `ERR_error_string`): | |
| /// | |
| /// [thread id]:error:[error code]:[library name]:OPENSSL_internal:[reason string]:[file]:[line number]:[optional string data] | |
| /// | |
| /// The callback can return one to continue the iteration or zero to stop it. | |
| /// The `ctx` argument is an opaque value that is passed through to the | |
| /// callback. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ERR_print_errors_callback_t, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_ERR_print_errors_cb') | |
| external void ERR_print_errors_cb( | |
| ERR_print_errors_callback_t callback, | |
| ffi.Pointer<ffi.Void> ctx, | |
| ); | |
| /// ERR_print_errors_fp clears the current thread's error queue, printing each | |
| /// error to `file`. See `ERR_print_errors_cb` for the format. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<FILE>)>( | |
| symbol: 'bssl_dart_ERR_print_errors_fp', | |
| ) | |
| external void ERR_print_errors_fp( | |
| ffi.Pointer<FILE> file, | |
| ); | |
| /// ERR_put_error adds an error to the error queue, dropping the least recent | |
| /// error if necessary for space reasons. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.UnsignedInt, | |
| ) | |
| >(symbol: 'bssl_dart_ERR_put_error') | |
| external void ERR_put_error( | |
| int library, | |
| int unused, | |
| int reason, | |
| ffi.Pointer<ffi.Char> file, | |
| int line, | |
| ); | |
| /// ERR_reason_error_string returns a string representation of the reason for | |
| /// `packed_error`, or a placeholder string if the reason is unrecognized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32)>( | |
| symbol: 'bssl_dart_ERR_reason_error_string', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_reason_error_string( | |
| int packed_error, | |
| ); | |
| /// ERR_reason_symbol_name returns the symbol name of the reason for | |
| /// `packed_error`, or NULL if unrecognized. For example, `ERR_R_INTERNAL_ERROR` | |
| /// would return "INTERNAL_ERROR". | |
| /// | |
| /// Errors from the `ERR_LIB_SYS` library are typically `errno` values and will | |
| /// return NULL. User-defined errors will also return NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Uint32)>( | |
| symbol: 'bssl_dart_ERR_reason_symbol_name', | |
| ) | |
| external ffi.Pointer<ffi.Char> ERR_reason_symbol_name( | |
| int packed_error, | |
| ); | |
| /// ERR_remove_state calls `ERR_clear_error`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_ERR_remove_state', | |
| ) | |
| external void ERR_remove_state( | |
| int pid, | |
| ); | |
| /// ERR_remove_thread_state clears the error queue for the current thread if | |
| /// `tid` is NULL. Otherwise it calls `assert(0)`, because it's no longer | |
| /// possible to delete the error queue for other threads. | |
| /// | |
| /// Use `ERR_clear_error` instead. Note error queues are deleted automatically on | |
| /// thread exit. You do not need to call this function to release memory. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CRYPTO_THREADID>)>( | |
| symbol: 'bssl_dart_ERR_remove_thread_state', | |
| ) | |
| external void ERR_remove_thread_state( | |
| ffi.Pointer<CRYPTO_THREADID> tid, | |
| ); | |
| /// ERR_set_error_data sets the data on the most recent error to `data`, which | |
| /// must be a NUL-terminated string. `flags` must contain `ERR_FLAG_STRING`. If | |
| /// `flags` contains `ERR_FLAG_MALLOCED`, this function takes ownership of | |
| /// `data`, which must have been allocated with `OPENSSL_malloc`. Otherwise, it | |
| /// saves a copy of `data`. | |
| /// | |
| /// Note this differs from OpenSSL which, when `ERR_FLAG_MALLOCED` is unset, | |
| /// saves the pointer as-is and requires it remain valid for the lifetime of the | |
| /// address space. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Char>, ffi.Int)>( | |
| symbol: 'bssl_dart_ERR_set_error_data', | |
| ) | |
| external void ERR_set_error_data( | |
| ffi.Pointer<ffi.Char> data, | |
| int flags, | |
| ); | |
| /// ERR_set_mark "marks" the most recent error for use with `ERR_pop_to_mark`. | |
| /// It returns one if an error was marked and zero if there are no errors. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_ERR_set_mark') | |
| external int ERR_set_mark(); | |
| /// EVP_AEAD_CTX_aead returns the underlying AEAD for `ctx`, or NULL if one has | |
| /// not been set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function(ffi.Pointer<EVP_AEAD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_CTX_aead', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_AEAD_CTX_aead( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ); | |
| /// EVP_AEAD_CTX_cleanup frees any data allocated by `ctx`. It is a no-op to | |
| /// call `EVP_AEAD_CTX_cleanup` on a `EVP_AEAD_CTX` that has been `memset` to | |
| /// all zeros. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_AEAD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_CTX_cleanup', | |
| ) | |
| external void EVP_AEAD_CTX_cleanup( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ); | |
| /// EVP_AEAD_CTX_free calls `EVP_AEAD_CTX_cleanup` and `OPENSSL_free` on | |
| /// `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_AEAD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_CTX_free', | |
| ) | |
| external void EVP_AEAD_CTX_free( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ); | |
| /// EVP_AEAD_CTX_get_iv sets `*out_len` to the length of the IV for `ctx` and | |
| /// sets `*out_iv` to point to that many bytes of the current IV. This is only | |
| /// meaningful for AEADs with implicit IVs (i.e. CBC mode in TLS 1.0). | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_get_iv') | |
| external int EVP_AEAD_CTX_get_iv( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_iv, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// EVP_AEAD_CTX_init initializes `ctx` for the given AEAD algorithm. The `impl` | |
| /// argument is ignored and should be NULL. Authentication tags may be truncated | |
| /// by passing a size as `tag_len`. A `tag_len` of zero indicates the default | |
| /// tag length and this is defined as EVP_AEAD_DEFAULT_TAG_LENGTH for | |
| /// readability. | |
| /// | |
| /// Returns 1 on success. Otherwise returns 0 and pushes to the error stack. In | |
| /// the error case, you do not need to call `EVP_AEAD_CTX_cleanup`, but it's | |
| /// harmless to do so. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<EVP_AEAD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Size, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_init') | |
| external int EVP_AEAD_CTX_init( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ffi.Pointer<ffi.Uint8> key, | |
| int key_len, | |
| int tag_len, | |
| ffi.Pointer<ENGINE> impl, | |
| ); | |
| /// EVP_AEAD_CTX_init_with_direction calls `EVP_AEAD_CTX_init` for normal | |
| /// AEADs. For TLS-specific AEADs, it initializes `ctx` for a given direction. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<EVP_AEAD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_init_with_direction') | |
| external int EVP_AEAD_CTX_init_with_direction( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ffi.Pointer<ffi.Uint8> key, | |
| int key_len, | |
| int tag_len, | |
| int dir, | |
| ); | |
| /// EVP_AEAD_CTX_new allocates an `EVP_AEAD_CTX`, calls `EVP_AEAD_CTX_init` and | |
| /// returns the `EVP_AEAD_CTX`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_AEAD_CTX> Function( | |
| ffi.Pointer<EVP_AEAD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_new') | |
| external ffi.Pointer<EVP_AEAD_CTX> EVP_AEAD_CTX_new( | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ffi.Pointer<ffi.Uint8> key, | |
| int key_len, | |
| int tag_len, | |
| ); | |
| /// EVP_AEAD_CTX_open authenticates `in_len` bytes from `in` and `ad_len` bytes | |
| /// from `ad` and decrypts at most `in_len` bytes into `out`. It returns one on | |
| /// success and zero otherwise. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// At most `in_len` bytes are written to `out`. In order to ensure success, | |
| /// `max_out_len` should be at least `in_len`. On successful return, `*out_len` | |
| /// is set to the actual number of bytes written. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_open` never results in a partial output. If `max_out_len` is | |
| /// insufficient, zero will be returned. If any error occurs, `out` will be | |
| /// filled with zero bytes and `*out_len` set to zero. | |
| /// | |
| /// If `in` and `out` alias then `out` must be == `in`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_open') | |
| external int EVP_AEAD_CTX_open( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ffi.Pointer<ffi.Uint8> ad, | |
| int ad_len, | |
| ); | |
| /// EVP_AEAD_CTX_open_gather decrypts and authenticates `in_len` bytes from `in` | |
| /// and authenticates `ad_len` bytes from `ad` using `in_tag_len` bytes of | |
| /// authentication tag from `in_tag`. If successful, it writes `in_len` bytes of | |
| /// plaintext to `out`. It returns one on success and zero otherwise. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_open_gather` never results in a partial output. If any error | |
| /// occurs, `out` will be filled with zero bytes. | |
| /// | |
| /// If `in` and `out` alias then `out` must be == `in`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_open_gather') | |
| external int EVP_AEAD_CTX_open_gather( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ffi.Pointer<ffi.Uint8> in_tag, | |
| int in_tag_len, | |
| ffi.Pointer<ffi.Uint8> ad, | |
| int ad_len, | |
| ); | |
| /// EVP_AEAD_CTX_openv authenticates the `in` bytes from `iovec` and `aadvec`, | |
| /// and decrypts the `in` bytes to the `out` pointers of `iovec`. It returns one | |
| /// on success and zero otherwise. | |
| /// | |
| /// This function computes the same output as `EVP_AEAD_CTX_open`, but without | |
| /// requiring the input or output to be a contiguous buffer. The individual | |
| /// input and output pieces are logically concatenated for a single operation; | |
| /// their boundaries are not semantically significant and will not impact the | |
| /// output. | |
| /// | |
| /// This function may (and usually will) output less than the total length of | |
| /// `iovec`. In this case, it outputs to a prefix of `iovec`'s output space, | |
| /// then returns the length of what was actually written. | |
| /// | |
| /// In AEADs with a fixed-length authentication tag, the tag is treated as if it | |
| /// were appended to the ciphertext, and successful outputs will always be | |
| /// exactly the tag length shorter. To open with a separate, detached tag, | |
| /// either provide it as a separate `CRYPTO_IOVEC`, or use | |
| /// `EVP_AEAD_CTX_openv_detached`. The latter may be more convenient, one does | |
| /// not need consider the possibility of output to the final `CRYPTO_IOVEC`. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_openv` never results in a partial output. If any error occurs, | |
| /// `out` will be filled with zero bytes and `*out_len` set to zero. | |
| /// | |
| /// No output pointer may alias any other pointer passed to this function either | |
| /// directly or via `iovec` and `aadvec`, with the one exception that it is | |
| /// permitted for the same `iovec` member's `in` and `out` members to be equal | |
| /// (in-place operation). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<CRYPTO_IOVEC>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<CRYPTO_IVEC>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_openv') | |
| external int EVP_AEAD_CTX_openv( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<CRYPTO_IOVEC> iovec, | |
| int num_iovec, | |
| ffi.Pointer<ffi.Size> out_total_bytes, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<CRYPTO_IVEC> aadvec, | |
| int num_aadvec, | |
| ); | |
| /// EVP_AEAD_CTX_openv_detached authenticates the `in` bytes from `iovec` and | |
| /// `aadvec` using `in_tag_len` bytes of authentication tag from `in_tag`. If | |
| /// successful, it writes the plaintext of the `in` bytes to the `out` pointers | |
| /// of `iovec`. It returns one on success and zero otherwise. | |
| /// | |
| /// This function is usable with AEADs whose output can be split into a | |
| /// ciphertext portion, with the same length as the plaintext, and a | |
| /// fixed-length authentication tag. If the AEAD has a variable-length overhead, | |
| /// this function will return zero. Such AEADs can only be used with | |
| /// `EVP_AEAD_CTX_openv`. | |
| /// | |
| /// This function computes the same output as `EVP_AEAD_CTX_open`, but with a | |
| /// detached tag and without requiring the input or output to be a contiguous | |
| /// buffer. The individual input and output pieces are logically concatenated | |
| /// for a single operation; their boundaries are not semantically significant | |
| /// and will not impact the output. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_openv_detached` never results in a partial output. If any | |
| /// error occurs, `out` will be filled with zero bytes. | |
| /// | |
| /// No output pointer may alias any other pointer passed to this function either | |
| /// directly or via `iovec` and `aadvec`, with the one exception that it is | |
| /// permitted for the same `iovec` member's `in` and `out` members to be equal | |
| /// (in-place operation). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<CRYPTO_IOVEC>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<CRYPTO_IVEC>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_openv_detached') | |
| external int EVP_AEAD_CTX_openv_detached( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<CRYPTO_IOVEC> iovec, | |
| int num_iovec, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<ffi.Uint8> in_tag, | |
| int in_tag_len, | |
| ffi.Pointer<CRYPTO_IVEC> aadvec, | |
| int num_aadvec, | |
| ); | |
| /// EVP_AEAD_CTX_seal encrypts and authenticates `in_len` bytes from `in` and | |
| /// authenticates `ad_len` bytes from `ad` and writes the result to `out`. It | |
| /// returns one on success and zero otherwise. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// At most `max_out_len` bytes are written to `out` and, in order to ensure | |
| /// success, `max_out_len` should be `in_len` plus the result of | |
| /// `EVP_AEAD_max_overhead`. On successful return, `*out_len` is set to the | |
| /// actual number of bytes written. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_seal` never results in a partial output. If `max_out_len` is | |
| /// insufficient, zero will be returned. If any error occurs, `out` will be | |
| /// filled with zero bytes and `*out_len` set to zero. | |
| /// | |
| /// If `in` and `out` alias then `out` must be == `in`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_seal') | |
| external int EVP_AEAD_CTX_seal( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ffi.Pointer<ffi.Uint8> ad, | |
| int ad_len, | |
| ); | |
| /// EVP_AEAD_CTX_seal_scatter encrypts and authenticates `in_len` bytes from `in` | |
| /// and authenticates `ad_len` bytes from `ad`. It writes `in_len` bytes of | |
| /// ciphertext to `out` and the authentication tag to `out_tag`. It returns one | |
| /// on success and zero otherwise. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// Exactly `in_len` bytes are written to `out`, and up to | |
| /// `EVP_AEAD_max_overhead+extra_in_len` bytes to `out_tag`. On successful | |
| /// return, `*out_tag_len` is set to the actual number of bytes written to | |
| /// `out_tag`. | |
| /// | |
| /// `extra_in` may point to an additional plaintext input buffer if the cipher | |
| /// supports it. If present, `extra_in_len` additional bytes of plaintext are | |
| /// encrypted and authenticated, and the ciphertext is written (before the tag) | |
| /// to `out_tag`. `max_out_tag_len` must be sized to allow for the additional | |
| /// `extra_in_len` bytes. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_seal_scatter` never results in a partial output. If | |
| /// `max_out_tag_len` is insufficient, zero will be returned. If any error | |
| /// occurs, `out` and `out_tag` will be filled with zero bytes and `*out_tag_len` | |
| /// set to zero. | |
| /// | |
| /// If `in` and `out` alias then `out` must be == `in`. `out_tag` may not alias | |
| /// any other argument. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_seal_scatter') | |
| external int EVP_AEAD_CTX_seal_scatter( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> out_tag, | |
| ffi.Pointer<ffi.Size> out_tag_len, | |
| int max_out_tag_len, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ffi.Pointer<ffi.Uint8> extra_in, | |
| int extra_in_len, | |
| ffi.Pointer<ffi.Uint8> ad, | |
| int ad_len, | |
| ); | |
| /// EVP_AEAD_CTX_sealv encrypts and authenticates the `in` bytes from `iovec` | |
| /// and authenticates the `aadvec` bytes. It writes the same amount of | |
| /// ciphertext to the `out` pointers of `iovec` and the authentication tag to | |
| /// `out_tag`. It returns one on success and zero otherwise. | |
| /// | |
| /// This function computes the same output as `EVP_AEAD_CTX_seal_scatter`, but | |
| /// without requiring the input or output to be a contiguous buffer. The | |
| /// individual input and output pieces are logically concatenated for a single | |
| /// operation; their boundaries are not semantically significant and will not | |
| /// impact the output. | |
| /// | |
| /// This function may be called concurrently with itself or any other seal/open | |
| /// function on the same `EVP_AEAD_CTX`. | |
| /// | |
| /// Exactly `len` bytes are written to each `out` member of the `iovec`, and up | |
| /// to `EVP_AEAD_max_overhead+extra_in_len` bytes to `out_tag`. On successful | |
| /// return, `*out_tag_len` is set to the actual number of bytes written to | |
| /// `out_tag`. | |
| /// | |
| /// The length of `nonce`, `nonce_len`, must be equal to the result of | |
| /// `EVP_AEAD_nonce_length` for this AEAD. | |
| /// | |
| /// `EVP_AEAD_CTX_sealv` never results in a partial output. If `max_out_tag_len` | |
| /// is insufficient, zero will be returned. If any error occurs, the `out` | |
| /// members of the `iovec` and `out_tag` will be filled with zero bytes and | |
| /// `*out_tag_len` set to zero. | |
| /// | |
| /// No output pointer may alias any other pointer passed to this function either | |
| /// directly or via `iovec` and `aadvec`, with the one exception that it is | |
| /// permitted for the same `iovec` member's `in` and `out` members to be equal | |
| /// (in-place operation). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<CRYPTO_IOVEC>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<CRYPTO_IVEC>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_sealv') | |
| external int EVP_AEAD_CTX_sealv( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<CRYPTO_IOVEC> iovec, | |
| int num_iovec, | |
| ffi.Pointer<ffi.Uint8> out_tag, | |
| ffi.Pointer<ffi.Size> out_tag_len, | |
| int max_out_tag_len, | |
| ffi.Pointer<ffi.Uint8> nonce, | |
| int nonce_len, | |
| ffi.Pointer<CRYPTO_IVEC> aadvec, | |
| int num_aadvec, | |
| ); | |
| /// EVP_AEAD_CTX_tag_len computes the exact byte length of the tag written by | |
| /// `EVP_AEAD_CTX_seal_scatter` and writes it to `*out_tag_len`. It returns one | |
| /// on success or zero on error. `in_len` and `extra_in_len` must equal the | |
| /// arguments of the same names passed to `EVP_AEAD_CTX_seal_scatter`. | |
| /// | |
| /// To compute the exact byte length of the output written by | |
| /// `EVP_AEAD_CTX_seal`, set `extra_in_len` to zero and add `in_len` to the | |
| /// result. | |
| /// | |
| /// To compute the exact byte length of the tag written by `EVP_AEAD_CTX_sealv`, | |
| /// set `in_len` to the sum of `len` over the entire `iovec`, and set | |
| /// `extra_in_len` to zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_AEAD_CTX>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_AEAD_CTX_tag_len') | |
| external int EVP_AEAD_CTX_tag_len( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ffi.Pointer<ffi.Size> out_tag_len, | |
| int in_len, | |
| int extra_in_len, | |
| ); | |
| /// EVP_AEAD_CTX_zero sets an uninitialized `ctx` to the zero state. It must be | |
| /// initialized with `EVP_AEAD_CTX_init` before use. It is safe, but not | |
| /// necessary, to call `EVP_AEAD_CTX_cleanup` in this state. This may be used for | |
| /// more uniform cleanup of `EVP_AEAD_CTX`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_AEAD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_CTX_zero', | |
| ) | |
| external void EVP_AEAD_CTX_zero( | |
| ffi.Pointer<EVP_AEAD_CTX> ctx, | |
| ); | |
| /// EVP_AEAD_key_length returns the length, in bytes, of the keys used by | |
| /// `aead`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_AEAD>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_key_length', | |
| ) | |
| external int EVP_AEAD_key_length( | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ); | |
| /// EVP_AEAD_max_overhead returns the maximum number of additional bytes added | |
| /// by the act of sealing data with `aead`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_AEAD>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_max_overhead', | |
| ) | |
| external int EVP_AEAD_max_overhead( | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ); | |
| /// EVP_AEAD_max_tag_len returns the maximum tag length when using `aead`. This | |
| /// is the largest value that can be passed as `tag_len` to | |
| /// `EVP_AEAD_CTX_init`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_AEAD>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_max_tag_len', | |
| ) | |
| external int EVP_AEAD_max_tag_len( | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ); | |
| /// EVP_AEAD_nonce_length returns the length, in bytes, of the per-message nonce | |
| /// for `aead`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_AEAD>)>( | |
| symbol: 'bssl_dart_EVP_AEAD_nonce_length', | |
| ) | |
| external int EVP_AEAD_nonce_length( | |
| ffi.Pointer<EVP_AEAD> aead, | |
| ); | |
| /// EVP_BytesToKey generates a key and IV for the cipher `type` by iterating | |
| /// `md` `count` times using `data` and an optional `salt`, writing the result to | |
| /// `key` and `iv`. If not NULL, the `key` and `iv` buffers must have enough | |
| /// space to hold a key and IV for `type`, as returned by `EVP_CIPHER_key_length` | |
| /// and `EVP_CIPHER_iv_length`. This function returns the length of the key | |
| /// (without the IV) on success or zero on error. | |
| /// | |
| /// If `salt` is NULL, the empty string is used as the salt. Salt lengths other | |
| /// than 0 and 8 are not supported by this function. Either of `key` or `iv` may | |
| /// be NULL to skip that output. | |
| /// | |
| /// When the total data derived is less than the size of `md`, this function | |
| /// implements PBKDF1 from RFC 8018. Otherwise, it generalizes PBKDF1 by | |
| /// computing prepending the previous output to `data` and re-running PBKDF1 for | |
| /// further output. | |
| /// | |
| /// This function is provided for compatibility with legacy uses of PBKDF1. New | |
| /// applications should use a more modern algorithm, such as `EVP_PBE_scrypt`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_BytesToKey') | |
| external int EVP_BytesToKey( | |
| ffi.Pointer<EVP_CIPHER> type, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| int count, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ); | |
| /// EVP_CIPHER_CTX_block_size returns the block size, in bytes, of the cipher | |
| /// underlying `ctx`, or one if the cipher is a stream cipher. It will crash if | |
| /// no cipher has been configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_block_size', | |
| ) | |
| external int EVP_CIPHER_CTX_block_size( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_cipher returns the `EVP_CIPHER` underlying `ctx`, or NULL if | |
| /// none has been set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_cipher', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_CIPHER_CTX_cipher( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_cleanup frees any memory referenced by `ctx`. It returns | |
| /// one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_cleanup', | |
| ) | |
| external int EVP_CIPHER_CTX_cleanup( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_copy sets `out` to be a duplicate of the current state of | |
| /// `in`. The `out` argument must have been previously initialised, e.g. with | |
| /// `EVP_CIPHER_CTX_init` or `EVP_CIPHER_CTX_new`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Pointer<EVP_CIPHER_CTX>) | |
| >(symbol: 'bssl_dart_EVP_CIPHER_CTX_copy') | |
| external int EVP_CIPHER_CTX_copy( | |
| ffi.Pointer<EVP_CIPHER_CTX> out, | |
| ffi.Pointer<EVP_CIPHER_CTX> in$, | |
| ); | |
| /// EVP_CIPHER_CTX_ctrl is an `ioctl` like function. The `command` argument | |
| /// should be one of the `EVP_CTRL_*` values. The `arg` and `ptr` arguments are | |
| /// specific to the command in question. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CIPHER_CTX_ctrl') | |
| external int EVP_CIPHER_CTX_ctrl( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| int command, | |
| int arg, | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| /// EVP_CIPHER_CTX_encrypting returns one if `ctx` is configured for encryption | |
| /// and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_encrypting', | |
| ) | |
| external int EVP_CIPHER_CTX_encrypting( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_flags returns a value which is the OR of zero or more | |
| /// `EVP_CIPH_*` flags. It will crash if no cipher has been configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_flags', | |
| ) | |
| external int EVP_CIPHER_CTX_flags( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_free calls `EVP_CIPHER_CTX_cleanup` on `ctx` and then frees | |
| /// `ctx` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_free', | |
| ) | |
| external void EVP_CIPHER_CTX_free( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_get_app_data returns the opaque, application data pointer for | |
| /// `ctx`, or NULL if none has been set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_get_app_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> EVP_CIPHER_CTX_get_app_data( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_init sets an uninitialized `EVP_CIPHER_CTX` to the zero state. | |
| /// This is the same as setting the structure to zero. | |
| /// | |
| /// This function is used for initializing uninitialized memory in an | |
| /// `EVP_CIPHER_CTX`, e.g. if it is declared as a local variable on the stack. | |
| /// This function should not be used on objects that have already been | |
| /// initialized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_init', | |
| ) | |
| external void EVP_CIPHER_CTX_init( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_iv_length returns the IV size, in bytes, of the cipher | |
| /// underlying `ctx`. It will crash if no cipher has been configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_iv_length', | |
| ) | |
| external int EVP_CIPHER_CTX_iv_length( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_key_length returns the key size, in bytes, of the cipher | |
| /// underlying `ctx` or zero if no cipher has been configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_key_length', | |
| ) | |
| external int EVP_CIPHER_CTX_key_length( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_max_final returns the maximum number of bytes that may | |
| /// be output from `ctx` by a call to `EVP_CipherFinal_ex2`. This takes the | |
| /// current state of `ctx` into account, so the output will change as bytes are | |
| /// passed in and out. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_max_final', | |
| ) | |
| external int EVP_CIPHER_CTX_max_final( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_max_next_update returns the maximum number of bytes that may | |
| /// be output from `ctx` by a call to `EVP_CipherUpdate_ex` with `in_len` bytes | |
| /// of input. This takes the current state of `ctx` into account, so the output | |
| /// will change as bytes are passed in and out. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Size)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_max_next_update', | |
| ) | |
| external int EVP_CIPHER_CTX_max_next_update( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| int in_len, | |
| ); | |
| /// EVP_CIPHER_CTX_mode returns one of the `EVP_CIPH_*` cipher mode values | |
| /// enumerated below. It will crash if no cipher has been configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_mode', | |
| ) | |
| external int EVP_CIPHER_CTX_mode( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_new returns a newly-allocated `EVP_CIPHER_CTX` in the zero | |
| /// state, or NULL on allocation failure. The caller must use | |
| /// `EVP_CIPHER_CTX_free` to release the resulting object. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER_CTX> Function()>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_new', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER_CTX> EVP_CIPHER_CTX_new(); | |
| /// EVP_CIPHER_CTX_nid returns a NID identifying the `EVP_CIPHER` underlying | |
| /// `ctx` (e.g. `NID_aes_128_gcm`). It will crash if no cipher has been | |
| /// configured. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_nid', | |
| ) | |
| external int EVP_CIPHER_CTX_nid( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_reset calls `EVP_CIPHER_CTX_cleanup` followed by | |
| /// `EVP_CIPHER_CTX_init` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_reset', | |
| ) | |
| external int EVP_CIPHER_CTX_reset( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ); | |
| /// EVP_CIPHER_CTX_set_app_data sets the opaque, application data pointer for | |
| /// `ctx` to `data`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_EVP_CIPHER_CTX_set_app_data') | |
| external void EVP_CIPHER_CTX_set_app_data( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| ); | |
| /// EVP_CIPHER_CTX_set_flags does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Uint32)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_set_flags', | |
| ) | |
| external void EVP_CIPHER_CTX_set_flags( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| int flags, | |
| ); | |
| /// EVP_CIPHER_CTX_set_key_length sets the key length for `ctx`. This is only | |
| /// valid for ciphers that can take a variable length key. It returns one on | |
| /// success and zero on error. | |
| /// | |
| /// In order to use this function, |ctx| must have been configured with an | |
| /// |EVP_CIPHER| with |EVP_CipherInit_ex|. Callers should first configure only | |
| /// the cipher, leaving |key| NULL, call |EVP_CIPHER_CTX_set_key_length|, and | |
| /// finally call |EVP_CipherInit_ex| with a NULL |cipher| and non-NULL |key|. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_set_key_length', | |
| ) | |
| external int EVP_CIPHER_CTX_set_key_length( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| int key_len, | |
| ); | |
| /// EVP_CIPHER_CTX_set_padding sets whether padding is enabled for `ctx` and | |
| /// returns one. Pass a non-zero `pad` to enable padding (the default) or zero | |
| /// to disable. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_CTX_set_padding', | |
| ) | |
| external int EVP_CIPHER_CTX_set_padding( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| int pad, | |
| ); | |
| /// EVP_CIPHER_block_size returns the block size, in bytes, for `cipher`, or one | |
| /// if `cipher` is a stream cipher. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_block_size', | |
| ) | |
| external int EVP_CIPHER_block_size( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_CIPHER_flags returns a value which is the OR of zero or more | |
| /// `EVP_CIPH_*` flags. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_flags', | |
| ) | |
| external int EVP_CIPHER_flags( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_CIPHER_iv_length returns the IV size, in bytes, of `cipher`, or zero if | |
| /// `cipher` doesn't take an IV. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_iv_length', | |
| ) | |
| external int EVP_CIPHER_iv_length( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_CIPHER_key_length returns the key size, in bytes, for `cipher`. If | |
| /// `cipher` can take a variable key length then this function returns the | |
| /// default key length and `EVP_CIPHER_flags` will return a value with | |
| /// `EVP_CIPH_VARIABLE_LENGTH` set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_key_length', | |
| ) | |
| external int EVP_CIPHER_key_length( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_CIPHER_mode returns one of the cipher mode values enumerated below. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_mode', | |
| ) | |
| external int EVP_CIPHER_mode( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_CIPHER_nid returns a NID identifying `cipher`. (For example, | |
| /// `NID_aes_128_gcm`.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_CIPHER>)>( | |
| symbol: 'bssl_dart_EVP_CIPHER_nid', | |
| ) | |
| external int EVP_CIPHER_nid( | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ); | |
| /// EVP_Cipher historically exposed an internal implementation detail of `ctx` | |
| /// and should not be used. Use `EVP_CipherUpdate` and `EVP_CipherFinal_ex` | |
| /// instead. | |
| /// | |
| /// If `ctx`'s cipher does not have the `EVP_CIPH_FLAG_CUSTOM_CIPHER` flag, it | |
| /// encrypts or decrypts `in_len` bytes from `in` and writes the resulting | |
| /// `in_len` bytes to `out`. It returns one on success and zero on error. | |
| /// `in_len` must be a multiple of the cipher's block size, or the behavior is | |
| /// undefined. | |
| /// | |
| /// TODO(davidben): Rather than being undefined (it'll often round the length up | |
| /// and likely read past the buffer), just fail the operation. | |
| /// | |
| /// If `ctx`'s cipher has the `EVP_CIPH_FLAG_CUSTOM_CIPHER` flag, it runs in one | |
| /// of two modes: If `in` is non-NULL, it behaves like `EVP_CipherUpdate`. If | |
| /// `in` is NULL, it behaves like `EVP_CipherFinal_ex`. In both cases, it returns | |
| /// `*out_len` on success and -1 on error. | |
| /// | |
| /// WARNING: The two possible calling conventions of this function signal errors | |
| /// incompatibly. In the first, zero indicates an error. In the second, zero | |
| /// indicates success with zero bytes of output. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_Cipher') | |
| external int EVP_Cipher( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_CipherFinal calls `EVP_CipherFinal_ex`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherFinal') | |
| external int EVP_CipherFinal( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_CipherFinal_ex does the same as `EVP_CipherFinal_ex2`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// WARNING: This function does not check bounds on out, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_CipherFinal_ex2` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherFinal_ex') | |
| external int EVP_CipherFinal_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_CipherFinal_ex2 calls either `EVP_EncryptFinal_ex2` or | |
| /// `EVP_DecryptFinal_ex2` depending on how `ctx` has been setup. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherFinal_ex2') | |
| external int EVP_CipherFinal_ex2( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ); | |
| /// EVP_CipherInit acts like `EVP_CipherInit_ex` except that | |
| /// `EVP_CIPHER_CTX_init` is called on `cipher` first, if `cipher` is not NULL. | |
| /// | |
| /// `EVP_CIPHER_CTX_init` is used for initializing uninitialized memory in an | |
| /// `EVP_CIPHER_CTX`, e.g. if it is declared as a local variable on the stack. | |
| /// Thus this function should not be used on objects that have already been | |
| /// initialized. | |
| /// | |
| /// WARNING: This differs from OpenSSL 1.1.x, where `EVP_CipherInit` and | |
| /// `EVP_CipherInit_ex` are largely equivalent. This difference is because | |
| /// BoringSSL, like OpenSSL 1.0.x, still supports stack-allocating | |
| /// `EVP_CIPHER_CTX`. Implementing the OpenSSL 1.1.x semantics would introduce | |
| /// uninitialized reads in those callers. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherInit') | |
| external int EVP_CipherInit( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| int enc, | |
| ); | |
| /// EVP_CipherInit_ex configures `ctx` for a fresh encryption (or decryption, if | |
| /// `enc` is zero) operation using `cipher`. The memory in `ctx` must already | |
| /// have been initialized, e.g. with `EVP_CIPHER_CTX_init` or | |
| /// `EVP_CIPHER_CTX_new`. If non-NULL, `key` and `iv` will be used as the key and | |
| /// IV, respectively. These must point to `EVP_CIPHER_key_length` and | |
| /// `EVP_CIPHER_iv_length` bytes, respectively. It returns one on success and | |
| /// zero on error. | |
| /// | |
| /// This function may be called multiple times on a single `EVP_CIPHER_CTX`, | |
| /// either to reset an existing object, or to configure a single operation in | |
| /// multiple steps. In such cases: | |
| /// | |
| /// - `cipher` may be NULL to reuse the previous cipher state. A non-NULL | |
| /// `cipher` will reset all cipher state, including the key and IV, even if | |
| /// configuring the same `EVP_CIPHER` as before. | |
| /// | |
| /// - `key` and `iv` may be NULL to either reuse the previous value, or leave | |
| /// them unconfigured. | |
| /// | |
| /// - `enc` may be -1 to reuse the previous value. In ciphers that use a | |
| /// different key schedule between encryption and decryption (e.g. CBC and ECB | |
| /// modes), callers must configure `key` and `enc` together. | |
| /// | |
| /// Some example multi-step configuration patterns: | |
| /// | |
| /// - If setting a variable-length key with `EVP_CIPHER_CTX_set_key_length`, | |
| /// first configure only `cipher`, then use `EVP_CIPHER_CTX_set_key_length`, | |
| /// and finally configure `key`, leaving `cipher` NULL. | |
| /// | |
| /// - If setting a variable-length IV with `EVP_CTRL_AEAD_SET_IVLEN`, first | |
| /// configure `cipher` and `key`, then use `EVP_CTRL_AEAD_SET_IVLEN`, and | |
| /// finally configure `iv`, leaving other parameters NULL. | |
| /// | |
| /// - If retaining a long-lived context to reuse the key schedule across | |
| /// operations, first configure only `cipher` and `key` on the long-lived | |
| /// context, then copy the key schedule to a per-operation context with | |
| /// `EVP_CIPHER_CTX_copy`, and finally configure only `iv` on the per-operation | |
| /// context. | |
| /// | |
| /// WARNING: This API is difficult to use correctly. Use `EVP_AEAD` for AEADs. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherInit_ex') | |
| external int EVP_CipherInit_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ENGINE> engine, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| int enc, | |
| ); | |
| /// EVP_CipherUpdate does the same as `EVP_CipherUpdate_ex`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// Additionally, if `ctx` is an AEAD cipher, e.g. `EVP_aes_128_gcm`, and `out` | |
| /// is NULL, this function instead behaves like `EVP_CipherUpdateAAD`. | |
| /// | |
| /// WARNING: This function does not check bounds on `out`, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_CipherUpdate_ex` or | |
| /// `EVP_CipherUpdateAAD` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherUpdate') | |
| external int EVP_CipherUpdate( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_CipherUpdateAAD adds `in_len` bytes from `in` to the AAD. The AAD must | |
| /// be fully specified in this way before any plaintext or ciphertext is | |
| /// supplied to the other functions. Please consider moving to the `EVP_AEAD` | |
| /// APIs instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherUpdateAAD') | |
| external int EVP_CipherUpdateAAD( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_CipherUpdate_ex calls either `EVP_EncryptUpdate_ex` or | |
| /// `EVP_DecryptUpdate_ex` depending on how `ctx` has been setup. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_CipherUpdate_ex') | |
| external int EVP_CipherUpdate_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_DecodeBase64 decodes `in_len` bytes from base64 and writes | |
| /// `*out_len` bytes to `out`. `max_out` is the size of the output | |
| /// buffer. If it is not enough for the maximum output size, the | |
| /// operation fails. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecodeBase64') | |
| external int EVP_DecodeBase64( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_DecodeBlock encodes `src_len` bytes from `src` and writes the result to | |
| /// `dst`. It returns the number of bytes written or -1 on error. | |
| /// | |
| /// WARNING: EVP_DecodeBlock's return value does not take padding into | |
| /// account. It also strips leading whitespace and trailing | |
| /// whitespace and minuses. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DecodeBlock') | |
| external int EVP_DecodeBlock( | |
| ffi.Pointer<ffi.Uint8> dst, | |
| ffi.Pointer<ffi.Uint8> src, | |
| int src_len, | |
| ); | |
| /// EVP_DecodeFinal flushes any remaining output bytes from `ctx` to `out` and | |
| /// sets `*out_len` to the number of bytes written. It returns one on success | |
| /// and minus one on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_ENCODE_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecodeFinal') | |
| external int EVP_DecodeFinal( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_DecodeInit initialises `*ctx`, which is typically stack allocated, for | |
| /// a decoding operation. | |
| /// | |
| /// TODO(davidben): This isn't a straight-up base64 decode either. Document | |
| /// and/or fix exactly what's going on here; maximum line length and such. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_ENCODE_CTX>)>( | |
| symbol: 'bssl_dart_EVP_DecodeInit', | |
| ) | |
| external void EVP_DecodeInit( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ); | |
| /// EVP_DecodeUpdate decodes `in_len` bytes from `in` and writes the decoded | |
| /// data to `out` and sets `*out_len` to the number of bytes written. Some state | |
| /// may be contained in `ctx` so `EVP_DecodeFinal` must be used to flush it | |
| /// before using the encoded data. | |
| /// | |
| /// It returns -1 on error, one if a full line of input was processed and zero | |
| /// if the line was short (i.e. it was the last line). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_ENCODE_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecodeUpdate') | |
| external int EVP_DecodeUpdate( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_DecodedLength sets `*out_len` to the maximum number of bytes that will | |
| /// be needed to call `EVP_DecodeBase64` on an input of length `len`. It returns | |
| /// one on success or zero if `len` is not a valid length for a base64-encoded | |
| /// string. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Size>, ffi.Size)>( | |
| symbol: 'bssl_dart_EVP_DecodedLength', | |
| ) | |
| external int EVP_DecodedLength( | |
| ffi.Pointer<ffi.Size> out_len, | |
| int len, | |
| ); | |
| /// EVP_DecryptFinal calls `EVP_DecryptFinal_ex`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptFinal') | |
| external int EVP_DecryptFinal( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_DecryptFinal_ex does the same as `EVP_DecryptFinal_ex2`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// WARNING: This function does not check bounds on out, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_DecryptFinal_ex2` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptFinal_ex') | |
| external int EVP_DecryptFinal_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_DecryptFinal_ex2 finishes a decryption operation and writes up to | |
| /// `max_out_len` bytes of output to out. On success, it sets `*out_len` to the | |
| /// number of bytes written and returns one. Otherwise, it returns zero. | |
| /// | |
| /// If `max_out_len` is not large enough for the output, the function will return | |
| /// zero. The size of output buffer needed depends on the cipher and the number | |
| /// of bytes decrypted. `EVP_CIPHER_CTX_max_final` will return the maximum output | |
| /// for this call. | |
| /// | |
| /// If the block size is 1, there will be no final output at all; otherwise, at | |
| /// most one block of ciphertext will be written to the output. | |
| /// | |
| /// If padding is enabled (the default) and the block size is not 1, then | |
| /// standard padding is removed from the final block. | |
| /// | |
| /// WARNING: it is unsafe to call this function after decrypting unauthenticated | |
| /// ciphertext if padding is enabled and the block size is not 1 ("padding | |
| /// oracle"). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptFinal_ex2') | |
| external int EVP_DecryptFinal_ex2( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ); | |
| /// EVP_DecryptInit calls `EVP_CipherInit` with `enc` equal to zero. | |
| /// | |
| /// WARNING: See discussion in `EVP_CipherInit`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptInit') | |
| external int EVP_DecryptInit( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ); | |
| /// EVP_DecryptInit_ex calls `EVP_CipherInit_ex` with `enc` equal to zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptInit_ex') | |
| external int EVP_DecryptInit_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ENGINE> impl, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ); | |
| /// EVP_DecryptUpdate does the same as `EVP_DecryptUpdate_ex`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// Additionally, if `ctx` is an AEAD cipher, e.g. `EVP_aes_128_gcm`, and `out` | |
| /// is NULL, this function instead behaves like `EVP_CipherUpdateAAD`. | |
| /// | |
| /// WARNING: This function does not check bounds on out, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_DecryptUpdate_ex` or | |
| /// `EVP_CipherUpdateAAD` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptUpdate') | |
| external int EVP_DecryptUpdate( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_DecryptUpdate_ex decrypts `in_len` bytes from `in` and writes up to | |
| /// `max_out_len` bytes of plaintext to `out`. On success, it sets `*out_len` to | |
| /// the number of output bytes and returns one. Otherwise, it returns zero. | |
| /// | |
| /// If `max_out_len` is not large enough for the output, the function will return | |
| /// zero. The size of output buffer needed depends on the cipher and the number | |
| /// of bytes decrypted by `ctx` thus far. `EVP_CIPHER_CTX_max_next_update` will | |
| /// return the maximum output for this call. | |
| /// | |
| /// In ciphers whose block size is not 1, such as CBC, individual calls to | |
| /// `EVP_DecryptUpdate_ex` may output more or less than `in_len` bytes: a single | |
| /// call to `EVP_DecryptUpdate_ex` may output at most `in_len + block_size - 1` | |
| /// bytes. Additionally, the total output across all `EVP_DecryptUpdate_ex` and | |
| /// `EVP_DecryptFinal_ex2` calls will be at most the total input. | |
| /// | |
| /// WARNING: if the cipher is an AEAD cipher, decrypted data should not be | |
| /// parsed or otherwise processed until success has been returned by | |
| /// `EVP_EncryptFinal_ex2`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DecryptUpdate_ex') | |
| external int EVP_DecryptUpdate_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_Digest performs a complete hashing operation in one call. It hashes `len` | |
| /// bytes from `data` and writes the digest to `md_out`. `EVP_MD_CTX_size` bytes | |
| /// are written, which is at most `EVP_MAX_MD_SIZE`. If `out_size` is not NULL | |
| /// then `*out_size` is set to the number of bytes written. It returns one on | |
| /// success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_Digest') | |
| external int EVP_Digest( | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ffi.Pointer<ffi.Uint8> md_out, | |
| ffi.Pointer<ffi.UnsignedInt> md_out_size, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> impl, | |
| ); | |
| /// EVP_DigestFinal acts like `EVP_DigestFinal_ex` except that | |
| /// `EVP_MD_CTX_cleanup` is called on `ctx` before returning. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestFinal') | |
| external int EVP_DigestFinal( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> md_out, | |
| ffi.Pointer<ffi.UnsignedInt> out_size, | |
| ); | |
| /// EVP_DigestFinalXOF behaves like `EVP_DigestSqueeze` but calls | |
| /// `EVP_MD_CTX_cleanup` after being called, so it is not possible to call it | |
| /// multiple times. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DigestFinalXOF') | |
| external int EVP_DigestFinalXOF( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int len, | |
| ); | |
| /// EVP_DigestFinal_ex finishes the digest in `ctx` and writes the output to | |
| /// `md_out`. `EVP_MD_CTX_size` bytes are written, which is at most | |
| /// `EVP_MAX_MD_SIZE`. If `out_size` is not NULL then `*out_size` is set to the | |
| /// number of bytes written. It returns one. After this call, the hash cannot be | |
| /// updated or finished again until `EVP_DigestInit_ex` is called to start | |
| /// another hashing operation. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestFinal_ex') | |
| external int EVP_DigestFinal_ex( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> md_out, | |
| ffi.Pointer<ffi.UnsignedInt> out_size, | |
| ); | |
| /// EVP_DigestInit calls `EVP_MD_CTX_init`, followed by `EVP_DigestInit_ex`. | |
| /// | |
| /// `EVP_MD_CTX_init` is used for initializing uninitialized memory in an | |
| /// `EVP_MD_CTX`, e.g. if it is declared as a local variable on the stack. Thus | |
| /// this function should not be used on objects that have already been | |
| /// initialized. | |
| /// | |
| /// WARNING: This differs from OpenSSL 1.1.x, where `EVP_DigestInit` and | |
| /// `EVP_DigestInit_ex` are largely equivalent. This difference is because | |
| /// BoringSSL, like OpenSSL 1.0.x, still supports stack-allocating `EVP_MD_CTX`. | |
| /// Implementing the OpenSSL 1.1.x semantics would introduce uninitialized reads | |
| /// in those callers. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_DigestInit', | |
| ) | |
| external int EVP_DigestInit( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ); | |
| /// EVP_DigestInit_ex configures `ctx`, whose memory must already have been | |
| /// initialised (e.g. with `EVP_MD_CTX_init` or `EVP_MD_CTX_new`), for a fresh | |
| /// hashing operation using `type`. It returns one on success and zero on | |
| /// allocation failure. | |
| /// | |
| /// This function may be used to reconfigure an `EVP_MD_CTX` that was previously | |
| /// used for another operation. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestInit_ex') | |
| external int EVP_DigestInit_ex( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| /// EVP_DigestSign signs `data_len` bytes from `data` using `ctx`. If `out_sig` | |
| /// is NULL then `*out_sig_len` is set to the maximum number of output | |
| /// bytes. Otherwise, on entry, `*out_sig_len` must contain the length of the | |
| /// `out_sig` buffer. If the call is successful, the signature is written to | |
| /// `out_sig` and `*out_sig_len` is set to its length. | |
| /// | |
| /// It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestSign') | |
| external int EVP_DigestSign( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_sig, | |
| ffi.Pointer<ffi.Size> out_sig_len, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ); | |
| /// EVP_DigestSignFinal signs the data that has been included by one or more | |
| /// calls to `EVP_DigestSignUpdate`. If `out_sig` is NULL then `*out_sig_len` is | |
| /// set to the maximum number of output bytes. Otherwise, on entry, | |
| /// `*out_sig_len` must contain the length of the `out_sig` buffer. If the call | |
| /// is successful, the signature is written to `out_sig` and `*out_sig_len` is | |
| /// set to its length. | |
| /// | |
| /// This function performs a streaming signing operation and will fail for | |
| /// signature algorithms which do not support this. Use `EVP_DigestSign` for a | |
| /// single-shot operation. | |
| /// | |
| /// It returns one on success, or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestSignFinal') | |
| external int EVP_DigestSignFinal( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_sig, | |
| ffi.Pointer<ffi.Size> out_sig_len, | |
| ); | |
| /// EVP_DigestSignInit sets up `ctx` for a signing operation with `type` and | |
| /// `pkey`. The `ctx` argument must have been initialised with | |
| /// `EVP_MD_CTX_init`. If `pctx` is not NULL, the `EVP_PKEY_CTX` of the signing | |
| /// operation will be written to `*pctx`; this can be used to set alternative | |
| /// signing options. | |
| /// | |
| /// For single-shot signing algorithms which do not use a pre-hash, such as | |
| /// Ed25519, `type` should be NULL. The `EVP_MD_CTX` itself is unused but is | |
| /// present so the API is uniform. See `EVP_DigestSign`. | |
| /// | |
| /// It returns one on success, or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_CTX>>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestSignInit') | |
| external int EVP_DigestSignInit( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_CTX>> pctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> e, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_DigestSignUpdate appends `len` bytes from `data` to the data which will | |
| /// be signed in `EVP_DigestSignFinal`. It returns one. | |
| /// | |
| /// This function performs a streaming signing operation and will fail for | |
| /// signature algorithms which do not support this. Use `EVP_DigestSign` for a | |
| /// single-shot operation. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DigestSignUpdate') | |
| external int EVP_DigestSignUpdate( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// EVP_DigestSqueeze writes len bytes of output from `ctx` to `out` and returns | |
| /// one. This operation is only implemented if `ctx` was initialized with an | |
| /// extendable-output function, which can return arbitrarily long outputs. If | |
| /// not, this function returns zero. This function may be repeated to split its | |
| /// output over multiple calls. Doing so will give the same output as | |
| /// concatenating the calls into a single call. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestSqueeze') | |
| external int EVP_DigestSqueeze( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.UnsignedChar> out, | |
| int len, | |
| ); | |
| /// EVP_DigestUpdate hashes `len` bytes from `data` into the hashing operation | |
| /// in `ctx`. It returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DigestUpdate') | |
| external int EVP_DigestUpdate( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// EVP_DigestVerify verifies that `sig_len` bytes from `sig` are a valid | |
| /// signature for `data`. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestVerify') | |
| external int EVP_DigestVerify( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| /// EVP_DigestVerifyFinal verifies that `sig_len` bytes of `sig` are a valid | |
| /// signature for the data that has been included by one or more calls to | |
| /// `EVP_DigestVerifyUpdate`. It returns one on success and zero otherwise. | |
| /// | |
| /// This function performs streaming signature verification and will fail for | |
| /// signature algorithms which do not support this. Use `EVP_DigestVerify` for a | |
| /// single-shot verification. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DigestVerifyFinal') | |
| external int EVP_DigestVerifyFinal( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ); | |
| /// EVP_DigestVerifyInit sets up `ctx` for a signature verification operation | |
| /// with `type` and `pkey`. The `ctx` argument must have been initialised with | |
| /// `EVP_MD_CTX_init`. If `pctx` is not NULL, the `EVP_PKEY_CTX` of the signing | |
| /// operation will be written to `*pctx`; this can be used to set alternative | |
| /// signing options. | |
| /// | |
| /// For single-shot signing algorithms which do not use a pre-hash, such as | |
| /// Ed25519, `type` should be NULL. The `EVP_MD_CTX` itself is unused but is | |
| /// present so the API is uniform. See `EVP_DigestVerify`. | |
| /// | |
| /// It returns one on success, or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_CTX>>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_DigestVerifyInit') | |
| external int EVP_DigestVerifyInit( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_CTX>> pctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> e, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_DigestVerifyUpdate appends `len` bytes from `data` to the data which | |
| /// will be verified by `EVP_DigestVerifyFinal`. It returns one. | |
| /// | |
| /// This function performs streaming signature verification and will fail for | |
| /// signature algorithms which do not support this. Use `EVP_DigestVerify` for a | |
| /// single-shot verification. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_DigestVerifyUpdate') | |
| external int EVP_DigestVerifyUpdate( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// EVP_ENCODE_CTX_free releases memory associated with `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_ENCODE_CTX>)>( | |
| symbol: 'bssl_dart_EVP_ENCODE_CTX_free', | |
| ) | |
| external void EVP_ENCODE_CTX_free( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ); | |
| /// EVP_ENCODE_CTX_new returns a newly-allocated `EVP_ENCODE_CTX` or NULL on | |
| /// error. The caller must release the result with `EVP_ENCODE_CTX_free` when | |
| /// done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_ENCODE_CTX> Function()>( | |
| symbol: 'bssl_dart_EVP_ENCODE_CTX_new', | |
| ) | |
| external ffi.Pointer<EVP_ENCODE_CTX> EVP_ENCODE_CTX_new(); | |
| /// EVP_EncodeBlock encodes `src_len` bytes from `src` and writes the | |
| /// result to `dst` with a trailing NUL. It returns the number of bytes | |
| /// written, not including this trailing NUL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_EncodeBlock') | |
| external int EVP_EncodeBlock( | |
| ffi.Pointer<ffi.Uint8> dst, | |
| ffi.Pointer<ffi.Uint8> src, | |
| int src_len, | |
| ); | |
| /// EVP_EncodeFinal flushes any remaining output bytes from `ctx` to `out` and | |
| /// sets `*out_len` to the number of bytes written. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<EVP_ENCODE_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncodeFinal') | |
| external void EVP_EncodeFinal( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_EncodeInit initialises `*ctx`, which is typically stack | |
| /// allocated, for an encoding operation. | |
| /// | |
| /// NOTE: The encoding operation breaks its output with newlines every | |
| /// 64 characters of output (48 characters of input). Use | |
| /// EVP_EncodeBlock to encode raw base64. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_ENCODE_CTX>)>( | |
| symbol: 'bssl_dart_EVP_EncodeInit', | |
| ) | |
| external void EVP_EncodeInit( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ); | |
| /// EVP_EncodeUpdate encodes `in_len` bytes from `in` and writes an encoded | |
| /// version of them to `out` and sets `*out_len` to the number of bytes written. | |
| /// Some state may be contained in `ctx` so `EVP_EncodeFinal` must be used to | |
| /// flush it before using the encoded data. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<EVP_ENCODE_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncodeUpdate') | |
| external void EVP_EncodeUpdate( | |
| ffi.Pointer<EVP_ENCODE_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_EncodedLength sets `*out_len` to the number of bytes that will be needed | |
| /// to call `EVP_EncodeBlock` on an input of length `len`. This includes the | |
| /// final NUL that `EVP_EncodeBlock` writes. It returns one on success or zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Size>, ffi.Size)>( | |
| symbol: 'bssl_dart_EVP_EncodedLength', | |
| ) | |
| external int EVP_EncodedLength( | |
| ffi.Pointer<ffi.Size> out_len, | |
| int len, | |
| ); | |
| /// EVP_EncryptFinal calls `EVP_EncryptFinal_ex`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptFinal') | |
| external int EVP_EncryptFinal( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_EncryptFinal_ex does the same as `EVP_EncryptFinal_ex2`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// WARNING: This function does not check bounds on out, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_EncryptFinal_ex2` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptFinal_ex') | |
| external int EVP_EncryptFinal_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// EVP_EncryptFinal_ex2 finishes an encryption operation and writes up to | |
| /// `max_out_len` bytes of output to out. On success, it sets `*out_len` to the | |
| /// number of bytes written and returns one. Otherwise, it returns zero. | |
| /// | |
| /// If `max_out_len` is not large enough for the output, the function will return | |
| /// zero. The size of output buffer needed depends on the cipher and the number | |
| /// of bytes encrypted. `EVP_CIPHER_CTX_max_final` will return the maximum output | |
| /// for this call. | |
| /// | |
| /// If the block size is 1, there will be no final output at all; otherwise, at | |
| /// most one block of ciphertext will be written to the output. | |
| /// | |
| /// If padding is enabled (the default) and the block size is not 1, then | |
| /// standard padding is applied to create the final block. If padding is | |
| /// disabled (with `EVP_CIPHER_CTX_set_padding`) then any partial block | |
| /// remaining will cause an error. The function returns one on success and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptFinal_ex2') | |
| external int EVP_EncryptFinal_ex2( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ); | |
| /// EVP_EncryptInit calls `EVP_CipherInit` with `enc` equal to one. | |
| /// | |
| /// WARNING: See discussion in `EVP_CipherInit`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptInit') | |
| external int EVP_EncryptInit( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ); | |
| /// EVP_EncryptInit_ex calls `EVP_CipherInit_ex` with `enc` equal to one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptInit_ex') | |
| external int EVP_EncryptInit_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<EVP_CIPHER> cipher, | |
| ffi.Pointer<ENGINE> impl, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Uint8> iv, | |
| ); | |
| /// EVP_EncryptUpdate does the same as `EVP_EncryptUpdate_ex`, except that no | |
| /// output size is given and thus no bounds checking is performed. | |
| /// | |
| /// Additionally, if `ctx` is an AEAD cipher, e.g. `EVP_aes_128_gcm`, and `out` | |
| /// is NULL, this function instead behaves like `EVP_CipherUpdateAAD`. | |
| /// | |
| /// WARNING: This function does not check bounds on `out`, and correctly sizing | |
| /// the output buffer is difficult. Use `EVP_EncryptUpdate_ex` or | |
| /// `EVP_CipherUpdateAAD` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptUpdate') | |
| external int EVP_EncryptUpdate( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_EncryptUpdate_ex encrypts `in_len` bytes from `in` and writes up to | |
| /// `max_out_len` bytes of ciphertext to `out`. On success, it sets `*out_len` to | |
| /// the number of output bytes and returns one. Otherwise, it returns zero. | |
| /// | |
| /// If `max_out_len` is not large enough for the output, the function will return | |
| /// zero. The size of output buffer needed depends on the cipher and the number | |
| /// of bytes encrypted by `ctx` thus far. `EVP_CIPHER_CTX_max_next_update` will | |
| /// return the maximum output for this call. | |
| /// | |
| /// In ciphers whose block size is not 1, such as CBC, individual calls to | |
| /// `EVP_EncryptUpdate_ex` may output more or less than `in_len` bytes: a single | |
| /// call to `EVP_EncryptUpdate_ex` may output at most `in_len + block_size - 1` | |
| /// bytes. Additionally, the total output across all `EVP_EncryptUpdate_ex` and | |
| /// `EVP_EncryptFinal_ex2` calls will be at most the total input plus one byte, | |
| /// rounded up to a multiple of the block size. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_CIPHER_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_EncryptUpdate_ex') | |
| external int EVP_EncryptUpdate_ex( | |
| ffi.Pointer<EVP_CIPHER_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_KEM_ciphertext_len returns the fixed length, in bytes, of a ciphertext | |
| /// produced and consumed by `kem`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_KEM>)>( | |
| symbol: 'bssl_dart_EVP_KEM_ciphertext_len', | |
| ) | |
| external int EVP_KEM_ciphertext_len( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ); | |
| /// EVP_KEM_decap uses `kem` to decapsulate a `ciphertext` of length | |
| /// `ciphertext_len`, using `key` as a decapsulation key. It outputs a shared | |
| /// secret of length `secret_len` into `*out_secret`. `key` must be a private key | |
| /// of the type expected by `kem`. `secret_len` must match the output of | |
| /// `EVP_KEM_secret_len` when called with `kem`. This function returns one on | |
| /// success or zero on failure. If `ciphertext` has been corrupted, the function | |
| /// may fail or it may output a shared secret that appears to be random. Any | |
| /// subsequent symmetric encryption using `*out_secret` must use an authenticated | |
| /// encryption scheme in order to discover the decapsulation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_KEM>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_KEM_decap') | |
| external int EVP_KEM_decap( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ffi.Pointer<ffi.Uint8> out_secret, | |
| int secret_len, | |
| ffi.Pointer<ffi.Uint8> ciphertext, | |
| int ciphertext_len, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_KEM_encap uses `kem` to encapsulate a `peer_key`. It outputs a | |
| /// ciphertext of length `ciphertext_len` into `*out_ciphertext` and outputs a | |
| /// shared secret of length `secret_len` into `*out_secret`. `peer_key` must be | |
| /// a public key of the type expected by `kem`. `ciphertext_len` and | |
| /// `secret_len` must match the output of `EVP_KEM_ciphertext_len` and | |
| /// `EVP_KEM_secret_len`, respectively, when called with `kem`. This function | |
| /// returns one on success or zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_KEM>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_KEM_encap') | |
| external int EVP_KEM_encap( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ffi.Pointer<ffi.Uint8> out_ciphertext, | |
| int ciphertext_len, | |
| ffi.Pointer<ffi.Uint8> out_secret, | |
| int secret_len, | |
| ffi.Pointer<EVP_PKEY> peer_key, | |
| ); | |
| /// EVP_KEM_encap_external_entropy_for_testing behaves like `EVP_KEM_encap`, but | |
| /// takes `entropy_len` bytes of external `entropy` to behave deterministically | |
| /// for testing. The format of `entropy` depends on `kem`. `entropy_len` must | |
| /// match the output of `EVP_KEM_entropy_len_for_testing` when called with `kem`. | |
| /// | |
| /// WARNING: This function is only exported to help callers in testing systems | |
| /// against fixed test vectors. It must only be used for this purpose, and not in | |
| /// production. If `entropy` is predictable or known to an attacker, security | |
| /// properties of the KEM will not hold. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_KEM>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_KEM_encap_external_entropy_for_testing') | |
| external int EVP_KEM_encap_external_entropy_for_testing( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ffi.Pointer<ffi.Uint8> out_ciphertext, | |
| int ciphertext_len, | |
| ffi.Pointer<ffi.Uint8> out_secret, | |
| int secret_len, | |
| ffi.Pointer<EVP_PKEY> peer_key, | |
| ffi.Pointer<ffi.Uint8> entropy, | |
| int entropy_len, | |
| ); | |
| /// EVP_KEM_entropy_len_for_testing returns the fixed length, in bytes, of the | |
| /// external entropy to provide to `EVP_KEM_encap_external_entropy_for_testing`. | |
| /// | |
| /// WARNING: There should be no reason to use this function in production. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_KEM>)>( | |
| symbol: 'bssl_dart_EVP_KEM_entropy_len_for_testing', | |
| ) | |
| external int EVP_KEM_entropy_len_for_testing( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ); | |
| /// EVP_KEM_secret_len returns the fixed length, in bytes, of the shared | |
| /// secret produced and consumed by `kem`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_KEM>)>( | |
| symbol: 'bssl_dart_EVP_KEM_secret_len', | |
| ) | |
| external int EVP_KEM_secret_len( | |
| ffi.Pointer<EVP_KEM> kem, | |
| ); | |
| /// EVP_MD_CTX_block_size returns the block size of the digest function used by | |
| /// `ctx`, in bytes. It will crash if a digest hasn't been set on `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_block_size', | |
| ) | |
| external int EVP_MD_CTX_block_size( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_cleanse zeros the digest state in `ctx` and then performs the | |
| /// actions of `EVP_MD_CTX_cleanup`. Note that some `EVP_MD_CTX` objects contain | |
| /// more than just a digest (e.g. those resulting from `EVP_DigestSignInit`) but | |
| /// this function does not zero out more than just the digest state even in that | |
| /// case. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_cleanse', | |
| ) | |
| external void EVP_MD_CTX_cleanse( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_cleanup frees any resources owned by `ctx` and resets it to the | |
| /// zero state. It does not free `ctx` itself. It returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_cleanup', | |
| ) | |
| external int EVP_MD_CTX_cleanup( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_copy calls `EVP_MD_CTX_init`, followed by `EVP_MD_CTX_copy_ex`. | |
| /// | |
| /// `EVP_MD_CTX_init` is used for initializing uninitialized memory in an | |
| /// `EVP_MD_CTX`, e.g. if it is declared as a local variable on the stack. Thus | |
| /// this function should not be used on objects that have already been | |
| /// initialized. | |
| /// | |
| /// WARNING: This differs from OpenSSL 1.1.x, where `EVP_MD_CTX_copy` and | |
| /// |EVP_MD_CTX_copy_ex| are largely equivalent. This difference is because | |
| /// BoringSSL, like OpenSSL 1.0.x, still supports stack-allocating `EVP_MD_CTX`. | |
| /// Implementing the OpenSSL 1.1.x semantics would introduce uninitialized reads | |
| /// in those callers. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_copy', | |
| ) | |
| external int EVP_MD_CTX_copy( | |
| ffi.Pointer<EVP_MD_CTX> out, | |
| ffi.Pointer<EVP_MD_CTX> in$, | |
| ); | |
| /// EVP_MD_CTX_copy_ex sets `out` to be a copy of `in`. It returns one on success | |
| /// and zero on allocation failure. `out` must have been previously initialized, | |
| /// e.g. with `EVP_MD_CTX_init` or `EVP_MD_CTX_new`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_copy_ex', | |
| ) | |
| external int EVP_MD_CTX_copy_ex( | |
| ffi.Pointer<EVP_MD_CTX> out, | |
| ffi.Pointer<EVP_MD_CTX> in$, | |
| ); | |
| /// EVP_MD_CTX_create calls `EVP_MD_CTX_new`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD_CTX> Function()>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_create', | |
| ) | |
| external ffi.Pointer<EVP_MD_CTX> EVP_MD_CTX_create(); | |
| /// EVP_MD_CTX_destroy calls `EVP_MD_CTX_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_destroy', | |
| ) | |
| external void EVP_MD_CTX_destroy( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_free calls `EVP_MD_CTX_cleanup` and then frees `ctx` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_free', | |
| ) | |
| external void EVP_MD_CTX_free( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_get0_md returns the underlying digest function, or NULL if one has | |
| /// not been set. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_get0_md', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_MD_CTX_get0_md( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_init sets an uninitialized `EVP_MD_CTX` to the zero state. This | |
| /// is the same as setting the structure to zero. | |
| /// | |
| /// This function is used for initializing uninitialized memory in an | |
| /// `EVP_MD_CTX`, e.g. if it is declared as a local variable on the stack. This | |
| /// function should not be used on objects that have already been initialized. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_init', | |
| ) | |
| external void EVP_MD_CTX_init( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_md returns the underlying digest function, or NULL if one has not | |
| /// been set. (This is the same as `EVP_MD_CTX_get0_md` but OpenSSL has | |
| /// deprecated this spelling.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_md', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_MD_CTX_md( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_move sets `out`, which must already be initialised, to the hash | |
| /// state in `in`. `in` is mutated and left in an empty state. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD_CTX>) | |
| >(symbol: 'bssl_dart_EVP_MD_CTX_move') | |
| external void EVP_MD_CTX_move( | |
| ffi.Pointer<EVP_MD_CTX> out, | |
| ffi.Pointer<EVP_MD_CTX> in$, | |
| ); | |
| /// EVP_MD_CTX_new returns a newly-allocated `EVP_MD_CTX` in the zero state, or | |
| /// NULL on allocation failure. The caller must use `EVP_MD_CTX_free` to release | |
| /// the resulting object. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD_CTX> Function()>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_new', | |
| ) | |
| external ffi.Pointer<EVP_MD_CTX> EVP_MD_CTX_new(); | |
| /// EVP_MD_CTX_pkey_ctx returns the `EVP_PKEY_CTX` used to configure additional | |
| /// parameters on `ctx` if `ctx` is used for a sign or verify operation with | |
| /// `EVP_DigestSignInit` or `EVP_DigestVerifyInit`. It returns NULL otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_CTX> Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_pkey_ctx', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_CTX> EVP_MD_CTX_pkey_ctx( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_reset calls `EVP_MD_CTX_cleanup` followed by `EVP_MD_CTX_init`. It | |
| /// returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_reset', | |
| ) | |
| external int EVP_MD_CTX_reset( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_set_flags does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_set_flags', | |
| ) | |
| external void EVP_MD_CTX_set_flags( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| int flags, | |
| ); | |
| /// EVP_MD_CTX_size returns the digest size of `ctx`, in bytes. It | |
| /// will crash if a digest hasn't been set on `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_size', | |
| ) | |
| external int EVP_MD_CTX_size( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_CTX_type returns a NID describing the digest function used by `ctx`. | |
| /// (For example, `NID_sha256`.) It will crash if a digest hasn't been set on | |
| /// `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_EVP_MD_CTX_type', | |
| ) | |
| external int EVP_MD_CTX_type( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// EVP_MD_block_size returns the native block-size of `md`, in bytes. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_block_size', | |
| ) | |
| external int EVP_MD_block_size( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_fetch behaves like `EVP_get_digestbyname`. `libctx` and `propq` are | |
| /// ignored. Although it returns a non-const pointer, `EVP_MD`s in BoringSSL are | |
| /// static and do not need to be freed. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_MD> Function( | |
| ffi.Pointer<OSSL_LIB_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_MD_fetch') | |
| external ffi.Pointer<EVP_MD> EVP_MD_fetch( | |
| ffi.Pointer<OSSL_LIB_CTX> libctx, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<ffi.Char> propq, | |
| ); | |
| /// EVP_MD_flags returns the flags for `md`, which is a set of `EVP_MD_FLAG_*` | |
| /// values, ORed together. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_flags', | |
| ) | |
| external int EVP_MD_flags( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_free does nothing. `EVP_MD`s in BoringSSL are static. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_free', | |
| ) | |
| external void EVP_MD_free( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_meth_get_flags calls `EVP_MD_flags`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_meth_get_flags', | |
| ) | |
| external int EVP_MD_meth_get_flags( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_nid calls `EVP_MD_type`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_nid', | |
| ) | |
| external int EVP_MD_nid( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_size returns the digest size of `md`, in bytes. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_size', | |
| ) | |
| external int EVP_MD_size( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_type returns a NID identifying `md`. (For example, `NID_sha256`.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_type', | |
| ) | |
| external int EVP_MD_type( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_MD_up_ref returns one. `EVP_MD`s in BoringSSL are static. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_MD_up_ref', | |
| ) | |
| external int EVP_MD_up_ref( | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PBE_scrypt expands `password` into a secret key of length `key_len` using | |
| /// scrypt, as described in RFC 7914, and writes the result to `out_key`. It | |
| /// returns one on success and zero on allocation failure, if the memory required | |
| /// for the operation exceeds `max_mem`, or if any of the parameters are invalid | |
| /// as described below. | |
| /// | |
| /// `N`, `r`, and `p` are as described in RFC 7914 section 6. They determine the | |
| /// cost of the operation. If `max_mem` is zero, a default limit of 65MiB will be | |
| /// used. | |
| /// | |
| /// The parameters are considered invalid under any of the following conditions: | |
| /// - `r` or `p` are zero | |
| /// - `p` > (2^30 - 1) / `r` | |
| /// - `N` is not a power of two | |
| /// - `N` > 2^32 | |
| /// - `N` > 2^(128 * `r` / 8) | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Uint64, | |
| ffi.Uint64, | |
| ffi.Uint64, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PBE_scrypt') | |
| external int EVP_PBE_scrypt( | |
| ffi.Pointer<ffi.Char> password, | |
| int password_len, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| int N, | |
| int r, | |
| int p, | |
| int max_mem, | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| int key_len, | |
| ); | |
| /// EVP_PKCS82PKEY returns `p8` as a newly-allocated `EVP_PKEY`, or NULL if the | |
| /// key was unsupported or could not be decoded. The caller must release the | |
| /// result with `EVP_PKEY_free` when done. | |
| /// | |
| /// Use `EVP_parse_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<PKCS8_PRIV_KEY_INFO>)>( | |
| symbol: 'bssl_dart_EVP_PKCS82PKEY', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_PKCS82PKEY( | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> p8, | |
| ); | |
| /// EVP_PKEY2PKCS8 encodes `pkey` as a PKCS#8 PrivateKeyInfo (RFC 5208), | |
| /// represented as a newly-allocated `PKCS8_PRIV_KEY_INFO`, or NULL on error. The | |
| /// caller must release the result with `PKCS8_PRIV_KEY_INFO_free` when done. | |
| /// | |
| /// Use `EVP_marshal_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY2PKCS8', | |
| ) | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> EVP_PKEY2PKCS8( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_CTX_dup allocates a fresh `EVP_PKEY_CTX` and sets it equal to the | |
| /// state of `ctx`. It returns the fresh `EVP_PKEY_CTX` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_CTX> Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_dup', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_CTX> EVP_PKEY_CTX_dup( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_CTX_free frees `ctx` and the data it owns. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_free', | |
| ) | |
| external void EVP_PKEY_CTX_free( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_CTX_get0_pkey returns the `EVP_PKEY` associated with `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_get0_pkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_CTX_get0_pkey( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_CTX_get0_rsa_oaep_label sets `*out_label` to point to the internal | |
| /// buffer containing the OAEP label (which may be NULL) and returns the length | |
| /// of the label or a negative value on error. | |
| /// | |
| /// WARNING: the return value differs from the usual return value convention. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_get0_rsa_oaep_label') | |
| external int EVP_PKEY_CTX_get0_rsa_oaep_label( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_label, | |
| ); | |
| /// EVP_PKEY_CTX_get_rsa_mgf1_md sets `*out_md` to the digest function used in | |
| /// MGF1. Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Pointer<EVP_MD>>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_get_rsa_mgf1_md') | |
| external int EVP_PKEY_CTX_get_rsa_mgf1_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_MD>> out_md, | |
| ); | |
| /// EVP_PKEY_CTX_get_rsa_oaep_md sets `*out_md` to the digest function used in | |
| /// OAEP padding. Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Pointer<EVP_MD>>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_get_rsa_oaep_md') | |
| external int EVP_PKEY_CTX_get_rsa_oaep_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_MD>> out_md, | |
| ); | |
| /// EVP_PKEY_CTX_get_rsa_padding sets `*out_padding` to the current padding | |
| /// value, which is one of the `RSA_*_PADDING` values. Returns one on success or | |
| /// zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_get_rsa_padding', | |
| ) | |
| external int EVP_PKEY_CTX_get_rsa_padding( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Int> out_padding, | |
| ); | |
| /// EVP_PKEY_CTX_get_rsa_pss_saltlen sets `*out_salt_len` to the salt length of | |
| /// a PSS-padded signature. See the documentation for | |
| /// `EVP_PKEY_CTX_set_rsa_pss_saltlen` for details of the special values that it | |
| /// can take. | |
| /// | |
| /// Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Int>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_get_rsa_pss_saltlen', | |
| ) | |
| external int EVP_PKEY_CTX_get_rsa_pss_saltlen( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Int> out_salt_len, | |
| ); | |
| /// EVP_PKEY_CTX_get_signature_md sets `*out_md` to the digest to be used in a | |
| /// signature operation. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Pointer<EVP_MD>>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_get_signature_md') | |
| external int EVP_PKEY_CTX_get_signature_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_MD>> out_md, | |
| ); | |
| /// EVP_PKEY_CTX_new allocates a fresh `EVP_PKEY_CTX` for use with `pkey`. It | |
| /// returns the context or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY_CTX> Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ENGINE>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_new') | |
| external ffi.Pointer<EVP_PKEY_CTX> EVP_PKEY_CTX_new( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ENGINE> e, | |
| ); | |
| /// EVP_PKEY_CTX_new_id allocates a fresh `EVP_PKEY_CTX` for a key of type `id` | |
| /// (e.g. `EVP_PKEY_HMAC`). This can be used for key generation where | |
| /// `EVP_PKEY_CTX_new` can't be used because there isn't an `EVP_PKEY` to pass | |
| /// it. It returns the context or NULL on error. | |
| /// | |
| /// For key generation, prefer to use `EVP_PKEY_generate_from_alg`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_CTX> Function(ffi.Int, ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_new_id', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_CTX> EVP_PKEY_CTX_new_id( | |
| int id, | |
| ffi.Pointer<ENGINE> e, | |
| ); | |
| /// EVP_PKEY_CTX_set0_rsa_oaep_label sets `label_len` bytes from `label` as the | |
| /// label used in OAEP. DANGER: On success, this call takes ownership of `label` | |
| /// and will call `OPENSSL_free` on it when `ctx` is destroyed. | |
| /// | |
| /// Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_set0_rsa_oaep_label') | |
| external int EVP_PKEY_CTX_set0_rsa_oaep_label( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> label, | |
| int label_len, | |
| ); | |
| /// EVP_PKEY_CTX_set1_signature_context_string sets the context string for a | |
| /// signature or verification operation to `context`. It returns one success and | |
| /// zero on error. The context string is an additional input to some signature | |
| /// algorithms, such as ML-DSA, to separate different uses of the same key. This | |
| /// is known as domain separation. Section 8.3 of RFC 8032 provides some | |
| /// additional guidance on context strings. | |
| /// | |
| /// Not all signature algorithms support context strings. Callers that support | |
| /// a mix of algorithms, with and without context string support, can instead | |
| /// separate the signature input itself. For example, callers can prepend | |
| /// context-specific prefixes to signature inputs. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_PKEY_CTX_set1_signature_context_string') | |
| external int EVP_PKEY_CTX_set1_signature_context_string( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> context, | |
| int context_len, | |
| ); | |
| /// EVP_PKEY_CTX_set_dh_pad configures whether `ctx`, which must be an | |
| /// `EVP_PKEY_derive` operation, configures the handling of leading zeros in the | |
| /// Diffie-Hellman shared secret. If `pad` is zero, leading zeros are removed | |
| /// from the secret. If `pad` is non-zero, the fixed-width shared secret is used | |
| /// unmodified, as in PKCS #3. If this function is not called, the default is to | |
| /// remove leading zeros. | |
| /// | |
| /// WARNING: The behavior when `pad` is zero leaks information about the shared | |
| /// secret. This may result in side channel attacks such as | |
| /// https://raccoon-attack.com/, particularly when the same private key is used | |
| /// for multiple operations. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_dh_pad', | |
| ) | |
| external int EVP_PKEY_CTX_set_dh_pad( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int pad, | |
| ); | |
| /// EVP_PKEY_CTX_set_dsa_paramgen_bits returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_dsa_paramgen_bits', | |
| ) | |
| external int EVP_PKEY_CTX_set_dsa_paramgen_bits( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int nbits, | |
| ); | |
| /// EVP_PKEY_CTX_set_dsa_paramgen_q_bits returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_dsa_paramgen_q_bits', | |
| ) | |
| external int EVP_PKEY_CTX_set_dsa_paramgen_q_bits( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int qbits, | |
| ); | |
| /// EVP_PKEY_CTX_set_ec_param_enc returns one if `encoding` is | |
| /// `OPENSSL_EC_NAMED_CURVE` or zero with an error otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_ec_param_enc', | |
| ) | |
| external int EVP_PKEY_CTX_set_ec_param_enc( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int encoding, | |
| ); | |
| /// EVP_PKEY_CTX_set_ec_paramgen_curve_nid sets the curve used for | |
| /// `EVP_PKEY_keygen` or `EVP_PKEY_paramgen` operations to `nid`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_ec_paramgen_curve_nid', | |
| ) | |
| external int EVP_PKEY_CTX_set_ec_paramgen_curve_nid( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int nid, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_keygen_bits sets the size of the desired RSA modulus, | |
| /// in bits, for key generation. Returns one on success or zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_keygen_bits', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_keygen_bits( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int bits, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_keygen_pubexp sets `e` as the public exponent for key | |
| /// generation. Returns one on success or zero on error. On success, `ctx` takes | |
| /// ownership of `e`. The library will then call `BN_free` on `e` when `ctx` is | |
| /// destroyed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<BIGNUM>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_keygen_pubexp', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_keygen_pubexp( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<BIGNUM> e, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_mgf1_md sets `md` as the digest used in MGF1. Returns | |
| /// one on success or zero on error. | |
| /// | |
| /// If unset, the default is the signing hash for `RSA_PKCS1_PSS_PADDING` and the | |
| /// OAEP hash for `RSA_PKCS1_OAEP_PADDING`. Callers are recommended to use this | |
| /// default and not call this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_mgf1_md', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_mgf1_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_oaep_md sets `md` as the digest used in OAEP padding. | |
| /// Returns one on success or zero on error. If unset, the default is SHA-1. | |
| /// Callers are recommended to overwrite this default. | |
| /// | |
| /// TODO(davidben): Remove the default and require callers specify this. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_oaep_md', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_oaep_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_padding sets the padding type to use. It should be one | |
| /// of the `RSA_*_PADDING` values. Returns one on success or zero on error. By | |
| /// default, the padding is `RSA_PKCS1_PADDING`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_padding', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_padding( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int padding, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_pss_keygen_md returns 0. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_pss_keygen_md', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_pss_keygen_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md returns 0. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen returns 0. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int salt_len, | |
| ); | |
| /// EVP_PKEY_CTX_set_rsa_pss_saltlen sets the length of the salt in a PSS-padded | |
| /// signature. A value of `RSA_PSS_SALTLEN_DIGEST` causes the salt to be the same | |
| /// length as the digest in the signature. A value of `RSA_PSS_SALTLEN_AUTO` | |
| /// causes the salt to be the maximum length that will fit when signing and | |
| /// recovered from the signature when verifying. Otherwise the value gives the | |
| /// size of the salt in bytes. | |
| /// | |
| /// If unsure, use `RSA_PSS_SALTLEN_DIGEST`, which is the default. Note this | |
| /// differs from OpenSSL, which defaults to `RSA_PSS_SALTLEN_AUTO`. | |
| /// | |
| /// Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_rsa_pss_saltlen', | |
| ) | |
| external int EVP_PKEY_CTX_set_rsa_pss_saltlen( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| int salt_len, | |
| ); | |
| /// EVP_PKEY_CTX_set_signature_md sets `md` as the digest to be used in a | |
| /// signature operation. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_CTX_set_signature_md', | |
| ) | |
| external int EVP_PKEY_CTX_set_signature_md( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_PKEY_assign sets the underlying key of `pkey` to `key`, which must be of | |
| /// the given type. If successful, it returns one. If the `type` argument | |
| /// is not one of `EVP_PKEY_RSA`, `EVP_PKEY_DSA`, or `EVP_PKEY_EC` values or if | |
| /// `key` is NULL, it returns zero. This function may not be used with other | |
| /// `EVP_PKEY_*` types. | |
| /// | |
| /// Use the `EVP_PKEY_assign_*` functions instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_assign') | |
| external int EVP_PKEY_assign( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| int type, | |
| ffi.Pointer<ffi.Void> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_assign_DH', | |
| ) | |
| external int EVP_PKEY_assign_DH( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<DH> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_assign_DSA', | |
| ) | |
| external int EVP_PKEY_assign_DSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<DSA> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_assign_EC_KEY', | |
| ) | |
| external int EVP_PKEY_assign_EC_KEY( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_assign_RSA', | |
| ) | |
| external int EVP_PKEY_assign_RSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<RSA> key, | |
| ); | |
| /// EVP_PKEY_base_id calls `EVP_PKEY_id`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_base_id', | |
| ) | |
| external int EVP_PKEY_base_id( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_bits returns the "size", in bits, of `pkey`. For an RSA key, this | |
| /// returns the bit length of the modulus. For an EC key, this returns the bit | |
| /// length of the group order. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_bits', | |
| ) | |
| external int EVP_PKEY_bits( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_cmp calls `EVP_PKEY_eq`. It returns one if public keys are equal and | |
| /// zero otherwise. | |
| /// | |
| /// WARNING: This differs from the traditional return value of a "cmp" function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_cmp', | |
| ) | |
| external int EVP_PKEY_cmp( | |
| ffi.Pointer<EVP_PKEY> a, | |
| ffi.Pointer<EVP_PKEY> b, | |
| ); | |
| /// EVP_PKEY_cmp_parameters calls `EVP_PKEY_parameters_eq`. It returns one if | |
| /// parameters are equal and zero otherwise. | |
| /// | |
| /// WARNING: This differs from the traditional return value of a "cmp" function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_cmp_parameters', | |
| ) | |
| external int EVP_PKEY_cmp_parameters( | |
| ffi.Pointer<EVP_PKEY> a, | |
| ffi.Pointer<EVP_PKEY> b, | |
| ); | |
| /// EVP_PKEY_copy_parameters sets the parameters of `to` to equal the parameters | |
| /// of `from`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_copy_parameters', | |
| ) | |
| external int EVP_PKEY_copy_parameters( | |
| ffi.Pointer<EVP_PKEY> to, | |
| ffi.Pointer<EVP_PKEY> from, | |
| ); | |
| /// EVP_PKEY_copy_public returns a newly-allocated `EVP_PKEY` that contains only | |
| /// the public key of `pkey`, or NULL on error. Parameters, if relevant for the | |
| /// key type, are also copied. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_copy_public', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_copy_public( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_decapsulate implements private key decapsulation using `ctx`. | |
| /// `ciphertext` and `ciphertext_len` specify the ciphertext to be decapsulated. | |
| /// If `out_secret` is NULL, it writes the maximum size of the shared secret | |
| /// output to `*out_secret_len` and returns one. Otherwise, `*out_secret_len` | |
| /// must contain the number of bytes of space available at `out_secret`. If the | |
| /// space is insufficient, this function returns zero. If the space is | |
| /// sufficient, the decapsulated shared secret will be written to `out_secret` | |
| /// and the size of the output to `out_secret_len`, and this function will return | |
| /// one. If `ciphertext` has been corrupted, the function may fail or it may | |
| /// output a shared secret that appears to be random. Any subsequent symmetric | |
| /// encryption using `out_secret` must use an authenticated encryption scheme to | |
| /// discover the decapsulation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_decapsulate') | |
| external int EVP_PKEY_decapsulate( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_secret, | |
| ffi.Pointer<ffi.Size> out_secret_len, | |
| ffi.Pointer<ffi.Uint8> ciphertext, | |
| int ciphertext_len, | |
| ); | |
| /// EVP_PKEY_decapsulate_init initialises an `EVP_PKEY_CTX` for a decapsulate | |
| /// operation. It should be called before `EVP_PKEY_decapsulate`. `params` is | |
| /// included for OpenSSL compatibility, but this parameter should be NULL or have | |
| /// `OSSL_PARAM_END` as its first element. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<OSSL_PARAM>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_decapsulate_init') | |
| external int EVP_PKEY_decapsulate_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<OSSL_PARAM> params, | |
| ); | |
| /// EVP_PKEY_decrypt decrypts `in_len` bytes from `in`. If `out` is NULL, the | |
| /// maximum size of the plaintext is written to `out_len`. Otherwise, `*out_len` | |
| /// must contain the number of bytes of space available at `out`. If sufficient, | |
| /// the ciphertext will be written to `out` and `*out_len` updated with the true | |
| /// length. | |
| /// | |
| /// WARNING: Setting `out` to NULL only gives the maximum size of the | |
| /// plaintext. The actual plaintext may be smaller. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_decrypt') | |
| external int EVP_PKEY_decrypt( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_PKEY_decrypt_init initialises an `EVP_PKEY_CTX` for a decryption | |
| /// operation. It should be called before `EVP_PKEY_decrypt`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_decrypt_init', | |
| ) | |
| external int EVP_PKEY_decrypt_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_derive derives a shared key from `ctx`. If `key` is non-NULL then, | |
| /// on entry, `out_key_len` must contain the amount of space at `key`. If | |
| /// sufficient then the shared key will be written to `key` and `*out_key_len` | |
| /// will be set to the length. If `key` is NULL then `out_key_len` will be set to | |
| /// the maximum length. | |
| /// | |
| /// WARNING: Setting `out` to NULL only gives the maximum size of the key. The | |
| /// actual key may be smaller. | |
| /// | |
| /// It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_derive') | |
| external int EVP_PKEY_derive( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> key, | |
| ffi.Pointer<ffi.Size> out_key_len, | |
| ); | |
| /// EVP_PKEY_derive_init initialises an `EVP_PKEY_CTX` for a key derivation | |
| /// operation. It should be called before `EVP_PKEY_derive_set_peer` and | |
| /// `EVP_PKEY_derive`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_derive_init', | |
| ) | |
| external int EVP_PKEY_derive_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_derive_set_peer sets the peer's key to be used for key derivation | |
| /// by `ctx` to `peer`. It should be called after `EVP_PKEY_derive_init`. (For | |
| /// example, this is used to set the peer's key in (EC)DH.) It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_derive_set_peer', | |
| ) | |
| external int EVP_PKEY_derive_set_peer( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<EVP_PKEY> peer, | |
| ); | |
| /// EVP_PKEY_dup_ref increments the reference count of `pkey`, if non-null, and | |
| /// returns `pkey`. The caller must call `EVP_PKEY_free` on the result to | |
| /// release the reference. | |
| /// | |
| /// WARNING: Although the result is non-const for use with `EVP_PKEY_free`, it is | |
| /// still shared with other parts of the application that share the same object. | |
| /// Avoid mutating shared `EVP_PKEY`s. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_dup_ref', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_dup_ref( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_encapsulate implements public key encapsulation using `ctx`. It | |
| /// either performs the operation or returns the maximum output sizes, depending | |
| /// on whether `out_ciphertext` is NULL: | |
| /// | |
| /// If `out_ciphertext` is NULL, it writes the maximum ciphertext length to | |
| /// `*out_ciphertext_len` and the maximum shared secret length to | |
| /// `*out_secret_len`. Either of `out_ciphertext_len` or `out_secret_len` may be | |
| /// NULL to ignore the corresponding output. | |
| /// | |
| /// If `out_ciphertext` is non-NULL, it performs the operation and, on success, | |
| /// writes the ciphertext to `out_ciphertext`, the ciphertext size to | |
| /// `out_ciphertext_len`, the shared secret to `out_secret`, and the shared | |
| /// secret length to `out_secret_len`. On input, `*out_ciphertext_len` and | |
| /// `*out_secret_len` must contain the amount of space available in | |
| /// `out_ciphertext` and `out_secret`, respectively. If there is insufficient | |
| /// space to write the output, the operation will fail. | |
| /// | |
| /// In both modes, this function returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_encapsulate') | |
| external int EVP_PKEY_encapsulate( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_ciphertext, | |
| ffi.Pointer<ffi.Size> out_ciphertext_len, | |
| ffi.Pointer<ffi.Uint8> out_secret, | |
| ffi.Pointer<ffi.Size> out_secret_len, | |
| ); | |
| /// EVP_PKEY_encapsulate_init initialises an `EVP_PKEY_CTX` for an encapsulate | |
| /// operation. It should be called before `EVP_PKEY_encapsulate`. `params` is | |
| /// included for OpenSSL compatibility, but this parameter should be NULL or have | |
| /// `OSSL_PARAM_END` as its first element. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>, ffi.Pointer<OSSL_PARAM>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_encapsulate_init') | |
| external int EVP_PKEY_encapsulate_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<OSSL_PARAM> params, | |
| ); | |
| /// EVP_PKEY_encrypt encrypts `in_len` bytes from `in`. If `out` is NULL, the | |
| /// maximum size of the ciphertext is written to `out_len`. Otherwise, `*out_len` | |
| /// must contain the number of bytes of space available at `out`. If sufficient, | |
| /// the ciphertext will be written to `out` and `*out_len` updated with the true | |
| /// length. | |
| /// | |
| /// WARNING: Setting `out` to NULL only gives the maximum size of the | |
| /// ciphertext. The actual ciphertext may be smaller. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_encrypt') | |
| external int EVP_PKEY_encrypt( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// EVP_PKEY_encrypt_init initialises an `EVP_PKEY_CTX` for an encryption | |
| /// operation. It should be called before `EVP_PKEY_encrypt`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_encrypt_init', | |
| ) | |
| external int EVP_PKEY_encrypt_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_eq compares `a` and `b` and returns one if their public keys are | |
| /// equal and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_eq', | |
| ) | |
| external int EVP_PKEY_eq( | |
| ffi.Pointer<EVP_PKEY> a, | |
| ffi.Pointer<EVP_PKEY> b, | |
| ); | |
| /// EVP_PKEY_free decrements the reference count of `pkey` and frees it if the | |
| /// reference count drops to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_free', | |
| ) | |
| external void EVP_PKEY_free( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_ec_compressed_point') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_ec_compressed_point( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_ec_private_scalar decodes `len` bytes from `in` as an EC | |
| /// private key, encoded as a big-endian, zero-padded integer. The EC curve is | |
| /// determined by `alg`, which must be an EC algorithm (i.e. one of | |
| /// `EVP_pkey_ec_*`). The input must be fully reduced and padded to the size of | |
| /// the group order (e.g. 32 bytes for P-256) or the import will fail. | |
| /// | |
| /// This function returns a newly-allocated `EVP_PKEY` on success or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_ec_private_scalar') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_ec_private_scalar( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// The following functions decode `len` bytes from `in` as an EC public key in | |
| /// compressed or uncompressed X9.62 format, respectively. The EC curve is | |
| /// determined by `alg`, which must be an EC algorithm (i.e. one of | |
| /// `EVP_pkey_ec_*`). | |
| /// | |
| /// The functions return a newly-allocated `EVP_PKEY` on success or NULL on | |
| /// error. | |
| /// | |
| /// To support both uncompressed and compressed forms, call | |
| /// `EVP_PKEY_from_ec_uncompressed_point` when the input begins with 0x04 and | |
| /// `EVP_PKEY_from_ec_compressed_point` otherwise. Uncompressed form is more | |
| /// common. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_ec_uncompressed_point') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_ec_uncompressed_point( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_private_key_info decodes a DER-encoded PrivateKeyInfo structure | |
| /// (RFC 5208) from `in`. It returns a newly-allocated `EVP_PKEY` or NULL on | |
| /// error. Only the `num_algs` algorithms in `algs` will be considered when | |
| /// parsing. | |
| /// | |
| /// A PrivateKeyInfo ends with an optional set of attributes. These are silently | |
| /// ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_private_key_info') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_private_key_info( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>> algs, | |
| int num_algs, | |
| ); | |
| /// EVP_PKEY_from_private_seed interprets `in` as a private seed of type `alg` | |
| /// and returns a newly-allocated `EVP_PKEY`, or nullptr on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_private_seed') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_private_seed( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_raw_private_key interprets `in` as a raw private key of type | |
| /// `alg` and returns a newly-allocated `EVP_PKEY`, or nullptr on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_raw_private_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_raw_private_key( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_raw_public_key interprets `in` as a raw public key of type | |
| /// `alg` and returns a newly-allocated `EVP_PKEY`, or nullptr on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_raw_public_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_raw_public_key( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_rsa_private_key decodes `len` bytes from `in` as a DER-encoded | |
| /// RSAPrivateKey structure (RFC 8017) of algorithm `alg`. It returns a | |
| /// newly-allocated `EVP_PKEY` on success or NULL on error. `alg` must be an | |
| /// RSA-based algorithm, i.e. `EVP_pkey_rsa` or one of `EVP_pkey_rsa_pss_*`. If | |
| /// unsure, use `EVP_pkey_rsa`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_rsa_private_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_rsa_private_key( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_rsa_public_key decodes `len` bytes from `in` as a DER-encoded | |
| /// RSAPublicKey structure (RFC 8017) of algorithm `alg`. It returns a | |
| /// newly-allocated `EVP_PKEY` on success or NULL on error. `alg` must be an | |
| /// RSA-based algorithm, i.e. `EVP_pkey_rsa` or one of `EVP_pkey_rsa_pss_*`. If | |
| /// unsure, use `EVP_pkey_rsa`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<EVP_PKEY_ALG>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_rsa_public_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_rsa_public_key( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_from_subject_public_key_info decodes a DER-encoded | |
| /// SubjectPublicKeyInfo structure (RFC 5280) from `in`. It returns a | |
| /// newly-allocated `EVP_PKEY` or NULL on error. Only the `num_algs` algorithms | |
| /// in `algs` will be considered when parsing. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_from_subject_public_key_info') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_from_subject_public_key_info( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>> algs, | |
| int num_algs, | |
| ); | |
| /// EVP_PKEY_generate_from_alg generates a new key of type `alg`. It returns a | |
| /// newly-allocated `EVP_PKEY` or nullptr on error. | |
| /// | |
| /// When passed `EVP_pkey_rsa`, this function generates an RSA-2048 key with the | |
| /// recommended public exponent of 65537, or `RSA_F4`. Use `EVP_RSA_gen` or | |
| /// `EVP_PKEY_keygen` instead to customize these parameters. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<EVP_PKEY_ALG>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_generate_from_alg', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_generate_from_alg( | |
| ffi.Pointer<EVP_PKEY_ALG> alg, | |
| ); | |
| /// EVP_PKEY_get0 returns NULL. This function is provided for compatibility with | |
| /// OpenSSL but does not return anything. Use the typed `EVP_PKEY_get0_*` | |
| /// functions instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get0', | |
| ) | |
| external ffi.Pointer<ffi.Void> EVP_PKEY_get0( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get0_DH', | |
| ) | |
| external ffi.Pointer<DH> EVP_PKEY_get0_DH( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get0_DSA', | |
| ) | |
| external ffi.Pointer<DSA> EVP_PKEY_get0_DSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get0_EC_KEY', | |
| ) | |
| external ffi.Pointer<EC_KEY> EVP_PKEY_get0_EC_KEY( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get0_RSA', | |
| ) | |
| external ffi.Pointer<RSA> EVP_PKEY_get0_RSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DH> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get1_DH', | |
| ) | |
| external ffi.Pointer<DH> EVP_PKEY_get1_DH( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<DSA> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get1_DSA', | |
| ) | |
| external ffi.Pointer<DSA> EVP_PKEY_get1_DSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EC_KEY> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get1_EC_KEY', | |
| ) | |
| external ffi.Pointer<EC_KEY> EVP_PKEY_get1_EC_KEY( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get1_RSA', | |
| ) | |
| external ffi.Pointer<RSA> EVP_PKEY_get1_RSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_get1_tls_encodedpoint sets `*out_ptr` to a newly-allocated buffer | |
| /// containing the raw encoded public key for `pkey`. The caller must call | |
| /// `OPENSSL_free` to release this buffer. The function returns the length of the | |
| /// buffer on success and zero on error. | |
| /// | |
| /// If `pkey` is an EC key, the format is an X9.62 point with uncompressed | |
| /// coordinates. If it is an X25519 key, it is the 32-byte X25519 public key | |
| /// representation. This function is not supported for other key types and will | |
| /// fail. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_EVP_PKEY_get1_tls_encodedpoint') | |
| external int EVP_PKEY_get1_tls_encodedpoint( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_ptr, | |
| ); | |
| /// EVP_PKEY_get_ec_curve_nid returns `pkey`'s curve as a NID constant, such as | |
| /// `NID_X9_62_prime256v1`, or `NID_undef` if `pkey` is not an EC key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get_ec_curve_nid', | |
| ) | |
| external int EVP_PKEY_get_ec_curve_nid( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_get_ec_point_conv_form returns `pkey`'s point conversion form as a | |
| /// `POINT_CONVERSION_*` constant, or zero if `pkey` is not an EC key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_get_ec_point_conv_form', | |
| ) | |
| external int EVP_PKEY_get_ec_point_conv_form( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_get_private_seed outputs the private key for `pkey` as a private | |
| /// seed. If `out` is NULL, it sets `*out_len` to the size of the seed. | |
| /// Otherwise, it writes at most `*out_len` bytes to `out` and sets | |
| /// `*out_len` to the number of bytes written. | |
| /// | |
| /// It returns one on success and zero if `pkey` has no private key, the key | |
| /// type does not support this format, or the buffer is too small. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_get_private_seed') | |
| external int EVP_PKEY_get_private_seed( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// EVP_PKEY_get_raw_private_key outputs the private key for `pkey` in raw form. | |
| /// If `out` is NULL, it sets `*out_len` to the size of the raw private key. | |
| /// Otherwise, it writes at most `*out_len` bytes to `out` and sets `*out_len` to | |
| /// the number of bytes written. | |
| /// | |
| /// It returns one on success and zero if `pkey` has no private key, the key | |
| /// type does not support this format, or the buffer is too small. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_get_raw_private_key') | |
| external int EVP_PKEY_get_raw_private_key( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// EVP_PKEY_get_raw_public_key outputs the public key for `pkey` in raw form. | |
| /// If `out` is NULL, it sets `*out_len` to the size of the raw public key. | |
| /// Otherwise, it writes at most `*out_len` bytes to `out` and sets `*out_len` to | |
| /// the number of bytes written. | |
| /// | |
| /// It returns one on success and zero if `pkey` has no public key, the key | |
| /// type does not support this format, or the buffer is too small. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_get_raw_public_key') | |
| external int EVP_PKEY_get_raw_public_key( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// EVP_PKEY_has_private returns one if `pkey` has a private key, or zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_has_private', | |
| ) | |
| external int EVP_PKEY_has_private( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_has_public returns one if `pkey` has a public key, or zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_has_public', | |
| ) | |
| external int EVP_PKEY_has_public( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_id returns the type of `pkey`, which is one of the `EVP_PKEY_*` | |
| /// values above. These type values generally correspond to the algorithm OID, | |
| /// but not the parameters, of a SubjectPublicKeyInfo (RFC 5280) or | |
| /// PrivateKeyInfo (RFC 5208) AlgorithmIdentifier. Algorithm parameters can be | |
| /// inspected with algorithm-specific accessors, e.g. | |
| /// `EVP_PKEY_get_ec_curve_nid`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_id', | |
| ) | |
| external int EVP_PKEY_id( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_is_opaque returns one if `pkey` is opaque. Opaque keys are backed by | |
| /// custom implementations which do not expose key material and parameters. It is | |
| /// an error to attempt to duplicate, export, or compare an opaque key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_is_opaque', | |
| ) | |
| external int EVP_PKEY_is_opaque( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_keygen performs a key generation operation using the values from | |
| /// `ctx`. If `*out_pkey` is non-NULL, it overwrites `*out_pkey` with the | |
| /// resulting key. Otherwise, it sets `*out_pkey` to a newly-allocated `EVP_PKEY` | |
| /// containing the result. It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_keygen') | |
| external int EVP_PKEY_keygen( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out_pkey, | |
| ); | |
| /// EVP_PKEY_keygen_init initialises an `EVP_PKEY_CTX` for a key generation | |
| /// operation. It should be called before `EVP_PKEY_keygen`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_keygen_init', | |
| ) | |
| external int EVP_PKEY_keygen_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_marshal_ec_compressed_point', | |
| ) | |
| external int EVP_PKEY_marshal_ec_compressed_point( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_PKEY_marshal_ec_private_scalar marshals `key`'s private key as a | |
| /// big-endian, zero-padded integer EC scalar and writes the result to `cbb`. It | |
| /// returns one on success or zero on error. It is an error if `key` is not an EC | |
| /// key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_marshal_ec_private_scalar', | |
| ) | |
| external int EVP_PKEY_marshal_ec_private_scalar( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// The following functions marshal `key`'s EC public key in compressed or | |
| /// uncompressed X9.62 format, respectively, and write the result to `cbb`. They | |
| /// return one on success and zero on error. It is an error if `key` is not an EC | |
| /// key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_marshal_ec_uncompressed_point', | |
| ) | |
| external int EVP_PKEY_marshal_ec_uncompressed_point( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_PKEY_marshal_rsa_private_key marshals `key` as a DER-encoded | |
| /// RSAPrivateKey structure (RFC 8017) and writes the result to `cbb`. It returns | |
| /// one on success and zero on error. If `key` is not of type `EVP_PKEY_RSA` or | |
| /// `EVP_PKEY_RSA_PSS`, it returns zero. | |
| /// | |
| /// WARNING: If `key` is of type `EVP_PKEY_RSA_PSS`, this representation does not | |
| /// encode the key's RSA-PSS restrictions. If decoding with | |
| /// `EVP_PKEY_from_rsa_private_key`, callers are expected to pass an appropriate | |
| /// `EVP_PKEY_ALG` out of band. If decoding into a low-level `RSA` object, the | |
| /// result will be an unrestricted key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_marshal_rsa_private_key', | |
| ) | |
| external int EVP_PKEY_marshal_rsa_private_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_PKEY_marshal_rsa_public_key marshals `key` as a DER-encoded RSAPublicKey | |
| /// structure (RFC 8017) and writes the result to `cbb`. It returns one on | |
| /// success and zero on error. If `key` is not of type `EVP_PKEY_RSA` or | |
| /// `EVP_PKEY_RSA_PSS`, it returns zero. | |
| /// | |
| /// WARNING: If `key` is of type `EVP_PKEY_RSA_PSS`, this representation does not | |
| /// encode the key's RSA-PSS restrictions. If decoding with | |
| /// `EVP_PKEY_from_rsa_public_key`, callers are expected to pass an appropriate | |
| /// `EVP_PKEY_ALG` out of band. If decoding into a low-level `RSA` object, the | |
| /// result will be an unrestricted key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_marshal_rsa_public_key', | |
| ) | |
| external int EVP_PKEY_marshal_rsa_public_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_PKEY_missing_parameters returns one if `pkey` is missing needed | |
| /// parameters or zero if not, or if the algorithm doesn't take parameters. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_missing_parameters', | |
| ) | |
| external int EVP_PKEY_missing_parameters( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_new creates a new, empty public-key object and returns it or NULL | |
| /// on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function()>(symbol: 'bssl_dart_EVP_PKEY_new') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_new(); | |
| /// EVP_PKEY_new_raw_private_key interprets `in` as a raw private key of type | |
| /// `type`, which must be an `EVP_PKEY_*` constant, such as `EVP_PKEY_X25519`, | |
| /// and returns a newly-allocated `EVP_PKEY`, or nullptr on error. | |
| /// | |
| /// Prefer `EVP_PKEY_from_raw_private_key`, which allows dead code elimination to | |
| /// discard algorithms that aren't reachable from the caller. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Int, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_new_raw_private_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_new_raw_private_key( | |
| int type, | |
| ffi.Pointer<ENGINE> unused, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_new_raw_public_key interprets `in` as a raw public key of type | |
| /// `type`, which must be an `EVP_PKEY_*` constant, such as `EVP_PKEY_X25519`, | |
| /// and returns a newly-allocated `EVP_PKEY`, or nullptr on error. | |
| /// | |
| /// Prefer `EVP_PKEY_from_raw_private_key`, which allows dead code elimination to | |
| /// discard algorithms that aren't reachable from the caller. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Int, | |
| ffi.Pointer<ENGINE>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_new_raw_public_key') | |
| external ffi.Pointer<EVP_PKEY> EVP_PKEY_new_raw_public_key( | |
| int type, | |
| ffi.Pointer<ENGINE> unused, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_parameters_eq compares the parameters of `a` and `b`. It returns one | |
| /// if they match and zero otherwise. In algorithms that do not use parameters, | |
| /// this function returns one; null parameters are vacuously equal. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_parameters_eq', | |
| ) | |
| external int EVP_PKEY_parameters_eq( | |
| ffi.Pointer<EVP_PKEY> a, | |
| ffi.Pointer<EVP_PKEY> b, | |
| ); | |
| /// EVP_PKEY_paramgen performs a parameter generation using the values from | |
| /// `ctx`. If `*out_pkey` is non-NULL, it overwrites `*out_pkey` with the | |
| /// resulting parameters, but no key. Otherwise, it sets `*out_pkey` to a | |
| /// newly-allocated `EVP_PKEY` containing the result. It returns one on success | |
| /// or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_paramgen') | |
| external int EVP_PKEY_paramgen( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out_pkey, | |
| ); | |
| /// EVP_PKEY_paramgen_init initialises an `EVP_PKEY_CTX` for a parameter | |
| /// generation operation. It should be called before `EVP_PKEY_paramgen`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_paramgen_init', | |
| ) | |
| external int EVP_PKEY_paramgen_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_print_params prints a textual representation of the parameters in | |
| /// `pkey` to `out`. Returns one on success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_PCTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_print_params') | |
| external int EVP_PKEY_print_params( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| int indent, | |
| ffi.Pointer<ASN1_PCTX> pctx, | |
| ); | |
| /// EVP_PKEY_print_private prints a textual representation of the private key in | |
| /// `pkey` to `out`. Returns one on success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_PCTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_print_private') | |
| external int EVP_PKEY_print_private( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| int indent, | |
| ffi.Pointer<ASN1_PCTX> pctx, | |
| ); | |
| /// EVP_PKEY_print_public prints a textual representation of the public key in | |
| /// `pkey` to `out`. Returns one on success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_PCTX>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_print_public') | |
| external int EVP_PKEY_print_public( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| int indent, | |
| ffi.Pointer<ASN1_PCTX> pctx, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_set1_DH', | |
| ) | |
| external int EVP_PKEY_set1_DH( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<DH> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_set1_DSA', | |
| ) | |
| external int EVP_PKEY_set1_DSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<DSA> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_set1_EC_KEY', | |
| ) | |
| external int EVP_PKEY_set1_EC_KEY( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EC_KEY> key, | |
| ); | |
| /// Getting and setting concrete key types. | |
| /// | |
| /// The following functions get and set the underlying key representation in an | |
| /// `EVP_PKEY` object. The `set1` functions take an additional reference to the | |
| /// underlying key and return one on success or zero if `key` is NULL. The | |
| /// `assign` functions adopt the caller's reference and return one on success or | |
| /// zero if `key` is NULL. The `get1` functions return a fresh reference to the | |
| /// underlying object or NULL if `pkey` is not of the correct type. The `get0` | |
| /// functions behave the same but return a non-owning pointer. | |
| /// | |
| /// The `get0` and `get1` functions take `const` pointers and are thus | |
| /// non-mutating for thread-safety purposes, but mutating functions on the | |
| /// returned lower-level objects are considered to also mutate the `EVP_PKEY` and | |
| /// may not be called concurrently with other operations on the `EVP_PKEY`. | |
| /// | |
| /// WARNING: Matching OpenSSL, the RSA functions behave non-uniformly. | |
| /// `EVP_PKEY_set1_RSA` and `EVP_PKEY_assign_RSA` construct an `EVP_PKEY_RSA` | |
| /// key, while the `EVP_PKEY_get0_RSA` and `EVP_PKEY_get1_RSA` will return | |
| /// non-NULL for both `EVP_PKEY_RSA` and `EVP_PKEY_RSA_PSS`. | |
| /// | |
| /// This means callers risk misusing a key if they assume a non-NULL return from | |
| /// `EVP_PKEY_get0_RSA` or `EVP_PKEY_get1_RSA` implies `EVP_PKEY_RSA`. Prefer | |
| /// `EVP_PKEY_id` to check the type of a key. To reduce this risk, BoringSSL does | |
| /// not make `EVP_PKEY_RSA_PSS` available by default, only when callers opt in | |
| /// via `EVP_pkey_rsa_pss_sha256`. This differs from upstream OpenSSL, where | |
| /// callers are exposed to `EVP_PKEY_RSA_PSS` by default. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_set1_RSA', | |
| ) | |
| external int EVP_PKEY_set1_RSA( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<RSA> key, | |
| ); | |
| /// EVP_PKEY_set1_tls_encodedpoint replaces `pkey` with a public key encoded by | |
| /// `in`. It returns one on success and zero on error. | |
| /// | |
| /// If `pkey` is an EC key, the format is an X9.62 point and `pkey` must already | |
| /// have an EC group configured. If it is an X25519 key, it is the 32-byte X25519 | |
| /// public key representation. This function is not supported for other key types | |
| /// and will fail. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_PKEY_set1_tls_encodedpoint') | |
| external int EVP_PKEY_set1_tls_encodedpoint( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int len, | |
| ); | |
| /// EVP_PKEY_set_type sets the type of `pkey` to `type`. It returns one if | |
| /// successful or zero if the `type` argument is not one of the `EVP_PKEY_*` | |
| /// values supported for use with this function. If `pkey` is NULL, it simply | |
| /// reports whether the type is known. | |
| /// | |
| /// There are very few cases where this function is useful. Changing `pkey`'s | |
| /// type clears any previously stored keys, so there is no benefit to loading a | |
| /// key and then changing its type. Although `pkey` is left with a type | |
| /// configured, it has no key, and functions which set a key, such as | |
| /// `EVP_PKEY_set1_RSA`, will configure a type anyway. If writing unit tests that | |
| /// are only sensitive to the type of a key, it is preferable to construct a real | |
| /// key, so that tests are more representative of production code. | |
| /// | |
| /// The only API pattern which requires this function is | |
| /// `EVP_PKEY_set1_tls_encodedpoint` with X25519, which requires a half-empty | |
| /// `EVP_PKEY` that was first configured with `EVP_PKEY_X25519`. Currently, all | |
| /// other values of `type` will result in an error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_PKEY_set_type', | |
| ) | |
| external int EVP_PKEY_set_type( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| int type, | |
| ); | |
| /// EVP_PKEY_sign signs `digest_len` bytes from `digest` using `ctx`. If `sig` is | |
| /// NULL, the maximum size of the signature is written to `out_sig_len`. | |
| /// Otherwise, `*sig_len` must contain the number of bytes of space available at | |
| /// `sig`. If sufficient, the signature will be written to `sig` and `*sig_len` | |
| /// updated with the true length. This function will fail for signature | |
| /// algorithms like Ed25519 that do not support signing pre-hashed inputs. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// signed. Passing unhashed inputs will not result in a secure signature scheme. | |
| /// Use `EVP_DigestSignInit` to sign an unhashed input. | |
| /// | |
| /// WARNING: Setting `sig` to NULL only gives the maximum size of the | |
| /// signature. The actual signature may be smaller. | |
| /// | |
| /// It returns one on success or zero on error. (Note: this differs from | |
| /// OpenSSL, which can also return negative values to indicate an error.) | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_sign') | |
| external int EVP_PKEY_sign( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| ffi.Pointer<ffi.Size> sig_len, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ); | |
| /// EVP_PKEY_sign_init initialises an `EVP_PKEY_CTX` for a signing operation. It | |
| /// should be called before `EVP_PKEY_sign`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_sign_init', | |
| ) | |
| external int EVP_PKEY_sign_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_size returns the maximum size, in bytes, of a signature signed by | |
| /// `pkey`. For an RSA key, this returns the number of bytes needed to represent | |
| /// the modulus. For an EC key, this returns the maximum size of a DER-encoded | |
| /// ECDSA signature. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_size', | |
| ) | |
| external int EVP_PKEY_size( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_type returns `nid`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_EVP_PKEY_type') | |
| external int EVP_PKEY_type( | |
| int nid, | |
| ); | |
| /// EVP_PKEY_up_ref increments the reference count of `pkey` and returns one. It | |
| /// does not mutate `pkey` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_up_ref', | |
| ) | |
| external int EVP_PKEY_up_ref( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_PKEY_verify verifies that `sig_len` bytes from `sig` are a valid | |
| /// signature for `digest`. This function will fail for signature | |
| /// algorithms like Ed25519 that do not support signing pre-hashed inputs. | |
| /// | |
| /// WARNING: `digest` must be the output of some hash function on the data to be | |
| /// verified. Passing unhashed inputs will not result in a secure signature | |
| /// scheme. Use `EVP_DigestVerifyInit` to verify a signature given the unhashed | |
| /// input. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_verify') | |
| external int EVP_PKEY_verify( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ); | |
| /// EVP_PKEY_verify_init initialises an `EVP_PKEY_CTX` for a signature | |
| /// verification operation. It should be called before `EVP_PKEY_verify`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_verify_init', | |
| ) | |
| external int EVP_PKEY_verify_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_PKEY_verify_recover decrypts `sig_len` bytes from `sig`. If `out` is | |
| /// NULL, the maximum size of the plaintext is written to `out_len`. Otherwise, | |
| /// `*out_len` must contain the number of bytes of space available at `out`. If | |
| /// sufficient, the ciphertext will be written to `out` and `*out_len` updated | |
| /// with the true length. | |
| /// | |
| /// WARNING: Setting `out` to NULL only gives the maximum size of the | |
| /// plaintext. The actual plaintext may be smaller. | |
| /// | |
| /// See the warning about this operation in `EVP_PKEY_verify_recover_init`. It | |
| /// is probably not what you want. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_PKEY_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_PKEY_verify_recover') | |
| external int EVP_PKEY_verify_recover( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int siglen, | |
| ); | |
| /// EVP_PKEY_verify_recover_init initialises an `EVP_PKEY_CTX` for a public-key | |
| /// decryption operation. It should be called before `EVP_PKEY_verify_recover`. | |
| /// | |
| /// Public-key decryption is a very obscure operation that is only implemented | |
| /// by RSA keys. It is effectively a signature verification operation that | |
| /// returns the signed message directly. It is almost certainly not what you | |
| /// want. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_PKEY_CTX>)>( | |
| symbol: 'bssl_dart_EVP_PKEY_verify_recover_init', | |
| ) | |
| external int EVP_PKEY_verify_recover_init( | |
| ffi.Pointer<EVP_PKEY_CTX> ctx, | |
| ); | |
| /// EVP_Q_digest behaves like `EVP_Digest` but specifies the digest by a string | |
| /// `name`. `libctx` and `propq` are ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<OSSL_LIB_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_Q_digest') | |
| external int EVP_Q_digest( | |
| ffi.Pointer<OSSL_LIB_CTX> libctx, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<ffi.Char> propq, | |
| ffi.Pointer<ffi.Void> in$, | |
| int in_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ); | |
| /// EVP_RSA_gen generates a new RSA key with the specified number of bits. It | |
| /// returns a newly-allocated `EVP_PKEY` or nullptr on error. | |
| /// | |
| /// This function sets the public exponent to the recommended value of 65537, or | |
| /// `RSA_F4`. To use a less common value, instead use | |
| /// `EVP_PKEY_CTX_set_rsa_keygen_pubexp` and `EVP_PKEY_keygen`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_EVP_RSA_gen', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_RSA_gen( | |
| int bits, | |
| ); | |
| /// EVP_SignFinal signs the data that has been included by one or more calls to | |
| /// `EVP_SignUpdate`, using the key `pkey`, and writes it to `sig`. On entry, | |
| /// `sig` must point to at least `EVP_PKEY_size(pkey)` bytes of space. The | |
| /// actual size of the signature is written to `*out_sig_len`. | |
| /// | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_SignFinal') | |
| external int EVP_SignFinal( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| ffi.Pointer<ffi.UnsignedInt> out_sig_len, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_SignInit is a deprecated version of `EVP_SignInit_ex`. | |
| /// | |
| /// TODO(fork): remove. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_SignInit', | |
| ) | |
| external int EVP_SignInit( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ); | |
| /// EVP_SignInit_ex configures `ctx`, which must already have been initialised, | |
| /// for a fresh signing operation using the hash function `type`. It returns one | |
| /// on success and zero otherwise. | |
| /// | |
| /// (In order to initialise `ctx`, either obtain it initialised with | |
| /// `EVP_MD_CTX_create`, or use `EVP_MD_CTX_init`.) | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_SignInit_ex') | |
| external int EVP_SignInit_ex( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> impl, | |
| ); | |
| /// EVP_SignUpdate appends `len` bytes from `data` to the data which will be | |
| /// signed in `EVP_SignFinal`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_SignUpdate') | |
| external int EVP_SignUpdate( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// EVP_VerifyFinal verifies that `sig_len` bytes of `sig` are a valid | |
| /// signature, by `pkey`, for the data that has been included by one or more | |
| /// calls to `EVP_VerifyUpdate`. | |
| /// | |
| /// It returns one on success and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_PKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_VerifyFinal') | |
| external int EVP_VerifyFinal( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// EVP_VerifyInit is a deprecated version of `EVP_VerifyInit_ex`. | |
| /// | |
| /// TODO(fork): remove. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_VerifyInit', | |
| ) | |
| external int EVP_VerifyInit( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ); | |
| /// EVP_VerifyInit_ex configures `ctx`, which must already have been | |
| /// initialised, for a fresh signature verification operation using the hash | |
| /// function `type`. It returns one on success and zero otherwise. | |
| /// | |
| /// (In order to initialise `ctx`, either obtain it initialised with | |
| /// `EVP_MD_CTX_create`, or use `EVP_MD_CTX_init`.) | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EVP_MD_CTX>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_EVP_VerifyInit_ex') | |
| external int EVP_VerifyInit_ex( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<EVP_MD> type, | |
| ffi.Pointer<ENGINE> impl, | |
| ); | |
| /// EVP_VerifyUpdate appends `len` bytes from `data` to the data which will be | |
| /// signed in `EVP_VerifyFinal`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_MD_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_EVP_VerifyUpdate') | |
| external int EVP_VerifyUpdate( | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// EVP_add_cipher_alias does nothing and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_EVP_add_cipher_alias', | |
| ) | |
| external int EVP_add_cipher_alias( | |
| ffi.Pointer<ffi.Char> a, | |
| ffi.Pointer<ffi.Char> b, | |
| ); | |
| /// EVP_add_digest does nothing and returns one. It exists only for | |
| /// compatibility with OpenSSL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_add_digest', | |
| ) | |
| external int EVP_add_digest( | |
| ffi.Pointer<EVP_MD> digest, | |
| ); | |
| /// The following functions implement legacy TLS CBC cipher suites. | |
| /// | |
| /// WARNING: These functions are effectively internal implementation details of | |
| /// libssl, not general-purpose constructions. They are not true AEADs and differ | |
| /// from a normal `EVP_AEAD` in many ways: | |
| /// | |
| /// * They must be initialized with `EVP_AEAD_CTX_init_with_direction`, not | |
| /// `EVP_AEAD_CTX_init`. | |
| /// | |
| /// * The resulting `EVP_AEAD_CTX`s are stateful. Neither `EVP_AEAD_CTX_open*` | |
| /// nor `EVP_AEAD_CTX_seal*` can be called concurrently. | |
| /// | |
| /// * The `ad` parameter must have length 11 (the standard TLS one with length | |
| /// omitted). | |
| /// | |
| /// * The `nonce` parameter is used as a CBC IV and must be unpredictable, not | |
| /// just unique. | |
| /// | |
| /// * The `*_implicit_iv` variants implicitly set the IV to the last block of the | |
| /// previous message. They are vulnerable the BEAST attack unless the caller | |
| /// applies record-splitting mitigations externally. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_cbc_sha1_tls', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_cbc_sha1_tls(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_cbc_sha1_tls_implicit_iv', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_cbc_sha256_tls', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_cbc_sha256_tls(); | |
| /// EVP_aead_aes_128_ccm_bluetooth is AES-128-CCM with M=4 and L=2 (4-byte tags | |
| /// and 13-byte nonces), as described in the Bluetooth Core Specification v5.0, | |
| /// Volume 6, Part E, Section 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_ccm_bluetooth', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_ccm_bluetooth(); | |
| /// EVP_aead_aes_128_ccm_bluetooth_8 is AES-128-CCM with M=8 and L=2 (8-byte tags | |
| /// and 13-byte nonces), as used in the Bluetooth Mesh Networking Specification | |
| /// v1.0. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_ccm_bluetooth_8', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_ccm_bluetooth_8(); | |
| /// EVP_aead_aes_128_ccm_matter is AES-128-CCM with M=16 and L=2 (16-byte tags | |
| /// and 13-byte nonces), as used in the Matter specification. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_ccm_matter', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_ccm_matter(); | |
| /// EVP_aead_aes_128_ctr_hmac_sha256 is AES-128 in CTR mode with HMAC-SHA256 for | |
| /// authentication. The nonce is 12 bytes; the bottom 32-bits are used as the | |
| /// block counter, thus the maximum plaintext size is 64GB. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_ctr_hmac_sha256', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_ctr_hmac_sha256(); | |
| /// EVP_aead_aes_128_eax is AES-128 in EAX mode. Nonce size is either 12 or 16 | |
| /// bytes, tag length is 16 bytes. | |
| /// See https://doi.org/10.1007/978-3-540-25937-4_25. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_eax', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_eax(); | |
| /// EVP_aead_aes_128_gcm is AES-128 in Galois Counter Mode. | |
| /// | |
| /// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it | |
| /// is specified to take a variable-length nonce, nonces with other lengths are | |
| /// effectively randomized, which means one must consider collisions. Unless | |
| /// implementing an existing protocol which has already specified incorrect | |
| /// parameters, only use 12-byte nonces. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_gcm', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_gcm(); | |
| /// EVP_aead_aes_128_gcm_randnonce is AES-128 in Galois Counter Mode with | |
| /// internal nonce generation. The 12-byte nonce is appended to the tag | |
| /// and is generated internally. The "tag", for the purpurses of the API, is thus | |
| /// 12 bytes larger. The nonce parameter when using this AEAD must be | |
| /// zero-length. Since the nonce is random, a single key should not be used for | |
| /// more than 2^32 seal operations. | |
| /// | |
| /// Warning: this is for use for FIPS compliance only. It is probably not | |
| /// suitable for other uses. Using standard AES-GCM AEADs allows one to achieve | |
| /// the same effect, but gives more control over nonce storage. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_gcm_randnonce', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_gcm_randnonce(); | |
| /// EVP_aead_aes_128_gcm_siv is AES-128 in GCM-SIV mode. See RFC 8452. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_gcm_siv', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_gcm_siv(); | |
| /// The following functions behave like `EVP_aead_aes_128_gcm` or | |
| /// `EVP_aead_aes_256_gcm`, except that seal operations fail if nonces do not | |
| /// match the TLS 1.2 or TLS 1.3 nonce construction. | |
| /// | |
| /// These functions are only applicable for callers that want an extra AEAD-level | |
| /// nonce check. `EVP_aead_aes_128_gcm` and `EVP_aead_aes_256_gcm` are otherwise | |
| /// suitable for implementing TLS and will produce the same output. | |
| /// | |
| /// WARNING: `EVP_AEAD_CTX` objects initialized with these `EVP_AEAD`s are | |
| /// stateful. `EVP_AEAD_CTX_seal*` cannot be called concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_gcm_tls12', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_gcm_tls12(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_128_gcm_tls13', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_128_gcm_tls13(); | |
| /// EVP_aead_aes_192_gcm is AES-192 in Galois Counter Mode. | |
| /// | |
| /// WARNING: AES-192 is superfluous and shouldn't exist. NIST should never have | |
| /// defined it. Use only when interop with another system requires it, never | |
| /// de novo. | |
| /// | |
| /// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it | |
| /// is specified to take a variable-length nonce, nonces with other lengths are | |
| /// effectively randomized, which means one must consider collisions. Unless | |
| /// implementing an existing protocol which has already specified incorrect | |
| /// parameters, only use 12-byte nonces. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_192_gcm', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_192_gcm(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_cbc_sha1_tls', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_cbc_sha1_tls(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_cbc_sha1_tls_implicit_iv', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(); | |
| /// EVP_aead_aes_256_ctr_hmac_sha256 is AES-256 in CTR mode with HMAC-SHA256 for | |
| /// authentication. See `EVP_aead_aes_128_ctr_hmac_sha256` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_ctr_hmac_sha256', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_ctr_hmac_sha256(); | |
| /// EVP_aead_aes_256_eax is AES-256 in EAX mode. Nonce size is either 12 or 16 | |
| /// bytes, tag length is 16 bytes. | |
| /// See https://doi.org/10.1007/978-3-540-25937-4_25. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_eax', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_eax(); | |
| /// EVP_aead_aes_256_gcm is AES-256 in Galois Counter Mode. | |
| /// | |
| /// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it | |
| /// is specified to take a variable-length nonce, nonces with other lengths are | |
| /// effectively randomized, which means one must consider collisions. Unless | |
| /// implementing an existing protocol which has already specified incorrect | |
| /// parameters, only use 12-byte nonces. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_gcm', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_gcm(); | |
| /// EVP_aead_aes_256_gcm_randnonce is AES-256 in Galois Counter Mode with | |
| /// internal nonce generation. The 12-byte nonce is appended to the tag | |
| /// and is generated internally. The "tag", for the purpurses of the API, is thus | |
| /// 12 bytes larger. The nonce parameter when using this AEAD must be | |
| /// zero-length. Since the nonce is random, a single key should not be used for | |
| /// more than 2^32 seal operations. | |
| /// | |
| /// Warning: this is for use for FIPS compliance only. It is probably not | |
| /// suitable for other uses. Using standard AES-GCM AEADs allows one to achieve | |
| /// the same effect, but gives more control over nonce storage. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_gcm_randnonce', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_gcm_randnonce(); | |
| /// EVP_aead_aes_256_gcm_siv is AES-256 in GCM-SIV mode. See RFC 8452. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_gcm_siv', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_gcm_siv(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_gcm_tls12', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_gcm_tls12(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_aes_256_gcm_tls13', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_aes_256_gcm_tls13(); | |
| /// EVP_aead_chacha20_poly1305 is the AEAD built from ChaCha20 and | |
| /// Poly1305 as described in RFC 8439. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_chacha20_poly1305', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_chacha20_poly1305(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_des_ede3_cbc_sha1_tls', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_des_ede3_cbc_sha1_tls(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(); | |
| /// EVP_aead_xchacha20_poly1305 is ChaCha20-Poly1305 with an extended nonce that | |
| /// makes random generation of nonces safe. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_AEAD> Function()>( | |
| symbol: 'bssl_dart_EVP_aead_xchacha20_poly1305', | |
| ) | |
| external ffi.Pointer<EVP_AEAD> EVP_aead_xchacha20_poly1305(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_128_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_128_cbc(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_128_ctr', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_128_ctr(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_128_ecb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_128_ecb(); | |
| /// These AEADs are deprecated AES-GCM implementations that set | |
| /// `EVP_CIPH_FLAG_CUSTOM_CIPHER`. Use `EVP_aead_aes_128_gcm` and | |
| /// `EVP_aead_aes_256_gcm` instead. | |
| /// | |
| /// WARNING: Although these APIs allow streaming an individual AES-GCM operation, | |
| /// this is not secure. Until calling `EVP_DecryptFinal_ex`, the tag has not yet | |
| /// been checked and output released by `EVP_DecryptUpdate` is unauthenticated | |
| /// and easily manipulated by attackers. Callers must buffer the output and may | |
| /// not act on it until the entire operation is complete. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_128_gcm', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_128_gcm(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_128_ofb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_128_ofb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_192_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_192_cbc(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_192_ctr', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_192_ctr(); | |
| /// These are deprecated, 192-bit version of AES. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_192_ecb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_192_ecb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_192_gcm', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_192_gcm(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_192_ofb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_192_ofb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_256_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_256_cbc(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_256_ctr', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_256_ctr(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_256_ecb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_256_ecb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_256_gcm', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_256_gcm(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_aes_256_ofb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_aes_256_ofb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_blake2b256') | |
| external ffi.Pointer<EVP_MD> EVP_blake2b256(); | |
| /// EVP_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_EVP_cleanup') | |
| external void EVP_cleanup(); | |
| /// EVP_default_properties_is_fips_enabled calls `FIPS_mode`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<OSSL_LIB_CTX>)>( | |
| symbol: 'bssl_dart_EVP_default_properties_is_fips_enabled', | |
| ) | |
| external int EVP_default_properties_is_fips_enabled( | |
| ffi.Pointer<OSSL_LIB_CTX> libctx, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>(symbol: 'bssl_dart_EVP_des_cbc') | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_cbc(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>(symbol: 'bssl_dart_EVP_des_ecb') | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ecb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>(symbol: 'bssl_dart_EVP_des_ede') | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ede(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_des_ede3', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ede3(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_des_ede3_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ede3_cbc(); | |
| /// EVP_des_ede3_ecb is an alias for `EVP_des_ede3`. Use the former instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_des_ede3_ecb', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ede3_ecb(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_des_ede_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_des_ede_cbc(); | |
| /// EVP_enc_null returns a 'cipher' that passes plaintext through as | |
| /// ciphertext. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_enc_null', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_enc_null(); | |
| /// EVP_get_cipherbyname returns an `EVP_CIPHER` given a human readable name in | |
| /// `name`, or NULL if the name is unknown. Note using this function links almost | |
| /// every cipher implemented by BoringSSL into the binary, not just the ones the | |
| /// caller requests. Size-conscious callers, such as client software, should not | |
| /// use this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_EVP_get_cipherbyname', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_get_cipherbyname( | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// EVP_get_cipherbynid returns the cipher corresponding to the given NID, or | |
| /// NULL if no such cipher is known. Note using this function links almost every | |
| /// cipher implemented by BoringSSL into the binary, whether the caller uses them | |
| /// or not. Size-conscious callers, such as client software, should not use this | |
| /// function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_get_cipherbynid', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_get_cipherbynid( | |
| int nid, | |
| ); | |
| /// EVP_get_digestbyname returns an `EVP_MD` given a human readable name in | |
| /// `name`, or NULL if the name is unknown. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_EVP_get_digestbyname', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_get_digestbyname( | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// EVP_get_digestbynid returns an `EVP_MD` for the given NID, or NULL if no | |
| /// such digest is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_EVP_get_digestbynid', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_get_digestbynid( | |
| int nid, | |
| ); | |
| /// EVP_get_digestbyobj returns an `EVP_MD` for the given `ASN1_OBJECT`, or NULL | |
| /// if no such digest is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_EVP_get_digestbyobj', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_get_digestbyobj( | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// EVP_has_aes_hardware returns one if we enable hardware support for fast and | |
| /// constant-time AES-GCM. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_EVP_has_aes_hardware') | |
| external int EVP_has_aes_hardware(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_KEM> Function()>( | |
| symbol: 'bssl_dart_EVP_kem_ml_kem_1024', | |
| ) | |
| external ffi.Pointer<EVP_KEM> EVP_kem_ml_kem_1024(); | |
| /// EVP_kem_ml_kem_* implement ML-KEM, defined in FIPS 203. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_KEM> Function()>( | |
| symbol: 'bssl_dart_EVP_kem_ml_kem_768', | |
| ) | |
| external ffi.Pointer<EVP_KEM> EVP_kem_ml_kem_768(); | |
| /// EVP_kem_xwing implements the hybrid KEM known as X-Wing or MLKEM768-X25519, | |
| /// defined in draft-irtf-cfrg-concrete-hybrid-kems. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_KEM> Function()>(symbol: 'bssl_dart_EVP_kem_xwing') | |
| external ffi.Pointer<EVP_KEM> EVP_kem_xwing(); | |
| /// EVP_marshal_digest_algorithm marshals `md` as an AlgorithmIdentifier | |
| /// structure and appends the result to `cbb`. It returns one on success and zero | |
| /// on error. It sets the parameters field to NULL. Use | |
| /// `EVP_marshal_digest_algorithm_no_params` to omit the parameters instead. | |
| /// | |
| /// In general, the parameters should be omitted for digest algorithms, but the | |
| /// following specifications require a NULL parameter instead. | |
| /// | |
| /// - Hash algorithms and MGF-1 hash algorithms used in RSASSA-PSS and RSAES-OAEP | |
| /// (see RFC 4055, Section 2.1) | |
| /// - The hash algorithm in the DigestInfo structure of RSASSA-PKCS1-v1_5 (see | |
| /// RFC 8017, Appendix A.2.4) | |
| /// | |
| /// Some existing software also uses NULL parameters in other contexts. In | |
| /// practice, digest algorithms are encoded wildly inconsistently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_marshal_digest_algorithm', | |
| ) | |
| external int EVP_marshal_digest_algorithm( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_marshal_digest_algorithm_no_params behaves like | |
| /// `EVP_marshal_digest_algorithm` but omits the parameters field. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_EVP_marshal_digest_algorithm_no_params', | |
| ) | |
| external int EVP_marshal_digest_algorithm_no_params( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// EVP_marshal_private_key marshals `key` as a DER-encoded PrivateKeyInfo | |
| /// structure (RFC 5208) and appends the result to `cbb`. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_marshal_private_key', | |
| ) | |
| external int EVP_marshal_private_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_marshal_public_key marshals `key` as a DER-encoded SubjectPublicKeyInfo | |
| /// structure (RFC 5280) and appends the result to `cbb`. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_EVP_marshal_public_key', | |
| ) | |
| external int EVP_marshal_public_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// EVP_marshal_public_key_with_ec_point_format marshals key as a DER-encoded | |
| /// `SubjectPublicKeyInfo` structure (RFC 5280) and appends the result to `cbb`. | |
| /// `key` must be an EC key, and the EC point will be serialized in the format | |
| /// specified by `format`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<EVP_PKEY>, ffi.UnsignedInt) | |
| >(symbol: 'bssl_dart_EVP_marshal_public_key_with_ec_point_format') | |
| external int EVP_marshal_public_key_with_ec_point_format( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<EVP_PKEY> key, | |
| int format, | |
| ); | |
| /// Hash algorithms. | |
| /// | |
| /// The following functions return `EVP_MD` objects that implement the named hash | |
| /// function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_md4') | |
| external ffi.Pointer<EVP_MD> EVP_md4(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_md5') | |
| external ffi.Pointer<EVP_MD> EVP_md5(); | |
| /// EVP_md5_sha1 is a TLS-specific `EVP_MD` which computes the concatenation of | |
| /// MD5 and SHA-1, as used in TLS 1.1 and below. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_md5_sha1') | |
| external ffi.Pointer<EVP_MD> EVP_md5_sha1(); | |
| /// EVP_parse_digest_algorithm parses an AlgorithmIdentifier structure containing | |
| /// a hash function OID (for example, 2.16.840.1.101.3.4.2.1 is SHA-256) and | |
| /// advances `cbs`. The parameters field may either be omitted or a NULL. It | |
| /// returns the digest function or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EVP_parse_digest_algorithm', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_parse_digest_algorithm( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EVP_parse_digest_algorithm_nid behaves like `EVP_parse_digest_algorithm` | |
| /// except it returns `NID_undef` on error and some other value on success. This | |
| /// may be used to avoid depending on every digest algorithm in the library. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EVP_parse_digest_algorithm_nid', | |
| ) | |
| external int EVP_parse_digest_algorithm_nid( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EVP_parse_private_key decodes a DER-encoded PrivateKeyInfo structure (RFC | |
| /// 5208) from `cbs` and advances `cbs`. It returns a newly-allocated `EVP_PKEY` | |
| /// or NULL on error. | |
| /// | |
| /// Prefer `EVP_PKEY_from_private_key_info` instead. This function has | |
| /// several pitfalls: | |
| /// | |
| /// Callers are expected to handle trailing data returned from `cbs`, making more | |
| /// common cases error-prone. | |
| /// | |
| /// There is also no way to pass in supported algorithms. This function instead | |
| /// supports some default set of algorithms. Future versions of BoringSSL may add | |
| /// to this list, based on the needs of the other callers. Conversely, some | |
| /// algorithms may be intentionally omitted, if they cause too much risk to | |
| /// existing callers. | |
| /// | |
| /// This means the caller must check the type of the parsed private key to ensure | |
| /// it is suitable and validate other desired key properties such as RSA modulus | |
| /// size or EC curve. In particular, RSA private key operations scale cubicly, so | |
| /// applications accepting RSA private keys from external sources may need to | |
| /// bound key sizes (use `EVP_PKEY_bits` or `RSA_bits`) to avoid a DoS vector. | |
| /// | |
| /// A PrivateKeyInfo ends with an optional set of attributes. These are silently | |
| /// ignored. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EVP_parse_private_key', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_parse_private_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure | |
| /// (RFC 5280) from `cbs` and advances `cbs`. It returns a newly-allocated | |
| /// `EVP_PKEY` or NULL on error. | |
| /// | |
| /// Prefer `EVP_PKEY_from_subject_public_key_info` instead. This function has | |
| /// several pitfalls: | |
| /// | |
| /// Callers are expected to handle trailing data returned from `cbs`, making more | |
| /// common cases error-prone. | |
| /// | |
| /// There is also no way to pass in supported algorithms. This function instead | |
| /// supports some default set of algorithms. Future versions of BoringSSL may add | |
| /// to this list, based on the needs of the other callers. Conversely, some | |
| /// algorithms may be intentionally omitted, if they cause too much risk to | |
| /// existing callers. | |
| /// | |
| /// This means callers must check the type of the parsed public key to ensure it | |
| /// is suitable and validate other desired key properties such as RSA modulus | |
| /// size or EC curve. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_EVP_parse_public_key', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> EVP_parse_public_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// EVP_pkey_dsa implements DSA keys, encoded as in RFC 3279, Section 2.3.2. The | |
| /// `EVP_PKEY_id` value is `EVP_PKEY_DSA`. This `EVP_PKEY_ALG` accepts all DSA | |
| /// parameters supported by BoringSSL. | |
| /// | |
| /// Keys of this type are not usable with any operations, though the underlying | |
| /// `DSA` object can be extracted with `EVP_PKEY_get0_DSA`. This key type is | |
| /// deprecated and only implemented for compatibility with legacy applications. | |
| /// | |
| /// TODO(crbug.com/42290364): We didn't wire up `EVP_PKEY_sign` and | |
| /// `EVP_PKEY_verify` just so it was auditable which callers used DSA. Once DSA | |
| /// is removed from the default SPKI and PKCS#8 parser and DSA users explicitly | |
| /// request `EVP_pkey_dsa`, we could change that. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_dsa', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_dsa(); | |
| /// EVP_pkey_ec_* implement EC keys, encoded as id-ecPublicKey (RFC 5480, | |
| /// Section 2.1.1). The id-ecPublicKey encoding is confusingly named: it is also | |
| /// used for private keys (RFC 5915). The `EVP_PKEY_id` value is `EVP_PKEY_EC`. | |
| /// | |
| /// Each function only supports the specified curve, but curves are not reflected | |
| /// in `EVP_PKEY_id`. The curve can be inspected with | |
| /// `EVP_PKEY_get_ec_curve_nid`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ec_p224', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ec_p224(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ec_p256', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ec_p256(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ec_p384', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ec_p384(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ec_p521', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ec_p521(); | |
| /// EVP_pkey_ed25519 implements Ed25519 keys (RFC 8032), encoded as in RFC 8410. | |
| /// The `EVP_PKEY_id` value is `EVP_PKEY_ED25519`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ed25519', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ed25519(); | |
| /// EVP_pkey_ml_dsa_* implement ML-DSA keys, encoded as in RFC 9881. The | |
| /// `EVP_PKEY_id` values are `EVP_PKEY_ML_DSA_*`. In the private key | |
| /// representation, only the "seed" form is serialized or parsed. | |
| /// | |
| /// To configure OpenSSL to output the standard "seed" form, configure the | |
| /// "ml-dsa.output_formats" provider parameter so that "seed-only" is first. This | |
| /// can be done programmatically with OpenSSL's | |
| /// `OSSL_PROVIDER_add_conf_parameter` function, or by passing "-provparam" to | |
| /// the command-line tool. | |
| /// | |
| /// In OpenSSL 4.0, the defaults can also be fixed on a per-encoder basis by | |
| /// setting the "output_formats" parameter to "seed-only" with | |
| /// `OSSL_ENCODER_CTX_set_params`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ml_dsa_44', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ml_dsa_44(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ml_dsa_65', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ml_dsa_65(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ml_dsa_87', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ml_dsa_87(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ml_kem_1024', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ml_kem_1024(); | |
| /// EVP_pkey_ml_kem_* implement ML-KEM keys, encoded as in RFC 9935. The | |
| /// `EVP_PKEY_id` values are `EVP_PKEY_ML_KEM_*`. In the private key | |
| /// representation, only the "seed" form is serialized or parsed. | |
| /// | |
| /// To configure OpenSSL to output the standard "seed" form, configure the | |
| /// "ml-kem.output_formats" provider parameter so that "seed-only" is first. This | |
| /// can be done programmatically with OpenSSL's | |
| /// `OSSL_PROVIDER_add_conf_parameter` function, or by passing "-provparam" to | |
| /// the command-line tool. | |
| /// | |
| /// In OpenSSL 4.0, the defaults can also be fixed on a per-encoder basis by | |
| /// setting the "output_formats" parameter to "seed-only" with | |
| /// `OSSL_ENCODER_CTX_set_params`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_ml_kem_768', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_ml_kem_768(); | |
| /// EVP_pkey_rsa implements RSA keys (RFC 8017), encoded as rsaEncryption (RFC | |
| /// 3279, Section 2.3.1). The rsaEncryption encoding is confusingly named: these | |
| /// keys are used for all RSA operations, including signing. The `EVP_PKEY_id` | |
| /// value is `EVP_PKEY_RSA`. | |
| /// | |
| /// WARNING: This `EVP_PKEY_ALG` accepts all RSA key sizes supported by | |
| /// BoringSSL. When parsing RSA keys, callers should check the size is within | |
| /// their desired bounds with `EVP_PKEY_bits`. RSA public key operations scale | |
| /// quadratically and RSA private key operations scale cubicly, so key sizes may | |
| /// be a DoS vector. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_rsa', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_rsa(); | |
| /// EVP_pkey_rsa_pss_* implements RSASSA-PSS keys, encoded as id-RSASSA-PSS | |
| /// (RFC 4055, Section 3.1). The `EVP_PKEY_id` value is `EVP_PKEY_RSA_PSS`. Each | |
| /// `EVP_PKEY_ALG` only accepts keys whose parameters specify: | |
| /// | |
| /// - A hashAlgorithm of the specified hash | |
| /// - A maskGenAlgorithm of MGF1 with the specified hash | |
| /// - A minimum saltLength of the specified hash's digest length | |
| /// - A trailerField of one (must be omitted in the encoding) | |
| /// | |
| /// Keys of this type will only be usable with RSASSA-PSS with matching signature | |
| /// parameters. | |
| /// | |
| /// This algorithm type is not recommended. The id-RSASSA-PSS key type is not | |
| /// widely implemented. Using it negates any compatibility benefits of using RSA. | |
| /// More modern algorithms like ECDSA are more performant and more compatible | |
| /// than id-RSASSA-PSS keys. This key type also adds significant complexity to a | |
| /// system. It has a wide range of possible parameter sets, so any uses must | |
| /// ensure all components not only support id-RSASSA-PSS, but also the specific | |
| /// parameters chosen. | |
| /// | |
| /// Note the id-RSASSA-PSS key type is distinct from the RSASSA-PSS signature | |
| /// algorithm. The widely implemented id-rsaEncryption key type (`EVP_pkey_rsa` | |
| /// and `EVP_PKEY_RSA`) also supports RSASSA-PSS signatures. | |
| /// | |
| /// WARNING: Any `EVP_PKEY`s produced by this algorithm will return a non-NULL | |
| /// `RSA` object through `EVP_PKEY_get1_RSA` and `EVP_PKEY_get0_RSA`. This is | |
| /// dangerous as existing code may assume a non-NULL return implies the more | |
| /// common id-rsaEncryption key. Additionally, the operations on the underlying | |
| /// `RSA` object will not capture the RSA-PSS constraints, so callers risk | |
| /// misusing the key by calling these functions. Callers using this algorithm | |
| /// must use `EVP_PKEY_id` to distinguish `EVP_PKEY_RSA` and `EVP_PKEY_RSA_PSS`. | |
| /// | |
| /// WARNING: BoringSSL does not currently implement `RSA_get0_pss_params` with | |
| /// these keys. Callers that require this functionality should contact the | |
| /// BoringSSL team. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_rsa_pss_sha256', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_rsa_pss_sha256(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_rsa_pss_sha384', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_rsa_pss_sha384(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_rsa_pss_sha512', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_rsa_pss_sha512(); | |
| /// EVP_pkey_slh_dsa_* implement SLH-DSA and HashSLH-DSA keys, encoded as in | |
| /// RFC 9909. The `EVP_PKEY_id` values are `EVP_PKEY_SLH_DSA_*`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_slh_dsa_sha2_128s', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_slh_dsa_sha2_128s(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_slh_dsa_sha2_128s_with_sha256', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_slh_dsa_sha2_128s_with_sha256(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_slh_dsa_shake_256f', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_slh_dsa_shake_256f(); | |
| /// EVP_pkey_x25519 implements X25519 keys (RFC 7748), encoded as in RFC 8410. | |
| /// The `EVP_PKEY_id` value is `EVP_PKEY_X25519`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_x25519', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_x25519(); | |
| /// EVP_pkey_xwing implements the hybrid key encapsulation mechanism (KEM) known | |
| /// as X-Wing or MLKEM768-X25519, defined in | |
| /// draft-irtf-cfrg-concrete-hybrid-kems. Its private key representation is the | |
| /// "seed" form. It does not have public and private key encodings for X.509. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY_ALG> Function()>( | |
| symbol: 'bssl_dart_EVP_pkey_xwing', | |
| ) | |
| external ffi.Pointer<EVP_PKEY_ALG> EVP_pkey_xwing(); | |
| /// EVP_rc2_40_cbc returns a cipher that implements 40-bit RC2 in CBC mode. This | |
| /// is obviously very, very weak and is included only in order to read PKCS#12 | |
| /// files, which often encrypt the certificate chain using this cipher. It is | |
| /// deliberately not exported. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>( | |
| symbol: 'bssl_dart_EVP_rc2_40_cbc', | |
| ) | |
| external ffi.Pointer<EVP_CIPHER> EVP_rc2_40_cbc(); | |
| /// EVP_rc2_cbc returns a cipher that implements 128-bit RC2 in CBC mode. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>(symbol: 'bssl_dart_EVP_rc2_cbc') | |
| external ffi.Pointer<EVP_CIPHER> EVP_rc2_cbc(); | |
| /// Cipher primitives. | |
| /// | |
| /// The following functions return `EVP_CIPHER` objects that implement the named | |
| /// cipher algorithm. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_CIPHER> Function()>(symbol: 'bssl_dart_EVP_rc4') | |
| external ffi.Pointer<EVP_CIPHER> EVP_rc4(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha1') | |
| external ffi.Pointer<EVP_MD> EVP_sha1(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha224') | |
| external ffi.Pointer<EVP_MD> EVP_sha224(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha256') | |
| external ffi.Pointer<EVP_MD> EVP_sha256(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha384') | |
| external ffi.Pointer<EVP_MD> EVP_sha384(); | |
| /// SHA-3 family of digest functions. | |
| /// | |
| /// WARNING: Prefer to use SHA-2 (e.g. `EVP_sha256`) over SHA-3. Despite being a | |
| /// newer hash function, SHA-3 performs poorly and should only be used when | |
| /// necessary for interoperability with existing systems. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha3_256') | |
| external ffi.Pointer<EVP_MD> EVP_sha3_256(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha3_384') | |
| external ffi.Pointer<EVP_MD> EVP_sha3_384(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha3_512') | |
| external ffi.Pointer<EVP_MD> EVP_sha3_512(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha512') | |
| external ffi.Pointer<EVP_MD> EVP_sha512(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_sha512_256') | |
| external ffi.Pointer<EVP_MD> EVP_sha512_256(); | |
| /// EVP_shake256 is SHAKE256 extendable-output function. | |
| /// | |
| /// WARNING: SHAKE is slow. Prefer SHA-2, or TurboSHAKE (`EVP_turboshake256`) if | |
| /// an XOF is needed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>(symbol: 'bssl_dart_EVP_shake256') | |
| external ffi.Pointer<EVP_MD> EVP_shake256(); | |
| /// EVP_turboshake256 is TurboSHAKE extendable output function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function()>( | |
| symbol: 'bssl_dart_EVP_turboshake256', | |
| ) | |
| external ffi.Pointer<EVP_MD> EVP_turboshake256(); | |
| /// EXTENDED_KEY_USAGE_free releases memory associated with `eku`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<EXTENDED_KEY_USAGE>)>( | |
| symbol: 'bssl_dart_EXTENDED_KEY_USAGE_free', | |
| ) | |
| external void EXTENDED_KEY_USAGE_free( | |
| ffi.Pointer<EXTENDED_KEY_USAGE> eku, | |
| ); | |
| /// EXTENDED_KEY_USAGE_new returns a newly-allocated, empty `EXTENDED_KEY_USAGE` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EXTENDED_KEY_USAGE> Function()>( | |
| symbol: 'bssl_dart_EXTENDED_KEY_USAGE_new', | |
| ) | |
| external ffi.Pointer<EXTENDED_KEY_USAGE> EXTENDED_KEY_USAGE_new(); | |
| /// FIPS_mode returns zero unless BoringSSL is built with BORINGSSL_FIPS, in | |
| /// which case it returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_FIPS_mode') | |
| external int FIPS_mode(); | |
| /// FIPS_mode_set returns one if `on` matches whether BoringSSL was built with | |
| /// `BORINGSSL_FIPS` and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_FIPS_mode_set') | |
| external int FIPS_mode_set( | |
| int on, | |
| ); | |
| /// FIPS_module_name returns the name of the FIPS module. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_FIPS_module_name', | |
| ) | |
| external ffi.Pointer<ffi.Char> FIPS_module_name(); | |
| /// FIPS_query_algorithm_status returns one if `algorithm` is FIPS validated in | |
| /// the current BoringSSL and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_FIPS_query_algorithm_status', | |
| ) | |
| external int FIPS_query_algorithm_status( | |
| ffi.Pointer<ffi.Char> algorithm, | |
| ); | |
| /// FIPS_read_counter returns a counter of the number of times the specific | |
| /// function denoted by `counter` has been used. This always returns zero unless | |
| /// BoringSSL was built with BORINGSSL_FIPS_COUNTERS defined. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_FIPS_read_counter', | |
| ) | |
| external int FIPS_read_counter( | |
| int counter, | |
| ); | |
| /// FIPS_version returns the version of the FIPS module, or zero if the build | |
| /// isn't exactly at a verified version. The version, expressed in base 10, will | |
| /// be a date in the form yyyymmdd. | |
| /// | |
| /// (This format exceeds a `uint32_t` in the year 4294.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function()>(symbol: 'bssl_dart_FIPS_version') | |
| external int FIPS_version(); | |
| /// GENERAL_NAMES_free releases memory associated with `gens`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<GENERAL_NAMES>)>( | |
| symbol: 'bssl_dart_GENERAL_NAMES_free', | |
| ) | |
| external void GENERAL_NAMES_free( | |
| ffi.Pointer<GENERAL_NAMES> gens, | |
| ); | |
| /// GENERAL_NAMES_new returns a new, empty `GENERAL_NAMES`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<GENERAL_NAMES> Function()>( | |
| symbol: 'bssl_dart_GENERAL_NAMES_new', | |
| ) | |
| external ffi.Pointer<GENERAL_NAMES> GENERAL_NAMES_new(); | |
| /// GENERAL_NAME_dup returns a newly-allocated copy of `gen`, or NULL on error. | |
| /// This function works by serializing the structure, so it will fail if `gen` is | |
| /// empty. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<GENERAL_NAME> Function(ffi.Pointer<GENERAL_NAME>)>( | |
| symbol: 'bssl_dart_GENERAL_NAME_dup', | |
| ) | |
| external ffi.Pointer<GENERAL_NAME> GENERAL_NAME_dup( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ); | |
| /// GENERAL_NAME_free releases memory associated with `gen`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<GENERAL_NAME>)>( | |
| symbol: 'bssl_dart_GENERAL_NAME_free', | |
| ) | |
| external void GENERAL_NAME_free( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ); | |
| /// GENERAL_NAME_get0_otherName, if `gen` is an OtherName, sets `*out_oid` and | |
| /// `*out_value` to the OtherName's type-id and value, respectively, and returns | |
| /// one. If `gen` is not an OtherName, it returns zero and leaves `*out_oid` and | |
| /// `*out_value` unmodified. Either of `out_oid` or `out_value` may be NULL to | |
| /// ignore the value. | |
| /// | |
| /// WARNING: This function is not const-correct. `out_oid` and `out_value` are | |
| /// not const, but callers should not mutate the resulting objects. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ) | |
| >(symbol: 'bssl_dart_GENERAL_NAME_get0_otherName') | |
| external int GENERAL_NAME_get0_otherName( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>> out_oid, | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>> out_value, | |
| ); | |
| /// GENERAL_NAME_get0_value returns the in-memory representation of `gen`'s | |
| /// contents and, `out_type` is not NULL, sets `*out_type` to the type of `gen`, | |
| /// which will be a `GEN_*` constant. If `gen` is incomplete, the return value | |
| /// will be NULL and the type will be -1. | |
| /// | |
| /// WARNING: Casting the result of this function to the wrong type is a | |
| /// potentially exploitable memory error. Callers must check `gen`'s type, either | |
| /// via `*out_type` or checking `gen->type` directly, before inspecting the | |
| /// result. | |
| /// | |
| /// WARNING: This function is not const-correct. The return value should be | |
| /// const. Callers should not mutate the returned object. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_GENERAL_NAME_get0_value') | |
| external ffi.Pointer<ffi.Void> GENERAL_NAME_get0_value( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ffi.Pointer<ffi.Int> out_type, | |
| ); | |
| /// GENERAL_NAME_new returns a new, empty `GENERAL_NAME`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<GENERAL_NAME> Function()>( | |
| symbol: 'bssl_dart_GENERAL_NAME_new', | |
| ) | |
| external ffi.Pointer<GENERAL_NAME> GENERAL_NAME_new(); | |
| /// GENERAL_NAME_print prints a human-readable representation of `gen` to `out`. | |
| /// It returns one on success and zero on error. | |
| /// | |
| /// TODO(davidben): Actually, it just returns one and doesn't check for I/O or | |
| /// allocation errors. But it should return zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<GENERAL_NAME>)>( | |
| symbol: 'bssl_dart_GENERAL_NAME_print', | |
| ) | |
| external int GENERAL_NAME_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ); | |
| /// GENERAL_NAME_set0_othername sets `gen` to be an OtherName with type `oid` and | |
| /// value `value`. On success, it returns one and takes ownership of `oid` and | |
| /// `value`, which must be created in a way compatible with `ASN1_OBJECT_free` | |
| /// and `ASN1_TYPE_free`, respectively. On allocation failure, it returns zero. | |
| /// In the failure case, the caller retains ownership of `oid` and `value` and | |
| /// must release them when done. | |
| /// | |
| /// WARNING: `gen` must be empty (typically as returned from `GENERAL_NAME_new`) | |
| /// before calling this function. If `gen` already contained a value, the | |
| /// previously contents will be leaked. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Pointer<ASN1_TYPE>, | |
| ) | |
| >(symbol: 'bssl_dart_GENERAL_NAME_set0_othername') | |
| external int GENERAL_NAME_set0_othername( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ffi.Pointer<ASN1_OBJECT> oid, | |
| ffi.Pointer<ASN1_TYPE> value, | |
| ); | |
| /// GENERAL_NAME_set0_value set `gen`'s type and value to `type` and `value`. | |
| /// `type` must be a `GEN_*` constant and `value` must be an object of the | |
| /// corresponding type. `gen` takes ownership of `value`, so `value` must have | |
| /// been an allocated object. | |
| /// | |
| /// WARNING: `gen` must be empty (typically as returned from `GENERAL_NAME_new`) | |
| /// before calling this function. If `gen` already contained a value, the | |
| /// previous contents will be leaked. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<GENERAL_NAME>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_GENERAL_NAME_set0_value') | |
| external void GENERAL_NAME_set0_value( | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| int type, | |
| ffi.Pointer<ffi.Void> value, | |
| ); | |
| /// GENERAL_SUBTREE_free releases memory associated with `subtree`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<GENERAL_SUBTREE>)>( | |
| symbol: 'bssl_dart_GENERAL_SUBTREE_free', | |
| ) | |
| external void GENERAL_SUBTREE_free( | |
| ffi.Pointer<GENERAL_SUBTREE> subtree, | |
| ); | |
| /// GENERAL_SUBTREE_new returns a newly-allocated, empty `GENERAL_SUBTREE` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<GENERAL_SUBTREE> Function()>( | |
| symbol: 'bssl_dart_GENERAL_SUBTREE_new', | |
| ) | |
| external ffi.Pointer<GENERAL_SUBTREE> GENERAL_SUBTREE_new(); | |
| /// HKDF computes HKDF (as specified by RFC 5869) of initial keying material | |
| /// `secret` with `salt` and `info` using `digest`, and outputs `out_len` bytes | |
| /// to `out_key`. It returns one on success and zero on error. | |
| /// | |
| /// HKDF is an Extract-and-Expand algorithm. It does not do any key stretching, | |
| /// and as such, is not suited to be used alone to generate a key from a | |
| /// password. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_HKDF') | |
| external int HKDF( | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| int out_len, | |
| ffi.Pointer<EVP_MD> digest, | |
| ffi.Pointer<ffi.Uint8> secret, | |
| int secret_len, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| ffi.Pointer<ffi.Uint8> info, | |
| int info_len, | |
| ); | |
| /// HKDF_expand computes a HKDF OKM (as specified by RFC 5869) of length | |
| /// `out_len` from the PRK `prk` and info `info` using `digest`, and outputs | |
| /// the result to `out_key`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_HKDF_expand') | |
| external int HKDF_expand( | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| int out_len, | |
| ffi.Pointer<EVP_MD> digest, | |
| ffi.Pointer<ffi.Uint8> prk, | |
| int prk_len, | |
| ffi.Pointer<ffi.Uint8> info, | |
| int info_len, | |
| ); | |
| /// HKDF_extract computes a HKDF PRK (as specified by RFC 5869) from initial | |
| /// keying material `secret` and salt `salt` using `digest`, and outputs | |
| /// `out_len` bytes to `out_key`. The maximum output size is `EVP_MAX_MD_SIZE`. | |
| /// It returns one on success and zero on error. | |
| /// | |
| /// WARNING: This function orders the inputs differently from RFC 5869 | |
| /// specification. Double-check which parameter is the secret/IKM and which is | |
| /// the salt when using. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_HKDF_extract') | |
| external int HKDF_extract( | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<EVP_MD> digest, | |
| ffi.Pointer<ffi.Uint8> secret, | |
| int secret_len, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| ); | |
| /// HMAC calculates the HMAC of `data_len` bytes of `data`, using the given key | |
| /// and hash function, and writes the result to `out`. On entry, `out` must | |
| /// contain at least `EVP_MD_size` bytes of space. The actual length of the | |
| /// result is written to `*out_len`. An output size of `EVP_MAX_MD_SIZE` will | |
| /// always be large enough. It returns `out` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Uint8> Function( | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_HMAC') | |
| external ffi.Pointer<ffi.Uint8> HMAC( | |
| ffi.Pointer<EVP_MD> evp_md, | |
| ffi.Pointer<ffi.Void> key, | |
| int key_len, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// HMAC_CTX_cleanse zeros the digest state from `ctx` and then performs the | |
| /// actions of `HMAC_CTX_cleanup`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_cleanse', | |
| ) | |
| external void HMAC_CTX_cleanse( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_CTX_cleanup frees data owned by `ctx`. It does not free `ctx` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_cleanup', | |
| ) | |
| external void HMAC_CTX_cleanup( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_CTX_copy calls `HMAC_CTX_init` on `dest` and then sets it equal to | |
| /// `src`. On entry, `dest` must /not/ be initialised for an operation with | |
| /// `HMAC_Init_ex`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<HMAC_CTX>, ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_copy', | |
| ) | |
| external int HMAC_CTX_copy( | |
| ffi.Pointer<HMAC_CTX> dest, | |
| ffi.Pointer<HMAC_CTX> src, | |
| ); | |
| /// HMAC_CTX_copy_ex sets `dest` equal to `src`. On entry, `dest` must have been | |
| /// initialised by calling `HMAC_CTX_init`. It returns one on success and zero | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<HMAC_CTX>, ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_copy_ex', | |
| ) | |
| external int HMAC_CTX_copy_ex( | |
| ffi.Pointer<HMAC_CTX> dest, | |
| ffi.Pointer<HMAC_CTX> src, | |
| ); | |
| /// HMAC_CTX_free calls `HMAC_CTX_cleanup` and then frees `ctx` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_free', | |
| ) | |
| external void HMAC_CTX_free( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_CTX_get_md returns `ctx`'s hash function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_MD> Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_get_md', | |
| ) | |
| external ffi.Pointer<EVP_MD> HMAC_CTX_get_md( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_CTX_init initialises `ctx` for use in an HMAC operation. It's assumed | |
| /// that HMAC_CTX objects will be allocated on the stack thus no allocation | |
| /// function is provided. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_init', | |
| ) | |
| external void HMAC_CTX_init( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_CTX_new allocates and initialises a new `HMAC_CTX` and returns it, or | |
| /// NULL on allocation failure. The caller must use `HMAC_CTX_free` to release | |
| /// the resulting object. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<HMAC_CTX> Function()>(symbol: 'bssl_dart_HMAC_CTX_new') | |
| external ffi.Pointer<HMAC_CTX> HMAC_CTX_new(); | |
| /// HMAC_CTX_reset calls `HMAC_CTX_cleanup` followed by `HMAC_CTX_init`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_CTX_reset', | |
| ) | |
| external void HMAC_CTX_reset( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// HMAC_Final completes the HMAC operation in `ctx` and writes the result to | |
| /// `out`. If `out_len` is not `NULL` then it writes the length of the result to | |
| /// `*out_len`. On entry, `out` must contain at least `HMAC_size` bytes of | |
| /// space. An output size of `EVP_MAX_MD_SIZE` will always be large enough. It | |
| /// returns one on success or zero on allocation failure. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<HMAC_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_HMAC_Final') | |
| external int HMAC_Final( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// Deprecated functions. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<HMAC_CTX>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_HMAC_Init') | |
| external int HMAC_Init( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ffi.Pointer<ffi.Void> key, | |
| int key_len, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// HMAC_Init_ex sets up an initialised `HMAC_CTX` to use `md` as the hash | |
| /// function and `key` as the key. For a non-initial call, `md` may be NULL, in | |
| /// which case the previous hash function will be used. If the hash function has | |
| /// not changed and `key` is NULL, `ctx` reuses the previous key. It returns one | |
| /// on success or zero on allocation failure. | |
| /// | |
| /// WARNING: NULL and empty keys are ambiguous on non-initial calls. Passing NULL | |
| /// `key` but repeating the previous `md` reuses the previous key rather than the | |
| /// empty key. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<HMAC_CTX>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ENGINE>, | |
| ) | |
| >(symbol: 'bssl_dart_HMAC_Init_ex') | |
| external int HMAC_Init_ex( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ffi.Pointer<ffi.Void> key, | |
| int key_len, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ENGINE> impl, | |
| ); | |
| /// HMAC_Update hashes `data_len` bytes from `data` into the current HMAC | |
| /// operation in `ctx`. It returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<HMAC_CTX>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_HMAC_Update') | |
| external int HMAC_Update( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int data_len, | |
| ); | |
| /// HMAC_size returns the size, in bytes, of the HMAC that will be produced by | |
| /// `ctx`. On entry, `ctx` must have been setup with `HMAC_Init_ex`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<HMAC_CTX>)>( | |
| symbol: 'bssl_dart_HMAC_size', | |
| ) | |
| external int HMAC_size( | |
| ffi.Pointer<HMAC_CTX> ctx, | |
| ); | |
| /// ISSUING_DIST_POINT_free releases memory associated with `idp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ISSUING_DIST_POINT>)>( | |
| symbol: 'bssl_dart_ISSUING_DIST_POINT_free', | |
| ) | |
| external void ISSUING_DIST_POINT_free( | |
| ffi.Pointer<ISSUING_DIST_POINT> idp, | |
| ); | |
| /// ISSUING_DIST_POINT_new returns a newly-allocated, empty `ISSUING_DIST_POINT` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ISSUING_DIST_POINT> Function()>( | |
| symbol: 'bssl_dart_ISSUING_DIST_POINT_new', | |
| ) | |
| external ffi.Pointer<ISSUING_DIST_POINT> ISSUING_DIST_POINT_new(); | |
| /// METHOD_ref increments the reference count of `method`. This is a no-op for | |
| /// now because all methods are currently static. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_METHOD_ref', | |
| ) | |
| external void METHOD_ref( | |
| ffi.Pointer<ffi.Void> method, | |
| ); | |
| /// METHOD_unref decrements the reference count of `method` and frees it if the | |
| /// reference count drops to zero. This is a no-op for now because all methods | |
| /// are currently static. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_METHOD_unref', | |
| ) | |
| external void METHOD_unref( | |
| ffi.Pointer<ffi.Void> method, | |
| ); | |
| /// NAME_CONSTRAINTS_check checks if `x509` satisfies name constraints in `nc`. | |
| /// It returns `X509_V_OK` on success and some `X509_V_ERR_*` constant on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<NAME_CONSTRAINTS>)>( | |
| symbol: 'bssl_dart_NAME_CONSTRAINTS_check', | |
| ) | |
| external int NAME_CONSTRAINTS_check( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<NAME_CONSTRAINTS> nc, | |
| ); | |
| /// NAME_CONSTRAINTS_free releases memory associated with `ncons`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<NAME_CONSTRAINTS>)>( | |
| symbol: 'bssl_dart_NAME_CONSTRAINTS_free', | |
| ) | |
| external void NAME_CONSTRAINTS_free( | |
| ffi.Pointer<NAME_CONSTRAINTS> ncons, | |
| ); | |
| /// NAME_CONSTRAINTS_new returns a newly-allocated, empty `NAME_CONSTRAINTS` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<NAME_CONSTRAINTS> Function()>( | |
| symbol: 'bssl_dart_NAME_CONSTRAINTS_new', | |
| ) | |
| external ffi.Pointer<NAME_CONSTRAINTS> NAME_CONSTRAINTS_new(); | |
| /// NCONF_free frees all the data owned by `conf` and then `conf` itself. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CONF>)>( | |
| symbol: 'bssl_dart_NCONF_free', | |
| ) | |
| external void NCONF_free( | |
| ffi.Pointer<CONF> conf, | |
| ); | |
| /// NCONF_get_section returns a stack of values for a given section in `conf`. | |
| /// If `section` is NULL, the default section is returned. It returns NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_CONF_VALUE> Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_NCONF_get_section') | |
| external ffi.Pointer<stack_st_CONF_VALUE> NCONF_get_section( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<ffi.Char> section, | |
| ); | |
| /// NCONF_get_string returns the value of the key `name`, in section `section`. | |
| /// The `section` argument may be NULL to indicate the default section. It | |
| /// returns the value or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_NCONF_get_string') | |
| external ffi.Pointer<ffi.Char> NCONF_get_string( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<ffi.Char> section, | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// NCONF_load parses the file named `filename` and adds the values found to | |
| /// `conf`. It returns one on success and zero on error. In the event of an | |
| /// error, if `out_error_line` is not NULL, `*out_error_line` is set to the | |
| /// number of the line that contained the error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Long>, | |
| ) | |
| >(symbol: 'bssl_dart_NCONF_load') | |
| external int NCONF_load( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<ffi.Char> filename, | |
| ffi.Pointer<ffi.Long> out_error_line, | |
| ); | |
| /// NCONF_load_bio acts like `NCONF_load` but reads from `bio` rather than from | |
| /// a named file. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CONF>, ffi.Pointer<BIO>, ffi.Pointer<ffi.Long>) | |
| >(symbol: 'bssl_dart_NCONF_load_bio') | |
| external int NCONF_load_bio( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Long> out_error_line, | |
| ); | |
| /// NCONF_new returns a fresh, empty `CONF`, or NULL on error. The `method` | |
| /// argument must be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<CONF> Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_NCONF_new', | |
| ) | |
| external ffi.Pointer<CONF> NCONF_new( | |
| ffi.Pointer<ffi.Void> method, | |
| ); | |
| /// NETSCAPE_SPKAC_free releases memory associated with `spkac`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<NETSCAPE_SPKAC>)>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKAC_free', | |
| ) | |
| external void NETSCAPE_SPKAC_free( | |
| ffi.Pointer<NETSCAPE_SPKAC> spkac, | |
| ); | |
| /// NETSCAPE_SPKAC_new returns a newly-allocated, empty `NETSCAPE_SPKAC` object, | |
| /// or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<NETSCAPE_SPKAC> Function()>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKAC_new', | |
| ) | |
| external ffi.Pointer<NETSCAPE_SPKAC> NETSCAPE_SPKAC_new(); | |
| /// NETSCAPE_SPKI_b64_decode decodes `len` bytes from `str` as a base64-encoded | |
| /// SignedPublicKeyAndChallenge structure. It returns a newly-allocated | |
| /// `NETSCAPE_SPKI` structure with the result, or NULL on error. If `len` is 0 or | |
| /// negative, the length is calculated with `strlen` and `str` must be a | |
| /// NUL-terminated C string. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<NETSCAPE_SPKI> Function(ffi.Pointer<ffi.Char>, ossl_ssize_t) | |
| >(symbol: 'bssl_dart_NETSCAPE_SPKI_b64_decode') | |
| external ffi.Pointer<NETSCAPE_SPKI> NETSCAPE_SPKI_b64_decode( | |
| ffi.Pointer<ffi.Char> str, | |
| int len, | |
| ); | |
| /// NETSCAPE_SPKI_b64_encode encodes `spki` as a base64-encoded | |
| /// SignedPublicKeyAndChallenge structure. It returns a newly-allocated | |
| /// NUL-terminated C string with the result, or NULL on error. The caller must | |
| /// release the memory with `OPENSSL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<NETSCAPE_SPKI>)>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKI_b64_encode', | |
| ) | |
| external ffi.Pointer<ffi.Char> NETSCAPE_SPKI_b64_encode( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ); | |
| /// NETSCAPE_SPKI_free releases memory associated with `spki`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<NETSCAPE_SPKI>)>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKI_free', | |
| ) | |
| external void NETSCAPE_SPKI_free( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ); | |
| /// NETSCAPE_SPKI_get_pubkey decodes and returns the public key in `spki` as an | |
| /// `EVP_PKEY`, or NULL on error. The caller takes ownership of the resulting | |
| /// pointer and must call `EVP_PKEY_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<NETSCAPE_SPKI>)>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKI_get_pubkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> NETSCAPE_SPKI_get_pubkey( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ); | |
| /// NETSCAPE_SPKI_new returns a newly-allocated, empty `NETSCAPE_SPKI` object, or | |
| /// NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<NETSCAPE_SPKI> Function()>( | |
| symbol: 'bssl_dart_NETSCAPE_SPKI_new', | |
| ) | |
| external ffi.Pointer<NETSCAPE_SPKI> NETSCAPE_SPKI_new(); | |
| /// NETSCAPE_SPKI_set_pubkey sets `spki`'s public key to `pkey`. It returns one | |
| /// on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<NETSCAPE_SPKI>, ffi.Pointer<EVP_PKEY>) | |
| >(symbol: 'bssl_dart_NETSCAPE_SPKI_set_pubkey') | |
| external int NETSCAPE_SPKI_set_pubkey( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// NETSCAPE_SPKI_sign signs `spki` with `pkey` and replaces the signature | |
| /// algorithm and signature fields. It returns the length of the signature on | |
| /// success and zero on error. This function uses digest algorithm `md`, or | |
| /// `pkey`'s default if NULL. Other signing parameters use `pkey`'s defaults. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<NETSCAPE_SPKI>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_NETSCAPE_SPKI_sign') | |
| external int NETSCAPE_SPKI_sign( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// NETSCAPE_SPKI_verify checks that `spki` has a valid signature by `pkey`. It | |
| /// returns one if the signature is valid and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<NETSCAPE_SPKI>, ffi.Pointer<EVP_PKEY>) | |
| >(symbol: 'bssl_dart_NETSCAPE_SPKI_verify') | |
| external int NETSCAPE_SPKI_verify( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// NOTICEREF_free releases memory associated with `ref`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<NOTICEREF>)>( | |
| symbol: 'bssl_dart_NOTICEREF_free', | |
| ) | |
| external void NOTICEREF_free( | |
| ffi.Pointer<NOTICEREF> ref, | |
| ); | |
| /// NOTICEREF_new returns a newly-allocated, empty `NOTICEREF` object, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<NOTICEREF> Function()>( | |
| symbol: 'bssl_dart_NOTICEREF_new', | |
| ) | |
| external ffi.Pointer<NOTICEREF> NOTICEREF_new(); | |
| /// OBJ_cbs2nid returns the nid corresponding to the DER data in `cbs`, or | |
| /// `NID_undef` if no such object is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBS>)>(symbol: 'bssl_dart_OBJ_cbs2nid') | |
| external int OBJ_cbs2nid( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// OBJ_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OBJ_cleanup') | |
| external void OBJ_cleanup(); | |
| /// OBJ_cmp returns a value less than, equal to or greater than zero if `a` is | |
| /// less than, equal to or greater than `b`, respectively. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_OBJECT>, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_OBJ_cmp') | |
| external int OBJ_cmp( | |
| ffi.Pointer<ASN1_OBJECT> a, | |
| ffi.Pointer<ASN1_OBJECT> b, | |
| ); | |
| /// OBJ_create adds a known object and returns the NID of the new object, or | |
| /// NID_undef on error. | |
| /// | |
| /// WARNING: This function modifies global state. The table cannot contain | |
| /// duplicate OIDs, short names, or long names. If two callers in the same | |
| /// address space add conflicting values, only one registration will take effect. | |
| /// Avoid this function if possible. Instead, callers can process OIDs unknown to | |
| /// BoringSSL by acting on the byte representation directly. See | |
| /// `ASN1_OBJECT_create`, `OBJ_get0_data`, and `OBJ_length`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_OBJ_create') | |
| external int OBJ_create( | |
| ffi.Pointer<ffi.Char> oid, | |
| ffi.Pointer<ffi.Char> short_name, | |
| ffi.Pointer<ffi.Char> long_name, | |
| ); | |
| /// OBJ_dup returns a duplicate copy of `obj` or NULL on allocation failure. The | |
| /// caller must call `ASN1_OBJECT_free` on the result to release it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_OBJ_dup', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> OBJ_dup( | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// OBJ_find_sigid_algs finds the digest and public-key NIDs that correspond to | |
| /// the signing algorithm `sign_nid`. If successful, it sets `*out_digest_nid` | |
| /// and `*out_pkey_nid` and returns one. Otherwise it returns zero. Any of | |
| /// `out_digest_nid` or `out_pkey_nid` can be NULL if the caller doesn't need | |
| /// that output value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Int, ffi.Pointer<ffi.Int>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_OBJ_find_sigid_algs') | |
| external int OBJ_find_sigid_algs( | |
| int sign_nid, | |
| ffi.Pointer<ffi.Int> out_digest_nid, | |
| ffi.Pointer<ffi.Int> out_pkey_nid, | |
| ); | |
| /// OBJ_find_sigid_by_algs finds the signature NID that corresponds to the | |
| /// combination of `digest_nid` and `pkey_nid`. If success, it sets | |
| /// `*out_sign_nid` and returns one. Otherwise it returns zero. The | |
| /// `out_sign_nid` argument can be NULL if the caller only wishes to learn | |
| /// whether the combination is valid. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_find_sigid_by_algs', | |
| ) | |
| external int OBJ_find_sigid_by_algs( | |
| ffi.Pointer<ffi.Int> out_sign_nid, | |
| int digest_nid, | |
| int pkey_nid, | |
| ); | |
| /// OBJ_get0_data returns a pointer to the DER representation of `obj`. This is | |
| /// the contents of the DER-encoded identifier, not including the tag and length. | |
| /// If `obj` does not have an associated object identifier (i.e. it is a nid-only | |
| /// value), this value is the empty string. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_OBJ_get0_data', | |
| ) | |
| external ffi.Pointer<ffi.Uint8> OBJ_get0_data( | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// OBJ_get_undef returns the object for `NID_undef`. Prefer this function over | |
| /// `OBJ_nid2obj` to avoid pulling in the full OID table. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function()>( | |
| symbol: 'bssl_dart_OBJ_get_undef', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> OBJ_get_undef(); | |
| /// OBJ_length returns the length of the DER representation of `obj`. This is the | |
| /// contents of the DER-encoded identifier, not including the tag and length. If | |
| /// `obj` does not have an associated object identifier (i.e. it is a nid-only | |
| /// value), this value is the empty string. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_OBJ_length', | |
| ) | |
| external int OBJ_length( | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// OBJ_ln2nid returns the nid corresponding to `long_name`, or `NID_undef` if | |
| /// no such long name is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OBJ_ln2nid', | |
| ) | |
| external int OBJ_ln2nid( | |
| ffi.Pointer<ffi.Char> long_name, | |
| ); | |
| /// OBJ_nid2cbb writes `nid` as an ASN.1 OBJECT IDENTIFIER to `out`. It returns | |
| /// one on success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_nid2cbb', | |
| ) | |
| external int OBJ_nid2cbb( | |
| ffi.Pointer<CBB> out, | |
| int nid, | |
| ); | |
| /// OBJ_nid2ln returns the long name for `nid`, or NULL if `nid` is unknown. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_nid2ln', | |
| ) | |
| external ffi.Pointer<ffi.Char> OBJ_nid2ln( | |
| int nid, | |
| ); | |
| /// OBJ_nid2obj returns the `ASN1_OBJECT` corresponding to `nid`, or NULL if | |
| /// `nid` is unknown. | |
| /// | |
| /// Although the output is not const, this function returns a static, immutable | |
| /// `ASN1_OBJECT`. It is not necessary to release the object with | |
| /// `ASN1_OBJECT_free`. | |
| /// | |
| /// However, functions like `X509_ALGOR_set0` expect to take ownership of a | |
| /// possibly dynamically-allocated `ASN1_OBJECT`. `ASN1_OBJECT_free` is a no-op | |
| /// for static `ASN1_OBJECT`s, so `OBJ_nid2obj` is compatible with such | |
| /// functions. | |
| /// | |
| /// Callers are encouraged to store the result of this function in a const | |
| /// pointer. However, if using functions like `X509_ALGOR_set0`, callers may use | |
| /// a non-const pointer and manage ownership. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_nid2obj', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> OBJ_nid2obj( | |
| int nid, | |
| ); | |
| /// OBJ_nid2sn returns the short name for `nid`, or NULL if `nid` is unknown. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_nid2sn', | |
| ) | |
| external ffi.Pointer<ffi.Char> OBJ_nid2sn( | |
| int nid, | |
| ); | |
| /// OBJ_obj2nid returns the nid corresponding to `obj`, or `NID_undef` if no | |
| /// such object is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_OBJ_obj2nid', | |
| ) | |
| external int OBJ_obj2nid( | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// OBJ_obj2txt converts `obj` to a textual representation. If | |
| /// `always_return_oid` is zero then `obj` will be matched against known objects | |
| /// and the long (preferably) or short name will be used if found. Otherwise | |
| /// `obj` will be converted into a dotted sequence of integers. If `out` is not | |
| /// NULL, then at most `out_len` bytes of the textual form will be written | |
| /// there. If `out_len` is at least one, then string written to `out` will | |
| /// always be NUL terminated. It returns the number of characters that could | |
| /// have been written, not including the final NUL, or -1 on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_OBJ_obj2txt') | |
| external int OBJ_obj2txt( | |
| ffi.Pointer<ffi.Char> out, | |
| int out_len, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int always_return_oid, | |
| ); | |
| /// OBJ_sn2nid returns the nid corresponding to `short_name`, or `NID_undef` if | |
| /// no such short name is known. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OBJ_sn2nid', | |
| ) | |
| external int OBJ_sn2nid( | |
| ffi.Pointer<ffi.Char> short_name, | |
| ); | |
| /// OBJ_txt2nid returns the nid corresponding to `s`, which may be a short name, | |
| /// long name, or an ASCII string containing a dotted sequence of numbers. It | |
| /// returns the nid or NID_undef if unknown. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OBJ_txt2nid', | |
| ) | |
| external int OBJ_txt2nid( | |
| ffi.Pointer<ffi.Char> s, | |
| ); | |
| /// OBJ_txt2obj returns an ASN1_OBJECT for the textual representation in `s`. | |
| /// If `dont_search_names` is zero, then `s` will be matched against the long | |
| /// and short names of a known objects to find a match. Otherwise `s` must | |
| /// contain an ASCII string with a dotted sequence of numbers. The resulting | |
| /// object need not be previously known. It returns a freshly allocated | |
| /// `ASN1_OBJECT` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Pointer<ffi.Char>, ffi.Int)>( | |
| symbol: 'bssl_dart_OBJ_txt2obj', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> OBJ_txt2obj( | |
| ffi.Pointer<ffi.Char> s, | |
| int dont_search_names, | |
| ); | |
| /// OPENSSL_add_all_algorithms_conf does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>( | |
| symbol: 'bssl_dart_OPENSSL_add_all_algorithms_conf', | |
| ) | |
| external void OPENSSL_add_all_algorithms_conf(); | |
| /// OPENSSL_asprintf has the same behavior as asprintf(3), except that | |
| /// memory allocated in a returned string must be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<ffi.Char>>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_OPENSSL_asprintf') | |
| external int OPENSSL_asprintf( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> str, | |
| ffi.Pointer<ffi.Char> format, | |
| ); | |
| /// OPENSSL_calloc is similar to a regular `calloc`, but allocates data with | |
| /// `OPENSSL_malloc`. On overflow, it will push `ERR_R_OVERFLOW` onto the error | |
| /// queue. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_calloc', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_calloc( | |
| int num, | |
| int size, | |
| ); | |
| /// OPENSSL_cleanse zeros out `len` bytes of memory at `ptr`. This is similar to | |
| /// `memset_s` from C11. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_cleanse', | |
| ) | |
| external void OPENSSL_cleanse( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int len, | |
| ); | |
| /// OPENSSL_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OPENSSL_cleanup') | |
| external void OPENSSL_cleanup(); | |
| /// OPENSSL_clear_free calls `OPENSSL_free`. BoringSSL automatically clears all | |
| /// allocations on free, but we define `OPENSSL_clear_free` for compatibility. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_clear_free', | |
| ) | |
| external void OPENSSL_clear_free( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int len, | |
| ); | |
| /// OPENSSL_config does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OPENSSL_config', | |
| ) | |
| external void OPENSSL_config( | |
| ffi.Pointer<ffi.Char> config_name, | |
| ); | |
| /// OPENSSL_free does nothing if `ptr` is NULL. Otherwise it zeros out the | |
| /// memory allocated at `ptr` and frees it along with the private data. | |
| /// It must only be used on `ptr` values obtained from `OPENSSL_malloc` | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_OPENSSL_free', | |
| ) | |
| external void OPENSSL_free( | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| /// OPENSSL_fromxdigit returns one if `c` is a hexadecimal digit as recognized | |
| /// by OPENSSL_isxdigit, and sets `out` to the corresponding value. Otherwise | |
| /// zero is returned. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Int)>( | |
| symbol: 'bssl_dart_OPENSSL_fromxdigit', | |
| ) | |
| external int OPENSSL_fromxdigit( | |
| ffi.Pointer<ffi.Uint8> out, | |
| int c, | |
| ); | |
| /// OPENSSL_hash32 implements the 32 bit, FNV-1a hash. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_hash32', | |
| ) | |
| external int OPENSSL_hash32( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int len, | |
| ); | |
| /// OPENSSL_init_crypto returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Uint64, ffi.Pointer<OPENSSL_INIT_SETTINGS>)>( | |
| symbol: 'bssl_dart_OPENSSL_init_crypto', | |
| ) | |
| external int OPENSSL_init_crypto( | |
| int opts, | |
| ffi.Pointer<OPENSSL_INIT_SETTINGS> settings, | |
| ); | |
| /// OPENSSL_isalnum is a locale-independent, ASCII-only version of isalnum(3), It | |
| /// only recognizes what `OPENSSL_isalpha` and `OPENSSL_isdigit` recognize. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_isalnum') | |
| external int OPENSSL_isalnum( | |
| int c, | |
| ); | |
| /// OPENSSL_isalpha is a locale-independent, ASCII-only version of isalpha(3), It | |
| /// only recognizes 'a' through 'z' and 'A' through 'Z' as alphabetic. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_isalpha') | |
| external int OPENSSL_isalpha( | |
| int c, | |
| ); | |
| /// OPENSSL_isdigit is a locale-independent, ASCII-only version of isdigit(3), It | |
| /// only recognizes '0' through '9' as digits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_isdigit') | |
| external int OPENSSL_isdigit( | |
| int c, | |
| ); | |
| /// OPENSSL_isspace is a locale-independent, ASCII-only version of isspace(3). It | |
| /// only recognizes '\t', '\n', '\v', '\f', '\r', and ' '. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_isspace') | |
| external int OPENSSL_isspace( | |
| int c, | |
| ); | |
| /// OPENSSL_isxdigit is a locale-independent, ASCII-only version of isxdigit(3), | |
| /// It only recognizes '0' through '9', 'a' through 'f', and 'A through 'F' as | |
| /// digits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_isxdigit') | |
| external int OPENSSL_isxdigit( | |
| int c, | |
| ); | |
| /// OPENSSL_load_builtin_modules does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>( | |
| symbol: 'bssl_dart_OPENSSL_load_builtin_modules', | |
| ) | |
| external void OPENSSL_load_builtin_modules(); | |
| /// OPENSSL_malloc is similar to a regular `malloc`, but allocates additional | |
| /// private data. The resulting pointer must be freed with `OPENSSL_free`. In | |
| /// the case of a malloc failure, prior to returning NULL `OPENSSL_malloc` will | |
| /// push `ERR_R_MALLOC_FAILURE` onto the openssl error stack. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_malloc', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_malloc( | |
| int size, | |
| ); | |
| /// OPENSSL_malloc_init returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_OPENSSL_malloc_init') | |
| external int OPENSSL_malloc_init(); | |
| /// OPENSSL_memdup returns an allocated, duplicate of `size` bytes from `data` or | |
| /// NULL on allocation failure. The memory allocated must be freed with | |
| /// `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_memdup', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_memdup( | |
| ffi.Pointer<ffi.Void> data, | |
| int size, | |
| ); | |
| /// OPENSSL_no_config does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OPENSSL_no_config') | |
| external void OPENSSL_no_config(); | |
| /// OPENSSL_realloc returns a pointer to a buffer of `new_size` bytes that | |
| /// contains the contents of `ptr`. Unlike `realloc`, a new buffer is always | |
| /// allocated and the data at `ptr` is always wiped and freed. Memory is | |
| /// allocated with `OPENSSL_malloc` and must be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_realloc', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_realloc( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int new_size, | |
| ); | |
| /// OPENSSL_secure_clear_free calls `OPENSSL_clear_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_secure_clear_free', | |
| ) | |
| external void OPENSSL_secure_clear_free( | |
| ffi.Pointer<ffi.Void> ptr, | |
| int len, | |
| ); | |
| /// OPENSSL_secure_malloc calls `OPENSSL_malloc`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_secure_malloc', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_secure_malloc( | |
| int size, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<OPENSSL_STACK> Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| OPENSSL_sk_call_copy_func, | |
| OPENSSL_sk_copy_func, | |
| OPENSSL_sk_call_free_func, | |
| OPENSSL_sk_free_func, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_deep_copy') | |
| external ffi.Pointer<OPENSSL_STACK> OPENSSL_sk_deep_copy( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_copy_func call_copy_func, | |
| OPENSSL_sk_copy_func copy_func, | |
| OPENSSL_sk_call_free_func call_free_func, | |
| OPENSSL_sk_free_func free_func, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_delete') | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_delete( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| int where, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| OPENSSL_sk_call_delete_if_func, | |
| OPENSSL_sk_delete_if_func, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_delete_if') | |
| external void OPENSSL_sk_delete_if( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_delete_if_func call_func, | |
| OPENSSL_sk_delete_if_func func, | |
| ffi.Pointer<ffi.Void> data, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_delete_ptr') | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_delete_ptr( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ffi.Pointer<ffi.Void> p, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<OPENSSL_STACK> Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_dup', | |
| ) | |
| external ffi.Pointer<OPENSSL_STACK> OPENSSL_sk_dup( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Void>, | |
| OPENSSL_sk_call_cmp_func, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_find') | |
| external int OPENSSL_sk_find( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ffi.Pointer<ffi.Size> out_index, | |
| ffi.Pointer<ffi.Void> p, | |
| OPENSSL_sk_call_cmp_func call_cmp_func, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_free', | |
| ) | |
| external void OPENSSL_sk_free( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<OPENSSL_STACK>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_insert') | |
| external int OPENSSL_sk_insert( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ffi.Pointer<ffi.Void> p, | |
| int where, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_is_sorted', | |
| ) | |
| external int OPENSSL_sk_is_sorted( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_last', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_last( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| /// The following are raw stack functions. They implement the corresponding typed | |
| /// `sk_SAMPLE_*` functions generated by `DEFINE_STACK_OF`. Callers shouldn't be | |
| /// using them. Rather, callers should use the typed functions. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<OPENSSL_STACK> Function(OPENSSL_sk_cmp_func)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_new', | |
| ) | |
| external ffi.Pointer<OPENSSL_STACK> OPENSSL_sk_new( | |
| OPENSSL_sk_cmp_func comp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<OPENSSL_STACK> Function()>( | |
| symbol: 'bssl_dart_OPENSSL_sk_new_null', | |
| ) | |
| external ffi.Pointer<OPENSSL_STACK> OPENSSL_sk_new_null(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_num', | |
| ) | |
| external int OPENSSL_sk_num( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_pop', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_pop( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| OPENSSL_sk_call_free_func, | |
| OPENSSL_sk_free_func, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_pop_free_ex') | |
| external void OPENSSL_sk_pop_free_ex( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_free_func call_free_func, | |
| OPENSSL_sk_free_func free_func, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<OPENSSL_STACK>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_push') | |
| external int OPENSSL_sk_push( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ffi.Pointer<ffi.Void> p, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_set') | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_set( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| int i, | |
| ffi.Pointer<ffi.Void> p, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| OPENSSL_sk_cmp_func Function(ffi.Pointer<OPENSSL_STACK>, OPENSSL_sk_cmp_func) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_set_cmp_func') | |
| external OPENSSL_sk_cmp_func OPENSSL_sk_set_cmp_func( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_cmp_func comp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_shift', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_shift( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<OPENSSL_STACK>, OPENSSL_sk_call_cmp_func) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_sort') | |
| external void OPENSSL_sk_sort( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_cmp_func call_cmp_func, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| OPENSSL_sk_call_cmp_func, | |
| OPENSSL_sk_call_free_func, | |
| OPENSSL_sk_free_func, | |
| ) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_sort_and_dedup') | |
| external void OPENSSL_sk_sort_and_dedup( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_cmp_func call_cmp_func, | |
| OPENSSL_sk_call_free_func call_free_func, | |
| OPENSSL_sk_free_func free_func, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_sk_value') | |
| external ffi.Pointer<ffi.Void> OPENSSL_sk_value( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| int i, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_OPENSSL_sk_zero', | |
| ) | |
| external void OPENSSL_sk_zero( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| /// OPENSSL_strcasecmp is a locale-independent, ASCII-only version of | |
| /// strcasecmp(3). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OPENSSL_strcasecmp', | |
| ) | |
| external int OPENSSL_strcasecmp( | |
| ffi.Pointer<ffi.Char> a, | |
| ffi.Pointer<ffi.Char> b, | |
| ); | |
| /// OPENSSL_strdup has the same behaviour as strdup(3). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OPENSSL_strdup', | |
| ) | |
| external ffi.Pointer<ffi.Char> OPENSSL_strdup( | |
| ffi.Pointer<ffi.Char> s, | |
| ); | |
| /// OPENSSL_strhash calls `OPENSSL_hash32` on the NUL-terminated string `s`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_OPENSSL_strhash', | |
| ) | |
| external int OPENSSL_strhash( | |
| ffi.Pointer<ffi.Char> s, | |
| ); | |
| /// OPENSSL_strlcat acts like strlcat(3). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_strlcat') | |
| external int OPENSSL_strlcat( | |
| ffi.Pointer<ffi.Char> dst, | |
| ffi.Pointer<ffi.Char> src, | |
| int dst_size, | |
| ); | |
| /// OPENSSL_strlcpy acts like strlcpy(3). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_strlcpy') | |
| external int OPENSSL_strlcpy( | |
| ffi.Pointer<ffi.Char> dst, | |
| ffi.Pointer<ffi.Char> src, | |
| int dst_size, | |
| ); | |
| /// OPENSSL_strncasecmp is a locale-independent, ASCII-only version of | |
| /// strncasecmp(3). | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Size) | |
| >(symbol: 'bssl_dart_OPENSSL_strncasecmp') | |
| external int OPENSSL_strncasecmp( | |
| ffi.Pointer<ffi.Char> a, | |
| ffi.Pointer<ffi.Char> b, | |
| int n, | |
| ); | |
| /// OPENSSL_strndup returns an allocated, duplicate of `str`, which is, at most, | |
| /// `size` bytes. The result is always NUL terminated. The memory allocated | |
| /// must be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Char>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_strndup', | |
| ) | |
| external ffi.Pointer<ffi.Char> OPENSSL_strndup( | |
| ffi.Pointer<ffi.Char> str, | |
| int size, | |
| ); | |
| /// OPENSSL_strnlen has the same behaviour as strnlen(3). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<ffi.Char>, ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_strnlen', | |
| ) | |
| external int OPENSSL_strnlen( | |
| ffi.Pointer<ffi.Char> s, | |
| int len, | |
| ); | |
| /// OPENSSL_tolower is a locale-independent, ASCII-only version of tolower(3). It | |
| /// only lowercases ASCII values. Other values are returned as-is. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>(symbol: 'bssl_dart_OPENSSL_tolower') | |
| external int OPENSSL_tolower( | |
| int c, | |
| ); | |
| /// OPENSSL_zalloc behaves like `OPENSSL_malloc` except it also initializes the | |
| /// resulting memory to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Size)>( | |
| symbol: 'bssl_dart_OPENSSL_zalloc', | |
| ) | |
| external ffi.Pointer<ffi.Void> OPENSSL_zalloc( | |
| int size, | |
| ); | |
| /// OTHERNAME_free releases memory associated with `name`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<OTHERNAME>)>( | |
| symbol: 'bssl_dart_OTHERNAME_free', | |
| ) | |
| external void OTHERNAME_free( | |
| ffi.Pointer<OTHERNAME> name, | |
| ); | |
| /// OTHERNAME_new returns a new, empty `OTHERNAME`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<OTHERNAME> Function()>( | |
| symbol: 'bssl_dart_OTHERNAME_new', | |
| ) | |
| external ffi.Pointer<OTHERNAME> OTHERNAME_new(); | |
| /// OpenSSL_add_all_algorithms does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OpenSSL_add_all_algorithms') | |
| external void OpenSSL_add_all_algorithms(); | |
| /// OpenSSL_add_all_ciphers does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OpenSSL_add_all_ciphers') | |
| external void OpenSSL_add_all_ciphers(); | |
| /// OpenSSL_add_all_digests does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_OpenSSL_add_all_digests') | |
| external void OpenSSL_add_all_digests(); | |
| /// OpenSSL_version is a compatibility function that returns the string | |
| /// "BoringSSL" if `which` is `OPENSSL_VERSION` and placeholder strings | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_OpenSSL_version', | |
| ) | |
| external ffi.Pointer<ffi.Char> OpenSSL_version( | |
| int which, | |
| ); | |
| /// OpenSSL_version_num is a compatibility function that returns | |
| /// OPENSSL_VERSION_NUMBER from base.h. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedLong Function()>( | |
| symbol: 'bssl_dart_OpenSSL_version_num', | |
| ) | |
| external int OpenSSL_version_num(); | |
| /// PEM_ASN1_read behaves like `PEM_ASN1_read_bio` but reads from `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<d2i_of_void>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_ASN1_read') | |
| external ffi.Pointer<ffi.Void> PEM_ASN1_read( | |
| ffi.Pointer<d2i_of_void> d2i, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_ASN1_read_bio calls `PEM_bytes_read_bio` and then decodes the resulting | |
| /// data with `d2i`, which should behave as in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<d2i_of_void>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_ASN1_read_bio') | |
| external ffi.Pointer<ffi.Void> PEM_ASN1_read_bio( | |
| ffi.Pointer<d2i_of_void> d2i, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_ASN1_write behaves like `PEM_ASN1_write_bio` but reads from `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<i2d_of_void>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_ASN1_write') | |
| external int PEM_ASN1_write( | |
| ffi.Pointer<i2d_of_void> i2d, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Void> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> callback, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_ASN1_write_bio encodes `in` with `i2d`, which should behave as in | |
| /// `i2d_SAMPLE`. It then writes the result to `bio` as in | |
| /// `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<i2d_of_void>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_ASN1_write_bio') | |
| external int PEM_ASN1_write_bio( | |
| ffi.Pointer<i2d_of_void> i2d, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Void> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_INFO> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<stack_st_X509_INFO>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_X509_INFO_read') | |
| external ffi.Pointer<stack_st_X509_INFO> PEM_X509_INFO_read( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<stack_st_X509_INFO> sk, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_X509_INFO_read_bio reads PEM blocks from `bio` and decodes any | |
| /// certificates, CRLs, and private keys found. It returns a | |
| /// `STACK_OF(X509_INFO)` structure containing the results, or NULL on error. | |
| /// | |
| /// If `sk` is NULL, the result on success will be a newly-allocated | |
| /// `STACK_OF(X509_INFO)` structure which should be released with | |
| /// `sk_X509_INFO_pop_free` and `X509_INFO_free` when done. | |
| /// | |
| /// If `sk` is non-NULL, it appends the results to `sk` instead and returns `sk` | |
| /// on success. In this case, the caller retains ownership of `sk` in both | |
| /// success and failure. | |
| /// | |
| /// This function will decrypt any encrypted certificates in `bio`, using `cb`, | |
| /// but it will not decrypt encrypted private keys. Encrypted private keys are | |
| /// instead represented as placeholder `X509_INFO` objects with an empty `x_pkey` | |
| /// field. This allows this function to be used with inputs with unencrypted | |
| /// certificates, but encrypted passwords, without knowing the password. However, | |
| /// it also means that this function cannot be used to decrypt the private key | |
| /// when the password is known. | |
| /// | |
| /// WARNING: If the input contains "TRUSTED CERTIFICATE" PEM blocks, this | |
| /// function parses auxiliary properties as in `d2i_X509_AUX`. Passing untrusted | |
| /// input to this function allows an attacker to influence those properties. See | |
| /// `d2i_X509_AUX` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_INFO> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<stack_st_X509_INFO>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_X509_INFO_read_bio') | |
| external ffi.Pointer<stack_st_X509_INFO> PEM_X509_INFO_read_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<stack_st_X509_INFO> sk, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_bytes_read_bio reads from `bio` until it finds a PEM block whose name | |
| /// matches `expected_name`. If one is found, it sets `*out_name` and `*out_data` | |
| /// to newly-allocated buffers containing the PEM type and (possibly decrypted) | |
| /// PEM data. `*out_name` is a NUL-terminated C string, while `*out_data` has | |
| /// `*out_len` bytes. The caller must release `*out_name` and `*out_data` with | |
| /// `OPENSSL_free` when done. | |
| /// | |
| /// If the PEM block is encrypted, `cb` will be called to look up the password. | |
| /// See `pem_password_cb` for details. If `cb` is NULL, `PEM_def_callback` is | |
| /// used and `userdata` should be a NUL-terminated C string containing the | |
| /// password. Set both `cb` and `userdata` to NULL to only handle plaintext | |
| /// blocks. | |
| /// | |
| /// `expected_name` and `*out_name` may not necessarily be the same value, so | |
| /// callers must check `*out_name` before decoding `*out_data`. In addition to an | |
| /// exact match, the following values are also accepted: | |
| /// | |
| /// - If `expected_name` is "CERTIFICATE", the older "X509 CERTIFICATE" type is | |
| /// also accepted. | |
| /// | |
| /// - If `expected_name` is "CERTIFICATE REQUEST", the older "NEW CERTIFICATE | |
| /// REQUEST" type is also accepted. | |
| /// | |
| /// - If `expected_name` is "TRUSTED CERTIFICATE", "CERTIFICATE" and the older | |
| /// "X509 CERTIFICATE" are also accepted. | |
| /// | |
| /// - If `expected_name` is "PKCS7", "PKCS #7 SIGNED DATA" is also accepted. | |
| /// | |
| /// - If `expected_name` is "PKCS7", "CERTIFICATE" is also accepted. This is an | |
| /// exposed implementation detail of `PKCS7_get_PEM_certificates`, which works | |
| /// around a 2000-era mistake by some CAs. | |
| /// | |
| /// - If `expected_name` is "ANY PRIVATE KEY", the type "ANY PRIVATE KEY" is not | |
| /// accepted and, instead, the function accepts "PRIVATE KEY", "ENCRYPTED | |
| /// PRIVATE KEY", "RSA PRIVATE KEY", "EC PRIVATE KEY", and "DSA PRIVATE KEY". | |
| /// This is an exposed implementation detail of `PEM_read_bio_PrivateKey`. | |
| /// | |
| /// TODO(davidben): Can some of the older aliases and workarounds be removed now? | |
| /// | |
| /// If no PEM block is found, this function returns zero and pushes | |
| /// `PEM_R_NO_START_LINE` to the error queue. If one is found, but there is an | |
| /// error decoding it, it returns zero and pushes some other error to the error | |
| /// queue. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Long>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_bytes_read_bio') | |
| external int PEM_bytes_read_bio( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| ffi.Pointer<ffi.Long> out_len, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_name, | |
| ffi.Pointer<ffi.Char> expected_name, | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_def_callback is the default implementation of `pem_password_cb`. It | |
| /// interprets `userdata` as a NUL-terminated C string and outputs it according | |
| /// to `pem_password_cb`. If `userdata` is NULL, it returns -1. | |
| /// | |
| /// This differs from OpenSSL, which interactively prompts for a password by | |
| /// default. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_def_callback') | |
| external int PEM_def_callback( | |
| ffi.Pointer<ffi.Char> buf, | |
| int size, | |
| int enc, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read behaves like `PEM_read_bio` but reads from `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Long>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read') | |
| external int PEM_read( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_name, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_header, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| ffi.Pointer<ffi.Long> out_len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DH> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<DH>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_DHparams') | |
| external ffi.Pointer<DH> PEM_read_DHparams( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DH>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_DSAPrivateKey') | |
| external ffi.Pointer<DSA> PEM_read_DSAPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_DSA_PUBKEY') | |
| external ffi.Pointer<DSA> PEM_read_DSA_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_DSAparams') | |
| external ffi.Pointer<DSA> PEM_read_DSAparams( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_ECPrivateKey') | |
| external ffi.Pointer<EC_KEY> PEM_read_ECPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_EC_PUBKEY') | |
| external ffi.Pointer<EC_KEY> PEM_read_EC_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS7> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<PKCS7>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_PKCS7') | |
| external ffi.Pointer<PKCS7> PEM_read_PKCS7( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<PKCS7>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_SIG> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_PKCS8') | |
| external ffi.Pointer<X509_SIG> PEM_read_PKCS8( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_PKCS8_PRIV_KEY_INFO') | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> PEM_read_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_PUBKEY') | |
| external ffi.Pointer<EVP_PKEY> PEM_read_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_PrivateKey') | |
| external ffi.Pointer<EVP_PKEY> PEM_read_PrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_RSAPrivateKey') | |
| external ffi.Pointer<RSA> PEM_read_RSAPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_RSAPublicKey') | |
| external ffi.Pointer<RSA> PEM_read_RSAPublicKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_RSA_PUBKEY') | |
| external ffi.Pointer<RSA> PEM_read_RSA_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// The following functions behave like the corresponding `PEM_read_bio_*` | |
| /// functions, but read from `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_X509') | |
| external ffi.Pointer<X509> PEM_read_X509( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_X509_AUX') | |
| external ffi.Pointer<X509> PEM_read_X509_AUX( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_X509_CRL') | |
| external ffi.Pointer<X509_CRL> PEM_read_X509_CRL( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REQ> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_X509_REQ') | |
| external ffi.Pointer<X509_REQ> PEM_read_X509_REQ( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio reads from `bio` until the next PEM block. If one is found, it | |
| /// returns one and sets `*out_name`, `*out_header`, and `*out_data` to | |
| /// newly-allocated buffers containing the PEM type, the header block, and the | |
| /// decoded data, respectively. `*out_name` and `*out_header` are NUL-terminated | |
| /// C strings, while `*out_data` has `*out_len` bytes. The caller must release | |
| /// each of `*out_name`, `*out_header`, and `*out_data` with `OPENSSL_free` when | |
| /// done. | |
| /// | |
| /// If no PEM block is found, this function returns zero and pushes | |
| /// `PEM_R_NO_START_LINE` to the error queue. If one is found, but there is an | |
| /// error decoding it, it returns zero and pushes some other error to the error | |
| /// queue. | |
| /// | |
| /// This function does not decrypt encrypted PEM blocks and instead returns the | |
| /// header and (possibly encrypted) data unprocessed. See `PEM_bytes_read_bio` to | |
| /// decrypt blocks. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Long>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio') | |
| external int PEM_read_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_name, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_header, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_data, | |
| ffi.Pointer<ffi.Long> out_len, | |
| ); | |
| /// PEM_read_bio_DHparams reads a PEM block of type "DH PARAMETERS", as described | |
| /// in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DH> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<DH>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_DHparams') | |
| external ffi.Pointer<DH> PEM_read_bio_DHparams( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<DH>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_DSAPrivateKey behaves like `PEM_read_bio_PrivateKey` but only | |
| /// returns DSA keys, represented as a `DSA` object. Keys of other types result | |
| /// in an error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_DSAPrivateKey') | |
| external ffi.Pointer<DSA> PEM_read_bio_DSAPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_DSA_PUBKEY behaves like `PEM_read_bio_PUBKEY` but only returns | |
| /// DSA keys, represented as a `DSA` object. Keys of other types result in an | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_DSA_PUBKEY') | |
| external ffi.Pointer<DSA> PEM_read_bio_DSA_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_DSAparams reads a PEM block of type "DSA PARAMETERS", as | |
| /// described in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_DSAparams') | |
| external ffi.Pointer<DSA> PEM_read_bio_DSAparams( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_ECPrivateKey behaves like `PEM_read_bio_PrivateKey` but only | |
| /// returns EC keys, represented as an `EC_KEY` object. Keys of other types | |
| /// result in an error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_ECPrivateKey') | |
| external ffi.Pointer<EC_KEY> PEM_read_bio_ECPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_EC_PUBKEY behaves like `PEM_read_bio_PUBKEY` but only returns | |
| /// EC keys, represented as an `EC_KEY` object. Keys of other types result in an | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_EC_PUBKEY') | |
| external ffi.Pointer<EC_KEY> PEM_read_bio_EC_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_PKCS7 reads a PEM block of type "PKCS7" (RFC 7468) or "PKCS #7 | |
| /// SIGNED DATA", as described in `PEM_read_bio_SAMPLE`. | |
| /// | |
| /// This function also accepts type "CERTIFICATE" but decodes the contents as a | |
| /// PKCS #7 structure rather than a certificate. This is a historical workaround | |
| /// for an old CA bug. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS7> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<PKCS7>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_PKCS7') | |
| external ffi.Pointer<PKCS7> PEM_read_bio_PKCS7( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<PKCS7>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_PKCS8 reads a PEM block of type "ENCRYPTED PRIVATE KEY", as | |
| /// described in `PEM_read_bio_SAMPLE`. | |
| /// | |
| /// Although this function accepts `cb` and `userdata` to decrypt the PEM-level | |
| /// encryption, it does not decrypt the EncryptedPrivateKeyInfo structure. It | |
| /// returns the encrypted key as an `X509_SIG` object which, despite its name, is | |
| /// an algorithm and octet string pair. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_SIG> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_PKCS8') | |
| external ffi.Pointer<X509_SIG> PEM_read_bio_PKCS8( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_PKCS8_PRIV_KEY_INFO reads a PEM block of type "PRIVATE KEY", as | |
| /// described in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_PKCS8_PRIV_KEY_INFO') | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> PEM_read_bio_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_PUBKEY reads a PEM block of type "PUBLIC KEY", as described in | |
| /// `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_PUBKEY') | |
| external ffi.Pointer<EVP_PKEY> PEM_read_bio_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_PrivateKey reads a PEM block containing a private key, as | |
| /// described in `PEM_read_bio_SAMPLE`. It handles generic PKCS #8 blocks of type | |
| /// "PRIVATE KEY" and "ENCRYPTED PRIVATE KEY", as well as key-specific formats | |
| /// like "RSA PRIVATE KEY", "EC PRIVATE KEY", and "DSA PRIVATE KEY". | |
| /// | |
| /// `cb` and `userdata` are used to look up the password for both PEM-level | |
| /// encryption as well as PKCS #8 encryption, in the case of "ENCRYPTED PRIVATE | |
| /// KEY" blocks. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_PrivateKey') | |
| external ffi.Pointer<EVP_PKEY> PEM_read_bio_PrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_RSAPrivateKey behaves like `PEM_read_bio_PrivateKey` but only | |
| /// returns RSA keys, represented as an `RSA` object. Keys of other types result | |
| /// in an error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_RSAPrivateKey') | |
| external ffi.Pointer<RSA> PEM_read_bio_RSAPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_RSAPublicKey reads a PEM block of type "RSA PUBLIC KEY", as | |
| /// described in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_RSAPublicKey') | |
| external ffi.Pointer<RSA> PEM_read_bio_RSAPublicKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_RSA_PUBKEY behaves like `PEM_read_bio_PUBKEY` but only returns | |
| /// RSA keys, represented as an `RSA` object. Keys of other types result in an | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_RSA_PUBKEY') | |
| external ffi.Pointer<RSA> PEM_read_bio_RSA_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_X509 reads a PEM block of type "CERTIFICATE" (RFC 7468) or "X509 | |
| /// CERTIFICATE", as described in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_X509') | |
| external ffi.Pointer<X509> PEM_read_bio_X509( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<X509>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_X509_AUX reads a PEM block of type "CERTIFICATE" (RFC 7468), | |
| /// "X509 CERTIFICATE", or "TRUSTED CERTIFICATE", as described in | |
| /// `PEM_read_bio_SAMPLE`. | |
| /// | |
| /// WARNING: This function parses auxiliary properties as in `d2i_X509_AUX`. | |
| /// Passing untrusted input to this function allows an attacker to influence | |
| /// those properties. See `d2i_X509_AUX` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_X509_AUX') | |
| external ffi.Pointer<X509> PEM_read_bio_X509_AUX( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<X509>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_X509_CRL reads a PEM block of type "X509 CRL" (RFC 7468), as | |
| /// described in `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_X509_CRL') | |
| external ffi.Pointer<X509_CRL> PEM_read_bio_X509_CRL( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_read_bio_X509_REQ reads a PEM block of type "CERTIFICATE REQUEST" | |
| /// (RFC 7468) or "NEW CERTIFICATE REQUEST", as described in | |
| /// `PEM_read_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REQ> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_read_bio_X509_REQ') | |
| external ffi.Pointer<X509_REQ> PEM_read_bio_X509_REQ( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write behaves like `PEM_write_bio` but reads from `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write') | |
| external int PEM_write( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<ffi.Char> hdr, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_PEM_write_DHparams', | |
| ) | |
| external int PEM_write_DHparams( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DH> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<DSA>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_DSAPrivateKey') | |
| external int PEM_write_DSAPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DSA> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_PEM_write_DSA_PUBKEY', | |
| ) | |
| external int PEM_write_DSA_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DSA> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_PEM_write_DSAparams', | |
| ) | |
| external int PEM_write_DSAparams( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DSA> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_ECPrivateKey') | |
| external int PEM_write_ECPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EC_KEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_PEM_write_EC_PUBKEY', | |
| ) | |
| external int PEM_write_EC_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EC_KEY> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PEM_write_PKCS7', | |
| ) | |
| external int PEM_write_PKCS7( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<PKCS7> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_SIG>)>( | |
| symbol: 'bssl_dart_PEM_write_PKCS8', | |
| ) | |
| external int PEM_write_PKCS8( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_SIG> in$, | |
| ); | |
| /// PEM_write_PKCS8PrivateKey behaves like `PEM_write_bio_PKCS8PrivateKey` but | |
| /// writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_PKCS8PrivateKey') | |
| external int PEM_write_PKCS8PrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_PKCS8PrivateKey_nid behaves like | |
| /// `PEM_write_bio_PKCS8PrivateKey_nid` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_PKCS8PrivateKey_nid') | |
| external int PEM_write_PKCS8PrivateKey_nid( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| int nid, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<PKCS8_PRIV_KEY_INFO>) | |
| >(symbol: 'bssl_dart_PEM_write_PKCS8_PRIV_KEY_INFO') | |
| external int PEM_write_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_PEM_write_PUBKEY', | |
| ) | |
| external int PEM_write_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_PrivateKey') | |
| external int PEM_write_PrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_RSAPrivateKey') | |
| external int PEM_write_RSAPrivateKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_PEM_write_RSAPublicKey', | |
| ) | |
| external int PEM_write_RSAPublicKey( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_PEM_write_RSA_PUBKEY', | |
| ) | |
| external int PEM_write_RSA_PUBKEY( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> in$, | |
| ); | |
| /// The following functions behave like the corresponding `PEM_write_bio_*` | |
| /// functions, but write to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_PEM_write_X509', | |
| ) | |
| external int PEM_write_X509( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509> x, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_PEM_write_X509_AUX', | |
| ) | |
| external int PEM_write_X509_AUX( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_PEM_write_X509_CRL', | |
| ) | |
| external int PEM_write_X509_CRL( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_CRL> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_PEM_write_X509_REQ', | |
| ) | |
| external int PEM_write_X509_REQ( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_REQ> in$, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_PEM_write_X509_REQ_NEW', | |
| ) | |
| external int PEM_write_X509_REQ_NEW( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_REQ> in$, | |
| ); | |
| /// PEM_write_bio writes a PEM block to `bio`, containing `len` bytes from `data` | |
| /// as data. `name` and `hdr` are NUL-terminated C strings containing the PEM | |
| /// type and header block, respectively. This function returns zero on error and | |
| /// the number of bytes written on success. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio') | |
| external int PEM_write_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<ffi.Char> hdr, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int len, | |
| ); | |
| /// PEM_write_bio_DHparams writes a PEM block of type "DH PARAMETERS", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_DHparams', | |
| ) | |
| external int PEM_write_bio_DHparams( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<DH> in$, | |
| ); | |
| /// PEM_write_bio_DSAPrivateKey writes `in` as a PEM block of type "DSA PRIVATE | |
| /// KEY", as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<DSA>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_DSAPrivateKey') | |
| external int PEM_write_bio_DSAPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<DSA> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_DSA_PUBKEY writes `in` in SubjectPublicKeyInfo format as a PEM | |
| /// block of type "PUBLIC KEY", as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_DSA_PUBKEY', | |
| ) | |
| external int PEM_write_bio_DSA_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<DSA> in$, | |
| ); | |
| /// PEM_write_bio_DSAparams writes a PEM block of type "DSA PARAMETERS", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_DSAparams', | |
| ) | |
| external int PEM_write_bio_DSAparams( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<DSA> in$, | |
| ); | |
| /// PEM_write_bio_ECPrivateKey writes `in` as a PEM block of type "EC PRIVATE | |
| /// KEY", as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_ECPrivateKey') | |
| external int PEM_write_bio_ECPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EC_KEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_EC_PUBKEY writes `in` in SubjectPublicKeyInfo format as a PEM | |
| /// block of type "PUBLIC KEY", as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_EC_PUBKEY', | |
| ) | |
| external int PEM_write_bio_EC_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EC_KEY> in$, | |
| ); | |
| /// PEM_write_bio_PKCS7 writes a PEM block of type "PKCS7" (RFC 7468), as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_PKCS7', | |
| ) | |
| external int PEM_write_bio_PKCS7( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<PKCS7> in$, | |
| ); | |
| /// PEM_write_bio_PKCS8 writes a PEM block of type "ENCRYPTED PRIVATE KEY", as | |
| /// described in `PEM_write_bio_SAMPLE`. `in` is used to represent an | |
| /// already-encrypted EncryptedPrivateKeyInfo structure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_SIG>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_PKCS8', | |
| ) | |
| external int PEM_write_bio_PKCS8( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509_SIG> in$, | |
| ); | |
| /// PEM_write_bio_PKCS8PrivateKey is an alias for `PEM_write_bio_PrivateKey`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_PKCS8PrivateKey') | |
| external int PEM_write_bio_PKCS8PrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_PKCS8PrivateKey_nid behaves like `PEM_write_bio_PrivateKey` | |
| /// but uses the PBES1 algorithm specified by `nid` for encryption. See also | |
| /// `PKCS8_encrypt`. If `nid` is -1, it writes the private key unencrypted. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_PKCS8PrivateKey_nid') | |
| external int PEM_write_bio_PKCS8PrivateKey_nid( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| int nid, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_PKCS8_PRIV_KEY_INFO writes a PEM block of type "PRIVATE KEY", | |
| /// as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<PKCS8_PRIV_KEY_INFO>) | |
| >(symbol: 'bssl_dart_PEM_write_bio_PKCS8_PRIV_KEY_INFO') | |
| external int PEM_write_bio_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> in$, | |
| ); | |
| /// PEM_write_bio_PUBKEY writes `in` as a PEM block of type "PUBLIC KEY", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_PUBKEY', | |
| ) | |
| external int PEM_write_bio_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ); | |
| /// PEM_write_bio_PrivateKey writes `in` to `bio` in PKCS#8 format, as described | |
| /// in `PEM_write_bio_SAMPLE`. However, it interprets encryption parameters | |
| /// differently: | |
| /// | |
| /// - If not encrypting (`enc` is NULL), it writes the key as a PEM block of type | |
| /// "PRIVATE KEY". | |
| /// | |
| /// - If encrypted (`enc` is not NULL), it encrypts the key in an | |
| /// EncryptedPrivateKeyInfo using PBES2 (see `PKCS8_encrypt`) and writes the | |
| /// result as a PEM block of type "ENCRYPTED PRIVATE KEY". | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_PrivateKey') | |
| external int PEM_write_bio_PrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_RSAPrivateKey writes `in` as a PEM block of type "RSA PRIVATE | |
| /// KEY", as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_PEM_write_bio_RSAPrivateKey') | |
| external int PEM_write_bio_RSAPrivateKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<RSA> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Uint8> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// PEM_write_bio_RSAPublicKey writes a PEM block of type "RSA PUBLIC KEY", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_RSAPublicKey', | |
| ) | |
| external int PEM_write_bio_RSAPublicKey( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<RSA> in$, | |
| ); | |
| /// PEM_write_bio_RSA_PUBKEY writes `in` as a PEM block of type "PUBLIC KEY", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_RSA_PUBKEY', | |
| ) | |
| external int PEM_write_bio_RSA_PUBKEY( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<RSA> in$, | |
| ); | |
| /// PEM_write_bio_X509 writes a PEM block of type "CERTIFICATE" (RFC 7468), as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_X509', | |
| ) | |
| external int PEM_write_bio_X509( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509> in$, | |
| ); | |
| /// PEM_write_bio_X509_AUX writes a PEM block of type "TRUSTED CERTIFICATE", as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| /// | |
| /// WARNING: This function writes a custom OpenSSL-specific format that includes | |
| /// auxiliary properties. See `i2d_X509_AUX`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_X509_AUX', | |
| ) | |
| external int PEM_write_bio_X509_AUX( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509> in$, | |
| ); | |
| /// PEM_write_bio_X509_CRL writes a PEM block of type "X509 CRL" (RFC 7468), as | |
| /// described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_X509_CRL', | |
| ) | |
| external int PEM_write_bio_X509_CRL( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509_CRL> in$, | |
| ); | |
| /// PEM_write_bio_X509_REQ writes a PEM block of type "CERTIFICATE REQUEST" | |
| /// (RFC 7468), as described in `PEM_write_bio_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_X509_REQ', | |
| ) | |
| external int PEM_write_bio_X509_REQ( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509_REQ> in$, | |
| ); | |
| /// PEM_write_bio_X509_REQ_NEW writes a PEM block of type "NEW CERTIFICATE | |
| /// REQUEST", as described in `PEM_write_bio_SAMPLE`. Prefer to use | |
| /// `PEM_write_bio_X509_REQ`. "NEW CERTIFICATE REQUEST" is the older type. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_PEM_write_bio_X509_REQ_NEW', | |
| ) | |
| external int PEM_write_bio_X509_REQ_NEW( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509_REQ> in$, | |
| ); | |
| /// PKCS5_PBKDF2_HMAC computes `iterations` iterations of PBKDF2 of `password` | |
| /// and `salt`, using `digest`, and outputs `key_len` bytes to `out_key`. It | |
| /// returns one on success and zero on allocation failure or if iterations is 0. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Uint32, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_PKCS5_PBKDF2_HMAC') | |
| external int PKCS5_PBKDF2_HMAC( | |
| ffi.Pointer<ffi.Char> password, | |
| int password_len, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| int iterations, | |
| ffi.Pointer<EVP_MD> digest, | |
| int key_len, | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| ); | |
| /// PKCS5_PBKDF2_HMAC_SHA1 is the same as PKCS5_PBKDF2_HMAC, but with `digest` | |
| /// fixed to `EVP_sha1`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Uint32, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_PKCS5_PBKDF2_HMAC_SHA1') | |
| external int PKCS5_PBKDF2_HMAC_SHA1( | |
| ffi.Pointer<ffi.Char> password, | |
| int password_len, | |
| ffi.Pointer<ffi.Uint8> salt, | |
| int salt_len, | |
| int iterations, | |
| int key_len, | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| ); | |
| /// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing | |
| /// `crls` to `out`. It returns one on success and zero on error. Note that CRLs | |
| /// in SignedData structures are unordered. The order in `crls` will not be | |
| /// preserved. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<stack_st_X509_CRL>)>( | |
| symbol: 'bssl_dart_PKCS7_bundle_CRLs', | |
| ) | |
| external int PKCS7_bundle_CRLs( | |
| ffi.Pointer<CBB> out, | |
| ffi.Pointer<stack_st_X509_CRL> crls, | |
| ); | |
| /// PKCS7_bundle_certificates behaves like `PKCS7_bundle_raw_certificates` but | |
| /// takes `X509` objects as input. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<stack_st_X509>)>( | |
| symbol: 'bssl_dart_PKCS7_bundle_certificates', | |
| ) | |
| external int PKCS7_bundle_certificates( | |
| ffi.Pointer<CBB> out, | |
| ffi.Pointer<stack_st_X509> certs, | |
| ); | |
| /// PKCS7_bundle_raw_certificates appends a PKCS#7, SignedData structure | |
| /// containing `certs` to `out`. It returns one on success and zero on error. | |
| /// Note that certificates in SignedData structures are unordered. The order in | |
| /// `certs` will not be preserved. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<stack_st_CRYPTO_BUFFER>) | |
| >(symbol: 'bssl_dart_PKCS7_bundle_raw_certificates') | |
| external int PKCS7_bundle_raw_certificates( | |
| ffi.Pointer<CBB> out, | |
| ffi.Pointer<stack_st_CRYPTO_BUFFER> certs, | |
| ); | |
| /// PKCS7_free releases memory associated with `p7`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_free', | |
| ) | |
| external void PKCS7_free( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from `cbs` and appends | |
| /// the included CRLs to `out_crls`. It returns one on success and zero on error. | |
| /// `cbs` is advanced passed the structure. | |
| /// | |
| /// Note that a SignedData structure may contain no CRLs, in which case this | |
| /// function succeeds but does not append any CRLs. Additionally, CRLs in | |
| /// SignedData structures are unordered. Callers should not assume an order in | |
| /// `*out_crls` and may need to search for matches. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<stack_st_X509_CRL>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_PKCS7_get_CRLs', | |
| ) | |
| external int PKCS7_get_CRLs( | |
| ffi.Pointer<stack_st_X509_CRL> out_crls, | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from | |
| /// `pem_bio` and appends the included CRLs to `out_crls`. It returns one on | |
| /// success and zero on error. | |
| /// | |
| /// Note that a SignedData structure may contain no CRLs, in which case this | |
| /// function succeeds but does not append any CRLs. Additionally, CRLs in | |
| /// SignedData structures are unordered. Callers should not assume an order in | |
| /// `*out_crls` and may need to search for matches. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<stack_st_X509_CRL>, ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_PKCS7_get_PEM_CRLs', | |
| ) | |
| external int PKCS7_get_PEM_CRLs( | |
| ffi.Pointer<stack_st_X509_CRL> out_crls, | |
| ffi.Pointer<BIO> pem_bio, | |
| ); | |
| /// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure | |
| /// from `pem_bio` and appends the included certificates to `out_certs`. It | |
| /// returns one on success and zero on error. | |
| /// | |
| /// Note that a SignedData structure may contain no certificates, in which case | |
| /// this function succeeds but does not append any certificates. Additionally, | |
| /// certificates in SignedData structures are unordered. Callers should not | |
| /// assume a particular order in `*out_certs` and may need to search for matches | |
| /// or run path-building algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<stack_st_X509>, ffi.Pointer<BIO>)>( | |
| symbol: 'bssl_dart_PKCS7_get_PEM_certificates', | |
| ) | |
| external int PKCS7_get_PEM_certificates( | |
| ffi.Pointer<stack_st_X509> out_certs, | |
| ffi.Pointer<BIO> pem_bio, | |
| ); | |
| /// PKCS7_get_certificates behaves like `PKCS7_get_raw_certificates` but parses | |
| /// them into `X509` objects. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<stack_st_X509>, ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_PKCS7_get_certificates', | |
| ) | |
| external int PKCS7_get_certificates( | |
| ffi.Pointer<stack_st_X509> out_certs, | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from `cbs` | |
| /// and appends the included certificates to `out_certs`. It returns one on | |
| /// success and zero on error. `cbs` is advanced passed the structure. | |
| /// | |
| /// Note that a SignedData structure may contain no certificates, in which case | |
| /// this function succeeds but does not append any certificates. Additionally, | |
| /// certificates in SignedData structures are unordered. Callers should not | |
| /// assume a particular order in `*out_certs` and may need to search for matches | |
| /// or run path-building algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<stack_st_CRYPTO_BUFFER>, | |
| ffi.Pointer<CBS>, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL>, | |
| ) | |
| >(symbol: 'bssl_dart_PKCS7_get_raw_certificates') | |
| external int PKCS7_get_raw_certificates( | |
| ffi.Pointer<stack_st_CRYPTO_BUFFER> out_certs, | |
| ffi.Pointer<CBS> cbs, | |
| ffi.Pointer<CRYPTO_BUFFER_POOL> pool, | |
| ); | |
| /// PKCS7_sign can operate in two modes to provide some backwards compatibility: | |
| /// | |
| /// The first mode assembles `certs` into a PKCS#7 signed data ContentInfo with | |
| /// external data and no signatures. It returns a newly-allocated `PKCS7` on | |
| /// success or NULL on error. `sign_cert` and `pkey` must be NULL. `data` is | |
| /// ignored. `flags` must be equal to `PKCS7_DETACHED`. Additionally, | |
| /// certificates in SignedData structures are unordered. The order of `certs` | |
| /// will not be preserved. | |
| /// | |
| /// The second mode generates a detached RSA SHA-256 signature of `data` using | |
| /// `pkey` and produces a PKCS#7 SignedData structure containing it. `certs` | |
| /// must be NULL and `flags` must be exactly | |
| /// `PKCS7_NOATTR | PKCS7_BINARY | PKCS7_NOCERTS | PKCS7_DETACHED`. | |
| /// | |
| /// Note this function only implements a subset of the corresponding OpenSSL | |
| /// function. It is provided for backwards compatibility only. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS7> Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<stack_st_X509>, | |
| ffi.Pointer<BIO>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_PKCS7_sign') | |
| external ffi.Pointer<PKCS7> PKCS7_sign( | |
| ffi.Pointer<X509> sign_cert, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<stack_st_X509> certs, | |
| ffi.Pointer<BIO> data, | |
| int flags, | |
| ); | |
| /// PKCS7_type_is_data returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_data', | |
| ) | |
| external int PKCS7_type_is_data( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_type_is_digest returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_digest', | |
| ) | |
| external int PKCS7_type_is_digest( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_type_is_encrypted returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_encrypted', | |
| ) | |
| external int PKCS7_type_is_encrypted( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_type_is_enveloped returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_enveloped', | |
| ) | |
| external int PKCS7_type_is_enveloped( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_type_is_signed returns one. (We only support signed data ContentInfos.) | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_signed', | |
| ) | |
| external int PKCS7_type_is_signed( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS7_type_is_signedAndEnveloped returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_PKCS7_type_is_signedAndEnveloped', | |
| ) | |
| external int PKCS7_type_is_signedAndEnveloped( | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// PKCS8_PRIV_KEY_INFO_free releases memory associated with `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<PKCS8_PRIV_KEY_INFO>)>( | |
| symbol: 'bssl_dart_PKCS8_PRIV_KEY_INFO_free', | |
| ) | |
| external void PKCS8_PRIV_KEY_INFO_free( | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> key, | |
| ); | |
| /// PKCS8_PRIV_KEY_INFO_new returns a newly-allocated, empty | |
| /// `PKCS8_PRIV_KEY_INFO` object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function()>( | |
| symbol: 'bssl_dart_PKCS8_PRIV_KEY_INFO_new', | |
| ) | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> PKCS8_PRIV_KEY_INFO_new(); | |
| /// POLICYINFO_free releases memory associated with `info`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<POLICYINFO>)>( | |
| symbol: 'bssl_dart_POLICYINFO_free', | |
| ) | |
| external void POLICYINFO_free( | |
| ffi.Pointer<POLICYINFO> info, | |
| ); | |
| /// POLICYINFO_new returns a newly-allocated, empty `POLICYINFO` object, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<POLICYINFO> Function()>( | |
| symbol: 'bssl_dart_POLICYINFO_new', | |
| ) | |
| external ffi.Pointer<POLICYINFO> POLICYINFO_new(); | |
| /// POLICYQUALINFO_free releases memory associated with `info`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<POLICYQUALINFO>)>( | |
| symbol: 'bssl_dart_POLICYQUALINFO_free', | |
| ) | |
| external void POLICYQUALINFO_free( | |
| ffi.Pointer<POLICYQUALINFO> info, | |
| ); | |
| /// POLICYQUALINFO_new returns a newly-allocated, empty `POLICYQUALINFO` object, | |
| /// or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<POLICYQUALINFO> Function()>( | |
| symbol: 'bssl_dart_POLICYQUALINFO_new', | |
| ) | |
| external ffi.Pointer<POLICYQUALINFO> POLICYQUALINFO_new(); | |
| /// POLICY_CONSTRAINTS_free releases memory associated with `pcons`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<POLICY_CONSTRAINTS>)>( | |
| symbol: 'bssl_dart_POLICY_CONSTRAINTS_free', | |
| ) | |
| external void POLICY_CONSTRAINTS_free( | |
| ffi.Pointer<POLICY_CONSTRAINTS> pcons, | |
| ); | |
| /// POLICY_CONSTRAINTS_new returns a newly-allocated, empty `POLICY_CONSTRAINTS` | |
| /// object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<POLICY_CONSTRAINTS> Function()>( | |
| symbol: 'bssl_dart_POLICY_CONSTRAINTS_new', | |
| ) | |
| external ffi.Pointer<POLICY_CONSTRAINTS> POLICY_CONSTRAINTS_new(); | |
| /// POLICY_MAPPING_free releases memory associated with `mapping`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<POLICY_MAPPING>)>( | |
| symbol: 'bssl_dart_POLICY_MAPPING_free', | |
| ) | |
| external void POLICY_MAPPING_free( | |
| ffi.Pointer<POLICY_MAPPING> mapping, | |
| ); | |
| /// POLICY_MAPPING_new returns a newly-allocated, empty `POLICY_MAPPING` object, | |
| /// or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<POLICY_MAPPING> Function()>( | |
| symbol: 'bssl_dart_POLICY_MAPPING_new', | |
| ) | |
| external ffi.Pointer<POLICY_MAPPING> POLICY_MAPPING_new(); | |
| /// RAND_OpenSSL returns a pointer to a dummy `RAND_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RAND_METHOD> Function()>( | |
| symbol: 'bssl_dart_RAND_OpenSSL', | |
| ) | |
| external ffi.Pointer<RAND_METHOD> RAND_OpenSSL(); | |
| /// RAND_SSLeay returns a pointer to a dummy `RAND_METHOD`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RAND_METHOD> Function()>( | |
| symbol: 'bssl_dart_RAND_SSLeay', | |
| ) | |
| external ffi.Pointer<RAND_METHOD> RAND_SSLeay(); | |
| /// RAND_add does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int, ffi.Double)>( | |
| symbol: 'bssl_dart_RAND_add', | |
| ) | |
| external void RAND_add( | |
| ffi.Pointer<ffi.Void> buf, | |
| int num, | |
| double entropy, | |
| ); | |
| /// RAND_bytes writes `len` bytes of random data to `buf` and returns one. In the | |
| /// event that sufficient random data can not be obtained, `abort` is called. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_RAND_bytes', | |
| ) | |
| external int RAND_bytes( | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int len, | |
| ); | |
| /// RAND_cleanup does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>(symbol: 'bssl_dart_RAND_cleanup') | |
| external void RAND_cleanup(); | |
| /// RAND_disable_fork_unsafe_buffering restores BoringSSL's default fork-safety | |
| /// protections. See also `RAND_enable_fork_unsafe_buffering`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function()>( | |
| symbol: 'bssl_dart_RAND_disable_fork_unsafe_buffering', | |
| ) | |
| external void RAND_disable_fork_unsafe_buffering(); | |
| /// RAND_egd returns 255. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_RAND_egd', | |
| ) | |
| external int RAND_egd( | |
| ffi.Pointer<ffi.Char> arg0, | |
| ); | |
| /// RAND_enable_fork_unsafe_buffering indicates that clones of the address space, | |
| /// e.g. via `fork`, will never call into BoringSSL. It may be used to disable | |
| /// BoringSSL's more expensive fork-safety measures. However, calling this | |
| /// function and then using BoringSSL across `fork` calls will leak secret keys. | |
| /// `fd` must be -1. | |
| /// | |
| /// WARNING: This function affects BoringSSL for the entire address space. Thus | |
| /// this function should never be called by library code, only by code with | |
| /// global knowledge of the application's use of BoringSSL. | |
| /// | |
| /// Do not use this function unless a performance issue was measured with the | |
| /// default behavior. BoringSSL can efficiently detect forks on most platforms, | |
| /// in which case this function is a no-op and is unnecessary. In particular, | |
| /// Linux kernel versions 4.14 or later provide `MADV_WIPEONFORK`. Future | |
| /// versions of BoringSSL will remove this functionality when older kernels are | |
| /// sufficiently rare. | |
| /// | |
| /// This function has an unusual name because it historically controlled internal | |
| /// buffers, but no longer does. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Int)>( | |
| symbol: 'bssl_dart_RAND_enable_fork_unsafe_buffering', | |
| ) | |
| external void RAND_enable_fork_unsafe_buffering( | |
| int fd, | |
| ); | |
| /// RAND_file_name returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Char>, ffi.Size)>( | |
| symbol: 'bssl_dart_RAND_file_name', | |
| ) | |
| external ffi.Pointer<ffi.Char> RAND_file_name( | |
| ffi.Pointer<ffi.Char> buf, | |
| int num, | |
| ); | |
| /// RAND_get_rand_method returns `RAND_SSLeay()`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RAND_METHOD> Function()>( | |
| symbol: 'bssl_dart_RAND_get_rand_method', | |
| ) | |
| external ffi.Pointer<RAND_METHOD> RAND_get_rand_method(); | |
| /// RAND_get_system_entropy_for_custom_prng writes `len` bytes of random data | |
| /// from a system entropy source to `buf`. The maximum length of entropy which | |
| /// may be requested is 256 bytes. If more than 256 bytes of data is requested, | |
| /// or if sufficient random data can not be obtained, `abort` is called. | |
| /// `RAND_bytes` should normally be used instead of this function. This function | |
| /// should only be used for seed values or where `malloc` should not be called | |
| /// from BoringSSL. This function is not FIPS compliant. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_RAND_get_system_entropy_for_custom_prng', | |
| ) | |
| external void RAND_get_system_entropy_for_custom_prng( | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int len, | |
| ); | |
| /// RAND_load_file returns a nonnegative number. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Long)>( | |
| symbol: 'bssl_dart_RAND_load_file', | |
| ) | |
| external int RAND_load_file( | |
| ffi.Pointer<ffi.Char> path, | |
| int num, | |
| ); | |
| /// RAND_poll returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_RAND_poll') | |
| external int RAND_poll(); | |
| /// RAND_pseudo_bytes is a wrapper around `RAND_bytes`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_RAND_pseudo_bytes', | |
| ) | |
| external int RAND_pseudo_bytes( | |
| ffi.Pointer<ffi.Uint8> buf, | |
| int len, | |
| ); | |
| /// RAND_seed reads a single byte of random data to ensure that any file | |
| /// descriptors etc are opened. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( | |
| symbol: 'bssl_dart_RAND_seed', | |
| ) | |
| external void RAND_seed( | |
| ffi.Pointer<ffi.Void> buf, | |
| int num, | |
| ); | |
| /// RAND_set_rand_method returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RAND_METHOD>)>( | |
| symbol: 'bssl_dart_RAND_set_rand_method', | |
| ) | |
| external int RAND_set_rand_method( | |
| ffi.Pointer<RAND_METHOD> arg0, | |
| ); | |
| /// RAND_status returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>(symbol: 'bssl_dart_RAND_status') | |
| external int RAND_status(); | |
| /// RSAPrivateKey_dup allocates a fresh `RSA` and copies the private key from | |
| /// `rsa` into it. It returns the fresh `RSA` object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSAPrivateKey_dup', | |
| ) | |
| external ffi.Pointer<RSA> RSAPrivateKey_dup( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSAPublicKey_dup allocates a fresh `RSA` and copies the public key from | |
| /// `rsa` into it. It returns the fresh `RSA` object, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSAPublicKey_dup', | |
| ) | |
| external ffi.Pointer<RSA> RSAPublicKey_dup( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_PSS_PARAMS_free releases memory associated with `params`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<RSA_PSS_PARAMS>)>( | |
| symbol: 'bssl_dart_RSA_PSS_PARAMS_free', | |
| ) | |
| external void RSA_PSS_PARAMS_free( | |
| ffi.Pointer<RSA_PSS_PARAMS> params, | |
| ); | |
| /// RSA_PSS_PARAMS_new returns a new, empty `RSA_PSS_PARAMS`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA_PSS_PARAMS> Function()>( | |
| symbol: 'bssl_dart_RSA_PSS_PARAMS_new', | |
| ) | |
| external ffi.Pointer<RSA_PSS_PARAMS> RSA_PSS_PARAMS_new(); | |
| /// RSA_add_pkcs1_prefix builds a version of `digest` prefixed with the | |
| /// DigestInfo header for the given hash function and sets `out_msg` to point to | |
| /// it. On successful return, if `*is_alloced` is one, the caller must release | |
| /// `*out_msg` with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_add_pkcs1_prefix') | |
| external int RSA_add_pkcs1_prefix( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_msg, | |
| ffi.Pointer<ffi.Size> out_msg_len, | |
| ffi.Pointer<ffi.Int> is_alloced, | |
| int hash_nid, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ); | |
| /// RSA_bits returns the size of `rsa`, in bits. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_bits', | |
| ) | |
| external int RSA_bits( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_blinding_off does nothing. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_blinding_off', | |
| ) | |
| external void RSA_blinding_off( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_blinding_on returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>, ffi.Pointer<BN_CTX>)>( | |
| symbol: 'bssl_dart_RSA_blinding_on', | |
| ) | |
| external int RSA_blinding_on( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<BN_CTX> ctx, | |
| ); | |
| /// RSA_check_fips performs public key validity tests on `key`. It returns one if | |
| /// they pass and zero otherwise. Opaque keys always fail. This function does not | |
| /// mutate `rsa` for thread-safety purposes and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_check_fips', | |
| ) | |
| external int RSA_check_fips( | |
| ffi.Pointer<RSA> key, | |
| ); | |
| /// RSA_check_key performs basic validity tests on `rsa`. It returns one if | |
| /// they pass and zero otherwise. Opaque keys and public keys always pass. If it | |
| /// returns zero then a more detailed error is available on the error queue. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_check_key', | |
| ) | |
| external int RSA_check_key( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_decrypt decrypts `in_len` bytes from `in` with the private key from | |
| /// `rsa` and writes, at most, `max_out` bytes of plaintext to `out`. The | |
| /// `max_out` argument must be, at least, `RSA_size` in order to ensure success. | |
| /// | |
| /// It returns 1 on success or zero on error. | |
| /// | |
| /// The `padding` argument must be one of the `RSA_*_PADDING` values. If in | |
| /// doubt, use `RSA_PKCS1_OAEP_PADDING` for new protocols. When `padding` is | |
| /// `RSA_PKCS1_OAEP_PADDING`, this function has no way to set the OAEP or MGF-1 | |
| /// digest, so it is always SHA-1. For other OAEP parameters, wrap `rsa` in an | |
| /// `EVP_PKEY` and use `EVP_PKEY_decrypt` with `EVP_PKEY_CTX_set_rsa_padding` and | |
| /// related functions. | |
| /// | |
| /// WARNING: Passing `RSA_PKCS1_PADDING` into this function is deprecated and | |
| /// insecure. RSAES-PKCS1-v1_5 is vulnerable to a chosen-ciphertext attack. | |
| /// Decrypting attacker-supplied ciphertext with RSAES-PKCS1-v1_5 may give the | |
| /// attacker control over your private key. See "Chosen Ciphertext Attacks | |
| /// Against Protocols Based on the RSA Encryption Standard PKCS #1", Daniel | |
| /// Bleichenbacher, Advances in Cryptology (Crypto '98). | |
| /// | |
| /// In some limited cases, such as TLS RSA key exchange, it is possible to | |
| /// mitigate this flaw with custom, protocol-specific padding logic. This | |
| /// should be implemented with `RSA_NO_PADDING`, not `RSA_PKCS1_PADDING`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_decrypt') | |
| external int RSA_decrypt( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| int padding, | |
| ); | |
| /// RSA_dup_ref increments the reference count of `rsa` and returns the same | |
| /// handle. It does not mutate `rsa` for thread-safety purposes and may be used | |
| /// concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_dup_ref', | |
| ) | |
| external ffi.Pointer<RSA> RSA_dup_ref( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_encrypt encrypts `in_len` bytes from `in` to the public key from `rsa` | |
| /// and writes, at most, `max_out` bytes of encrypted data to `out`. The | |
| /// `max_out` argument must be, at least, `RSA_size` in order to ensure success. | |
| /// | |
| /// It returns 1 on success or zero on error. | |
| /// | |
| /// The `padding` argument must be one of the `RSA_*_PADDING` values. If in | |
| /// doubt, use `RSA_PKCS1_OAEP_PADDING` for new protocols. When `padding` is | |
| /// `RSA_PKCS1_OAEP_PADDING`, this function has no way to set the OAEP or MGF-1 | |
| /// digest, so it is always SHA-1. For other OAEP parameters, wrap `rsa` in an | |
| /// `EVP_PKEY` and use `EVP_PKEY_encrypt` with `EVP_PKEY_CTX_set_rsa_padding` and | |
| /// related functions. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_encrypt') | |
| external int RSA_encrypt( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| int padding, | |
| ); | |
| /// RSA_flags returns the flags for `rsa`. These are a bitwise OR of `RSA_FLAG_*` | |
| /// constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>)>(symbol: 'bssl_dart_RSA_flags') | |
| external int RSA_flags( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_free decrements the reference count of `rsa` and frees it if the | |
| /// reference count drops to zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<RSA>)>(symbol: 'bssl_dart_RSA_free') | |
| external void RSA_free( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_generate_key_ex generates a new RSA key where the modulus has size | |
| /// `bits` and the public exponent is `e`. If unsure, `RSA_F4` is a good value | |
| /// for `e`. If `cb` is not NULL then it is called during the key generation | |
| /// process. In addition to the calls documented for `BN_generate_prime_ex`, it | |
| /// is called with event=2 when the n'th prime is rejected as unsuitable and | |
| /// with event=3 when a suitable value for `p` is found. | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Int, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BN_GENCB>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_generate_key_ex') | |
| external int RSA_generate_key_ex( | |
| ffi.Pointer<RSA> rsa, | |
| int bits, | |
| ffi.Pointer<BIGNUM> e, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// RSA_generate_key_fips behaves like `RSA_generate_key_ex` but performs | |
| /// additional checks for FIPS compliance. The public exponent is always 65537 | |
| /// and `bits` must be either 2048 or 3072. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>, ffi.Int, ffi.Pointer<BN_GENCB>)>( | |
| symbol: 'bssl_dart_RSA_generate_key_fips', | |
| ) | |
| external int RSA_generate_key_fips( | |
| ffi.Pointer<RSA> rsa, | |
| int bits, | |
| ffi.Pointer<BN_GENCB> cb, | |
| ); | |
| /// RSA_get0_crt_params sets `*out_dmp1`, `*out_dmq1`, and `*out_iqmp`, if | |
| /// non-NULL, to `rsa`'s CRT parameters. These are d (mod p-1), d (mod q-1) and | |
| /// q^-1 (mod p), respectively. If `rsa` is a public key, each parameter will be | |
| /// set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_get0_crt_params') | |
| external void RSA_get0_crt_params( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_dmp1, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_dmq1, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_iqmp, | |
| ); | |
| /// RSA_get0_d returns `rsa`'s private exponent. If `rsa` is a public key, this | |
| /// value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_d', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_d( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_dmp1 returns d (mod p-1) for `rsa`. If `rsa` is a public key or | |
| /// lacks CRT parameters, this value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_dmp1', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_dmp1( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_dmq1 returns d (mod q-1) for `rsa`. If `rsa` is a public key or | |
| /// lacks CRT parameters, this value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_dmq1', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_dmq1( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_e returns `rsa`'s public exponent. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_e', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_e( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_factors sets `*out_p` and `*out_q`, if non-NULL, to `rsa`'s prime | |
| /// factors. If `rsa` is a public key, they will be set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_get0_factors') | |
| external void RSA_get0_factors( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_p, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_q, | |
| ); | |
| /// RSA_get0_iqmp returns q^-1 (mod p). If `rsa` is a public key or lacks CRT | |
| /// parameters, this value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_iqmp', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_iqmp( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_key sets `*out_n`, `*out_e`, and `*out_d`, if non-NULL, to `rsa`'s | |
| /// modulus, public exponent, and private exponent, respectively. If `rsa` is a | |
| /// public key, the private exponent will be set to NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_get0_key') | |
| external void RSA_get0_key( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_n, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_e, | |
| ffi.Pointer<ffi.Pointer<BIGNUM>> out_d, | |
| ); | |
| /// RSA_get0_n returns `rsa`'s public modulus. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_n', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_n( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_p returns `rsa`'s first private prime factor. If `rsa` is a public | |
| /// key or lacks its prime factors, this value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_p', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_p( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_pss_params returns NULL. In OpenSSL, this function retries RSA-PSS | |
| /// parameters associated with `RSA` objects, but BoringSSL does not enable the | |
| /// id-RSASSA-PSS key encoding by default. | |
| /// | |
| /// WARNING: BoringSSL does support id-RSASSA-PSS parameters when callers opt in | |
| /// (see `EVP_pkey_rsa_pss_sha256` and others). We currently assume such callers | |
| /// do not need this function. Callers that opt into id-RSASSA-PSS support and | |
| /// require this functionality should contact the BoringSSL team. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA_PSS_PARAMS> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_pss_params', | |
| ) | |
| external ffi.Pointer<RSA_PSS_PARAMS> RSA_get0_pss_params( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_get0_q returns `rsa`'s second private prime factor. If `rsa` is a public | |
| /// key or lacks its prime factors, this value will be NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<BIGNUM> Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_get0_q', | |
| ) | |
| external ffi.Pointer<BIGNUM> RSA_get0_q( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<RSA>, ffi.Int)>( | |
| symbol: 'bssl_dart_RSA_get_ex_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> RSA_get_ex_data( | |
| ffi.Pointer<RSA> rsa, | |
| int idx, | |
| ); | |
| /// ex_data functions. | |
| /// | |
| /// See `ex_data.h` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_get_ex_new_index') | |
| external int RSA_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// RSA_is_opaque returns one if `rsa` is opaque and doesn't expose its key | |
| /// material. Otherwise it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_is_opaque', | |
| ) | |
| external int RSA_is_opaque( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_marshal_private_key marshals `rsa` as a DER-encoded RSAPrivateKey | |
| /// structure (RFC 8017) and appends the result to `cbb`. It returns one on | |
| /// success and zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_marshal_private_key', | |
| ) | |
| external int RSA_marshal_private_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_marshal_public_key marshals `rsa` as a DER-encoded RSAPublicKey structure | |
| /// (RFC 8017) and appends the result to `cbb`. It returns one on success and | |
| /// zero on failure. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<CBB>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_marshal_public_key', | |
| ) | |
| external int RSA_marshal_public_key( | |
| ffi.Pointer<CBB> cbb, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_new returns a new, empty `RSA` object or NULL on error. Prefer using | |
| /// `RSA_new_public_key` or `RSA_new_private_key` to import an RSA key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function()>(symbol: 'bssl_dart_RSA_new') | |
| external ffi.Pointer<RSA> RSA_new(); | |
| /// RSA_new_method acts the same as `RSA_new` but takes an explicit `ENGINE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<ENGINE>)>( | |
| symbol: 'bssl_dart_RSA_new_method', | |
| ) | |
| external ffi.Pointer<RSA> RSA_new_method( | |
| ffi.Pointer<ENGINE> engine, | |
| ); | |
| /// RSA_new_method_no_e returns a newly-allocated `RSA` object backed by | |
| /// `engine`, with a public modulus of `n` and no known public exponent. | |
| /// | |
| /// Do not use this function. It exists only to support Conscrypt, whose use | |
| /// should be replaced with a more sound mechanism. See | |
| /// https://crbug.com/boringssl/602. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<ENGINE>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_RSA_new_method_no_e') | |
| external ffi.Pointer<RSA> RSA_new_method_no_e( | |
| ffi.Pointer<ENGINE> engine, | |
| ffi.Pointer<BIGNUM> n, | |
| ); | |
| /// RSA_new_private_key returns a new `RSA` object containing a private key with | |
| /// the specified parameters, or NULL on error or invalid input. All parameters | |
| /// are mandatory and may not be NULL. | |
| /// | |
| /// This function creates standard RSA private keys with CRT parameters. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_new_private_key') | |
| external ffi.Pointer<RSA> RSA_new_private_key( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ffi.Pointer<BIGNUM> d, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> q, | |
| ffi.Pointer<BIGNUM> dmp1, | |
| ffi.Pointer<BIGNUM> dmq1, | |
| ffi.Pointer<BIGNUM> iqmp, | |
| ); | |
| /// RSA_new_private_key_large_e behaves like `RSA_new_private_key` but allows any | |
| /// `e` up to `n`. | |
| /// | |
| /// BoringSSL typically bounds public exponents as a denial-of-service | |
| /// mitigation. Keys created by this function may perform worse than those | |
| /// created by `RSA_new_private_key`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_new_private_key_large_e') | |
| external ffi.Pointer<RSA> RSA_new_private_key_large_e( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ffi.Pointer<BIGNUM> d, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> q, | |
| ffi.Pointer<BIGNUM> dmp1, | |
| ffi.Pointer<BIGNUM> dmq1, | |
| ffi.Pointer<BIGNUM> iqmp, | |
| ); | |
| /// RSA_new_private_key_no_crt behaves like `RSA_new_private_key` but constructs | |
| /// an RSA key without CRT coefficients. | |
| /// | |
| /// Keys created by this function will be less performant and cannot be | |
| /// serialized. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_new_private_key_no_crt') | |
| external ffi.Pointer<RSA> RSA_new_private_key_no_crt( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ffi.Pointer<BIGNUM> d, | |
| ); | |
| /// RSA_new_private_key_no_e behaves like `RSA_new_private_key` but constructs an | |
| /// RSA key without CRT parameters or public exponent. | |
| /// | |
| /// Keys created by this function will be less performant, cannot be serialized, | |
| /// and lack hardening measures that protect against side channels and fault | |
| /// attacks. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_RSA_new_private_key_no_e') | |
| external ffi.Pointer<RSA> RSA_new_private_key_no_e( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> d, | |
| ); | |
| /// RSA_new_public_key returns a new `RSA` object containing a public key with | |
| /// the specified parameters, or NULL on error or invalid input. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_RSA_new_public_key') | |
| external ffi.Pointer<RSA> RSA_new_public_key( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ); | |
| /// RSA_new_public_key_large_e behaves like `RSA_new_public_key` but allows any | |
| /// `e` up to `n`. | |
| /// | |
| /// BoringSSL typically bounds public exponents as a denial-of-service | |
| /// mitigation. Keys created by this function may perform worse than those | |
| /// created by `RSA_new_public_key`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_RSA_new_public_key_large_e') | |
| external ffi.Pointer<RSA> RSA_new_public_key_large_e( | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ); | |
| /// RSA_padding_add_PKCS1_OAEP_mgf1 writes an OAEP padding of `from` to `to` | |
| /// with the given parameters and hash functions. If `md` is NULL then SHA-1 is | |
| /// used. If `mgf1md` is NULL then the value of `md` is used (which means SHA-1 | |
| /// if that, in turn, is NULL). | |
| /// | |
| /// It returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_padding_add_PKCS1_OAEP_mgf1') | |
| external int RSA_padding_add_PKCS1_OAEP_mgf1( | |
| ffi.Pointer<ffi.Uint8> to, | |
| int to_len, | |
| ffi.Pointer<ffi.Uint8> from, | |
| int from_len, | |
| ffi.Pointer<ffi.Uint8> param, | |
| int param_len, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<EVP_MD> mgf1md, | |
| ); | |
| /// RSA_padding_add_PKCS1_PSS_mgf1 writes a PSS padding of `mHash` to `EM`, | |
| /// where `mHash` is a digest produced by `Hash`. `RSA_size(rsa)` bytes of | |
| /// output will be written to `EM`. The `mgf1Hash` argument specifies the hash | |
| /// function for generating the mask. If NULL, `Hash` is used. The `sLen` | |
| /// argument specifies the expected salt length in bytes. If `sLen` is -1 then | |
| /// the salt length is the same as the hash length. If -2, then the salt length | |
| /// is maximal given the space in `EM`. | |
| /// | |
| /// It returns one on success or zero on error. | |
| /// | |
| /// This function implements only the low-level padding logic. Use | |
| /// `RSA_sign_pss_mgf1` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_padding_add_PKCS1_PSS_mgf1') | |
| external int RSA_padding_add_PKCS1_PSS_mgf1( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Uint8> EM, | |
| ffi.Pointer<ffi.Uint8> mHash, | |
| ffi.Pointer<EVP_MD> Hash, | |
| ffi.Pointer<EVP_MD> mgf1Hash, | |
| int sLen, | |
| ); | |
| /// RSA_parse_private_key parses a DER-encoded RSAPrivateKey structure (RFC 8017) | |
| /// from `cbs` and advances `cbs`. It returns a newly-allocated `RSA` or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_RSA_parse_private_key', | |
| ) | |
| external ffi.Pointer<RSA> RSA_parse_private_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// RSA_parse_public_key parses a DER-encoded RSAPublicKey structure (RFC 8017) | |
| /// from `cbs` and advances `cbs`. It returns a newly-allocated `RSA` or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<CBS>)>( | |
| symbol: 'bssl_dart_RSA_parse_public_key', | |
| ) | |
| external ffi.Pointer<RSA> RSA_parse_public_key( | |
| ffi.Pointer<CBS> cbs, | |
| ); | |
| /// RSA_print prints a textual representation of `rsa` to `bio`. It returns one | |
| /// on success or zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>, ffi.Int)>( | |
| symbol: 'bssl_dart_RSA_print', | |
| ) | |
| external int RSA_print( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<RSA> rsa, | |
| int indent, | |
| ); | |
| /// RSA_private_decrypt decrypts `flen` bytes from `from` with the public key in | |
| /// `rsa` and writes the plaintext to `to`. The `to` buffer must have at least | |
| /// `RSA_size` bytes of space. It returns the number of bytes written, or -1 on | |
| /// error. The `padding` argument must be one of the `RSA_*_PADDING` values. If | |
| /// in doubt, use `RSA_PKCS1_OAEP_PADDING` for new protocols. Passing | |
| /// `RSA_PKCS1_PADDING` into this function is deprecated and insecure. See | |
| /// `RSA_decrypt`. | |
| /// | |
| /// When `padding` is `RSA_PKCS1_OAEP_PADDING`, this function has no way to set | |
| /// the OAEP or MGF-1 digest, so it is always SHA-1. For other OAEP parameters, | |
| /// wrap `rsa` in an `EVP_PKEY` and use `EVP_PKEY_decrypt` with | |
| /// `EVP_PKEY_CTX_set_rsa_padding` and related functions. | |
| /// | |
| /// WARNING: this function is dangerous because it breaks the usual return value | |
| /// convention. Use `RSA_decrypt` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<RSA>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_private_decrypt') | |
| external int RSA_private_decrypt( | |
| int flen, | |
| ffi.Pointer<ffi.Uint8> from, | |
| ffi.Pointer<ffi.Uint8> to, | |
| ffi.Pointer<RSA> rsa, | |
| int padding, | |
| ); | |
| /// RSA_private_encrypt performs the private key portion of computing a signature | |
| /// with `rsa`. It takes `flen` bytes from `from` as input and writes the result | |
| /// to `to`. The `to` buffer must have at least `RSA_size` bytes of space. It | |
| /// returns the number of bytes written, or -1 on error. | |
| /// | |
| /// For the interpretation of `padding` and the input, see `RSA_sign_raw`. | |
| /// | |
| /// WARNING: This function is a building block for a signature scheme, not a | |
| /// complete one. See `RSA_sign_raw` for details. | |
| /// | |
| /// WARNING: This function is dangerous because it breaks the usual return value | |
| /// convention. Use `RSA_sign_raw` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<RSA>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_private_encrypt') | |
| external int RSA_private_encrypt( | |
| int flen, | |
| ffi.Pointer<ffi.Uint8> from, | |
| ffi.Pointer<ffi.Uint8> to, | |
| ffi.Pointer<RSA> rsa, | |
| int padding, | |
| ); | |
| /// RSA_private_key_from_bytes parses `in` as a DER-encoded RSAPrivateKey | |
| /// structure (RFC 8017). It returns a newly-allocated `RSA` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_RSA_private_key_from_bytes', | |
| ) | |
| external ffi.Pointer<RSA> RSA_private_key_from_bytes( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// RSA_private_key_to_bytes marshals `rsa` as a DER-encoded RSAPrivateKey | |
| /// structure (RFC 8017) and, on success, sets `*out_bytes` to a newly allocated | |
| /// buffer containing the result and returns one. Otherwise, it returns zero. The | |
| /// result should be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<RSA>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_private_key_to_bytes') | |
| external int RSA_private_key_to_bytes( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_bytes, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_public_decrypt performs the public key portion of verifying `flen` bytes | |
| /// of signature from `from` using the public key from `rsa`. It writes the | |
| /// result to `to`, which must have at least `RSA_size` bytes of space. It | |
| /// returns the number of bytes written, or -1 on error. | |
| /// | |
| /// For the interpretation of `padding` and the result, see `RSA_verify_raw`. | |
| /// | |
| /// WARNING: This function is a building block for a signature scheme, not a | |
| /// complete one. See `RSA_verify_raw` for details. | |
| /// | |
| /// WARNING: This function is dangerous because it breaks the usual return value | |
| /// convention. Use `RSA_verify_raw` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<RSA>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_public_decrypt') | |
| external int RSA_public_decrypt( | |
| int flen, | |
| ffi.Pointer<ffi.Uint8> from, | |
| ffi.Pointer<ffi.Uint8> to, | |
| ffi.Pointer<RSA> rsa, | |
| int padding, | |
| ); | |
| /// RSA_public_encrypt encrypts `flen` bytes from `from` to the public key in | |
| /// `rsa` and writes the encrypted data to `to`. The `to` buffer must have at | |
| /// least `RSA_size` bytes of space. It returns the number of bytes written, or | |
| /// -1 on error. The `padding` argument must be one of the `RSA_*_PADDING` | |
| /// values. If in doubt, use `RSA_PKCS1_OAEP_PADDING` for new protocols. | |
| /// | |
| /// When `padding` is `RSA_PKCS1_OAEP_PADDING`, this function has no way to set | |
| /// the OAEP or MGF-1 digest, so it is always SHA-1. For other OAEP parameters, | |
| /// wrap `rsa` in an `EVP_PKEY` and use `EVP_PKEY_encrypt` with | |
| /// `EVP_PKEY_CTX_set_rsa_padding` and related functions. | |
| /// | |
| /// WARNING: this function is dangerous because it breaks the usual return value | |
| /// convention. Use `RSA_encrypt` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<RSA>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_public_encrypt') | |
| external int RSA_public_encrypt( | |
| int flen, | |
| ffi.Pointer<ffi.Uint8> from, | |
| ffi.Pointer<ffi.Uint8> to, | |
| ffi.Pointer<RSA> rsa, | |
| int padding, | |
| ); | |
| /// RSA_public_key_from_bytes parses `in` as a DER-encoded RSAPublicKey structure | |
| /// (RFC 8017). It returns a newly-allocated `RSA` or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<RSA> Function(ffi.Pointer<ffi.Uint8>, ffi.Size)>( | |
| symbol: 'bssl_dart_RSA_public_key_from_bytes', | |
| ) | |
| external ffi.Pointer<RSA> RSA_public_key_from_bytes( | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| ); | |
| /// RSA_public_key_to_bytes marshals `rsa` as a DER-encoded RSAPublicKey | |
| /// structure (RFC 8017) and, on success, sets `*out_bytes` to a newly allocated | |
| /// buffer containing the result and returns one. Otherwise, it returns zero. The | |
| /// result should be freed with `OPENSSL_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<RSA>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_public_key_to_bytes') | |
| external int RSA_public_key_to_bytes( | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_bytes, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_set0_crt_params sets `rsa`'s CRT parameters to `dmp1`, `dmq1`, and | |
| /// `iqmp`, if non-NULL, and takes ownership of them. On success, it takes | |
| /// ownership of its parameters and returns one. Otherwise, it returns zero. | |
| /// | |
| /// Each argument must either be non-NULL or already configured on `rsa`. | |
| /// | |
| /// It is an error to call this function after `rsa` has been used for a | |
| /// cryptographic operation. Construct a new `RSA` object instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_set0_crt_params') | |
| external int RSA_set0_crt_params( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<BIGNUM> dmp1, | |
| ffi.Pointer<BIGNUM> dmq1, | |
| ffi.Pointer<BIGNUM> iqmp, | |
| ); | |
| /// RSA_set0_factors sets `rsa`'s prime factors to `p` and `q`, if non-NULL, and | |
| /// takes ownership of them. On success, it takes ownership of each argument and | |
| /// returns one. Otherwise, it returns zero. | |
| /// | |
| /// Each argument must either be non-NULL or already configured on `rsa`. | |
| /// | |
| /// It is an error to call this function after `rsa` has been used for a | |
| /// cryptographic operation. Construct a new `RSA` object instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<RSA>, ffi.Pointer<BIGNUM>, ffi.Pointer<BIGNUM>) | |
| >(symbol: 'bssl_dart_RSA_set0_factors') | |
| external int RSA_set0_factors( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<BIGNUM> p, | |
| ffi.Pointer<BIGNUM> q, | |
| ); | |
| /// RSA_set0_key sets `rsa`'s modulus, public exponent, and private exponent to | |
| /// `n`, `e`, and `d` respectively, if non-NULL. On success, it takes ownership | |
| /// of each argument and returns one. Otherwise, it returns zero. | |
| /// | |
| /// `d` may be NULL, but `n` and `e` must either be non-NULL or already | |
| /// configured on `rsa`. | |
| /// | |
| /// It is an error to call this function after `rsa` has been used for a | |
| /// cryptographic operation. Construct a new `RSA` object instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ffi.Pointer<BIGNUM>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_set0_key') | |
| external int RSA_set0_key( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<BIGNUM> n, | |
| ffi.Pointer<BIGNUM> e, | |
| ffi.Pointer<BIGNUM> d, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>, ffi.Int, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_RSA_set_ex_data', | |
| ) | |
| external int RSA_set_ex_data( | |
| ffi.Pointer<RSA> rsa, | |
| int idx, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// RSA_sign signs `digest_len` bytes of digest from `digest` with `rsa` using | |
| /// RSASSA-PKCS1-v1_5. It writes, at most, `RSA_size(rsa)` bytes to `out`. On | |
| /// successful return, the actual number of bytes written is written to | |
| /// `*out_len`. | |
| /// | |
| /// The `hash_nid` argument identifies the hash function used to calculate | |
| /// `digest` and is embedded in the resulting signature. For example, it might be | |
| /// `NID_sha256`. | |
| /// | |
| /// It returns 1 on success and zero on error. | |
| /// | |
| /// WARNING: `digest` must be the result of hashing the data to be signed with | |
| /// `hash_nid`. Passing unhashed inputs will not result in a secure signature | |
| /// scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ffi.Pointer<RSA>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_sign') | |
| external int RSA_sign( | |
| int hash_nid, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_sign_pss_mgf1 signs `digest_len` bytes from `digest` with the public key | |
| /// from `rsa` using RSASSA-PSS with MGF1 as the mask generation function. It | |
| /// writes, at most, `max_out` bytes of signature data to `out`. The `max_out` | |
| /// argument must be, at least, `RSA_size` in order to ensure success. It returns | |
| /// 1 on success or zero on error. | |
| /// | |
| /// The `md` and `mgf1_md` arguments identify the hash used to calculate `digest` | |
| /// and the MGF1 hash, respectively. If `mgf1_md` is NULL, `md` is | |
| /// used. | |
| /// | |
| /// `salt_len` specifies the expected salt length in bytes. If `salt_len` is | |
| /// `RSA_PSS_SALTLEN_DIGEST`, then the salt length is the same as the hash | |
| /// length. If `RSA_PSS_SALTLEN_AUTO`, then the salt length is maximal given the | |
| /// size of `rsa`. If unsure, use `RSA_PSS_SALTLEN_DIGEST`. | |
| /// | |
| /// WARNING: `digest` must be the result of hashing the data to be signed with | |
| /// `md`. Passing unhashed inputs will not result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_sign_pss_mgf1') | |
| external int RSA_sign_pss_mgf1( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<EVP_MD> mgf1_md, | |
| int salt_len, | |
| ); | |
| /// RSA_sign_raw performs the private key portion of computing a signature with | |
| /// `rsa`. It writes, at most, `max_out` bytes of signature data to `out`. The | |
| /// `max_out` argument must be, at least, `RSA_size` in order to ensure the | |
| /// output fits. It returns 1 on success or zero on error. | |
| /// | |
| /// If `padding` is `RSA_PKCS1_PADDING`, this function wraps `in` with the | |
| /// padding portion of RSASSA-PKCS1-v1_5 and then performs the raw private key | |
| /// operation. The caller is responsible for hashing the input and wrapping it in | |
| /// a DigestInfo structure. | |
| /// | |
| /// If `padding` is `RSA_NO_PADDING`, this function only performs the raw private | |
| /// key operation, interpreting `in` as an integer modulo n. The caller is | |
| /// responsible for hashing the input and encoding it for the signature scheme | |
| /// being implemented. | |
| /// | |
| /// WARNING: This function is a building block for a signature scheme, not a | |
| /// complete one. `in` must be the result of hashing and encoding the data as | |
| /// needed for the scheme being implemented. Passing in arbitrary inputs will not | |
| /// result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_sign_raw') | |
| external int RSA_sign_raw( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| int padding, | |
| ); | |
| /// RSA_size returns the number of bytes in the modulus, which is also the size | |
| /// of a signature or encrypted value using `rsa`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedInt Function(ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_RSA_size', | |
| ) | |
| external int RSA_size( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_test_flags returns the subset of flags in `flags` which are set in `rsa`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>, ffi.Int)>( | |
| symbol: 'bssl_dart_RSA_test_flags', | |
| ) | |
| external int RSA_test_flags( | |
| ffi.Pointer<RSA> rsa, | |
| int flags, | |
| ); | |
| /// RSA_up_ref increments the reference count of `rsa` and returns one. It does | |
| /// not mutate `rsa` for thread-safety purposes and may be used concurrently. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<RSA>)>(symbol: 'bssl_dart_RSA_up_ref') | |
| external int RSA_up_ref( | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_verify verifies that `sig_len` bytes from `sig` are a valid, | |
| /// RSASSA-PKCS1-v1_5 signature of `digest_len` bytes at `digest` by `rsa`. | |
| /// | |
| /// The `hash_nid` argument identifies the hash function used to calculate | |
| /// `digest` and is embedded in the resulting signature in order to prevent hash | |
| /// confusion attacks. For example, it might be `NID_sha256`. | |
| /// | |
| /// It returns one if the signature is valid and zero otherwise. | |
| /// | |
| /// WARNING: this differs from the original, OpenSSL function which additionally | |
| /// returned -1 on error. | |
| /// | |
| /// WARNING: `digest` must be the result of hashing the data to be verified with | |
| /// `hash_nid`. Passing unhashed input will not result in a secure signature | |
| /// scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<RSA>, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_verify') | |
| external int RSA_verify( | |
| int hash_nid, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// RSA_verify_PKCS1_PSS_mgf1 verifies that `EM` is a correct PSS padding of | |
| /// `mHash`, where `mHash` is a digest produced by `Hash`. `EM` must point to | |
| /// exactly `RSA_size(rsa)` bytes of data. The `mgf1Hash` argument specifies the | |
| /// hash function for generating the mask. If NULL, `Hash` is used. The `sLen` | |
| /// argument specifies the expected salt length in bytes. If `sLen` is -1 then | |
| /// the salt length is the same as the hash length. If -2, then the salt length | |
| /// is recovered and all values accepted. | |
| /// | |
| /// If unsure, use -1. | |
| /// | |
| /// It returns one on success or zero on error. | |
| /// | |
| /// This function implements only the low-level padding logic. Use | |
| /// `RSA_verify_pss_mgf1` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_verify_PKCS1_PSS_mgf1') | |
| external int RSA_verify_PKCS1_PSS_mgf1( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Uint8> mHash, | |
| ffi.Pointer<EVP_MD> Hash, | |
| ffi.Pointer<EVP_MD> mgf1Hash, | |
| ffi.Pointer<ffi.Uint8> EM, | |
| int sLen, | |
| ); | |
| /// RSA_verify_pss_mgf1 verifies that `sig_len` bytes from `sig` are a valid, | |
| /// RSASSA-PSS signature of `digest_len` bytes at `digest` by `rsa`. It returns | |
| /// one if the signature is valid and zero otherwise. MGF1 is used as the mask | |
| /// generation function. | |
| /// | |
| /// The `md` and `mgf1_md` arguments identify the hash used to calculate `digest` | |
| /// and the MGF1 hash, respectively. If `mgf1_md` is NULL, `md` is | |
| /// used. `salt_len` specifies the expected salt length in bytes. | |
| /// | |
| /// If `salt_len` is `RSA_PSS_SALTLEN_DIGEST`, then the salt length is the same | |
| /// as the hash length. If `RSA_PSS_SALTLEN_AUTO`, then the salt length is | |
| /// recovered and all values accepted. If unsure, use `RSA_PSS_SALTLEN_DIGEST`. | |
| /// | |
| /// WARNING: `digest` must be the result of hashing the data to be verified with | |
| /// `md`. Passing unhashed input will not result in a secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_verify_pss_mgf1') | |
| external int RSA_verify_pss_mgf1( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Uint8> digest, | |
| int digest_len, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<EVP_MD> mgf1_md, | |
| int salt_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ); | |
| /// RSA_verify_raw performs the public key portion of verifying `in_len` bytes of | |
| /// signature from `in` using the public key from `rsa`. On success, it returns | |
| /// one and writes, at most, `max_out` bytes of output to `out`. The `max_out` | |
| /// argument must be, at least, `RSA_size` in order to ensure the output fits. On | |
| /// failure or invalid input, it returns zero. | |
| /// | |
| /// If `padding` is `RSA_PKCS1_PADDING`, this function checks the padding portion | |
| /// of RSASSA-PKCS1-v1_5 and outputs the remainder of the encoded digest. The | |
| /// caller is responsible for checking the output is a DigestInfo-wrapped digest | |
| /// of the message. | |
| /// | |
| /// If `padding` is `RSA_NO_PADDING`, this function only performs the raw public | |
| /// key operation. The caller is responsible for checking the output is a valid | |
| /// result for the signature scheme being implemented. | |
| /// | |
| /// WARNING: This function is a building block for a signature scheme, not a | |
| /// complete one. Checking for arbitrary strings in `out` will not result in a | |
| /// secure signature scheme. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_RSA_verify_raw') | |
| external int RSA_verify_raw( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| int max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| int in_len, | |
| int padding, | |
| ); | |
| /// SHA1_Final adds the final padding to `sha` and writes the resulting digest to | |
| /// `out`, which must have at least `SHA_DIGEST_LENGTH` bytes of space. It | |
| /// returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA_CTX>)>( | |
| symbol: 'bssl_dart_SHA1_Final', | |
| ) | |
| external int SHA1_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA_CTX> sha, | |
| ); | |
| /// SHA1_Init initialises `sha` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA_CTX>)>( | |
| symbol: 'bssl_dart_SHA1_Init', | |
| ) | |
| external int SHA1_Init( | |
| ffi.Pointer<SHA_CTX> sha, | |
| ); | |
| /// SHA1_Transform is a low-level function that performs a single, SHA-1 block | |
| /// transformation using the state from `sha` and `SHA_CBLOCK` bytes from | |
| /// `block`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<SHA_CTX>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_SHA1_Transform', | |
| ) | |
| external void SHA1_Transform( | |
| ffi.Pointer<SHA_CTX> sha, | |
| ffi.Pointer<ffi.Uint8> block, | |
| ); | |
| /// SHA1_Update adds `len` bytes from `data` to `sha` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA1_Update') | |
| external int SHA1_Update( | |
| ffi.Pointer<SHA_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SHA224_Final adds the final padding to `sha` and writes the resulting digest | |
| /// to `out`, which must have at least `SHA224_DIGEST_LENGTH` bytes of space. It | |
| /// returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-224. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA256_CTX>)>( | |
| symbol: 'bssl_dart_SHA224_Final', | |
| ) | |
| external int SHA224_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ); | |
| /// SHA224_Init initialises `sha` for SHA-224 and returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA256_CTX>)>( | |
| symbol: 'bssl_dart_SHA224_Init', | |
| ) | |
| external int SHA224_Init( | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ); | |
| /// SHA224_Update adds `len` bytes from `data` to `sha` and returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-224. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA256_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA224_Update') | |
| external int SHA224_Update( | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SHA256_Final adds the final padding to `sha` and writes the resulting digest | |
| /// to `out`, which must have at least `SHA256_DIGEST_LENGTH` bytes of space. It | |
| /// returns one on success and zero on programmer error. | |
| /// | |
| /// `sha` must have been initialised for SHA-256. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA256_CTX>)>( | |
| symbol: 'bssl_dart_SHA256_Final', | |
| ) | |
| external int SHA256_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ); | |
| /// SHA256_Init initialises `sha` for SHA-256 and returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA256_CTX>)>( | |
| symbol: 'bssl_dart_SHA256_Init', | |
| ) | |
| external int SHA256_Init( | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ); | |
| /// SHA256_Transform is a low-level function that performs a single, SHA-256 | |
| /// block transformation using the state from `sha` and `SHA256_CBLOCK` bytes | |
| /// from `block`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<SHA256_CTX>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_SHA256_Transform', | |
| ) | |
| external void SHA256_Transform( | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ffi.Pointer<ffi.Uint8> block, | |
| ); | |
| /// SHA256_TransformBlocks is a low-level function that takes `num_blocks` * | |
| /// `SHA256_CBLOCK` bytes of data and performs SHA-256 transforms on it to update | |
| /// `state`. You should not use this function unless you are implementing a | |
| /// derivative of SHA-256. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<ffi.Uint32>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA256_TransformBlocks') | |
| external void SHA256_TransformBlocks( | |
| ffi.Pointer<ffi.Uint32> state, | |
| ffi.Pointer<ffi.Uint8> data, | |
| int num_blocks, | |
| ); | |
| /// SHA256_Update adds `len` bytes from `data` to `sha` and returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-256. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA256_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA256_Update') | |
| external int SHA256_Update( | |
| ffi.Pointer<SHA256_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SHA384_Final adds the final padding to `sha` and writes the resulting digest | |
| /// to `out`, which must have at least `SHA384_DIGEST_LENGTH` bytes of space. It | |
| /// returns one on success and zero on programmer error. | |
| /// | |
| /// `sha` must have been initialised for SHA-384. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA384_Final', | |
| ) | |
| external int SHA384_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA384_Init initialises `sha` for SHA-384 and returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA384_Init', | |
| ) | |
| external int SHA384_Init( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA384_Update adds `len` bytes from `data` to `sha` and returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-384. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA512_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA384_Update') | |
| external int SHA384_Update( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SHA512_256_Final adds the final padding to `sha` and writes the resulting | |
| /// digest to `out`, which must have at least `SHA512_256_DIGEST_LENGTH` bytes of | |
| /// space. It returns one on success and zero on programmer error. | |
| /// | |
| /// `sha` must have been initialised for SHA-512/256. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA512_256_Final', | |
| ) | |
| external int SHA512_256_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA512_256_Init initialises `sha` for SHA-512/256 and returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA512_256_Init', | |
| ) | |
| external int SHA512_256_Init( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA512_256_Update adds `len` bytes from `data` to `sha` and returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-512/256. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA512_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA512_256_Update') | |
| external int SHA512_256_Update( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SHA512_Final adds the final padding to `sha` and writes the resulting digest | |
| /// to `out`, which must have at least `SHA512_DIGEST_LENGTH` bytes of space. It | |
| /// returns one on success and zero on programmer error. | |
| /// | |
| /// `sha` must have been initialised for SHA-512. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA512_Final', | |
| ) | |
| external int SHA512_Final( | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA512_Init initialises `sha` and returns 1. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<SHA512_CTX>)>( | |
| symbol: 'bssl_dart_SHA512_Init', | |
| ) | |
| external int SHA512_Init( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ); | |
| /// SHA512_Transform is a low-level function that performs a single, SHA-512 | |
| /// block transformation using the state from `sha` and `SHA512_CBLOCK` bytes | |
| /// from `block`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<SHA512_CTX>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_SHA512_Transform', | |
| ) | |
| external void SHA512_Transform( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ffi.Pointer<ffi.Uint8> block, | |
| ); | |
| /// SHA512_Update adds `len` bytes from `data` to `sha` and returns 1. | |
| /// | |
| /// `sha` must have been initialised for SHA-512. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<SHA512_CTX>, ffi.Pointer<ffi.Void>, ffi.Size) | |
| >(symbol: 'bssl_dart_SHA512_Update') | |
| external int SHA512_Update( | |
| ffi.Pointer<SHA512_CTX> sha, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// SPAKE2_CTX_free frees `ctx` and all the resources that it has allocated. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<SPAKE2_CTX>)>( | |
| symbol: 'bssl_dart_SPAKE2_CTX_free', | |
| ) | |
| external void SPAKE2_CTX_free( | |
| ffi.Pointer<SPAKE2_CTX> ctx, | |
| ); | |
| /// SPAKE2_CTX_new creates a new `SPAKE2_CTX` (which can only be used for a | |
| /// single execution of the protocol). SPAKE2 requires the symmetry of the two | |
| /// parties to be broken which is indicated via `my_role` – each party must pass | |
| /// a different value for this argument. | |
| /// | |
| /// The `my_name` and `their_name` arguments allow optional, opaque names to be | |
| /// bound into the protocol. For example MAC addresses, hostnames, usernames | |
| /// etc. These values are not exposed and can avoid context-confusion attacks | |
| /// when a password is shared between several devices. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<SPAKE2_CTX> Function( | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_SPAKE2_CTX_new') | |
| external ffi.Pointer<SPAKE2_CTX> SPAKE2_CTX_new( | |
| int my_role, | |
| ffi.Pointer<ffi.Uint8> my_name, | |
| int my_name_len, | |
| ffi.Pointer<ffi.Uint8> their_name, | |
| int their_name_len, | |
| ); | |
| /// SPAKE2_generate_msg generates a SPAKE2 message given `password`, writes | |
| /// it to `out` and sets `*out_len` to the number of bytes written. | |
| /// | |
| /// At most `max_out_len` bytes are written to `out` and, in order to ensure | |
| /// success, `max_out_len` should be at least `SPAKE2_MAX_MSG_SIZE` bytes. | |
| /// | |
| /// This function can only be called once for a given `SPAKE2_CTX`. | |
| /// | |
| /// It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<SPAKE2_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_SPAKE2_generate_msg') | |
| external int SPAKE2_generate_msg( | |
| ffi.Pointer<SPAKE2_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Size> out_len, | |
| int max_out_len, | |
| ffi.Pointer<ffi.Uint8> password, | |
| int password_len, | |
| ); | |
| /// SPAKE2_process_msg completes the SPAKE2 exchange given the peer's message in | |
| /// `their_msg`, writes at most `max_out_key_len` bytes to `out_key` and sets | |
| /// `*out_key_len` to the number of bytes written. | |
| /// | |
| /// The resulting keying material is suitable for: | |
| /// - Using directly in a key-confirmation step: i.e. each side could | |
| /// transmit a hash of their role, a channel-binding value and the key | |
| /// material to prove to the other side that they know the shared key. | |
| /// - Using as input keying material to HKDF to generate a variety of subkeys | |
| /// for encryption etc. | |
| /// | |
| /// If `max_out_key_key` is smaller than the amount of key material generated | |
| /// then the key is silently truncated. If you want to ensure that no truncation | |
| /// occurs then `max_out_key` should be at least `SPAKE2_MAX_KEY_SIZE`. | |
| /// | |
| /// You must call `SPAKE2_generate_msg` on a given `SPAKE2_CTX` before calling | |
| /// this function. On successful return, `ctx` is complete and calling | |
| /// `SPAKE2_CTX_free` is the only acceptable operation on it. | |
| /// | |
| /// Returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<SPAKE2_CTX>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Size>, | |
| ffi.Size, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_SPAKE2_process_msg') | |
| external int SPAKE2_process_msg( | |
| ffi.Pointer<SPAKE2_CTX> ctx, | |
| ffi.Pointer<ffi.Uint8> out_key, | |
| ffi.Pointer<ffi.Size> out_key_len, | |
| int max_out_key_len, | |
| ffi.Pointer<ffi.Uint8> their_msg, | |
| int their_msg_len, | |
| ); | |
| /// SSLeay is a compatibility function that returns OPENSSL_VERSION_NUMBER from | |
| /// base.h. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedLong Function()>(symbol: 'bssl_dart_SSLeay') | |
| external int SSLeay(); | |
| /// SSLeay_version calls `OpenSSL_version`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_SSLeay_version', | |
| ) | |
| external ffi.Pointer<ffi.Char> SSLeay_version( | |
| int which, | |
| ); | |
| /// USERNOTICE_free releases memory associated with `notice`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<USERNOTICE>)>( | |
| symbol: 'bssl_dart_USERNOTICE_free', | |
| ) | |
| external void USERNOTICE_free( | |
| ffi.Pointer<USERNOTICE> notice, | |
| ); | |
| /// USERNOTICE_new returns a newly-allocated, empty `USERNOTICE` object, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<USERNOTICE> Function()>( | |
| symbol: 'bssl_dart_USERNOTICE_new', | |
| ) | |
| external ffi.Pointer<USERNOTICE> USERNOTICE_new(); | |
| /// X25519 writes a shared key to `out_shared_key` that is calculated from the | |
| /// given private key and the peer's public value. It returns one on success and | |
| /// zero on error. | |
| /// | |
| /// Don't use the shared key directly, rather use a KDF and also include the two | |
| /// public values as inputs. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ) | |
| >(symbol: 'bssl_dart_X25519') | |
| external int X25519( | |
| ffi.Pointer<ffi.Uint8> out_shared_key, | |
| ffi.Pointer<ffi.Uint8> private_key, | |
| ffi.Pointer<ffi.Uint8> peer_public_value, | |
| ); | |
| /// X25519_keypair sets `out_public_value` and `out_private_key` to a freshly | |
| /// generated, public–private key pair. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_X25519_keypair', | |
| ) | |
| external void X25519_keypair( | |
| ffi.Pointer<ffi.Uint8> out_public_value, | |
| ffi.Pointer<ffi.Uint8> out_private_key, | |
| ); | |
| /// X25519_public_from_private calculates a Diffie-Hellman public value from the | |
| /// given private key and writes it to `out_public_value`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Uint8>, ffi.Pointer<ffi.Uint8>)>( | |
| symbol: 'bssl_dart_X25519_public_from_private', | |
| ) | |
| external void X25519_public_from_private( | |
| ffi.Pointer<ffi.Uint8> out_public_value, | |
| ffi.Pointer<ffi.Uint8> private_key, | |
| ); | |
| /// X509V3_EXT_CRL_add_nconf adds extensions to `crl` as in | |
| /// `X509V3_EXT_add_nconf_sk`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<X509_CRL>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_CRL_add_nconf') | |
| external int X509V3_EXT_CRL_add_nconf( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> section, | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509V3_EXT_REQ_add_nconf adds extensions to `req` as in | |
| /// `X509V3_EXT_add_nconf_sk`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<X509_REQ>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_REQ_add_nconf') | |
| external int X509V3_EXT_REQ_add_nconf( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> section, | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509V3_EXT_add registers `ext` as a custom extension for the extension type | |
| /// `ext->ext_nid`. `ext` must be valid for the remainder of the address space's | |
| /// lifetime. It returns one on success and zero on error. | |
| /// | |
| /// WARNING: This function modifies global state. If other code in the same | |
| /// address space also registers an extension with type `ext->ext_nid`, the two | |
| /// registrations will conflict. Which registration takes effect is undefined. If | |
| /// the two registrations use incompatible in-memory representations, code | |
| /// expecting the other registration will then cast a type to the wrong type, | |
| /// resulting in a potentially exploitable memory error. This conflict can also | |
| /// occur if BoringSSL later adds support for `ext->ext_nid`, with a different | |
| /// in-memory representation than the one expected by `ext`. | |
| /// | |
| /// This function, additionally, is not thread-safe and cannot be called | |
| /// concurrently with any other BoringSSL function. | |
| /// | |
| /// As a result, it is impossible to safely use this function. Registering a | |
| /// custom extension has no impact on certificate verification so, instead, | |
| /// callers should simply handle the custom extension with the byte-based | |
| /// `X509_EXTENSION` APIs directly. Registering `ext` with the library has little | |
| /// practical value. | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509V3_EXT_METHOD>)>( | |
| symbol: 'bssl_dart_X509V3_EXT_add', | |
| ) | |
| external int X509V3_EXT_add( | |
| ffi.Pointer<X509V3_EXT_METHOD> ext, | |
| ); | |
| /// X509V3_EXT_add_alias registers a custom extension with NID `nid_to`. The | |
| /// corresponding ASN.1 type is copied from `nid_from`. It returns one on success | |
| /// and zero on error. | |
| /// | |
| /// WARNING: Do not use this function. See `X509V3_EXT_add`. | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509V3_EXT_add_alias', | |
| ) | |
| external int X509V3_EXT_add_alias( | |
| int nid_to, | |
| int nid_from, | |
| ); | |
| /// X509V3_EXT_add_nconf adds extensions to `cert` as in | |
| /// `X509V3_EXT_add_nconf_sk`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<X509>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_add_nconf') | |
| external int X509V3_EXT_add_nconf( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> section, | |
| ffi.Pointer<X509> cert, | |
| ); | |
| /// X509V3_EXT_add_nconf_sk looks up the section named `section` in `conf`. For | |
| /// each `CONF_VALUE` in the section, it constructs an extension as in | |
| /// `X509V3_EXT_nconf`, taking `name` and `value` from the `CONF_VALUE`. Each new | |
| /// extension is appended to `*sk`. If `*sk` is non-NULL, and at least one | |
| /// extension is added, it sets `*sk` to a newly-allocated | |
| /// `STACK_OF(X509_EXTENSION)`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_add_nconf_sk') | |
| external int X509V3_EXT_add_nconf_sk( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> section, | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>> sk, | |
| ); | |
| /// X509V3_EXT_d2i decodes `ext` and returns a pointer to a newly-allocated | |
| /// structure, with type dependent on the type of the extension. It returns NULL | |
| /// if `ext` is an unsupported extension or if there was a syntax error in the | |
| /// extension. The caller should cast the return value to the expected type and | |
| /// free the structure when done. | |
| /// | |
| /// WARNING: Casting the return value to the wrong type is a potentially | |
| /// exploitable memory error, so callers must not use this function before | |
| /// checking `ext` is of a known type. See the list at the top of this section | |
| /// for the correct types. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509V3_EXT_d2i', | |
| ) | |
| external ffi.Pointer<ffi.Void> X509V3_EXT_d2i( | |
| ffi.Pointer<X509_EXTENSION> ext, | |
| ); | |
| /// X509V3_EXT_free casts `ext_data` into the type that corresponds to `nid` and | |
| /// releases memory associated with it. It returns one on success and zero if | |
| /// `nid` is not a known extension. | |
| /// | |
| /// WARNING: Casting `ext_data` to the wrong type is a potentially exploitable | |
| /// memory error, so callers must ensure `ext_data`'s type matches `nid`. See the | |
| /// list at the top of this section for the correct types. | |
| /// | |
| /// TODO(davidben): OpenSSL upstream no longer exposes this function. Remove it? | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int, ffi.Pointer<ffi.Void>)>( | |
| symbol: 'bssl_dart_X509V3_EXT_free', | |
| ) | |
| external int X509V3_EXT_free( | |
| int nid, | |
| ffi.Pointer<ffi.Void> ext_data, | |
| ); | |
| /// X509V3_EXT_get returns the `X509V3_EXT_METHOD` corresponding to `ext`'s | |
| /// extension type, or NULL if none was registered. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509V3_EXT_METHOD> Function(ffi.Pointer<X509_EXTENSION>) | |
| >(symbol: 'bssl_dart_X509V3_EXT_get') | |
| external ffi.Pointer<X509V3_EXT_METHOD> X509V3_EXT_get( | |
| ffi.Pointer<X509_EXTENSION> ext, | |
| ); | |
| /// X509V3_EXT_get_nid returns the `X509V3_EXT_METHOD` corresponding to `nid`, or | |
| /// NULL if none was registered. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509V3_EXT_METHOD> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_X509V3_EXT_get_nid', | |
| ) | |
| external ffi.Pointer<X509V3_EXT_METHOD> X509V3_EXT_get_nid( | |
| int nid, | |
| ); | |
| /// X509V3_EXT_i2d casts `ext_struc` into the type that corresponds to | |
| /// `ext_nid`, serializes it, and returns a newly-allocated `X509_EXTENSION` | |
| /// object containing the serialization, or NULL on error. The `X509_EXTENSION` | |
| /// has OID `ext_nid` and is critical if `crit` is one. | |
| /// | |
| /// WARNING: Casting `ext_struc` to the wrong type is a potentially exploitable | |
| /// memory error, so callers must ensure `ext_struct`'s type matches `ext_nid`. | |
| /// See the list at the top of this section for the correct types. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Int, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_X509V3_EXT_i2d') | |
| external ffi.Pointer<X509_EXTENSION> X509V3_EXT_i2d( | |
| int ext_nid, | |
| int crit, | |
| ffi.Pointer<ffi.Void> ext_struc, | |
| ); | |
| /// X509V3_EXT_nconf constructs an extension of type specified by `name`, and | |
| /// value specified by `value`. It returns a newly-allocated `X509_EXTENSION` | |
| /// object on success, or NULL on error. `conf` and `ctx` specify additional | |
| /// information referenced by some formats. Either `conf` or `ctx` may be NULL, | |
| /// in which case features which use it will be disabled. | |
| /// | |
| /// If non-NULL, `ctx` must be initialized with `X509V3_set_ctx` or | |
| /// `X509V3_set_ctx_test`. | |
| /// | |
| /// Both `conf` and `ctx` provide a `CONF` object. When `ctx` is non-NULL, most | |
| /// features use the `ctx` copy, configured with `X509V3_set_ctx`, but some use | |
| /// `conf`. Callers should ensure the two match to avoid surprisingly behavior. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_nconf') | |
| external ffi.Pointer<X509_EXTENSION> X509V3_EXT_nconf( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> name, | |
| ffi.Pointer<ffi.Char> value, | |
| ); | |
| /// X509V3_EXT_nconf_nid behaves like `X509V3_EXT_nconf`, except the extension | |
| /// type is specified as a NID. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<CONF>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_nconf_nid') | |
| external ffi.Pointer<X509_EXTENSION> X509V3_EXT_nconf_nid( | |
| ffi.Pointer<CONF> conf, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| int ext_nid, | |
| ffi.Pointer<ffi.Char> value, | |
| ); | |
| /// X509V3_EXT_print prints a human-readable representation of `ext` to out. It | |
| /// returns one on success and zero on error. The output is indented by `indent` | |
| /// spaces. `flag` is one of the `X509V3_EXT_*` constants and controls printing | |
| /// of unknown extensions and syntax errors. | |
| /// | |
| /// WARNING: Although some applications programmatically parse the output of this | |
| /// function to process X.509 extensions, this is not safe. In many cases, the | |
| /// outputs are ambiguous to attempting to parse them can lead to string | |
| /// injection vulnerabilities. These functions should only be used for debugging | |
| /// or logging. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.UnsignedLong, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_print') | |
| external int X509V3_EXT_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<X509_EXTENSION> ext, | |
| int flag, | |
| int indent, | |
| ); | |
| /// X509V3_EXT_print_fp behaves like `X509V3_EXT_print` but writes to a `FILE` | |
| /// instead of a `BIO`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_EXT_print_fp') | |
| external int X509V3_EXT_print_fp( | |
| ffi.Pointer<FILE> out, | |
| ffi.Pointer<X509_EXTENSION> ext, | |
| int flag, | |
| int indent, | |
| ); | |
| /// X509V3_add1_i2d casts `value` to the type that corresponds to `nid`, | |
| /// serializes it, and appends it to the extension list in `*x`. If `*x` is NULL, | |
| /// it will set `*x` to a newly-allocated `STACK_OF(X509_EXTENSION)` as needed. | |
| /// The `crit` parameter determines whether the new extension is critical. | |
| /// `flags` may be some combination of the `X509V3_ADD_*` constants to control | |
| /// the function's behavior on duplicate extension. | |
| /// | |
| /// This function returns one on success, zero if the operation failed due to a | |
| /// missing or duplicate extension, and -1 on other errors. | |
| /// | |
| /// WARNING: Casting `value` to the wrong type is a potentially exploitable | |
| /// memory error, so callers must ensure `value`'s type matches `nid`. See the | |
| /// list at the top of this section for the correct types. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_add1_i2d') | |
| external int X509V3_add1_i2d( | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>> x, | |
| int nid, | |
| ffi.Pointer<ffi.Void> value, | |
| int crit, | |
| int flags, | |
| ); | |
| /// X509V3_add_standard_extensions returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function()>( | |
| symbol: 'bssl_dart_X509V3_add_standard_extensions', | |
| ) | |
| external int X509V3_add_standard_extensions(); | |
| /// X509V3_conf_free releases memory associated with `CONF_VALUE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<CONF_VALUE>)>( | |
| symbol: 'bssl_dart_X509V3_conf_free', | |
| ) | |
| external void X509V3_conf_free( | |
| ffi.Pointer<CONF_VALUE> val, | |
| ); | |
| /// X509V3_extensions_print prints `title`, followed by a human-readable | |
| /// representation of `exts` to `out`. It returns one on success and zero on | |
| /// error. The output is indented by `indent` spaces. `flag` is one of the | |
| /// `X509V3_EXT_*` constants and controls printing of unknown extensions and | |
| /// syntax errors. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.UnsignedLong, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_extensions_print') | |
| external int X509V3_extensions_print( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<ffi.Char> title, | |
| ffi.Pointer<stack_st_X509_EXTENSION> exts, | |
| int flag, | |
| int indent, | |
| ); | |
| /// X509V3_get_d2i finds and decodes the extension in `extensions` of type `nid`. | |
| /// If found, it decodes it and returns a newly-allocated structure, with type | |
| /// dependent on `nid`. If the extension is not found or on error, it returns | |
| /// NULL. The caller may distinguish these cases using the `out_critical` value. | |
| /// | |
| /// If `out_critical` is not NULL, this function sets `*out_critical` to one if | |
| /// the extension is found and critical, zero if it is found and not critical, -1 | |
| /// if it is not found, and -2 if there is an invalid duplicate extension. Note | |
| /// this function may set `*out_critical` to one or zero and still return NULL if | |
| /// the extension is found but has a syntax error. | |
| /// | |
| /// If `out_idx` is not NULL, this function looks for the first occurrence of the | |
| /// extension after `*out_idx`. It then sets `*out_idx` to the index of the | |
| /// extension, or -1 if not found. If `out_idx` is non-NULL, duplicate extensions | |
| /// are not treated as an error. Callers, however, should not rely on this | |
| /// behavior as it may be removed in the future. Duplicate extensions are | |
| /// forbidden in RFC 5280. | |
| /// | |
| /// WARNING: This function is difficult to use correctly. Callers should pass a | |
| /// non-NULL `out_critical` and check both the return value and `*out_critical` | |
| /// to handle errors. If the return value is NULL and `*out_critical` is not -1, | |
| /// there was an error. Otherwise, the function succeeded and but may return NULL | |
| /// for a missing extension. Callers should pass NULL to `out_idx` so that | |
| /// duplicate extensions are handled correctly. | |
| /// | |
| /// Additionally, casting the return value to the wrong type is a potentially | |
| /// exploitable memory error, so callers must ensure the cast and `nid` match. | |
| /// See the list at the top of this section for the correct types. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_get_d2i') | |
| external ffi.Pointer<ffi.Void> X509V3_get_d2i( | |
| ffi.Pointer<stack_st_X509_EXTENSION> extensions, | |
| int nid, | |
| ffi.Pointer<ffi.Int> out_critical, | |
| ffi.Pointer<ffi.Int> out_idx, | |
| ); | |
| /// X509V3_set_ctx initializes `ctx` with the specified objects. Some string | |
| /// formats will reference fields in these objects. Each object may be NULL to | |
| /// omit it, in which case those formats cannot be used. `flags` should be zero, | |
| /// unless called via `X509V3_set_ctx_test`. | |
| /// | |
| /// `issuer`, `subject`, `req`, and `crl`, if non-NULL, must outlive `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509V3_set_ctx') | |
| external void X509V3_set_ctx( | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<X509> issuer, | |
| ffi.Pointer<X509> subject, | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<X509_CRL> crl, | |
| int flags, | |
| ); | |
| /// X509V3_set_nconf sets `ctx` to use `conf` as the config database. `ctx` must | |
| /// have previously been initialized by `X509V3_set_ctx` or | |
| /// `X509V3_set_ctx_test`. Some string formats will reference sections in `conf`. | |
| /// `conf` may be NULL, in which case these formats cannot be used. If non-NULL, | |
| /// `conf` must outlive `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509V3_CTX>, ffi.Pointer<CONF>)>( | |
| symbol: 'bssl_dart_X509V3_set_nconf', | |
| ) | |
| external void X509V3_set_nconf( | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<CONF> conf, | |
| ); | |
| /// X509_ALGOR_cmp compares `a` and `b`. It returns zero if they are equal, and a | |
| /// negative or positive value if `a` sorts before or after `b`, respectively. | |
| /// Values are ordered first by algorithm, then by parameter, with an absent | |
| /// parameter sorting before a present one. The order is arbitrary but suitable | |
| /// for sorting. Callers should not rely on the exact order. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_ALGOR>, ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_ALGOR_cmp', | |
| ) | |
| external int X509_ALGOR_cmp( | |
| ffi.Pointer<X509_ALGOR> a, | |
| ffi.Pointer<X509_ALGOR> b, | |
| ); | |
| /// X509_ALGOR_copy sets `dst` to a copy of the contents of `src`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_ALGOR>, ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_ALGOR_copy', | |
| ) | |
| external int X509_ALGOR_copy( | |
| ffi.Pointer<X509_ALGOR> dst, | |
| ffi.Pointer<X509_ALGOR> src, | |
| ); | |
| /// X509_ALGOR_dup returns a newly-allocated copy of `alg`, or NULL on error. | |
| /// This function works by serializing the structure, so if `alg` is incomplete, | |
| /// it may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_ALGOR> Function(ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_ALGOR_dup', | |
| ) | |
| external ffi.Pointer<X509_ALGOR> X509_ALGOR_dup( | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ); | |
| /// X509_ALGOR_free releases memory associated with `alg`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_ALGOR_free', | |
| ) | |
| external void X509_ALGOR_free( | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ); | |
| /// X509_ALGOR_get0 sets `*out_obj` to the `alg`'s algorithm. If `alg`'s | |
| /// parameter is omitted, it sets `*out_param_type` and `*out_param_value` to | |
| /// `V_ASN1_UNDEF` and NULL. Otherwise, it sets `*out_param_type` and | |
| /// `*out_param_value` to the parameter, using the same representation as | |
| /// `ASN1_TYPE_set0`. See `ASN1_TYPE_set0` and `ASN1_TYPE` for details. | |
| /// | |
| /// Callers that require the parameter in serialized form should, after checking | |
| /// for `V_ASN1_UNDEF`, use `ASN1_TYPE_set1` and `d2i_ASN1_TYPE`, rather than | |
| /// inspecting `*out_param_value`. | |
| /// | |
| /// Each of `out_obj`, `out_param_type`, and `out_param_value` may be NULL to | |
| /// ignore the output. If `out_param_type` is NULL, `out_param_value` is ignored. | |
| /// | |
| /// WARNING: If `*out_param_type` is set to `V_ASN1_UNDEF`, OpenSSL and older | |
| /// revisions of BoringSSL leave `*out_param_value` unset rather than setting it | |
| /// to NULL. Callers that support both OpenSSL and BoringSSL should not assume | |
| /// `*out_param_value` is uniformly initialized. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ALGOR_get0') | |
| external void X509_ALGOR_get0( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>> out_obj, | |
| ffi.Pointer<ffi.Int> out_param_type, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> out_param_value, | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ); | |
| /// X509_ALGOR_new returns a newly-allocated, empty `X509_ALGOR` object, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_ALGOR> Function()>( | |
| symbol: 'bssl_dart_X509_ALGOR_new', | |
| ) | |
| external ffi.Pointer<X509_ALGOR> X509_ALGOR_new(); | |
| /// X509_ALGOR_set0 sets `alg` to an AlgorithmIdentifier with algorithm `obj` and | |
| /// parameter determined by `param_type` and `param_value`. It returns one on | |
| /// success and zero on error. This function takes ownership of `obj` and | |
| /// `param_value` on success. | |
| /// | |
| /// If `param_type` is `V_ASN1_UNDEF`, the parameter is omitted. If `param_type` | |
| /// is zero, the parameter is left unchanged. Otherwise, `param_type` and | |
| /// `param_value` are interpreted as in `ASN1_TYPE_set`. | |
| /// | |
| /// Note omitting the parameter (`V_ASN1_UNDEF`) and encoding an explicit NULL | |
| /// value (`V_ASN1_NULL`) are different. Some algorithms require one and some the | |
| /// other. Consult the relevant specification before calling this function. The | |
| /// correct parameter for an RSASSA-PKCS1-v1_5 signature is `V_ASN1_NULL`. The | |
| /// correct one for an ECDSA or Ed25519 signature is `V_ASN1_UNDEF`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ALGOR_set0') | |
| external int X509_ALGOR_set0( | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int param_type, | |
| ffi.Pointer<ffi.Void> param_value, | |
| ); | |
| /// X509_ALGOR_set_md sets `alg` to the hash function `md`. Note this | |
| /// AlgorithmIdentifier represents the hash function itself, not a signature | |
| /// algorithm that uses `md`. It returns one on success and zero on error. | |
| /// | |
| /// Due to historical specification mistakes (see Section 2.1 of RFC 4055), the | |
| /// parameters field is sometimes omitted and sometimes a NULL value. When used | |
| /// in RSASSA-PSS and RSAES-OAEP, it should be a NULL value. In other contexts, | |
| /// the parameters should be omitted. This function assumes the caller is | |
| /// constructing a RSASSA-PSS or RSAES-OAEP AlgorithmIdentifier and includes a | |
| /// NULL parameter. This differs from OpenSSL's behavior. | |
| /// | |
| /// TODO(davidben): Rename this function, or perhaps just add a bespoke API for | |
| /// constructing PSS and move on. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_ALGOR>, ffi.Pointer<EVP_MD>)>( | |
| symbol: 'bssl_dart_X509_ALGOR_set_md', | |
| ) | |
| external int X509_ALGOR_set_md( | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// X509_ATTRIBUTE_count returns the number of values in `attr`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_ATTRIBUTE>)>( | |
| symbol: 'bssl_dart_X509_ATTRIBUTE_count', | |
| ) | |
| external int X509_ATTRIBUTE_count( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ); | |
| /// X509_ATTRIBUTE_create returns a newly-allocated `X509_ATTRIBUTE`, or NULL on | |
| /// error. The attribute has type `nid` and contains a single value determined by | |
| /// `attrtype` and `value`, which are interpreted as in `ASN1_TYPE_set`. Note | |
| /// this function takes ownership of `value`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function(ffi.Int, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_create') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_create( | |
| int nid, | |
| int attrtype, | |
| ffi.Pointer<ffi.Void> value, | |
| ); | |
| /// X509_ATTRIBUTE_create_by_NID returns a newly-allocated `X509_ATTRIBUTE` of | |
| /// type `nid`, or NULL on error. The value is determined as in | |
| /// `X509_ATTRIBUTE_set1_data`. | |
| /// | |
| /// If `attr` is non-NULL, the resulting `X509_ATTRIBUTE` is also written to | |
| /// `*attr`. If `*attr` was non-NULL when the function was called, `*attr` is | |
| /// reused instead of creating a new object. | |
| /// | |
| /// WARNING: The interpretation of `attrtype`, `data`, and `len` is complex and | |
| /// error-prone. See `X509_ATTRIBUTE_set1_data` for details. | |
| /// | |
| /// WARNING: The object reuse form is deprecated and may be removed in the | |
| /// future. It also currently incorrectly appends to the reused object's value | |
| /// set rather than overwriting it. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_create_by_NID') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_create_by_NID( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>> attr, | |
| int nid, | |
| int attrtype, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// X509_ATTRIBUTE_create_by_OBJ behaves like `X509_ATTRIBUTE_create_by_NID` | |
| /// except the attribute's type is determined by `obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_create_by_OBJ') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_create_by_OBJ( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>> attr, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int attrtype, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// X509_ATTRIBUTE_create_by_txt behaves like `X509_ATTRIBUTE_create_by_NID` | |
| /// except the attribute's type is determined by calling `OBJ_txt2obj` with | |
| /// `attrname`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_create_by_txt') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_create_by_txt( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>> attr, | |
| ffi.Pointer<ffi.Char> attrname, | |
| int type, | |
| ffi.Pointer<ffi.UnsignedChar> bytes, | |
| int len, | |
| ); | |
| /// X509_ATTRIBUTE_dup returns a newly-allocated copy of `attr`, or NULL on | |
| /// error. This function works by serializing the structure, so if `attr` is | |
| /// incomplete, it may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_ATTRIBUTE> Function(ffi.Pointer<X509_ATTRIBUTE>)>( | |
| symbol: 'bssl_dart_X509_ATTRIBUTE_dup', | |
| ) | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_dup( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ); | |
| /// X509_ATTRIBUTE_free releases memory associated with `attr`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_ATTRIBUTE>)>( | |
| symbol: 'bssl_dart_X509_ATTRIBUTE_free', | |
| ) | |
| external void X509_ATTRIBUTE_free( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ); | |
| /// X509_ATTRIBUTE_get0_data returns the `idx`th value of `attr` in a | |
| /// type-specific representation to `attrtype`, or NULL if out of bounds or the | |
| /// type does not match. `attrtype` is one of the type values in `ASN1_TYPE`. On | |
| /// match, the return value uses the same representation as `ASN1_TYPE_set0`. See | |
| /// `ASN1_TYPE` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_get0_data') | |
| external ffi.Pointer<ffi.Void> X509_ATTRIBUTE_get0_data( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| int idx, | |
| int attrtype, | |
| ffi.Pointer<ffi.Void> unused, | |
| ); | |
| /// X509_ATTRIBUTE_get0_object returns the type of `attr`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Pointer<X509_ATTRIBUTE>)>( | |
| symbol: 'bssl_dart_X509_ATTRIBUTE_get0_object', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> X509_ATTRIBUTE_get0_object( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ); | |
| /// X509_ATTRIBUTE_get0_type returns the `idx`th value in `attr`, or NULL if out | |
| /// of bounds. Note this function returns one of `attr`'s values, not the type. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TYPE> Function(ffi.Pointer<X509_ATTRIBUTE>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_get0_type') | |
| external ffi.Pointer<ASN1_TYPE> X509_ATTRIBUTE_get0_type( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| int idx, | |
| ); | |
| /// X509_ATTRIBUTE_new returns a newly-allocated, empty `X509_ATTRIBUTE` object, | |
| /// or NULL on error. `X509_ATTRIBUTE_set1_*` may be used to finish initializing | |
| /// it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_ATTRIBUTE> Function()>( | |
| symbol: 'bssl_dart_X509_ATTRIBUTE_new', | |
| ) | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_ATTRIBUTE_new(); | |
| /// X509_ATTRIBUTE_set1_data appends a value to `attr`'s value set and returns | |
| /// one on success or zero on error. The value is determined as follows: | |
| /// | |
| /// If `attrtype` is zero, this function returns one and does nothing. This form | |
| /// may be used when calling `X509_ATTRIBUTE_create_by_*` to create an attribute | |
| /// with an empty value set. Such attributes are invalid, but OpenSSL supports | |
| /// creating them. | |
| /// | |
| /// Otherwise, if `attrtype` is a `MBSTRING_*` constant, the value is an ASN.1 | |
| /// string. The string is determined by decoding `len` bytes from `data` in the | |
| /// encoding specified by `attrtype`, and then re-encoding it in a form | |
| /// appropriate for `attr`'s type. If `len` is -1, `strlen(data)` is used | |
| /// instead. See `ASN1_STRING_set_by_NID` for details. | |
| /// | |
| /// Otherwise, if `len` is not -1, the value is an ASN.1 string. `attrtype` is an | |
| /// `ASN1_STRING` type value and the `len` bytes from `data` are copied as the | |
| /// type-specific representation of `ASN1_STRING`. See `ASN1_STRING` for details. | |
| /// | |
| /// Otherwise, if `len` is -1, the value is constructed by passing `attrtype` and | |
| /// `data` to `ASN1_TYPE_set1`. That is, `attrtype` is an `ASN1_TYPE` type value, | |
| /// and `data` is cast to the corresponding pointer type. | |
| /// | |
| /// WARNING: Despite the name, this function appends to `attr`'s value set, | |
| /// rather than overwriting it. To overwrite the value set, create a new | |
| /// `X509_ATTRIBUTE` with `X509_ATTRIBUTE_new`. | |
| /// | |
| /// WARNING: If using the `MBSTRING_*` form, pass a length rather than relying on | |
| /// `strlen`. In particular, `strlen` will not behave correctly if the input is | |
| /// `MBSTRING_BMP` or `MBSTRING_UNIV`. | |
| /// | |
| /// WARNING: This function currently misinterprets `V_ASN1_OTHER` as an | |
| /// `MBSTRING_*` constant. This matches OpenSSL but means it is impossible to | |
| /// construct a value with a non-universal tag. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_set1_data') | |
| external int X509_ATTRIBUTE_set1_data( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| int attrtype, | |
| ffi.Pointer<ffi.Void> data, | |
| int len, | |
| ); | |
| /// X509_ATTRIBUTE_set1_object sets `attr`'s type to `obj`. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_ATTRIBUTE>, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_X509_ATTRIBUTE_set1_object') | |
| external int X509_ATTRIBUTE_set1_object( | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// X509_CRL_add0_revoked adds `rev` to `crl`. On success, it takes ownership of | |
| /// `rev` and returns one. On error, it returns zero. If this function fails, the | |
| /// caller retains ownership of `rev` and must release it when done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_CRL_add0_revoked', | |
| ) | |
| external int X509_CRL_add0_revoked( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<X509_REVOKED> rev, | |
| ); | |
| /// X509_CRL_add1_ext_i2d behaves like `X509V3_add1_i2d` but adds the extension | |
| /// to `x`'s extension list. | |
| /// | |
| /// WARNING: This function may return zero or -1 on error. The caller must also | |
| /// ensure `value`'s type matches `nid`. See the documentation for | |
| /// `X509V3_add1_i2d` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_add1_ext_i2d') | |
| external int X509_CRL_add1_ext_i2d( | |
| ffi.Pointer<X509_CRL> x, | |
| int nid, | |
| ffi.Pointer<ffi.Void> value, | |
| int crit, | |
| int flags, | |
| ); | |
| /// X509_CRL_add_ext adds a copy of `ex` to `x`. It returns one on success and | |
| /// zero on failure. The caller retains ownership of `ex` and can release it | |
| /// independently of `x`. | |
| /// | |
| /// The new extension is inserted at index `loc`, shifting extensions to the | |
| /// right. If `loc` is -1 or out of bounds, the new extension is appended to the | |
| /// list. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_EXTENSION>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_CRL_add_ext') | |
| external int X509_CRL_add_ext( | |
| ffi.Pointer<X509_CRL> x, | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| int loc, | |
| ); | |
| /// X509_CRL_cmp behaves like `X509_NAME_cmp`, but compares `a` and `b`'s | |
| /// issuer names. | |
| /// | |
| /// WARNING: This function is misnamed. It does not compare other parts of the | |
| /// CRL, only the issuer fields using `X509_NAME_cmp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_cmp', | |
| ) | |
| external int X509_CRL_cmp( | |
| ffi.Pointer<X509_CRL> a, | |
| ffi.Pointer<X509_CRL> b, | |
| ); | |
| /// X509_CRL_delete_ext removes the extension in `x` at index `loc` and returns | |
| /// the removed extension, or NULL if `loc` was out of bounds. If non-NULL, the | |
| /// caller must release the result with `X509_EXTENSION_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_CRL>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_CRL_delete_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509_CRL_delete_ext( | |
| ffi.Pointer<X509_CRL> x, | |
| int loc, | |
| ); | |
| /// X509_CRL_digest hashes `crl`'s DER encoding with `md` and writes the result | |
| /// to `out`. `EVP_MD_CTX_size` bytes are written, which is at most | |
| /// `EVP_MAX_MD_SIZE`. If `out_len` is not NULL, `*out_len` is set to the number | |
| /// of bytes written. This function returns one on success and zero on error. | |
| /// Note this digest covers the entire CRL, not just the signed portion. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_digest') | |
| external int X509_CRL_digest( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// X509_CRL_dup returns a newly-allocated copy of `crl`, or NULL on error. This | |
| /// function works by serializing the structure, so if `crl` is incomplete, it | |
| /// may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_CRL> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_dup', | |
| ) | |
| external ffi.Pointer<X509_CRL> X509_CRL_dup( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_dup_ref adds one to the reference count of `crl` and returns the | |
| /// same. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_CRL> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_dup_ref', | |
| ) | |
| external ffi.Pointer<X509_CRL> X509_CRL_dup_ref( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_free decrements `crl`'s reference count and, if zero, releases | |
| /// memory associated with `crl`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_free', | |
| ) | |
| external void X509_CRL_free( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get0_by_cert behaves like `X509_CRL_get0_by_serial`, except it looks | |
| /// for the entry that matches `x509`. | |
| /// | |
| /// TODO(crbug.com/42290473): Ideally `crl` would be const. It is broadly | |
| /// thread-safe, but changes the order of entries in `crl`. It cannot be called | |
| /// concurrently with `i2d_X509_CRL`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ffi.Pointer<X509>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_get0_by_cert') | |
| external int X509_CRL_get0_by_cert( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>> out, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_CRL_get0_by_serial finds the entry in `crl` whose serial number is | |
| /// `serial`. If found, it sets `*out` to the entry and returns one. If not | |
| /// found, it returns zero. | |
| /// | |
| /// On success, `*out` continues to be owned by `crl`. It is an error to free or | |
| /// otherwise modify `*out`. | |
| /// | |
| /// TODO(crbug.com/42290473): Ideally `crl` would be const. It is broadly | |
| /// thread-safe, but changes the order of entries in `crl`. It cannot be called | |
| /// concurrently with `i2d_X509_CRL`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_get0_by_serial') | |
| external int X509_CRL_get0_by_serial( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>> out, | |
| ffi.Pointer<ASN1_INTEGER> serial, | |
| ); | |
| /// X509_CRL_get0_extensions returns `crl`'s extension list, or NULL if `crl` | |
| /// omits it. A CRL can have extensions on individual entries, which is | |
| /// `X509_REVOKED_get0_extensions`, or on the overall CRL, which is this | |
| /// function. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_EXTENSION> Function(ffi.Pointer<X509_CRL>) | |
| >(symbol: 'bssl_dart_X509_CRL_get0_extensions') | |
| external ffi.Pointer<stack_st_X509_EXTENSION> X509_CRL_get0_extensions( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get0_lastUpdate returns `crl`'s thisUpdate time. The OpenSSL API | |
| /// refers to this field as lastUpdate. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get0_lastUpdate', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_CRL_get0_lastUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get0_nextUpdate returns `crl`'s nextUpdate time, or NULL if `crl` | |
| /// has none. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get0_nextUpdate', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_CRL_get0_nextUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get0_signature sets `*out_sig` and `*out_alg` to the signature and | |
| /// signature algorithm of `crl`, respectively. Either output pointer may be NULL | |
| /// to ignore the value. | |
| /// | |
| /// This function outputs the outer signature algorithm, not the one in the | |
| /// TBSCertList. CRLs with mismatched signature algorithms will successfully | |
| /// parse, but they will be rejected when verifying. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_get0_signature') | |
| external void X509_CRL_get0_signature( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out_sig, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ); | |
| /// X509_CRL_get_REVOKED returns the list of revoked certificates in `crl`, or | |
| /// NULL if `crl` omits it. | |
| /// | |
| /// TODO(davidben): This function was originally a macro, without clear const | |
| /// semantics. It should take a const input and give const output, but the latter | |
| /// would break existing callers. For now, we match upstream. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509_REVOKED> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_REVOKED', | |
| ) | |
| external ffi.Pointer<stack_st_X509_REVOKED> X509_CRL_get_REVOKED( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get_ext returns the extension in `x` at index `loc`, or NULL if | |
| /// `loc` is out of bounds. This function returns a non-const pointer for OpenSSL | |
| /// compatibility, but callers should not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_CRL>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_CRL_get_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509_CRL_get_ext( | |
| ffi.Pointer<X509_CRL> x, | |
| int loc, | |
| ); | |
| /// X509_CRL_get_ext_by_NID behaves like `X509v3_get_ext_by_NID` but searches for | |
| /// extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_CRL_get_ext_by_NID', | |
| ) | |
| external int X509_CRL_get_ext_by_NID( | |
| ffi.Pointer<X509_CRL> x, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509_CRL_get_ext_by_OBJ behaves like `X509v3_get_ext_by_OBJ` but searches for | |
| /// extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<ASN1_OBJECT>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_CRL_get_ext_by_OBJ') | |
| external int X509_CRL_get_ext_by_OBJ( | |
| ffi.Pointer<X509_CRL> x, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509_CRL_get_ext_by_critical behaves like `X509v3_get_ext_by_critical` but | |
| /// searches for extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_CRL_get_ext_by_critical', | |
| ) | |
| external int X509_CRL_get_ext_by_critical( | |
| ffi.Pointer<X509_CRL> x, | |
| int crit, | |
| int lastpos, | |
| ); | |
| /// X509_CRL_get_ext_count returns the number of extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_ext_count', | |
| ) | |
| external int X509_CRL_get_ext_count( | |
| ffi.Pointer<X509_CRL> x, | |
| ); | |
| /// X509_CRL_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the | |
| /// extension in `crl`'s extension list. | |
| /// | |
| /// WARNING: This function is difficult to use correctly. See the documentation | |
| /// for `X509V3_get_d2i` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_get_ext_d2i') | |
| external ffi.Pointer<ffi.Void> X509_CRL_get_ext_d2i( | |
| ffi.Pointer<X509_CRL> crl, | |
| int nid, | |
| ffi.Pointer<ffi.Int> out_critical, | |
| ffi.Pointer<ffi.Int> out_idx, | |
| ); | |
| /// X509_CRL_get_issuer returns `crl`'s issuer name. Note this function is not | |
| /// const-correct for legacy reasons. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_issuer', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_CRL_get_issuer( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get_lastUpdate returns a mutable pointer to `crl`'s thisUpdate time. | |
| /// The OpenSSL API refers to this field as lastUpdate. | |
| /// | |
| /// Use `X509_CRL_get0_lastUpdate` or `X509_CRL_set1_lastUpdate` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_lastUpdate', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_CRL_get_lastUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get_nextUpdate returns a mutable pointer to `crl`'s nextUpdate time, | |
| /// or NULL if `crl` has none. Use `X509_CRL_get0_nextUpdate` or | |
| /// `X509_CRL_set1_nextUpdate` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_nextUpdate', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_CRL_get_nextUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get_signature_nid returns the NID corresponding to `crl`'s signature | |
| /// algorithm, or `NID_undef` if the signature algorithm does not correspond to | |
| /// a known NID. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_signature_nid', | |
| ) | |
| external int X509_CRL_get_signature_nid( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_get_version returns the numerical value of `crl`'s version, which | |
| /// will be one of the `X509_CRL_VERSION_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_get_version', | |
| ) | |
| external int X509_CRL_get_version( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_match compares `a` and `b` and returns zero if they are equal, a | |
| /// negative number if `b` sorts after `a` and a negative number if `a` sorts | |
| /// after `b`. The sort order implemented by this function is arbitrary and does | |
| /// not reflect properties of the CRL such as expiry. Applications should not | |
| /// rely on the order itself. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/355): This function works by comparing a | |
| /// cached hash of the encoded CRL. This cached hash is computed when the CRL is | |
| /// parsed, but not when mutating or issuing CRLs. This function should only be | |
| /// used with `X509_CRL` objects that were parsed from bytes and never mutated. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_match', | |
| ) | |
| external int X509_CRL_match( | |
| ffi.Pointer<X509_CRL> a, | |
| ffi.Pointer<X509_CRL> b, | |
| ); | |
| /// X509_CRL_new returns a newly-allocated, empty `X509_CRL` object, or NULL on | |
| /// error. This object may be filled in and then signed to construct a CRL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_CRL> Function()>(symbol: 'bssl_dart_X509_CRL_new') | |
| external ffi.Pointer<X509_CRL> X509_CRL_new(); | |
| /// X509_CRL_print writes a human-readable representation of `x` to `bp`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_print', | |
| ) | |
| external int X509_CRL_print( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_CRL> x, | |
| ); | |
| /// X509_CRL_print_fp behaves like `X509_CRL_print` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_print_fp', | |
| ) | |
| external int X509_CRL_print_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_CRL> x, | |
| ); | |
| /// X509_CRL_set1_lastUpdate sets `crl`'s thisUpdate time to `tm`. It returns one | |
| /// on success and zero on error. The OpenSSL API refers to this field as | |
| /// lastUpdate. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_CRL_set1_lastUpdate', | |
| ) | |
| external int X509_CRL_set1_lastUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_CRL_set1_nextUpdate sets `crl`'s nextUpdate time to `tm`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_CRL_set1_nextUpdate', | |
| ) | |
| external int X509_CRL_set1_nextUpdate( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_CRL_set1_signature_algo sets `crl`'s signature algorithm to `algo` and | |
| /// returns one on success or zero on error. It updates both the signature field | |
| /// of the TBSCertList structure, and the signatureAlgorithm field of the CRL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_CRL_set1_signature_algo', | |
| ) | |
| external int X509_CRL_set1_signature_algo( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<X509_ALGOR> algo, | |
| ); | |
| /// X509_CRL_set1_signature_value sets `crl`'s signature to a copy of the | |
| /// `sig_len` bytes pointed by `sig`. It returns one on success and zero on | |
| /// error. | |
| /// | |
| /// Due to a specification error, X.509 CRLs store signatures in ASN.1 BIT | |
| /// STRINGs, but signature algorithms return byte strings rather than bit | |
| /// strings. This function creates a BIT STRING containing a whole number of | |
| /// bytes, with the bit order matching the DER encoding. This matches the | |
| /// encoding used by all X.509 signature algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_X509_CRL_set1_signature_value') | |
| external int X509_CRL_set1_signature_value( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ); | |
| /// X509_CRL_set_issuer_name sets `crl`'s issuer to a copy of `name`. It returns | |
| /// one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_CRL_set_issuer_name', | |
| ) | |
| external int X509_CRL_set_issuer_name( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_CRL_set_version sets `crl`'s version to `version`, which should be one | |
| /// of the `X509_CRL_VERSION_*` constants. It returns one on success and zero on | |
| /// error. | |
| /// | |
| /// If unsure, use `X509_CRL_VERSION_2`. Note that, unlike certificates, CRL | |
| /// versions are only defined up to v2. Callers should not use `X509_VERSION_3`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Long)>( | |
| symbol: 'bssl_dart_X509_CRL_set_version', | |
| ) | |
| external int X509_CRL_set_version( | |
| ffi.Pointer<X509_CRL> crl, | |
| int version, | |
| ); | |
| /// X509_CRL_sign signs `crl` with `pkey` and replaces the signature algorithm | |
| /// and signature fields. It returns the length of the signature on success and | |
| /// zero on error. This function uses digest algorithm `md`, or `pkey`'s default | |
| /// if NULL. Other signing parameters use `pkey`'s defaults. To customize them, | |
| /// use `X509_CRL_sign_ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_CRL_sign') | |
| external int X509_CRL_sign( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// X509_CRL_sign_ctx signs `crl` with `ctx` and replaces the signature algorithm | |
| /// and signature fields. It returns the length of the signature on success and | |
| /// zero on error. The signature algorithm and parameters come from `ctx`, which | |
| /// must have been initialized with `EVP_DigestSignInit`. The caller should | |
| /// configure the corresponding `EVP_PKEY_CTX` before calling this function. | |
| /// | |
| /// On success or failure, this function mutates `ctx` and resets it to the empty | |
| /// state. Caller should not rely on its contents after the function returns. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_X509_CRL_sign_ctx', | |
| ) | |
| external int X509_CRL_sign_ctx( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// X509_CRL_sort sorts the entries in `crl` by serial number. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_sort', | |
| ) | |
| external int X509_CRL_sort( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_up_ref adds one to the reference count of `crl` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_CRL_up_ref', | |
| ) | |
| external int X509_CRL_up_ref( | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_CRL_verify checks that `crl` has a valid signature by `pkey`. It returns | |
| /// one if the signature is valid and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_CRL_verify', | |
| ) | |
| external int X509_CRL_verify( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_EXTENSION_create_by_NID creates a new `X509_EXTENSION` with type `nid`, | |
| /// value `data`, and critical bit `crit`. It returns an `X509_EXTENSION` on | |
| /// success, and NULL on error. `nid` should be a `NID_*` constant. | |
| /// | |
| /// If `ex` and `*ex` are both non-NULL, `*ex` is used to hold the result, | |
| /// otherwise a new object is allocated. If `ex` is non-NULL and `*ex` is NULL, | |
| /// the function sets `*ex` to point to the newly allocated result, in addition | |
| /// to returning the result. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_EXTENSION_create_by_NID') | |
| external ffi.Pointer<X509_EXTENSION> X509_EXTENSION_create_by_NID( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>> ex, | |
| int nid, | |
| int crit, | |
| ffi.Pointer<ASN1_OCTET_STRING> data, | |
| ); | |
| /// X509_EXTENSION_create_by_OBJ behaves like `X509_EXTENSION_create_by_NID`, but | |
| /// the extension type is determined by an `ASN1_OBJECT`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_EXTENSION_create_by_OBJ') | |
| external ffi.Pointer<X509_EXTENSION> X509_EXTENSION_create_by_OBJ( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>> ex, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int crit, | |
| ffi.Pointer<ASN1_OCTET_STRING> data, | |
| ); | |
| /// X509_EXTENSION_dup returns a newly-allocated copy of `ex`, or NULL on error. | |
| /// This function works by serializing the structure, so if `ex` is incomplete, | |
| /// it may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509_EXTENSION_dup', | |
| ) | |
| external ffi.Pointer<X509_EXTENSION> X509_EXTENSION_dup( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ); | |
| /// X509_EXTENSION_free releases memory associated with `ex`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509_EXTENSION_free', | |
| ) | |
| external void X509_EXTENSION_free( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ); | |
| /// X509_EXTENSION_get_critical returns one if `ex` is critical and zero | |
| /// otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509_EXTENSION_get_critical', | |
| ) | |
| external int X509_EXTENSION_get_critical( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ); | |
| /// X509_EXTENSION_get_data returns `ne`'s extension value. This function returns | |
| /// a non-const pointer for OpenSSL compatibility, but callers should not mutate | |
| /// the result. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<X509_EXTENSION>) | |
| >(symbol: 'bssl_dart_X509_EXTENSION_get_data') | |
| external ffi.Pointer<ASN1_OCTET_STRING> X509_EXTENSION_get_data( | |
| ffi.Pointer<X509_EXTENSION> ne, | |
| ); | |
| /// X509_EXTENSION_get_object returns `ex`'s extension type. This function | |
| /// returns a non-const pointer for OpenSSL compatibility, but callers should not | |
| /// mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509_EXTENSION_get_object', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> X509_EXTENSION_get_object( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ); | |
| /// X509_EXTENSION_new returns a newly-allocated, empty `X509_EXTENSION` object | |
| /// or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_EXTENSION> Function()>( | |
| symbol: 'bssl_dart_X509_EXTENSION_new', | |
| ) | |
| external ffi.Pointer<X509_EXTENSION> X509_EXTENSION_new(); | |
| /// X509_EXTENSION_set_critical sets `ex` to critical if `crit` is non-zero and | |
| /// to non-critical if `crit` is zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_EXTENSION>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_EXTENSION_set_critical', | |
| ) | |
| external int X509_EXTENSION_set_critical( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| int crit, | |
| ); | |
| /// X509_EXTENSION_set_data sets `ex`'s extension value to a copy of `data`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_EXTENSION>, ffi.Pointer<ASN1_OCTET_STRING>) | |
| >(symbol: 'bssl_dart_X509_EXTENSION_set_data') | |
| external int X509_EXTENSION_set_data( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ffi.Pointer<ASN1_OCTET_STRING> data, | |
| ); | |
| /// X509_EXTENSION_set_object sets `ex`'s extension type to `obj`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_EXTENSION>, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_X509_EXTENSION_set_object') | |
| external int X509_EXTENSION_set_object( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// X509_INFO_free releases memory associated with `info`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_INFO>)>( | |
| symbol: 'bssl_dart_X509_INFO_free', | |
| ) | |
| external void X509_INFO_free( | |
| ffi.Pointer<X509_INFO> info, | |
| ); | |
| /// X509_LOOKUP_add_dir configures `lookup` to load CRLs and trusted certificates | |
| /// from the directories in `path`. It returns one on success and zero on error. | |
| /// `lookup` must have been constructed with `X509_LOOKUP_hash_dir`. | |
| /// | |
| /// WARNING: `path` is interpreted as a colon-separated (semicolon-separated on | |
| /// Windows) list of paths. It is not possible to configure a path containing the | |
| /// separator character. https://crbug.com/boringssl/691 tracks removing this | |
| /// behavior. | |
| /// | |
| /// `type` should be one of the `X509_FILETYPE_*` constants and determines the | |
| /// format of the files. If `type` is `X509_FILETYPE_DEFAULT`, `path` is ignored | |
| /// and some default system path is used with `X509_FILETYPE_PEM`. See also | |
| /// `X509_STORE_set_default_paths`. | |
| /// | |
| /// Trusted certificates should be named HASH.N and CRLs should be | |
| /// named HASH.rN. HASH is `X509_NAME_hash` of the certificate subject and CRL | |
| /// issuer, respectively, in hexadecimal. N is in decimal and counts hash | |
| /// collisions consecutively, starting from zero. For example, "002c0b4f.0" and | |
| /// "002c0b4f.r0". | |
| /// | |
| /// WARNING: Objects from `path` are loaded on demand, but cached in memory on | |
| /// the `X509_STORE`. If a CA is removed from the directory, existing | |
| /// `X509_STORE`s will continue to trust it. Cache entries are not evicted for | |
| /// the lifetime of the `X509_STORE`. | |
| /// | |
| /// WARNING: This mechanism is also not well-suited for CRL updates. | |
| /// `X509_STORE`s rely on this cache and never load the same CRL file twice. CRL | |
| /// updates must use a new file, with an incremented suffix, to be reflected in | |
| /// existing `X509_STORE`s. However, this means each CRL update will use | |
| /// additional storage and memory. Instead, configure inputs that vary per | |
| /// verification, such as CRLs, on each `X509_STORE_CTX` separately, using | |
| /// functions like `X509_STORE_CTX_set0_crl`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_LOOKUP>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_LOOKUP_add_dir') | |
| external int X509_LOOKUP_add_dir( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| ffi.Pointer<ffi.Char> path, | |
| int type, | |
| ); | |
| /// X509_LOOKUP_ctrl implements commands on `lookup`. `cmd` specifies the | |
| /// command. The other arguments specify the operation in a command-specific way. | |
| /// Use `X509_LOOKUP_load_file` or `X509_LOOKUP_add_dir` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_LOOKUP>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Long, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_LOOKUP_ctrl') | |
| external int X509_LOOKUP_ctrl( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| int cmd, | |
| ffi.Pointer<ffi.Char> argc, | |
| int argl, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> ret, | |
| ); | |
| /// X509_LOOKUP_file creates `X509_LOOKUP`s that may be used with | |
| /// `X509_LOOKUP_load_file`. | |
| /// | |
| /// Although this is modeled as an `X509_LOOKUP`, this function is redundant. It | |
| /// has the same effect as loading a certificate or CRL from the filesystem, in | |
| /// the caller's desired format, and then adding it with `X509_STORE_add_cert` | |
| /// and `X509_STORE_add_crl`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_LOOKUP_METHOD> Function()>( | |
| symbol: 'bssl_dart_X509_LOOKUP_file', | |
| ) | |
| external ffi.Pointer<X509_LOOKUP_METHOD> X509_LOOKUP_file(); | |
| /// X509_LOOKUP_free releases memory associated with `ctx`. This function should | |
| /// never be used outside the library. No function in the public API hands | |
| /// ownership of an `X509_LOOKUP` to the caller. | |
| /// | |
| /// TODO(davidben): Unexport this function after rust-openssl is fixed to no | |
| /// longer call it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_LOOKUP>)>( | |
| symbol: 'bssl_dart_X509_LOOKUP_free', | |
| ) | |
| external void X509_LOOKUP_free( | |
| ffi.Pointer<X509_LOOKUP> ctx, | |
| ); | |
| /// X509_LOOKUP_hash_dir creates `X509_LOOKUP`s that may be used with | |
| /// `X509_LOOKUP_add_dir`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_LOOKUP_METHOD> Function()>( | |
| symbol: 'bssl_dart_X509_LOOKUP_hash_dir', | |
| ) | |
| external ffi.Pointer<X509_LOOKUP_METHOD> X509_LOOKUP_hash_dir(); | |
| /// X509_LOOKUP_load_file calls `X509_load_cert_crl_file`. `lookup` must have | |
| /// been constructed with `X509_LOOKUP_file`. | |
| /// | |
| /// If `type` is `X509_FILETYPE_DEFAULT`, it ignores `file` and instead uses some | |
| /// default system path with `X509_FILETYPE_PEM`. See also | |
| /// `X509_STORE_set_default_paths`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_LOOKUP>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_LOOKUP_load_file') | |
| external int X509_LOOKUP_load_file( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| ffi.Pointer<ffi.Char> file, | |
| int type, | |
| ); | |
| /// X509_NAME_ENTRY_create_by_NID behaves like `X509_NAME_ENTRY_create_by_OBJ` | |
| /// except the attribute type is `nid`, which should be one of the `NID_*` | |
| /// constants. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_create_by_NID') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_ENTRY_create_by_NID( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>> out, | |
| int nid, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| ); | |
| /// X509_NAME_ENTRY_create_by_OBJ creates a new `X509_NAME_ENTRY` with attribute | |
| /// type `obj`. The attribute value is determined from `type`, `bytes`, and `len` | |
| /// as in `X509_NAME_ENTRY_set_data`. It returns the `X509_NAME_ENTRY` on success | |
| /// and NULL on error. | |
| /// | |
| /// If `out` is non-NULL and `*out` is NULL, it additionally sets `*out` to the | |
| /// result on success. If both `out` and `*out` are non-NULL, it updates the | |
| /// object at `*out` instead of allocating a new one. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_create_by_OBJ') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_ENTRY_create_by_OBJ( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>> out, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| ); | |
| /// X509_NAME_ENTRY_create_by_txt behaves like `X509_NAME_ENTRY_create_by_OBJ` | |
| /// except the attribute type is `field`, which is passed to `OBJ_txt2obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_create_by_txt') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_ENTRY_create_by_txt( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>> out, | |
| ffi.Pointer<ffi.Char> field, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| ); | |
| /// X509_NAME_ENTRY_dup returns a newly-allocated copy of `entry`, or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function(ffi.Pointer<X509_NAME_ENTRY>) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_dup') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_ENTRY_dup( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ); | |
| /// X509_NAME_ENTRY_free releases memory associated with `entry`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_NAME_ENTRY>)>( | |
| symbol: 'bssl_dart_X509_NAME_ENTRY_free', | |
| ) | |
| external void X509_NAME_ENTRY_free( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ); | |
| /// X509_NAME_ENTRY_get_data returns `entry`'s attribute value, represented as an | |
| /// `ASN1_STRING`. This value may have any ASN.1 type, so callers must check the | |
| /// type before interpreting the contents. This function returns a non-const | |
| /// pointer for OpenSSL compatibility, but callers should not mutate the result. | |
| /// Doing so will break internal invariants in the library. | |
| /// | |
| /// See `ASN1_STRING` for how values are represented in this library. Where a | |
| /// specific `ASN1_STRING` representation exists, that representation is used. | |
| /// Otherwise, the `V_ASN1_OTHER` representation is used. Note that NULL, OBJECT | |
| /// IDENTIFIER, and BOOLEAN attribute values are represented as `V_ASN1_OTHER`, | |
| /// because their usual representation in this library is not | |
| /// `ASN1_STRING`-compatible. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_STRING> Function(ffi.Pointer<X509_NAME_ENTRY>)>( | |
| symbol: 'bssl_dart_X509_NAME_ENTRY_get_data', | |
| ) | |
| external ffi.Pointer<ASN1_STRING> X509_NAME_ENTRY_get_data( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ); | |
| /// X509_NAME_ENTRY_get_object returns `entry`'s attribute type. This function | |
| /// returns a non-const pointer for OpenSSL compatibility, but callers should not | |
| /// mutate the result. Doing so will break internal invariants in the library. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OBJECT> Function(ffi.Pointer<X509_NAME_ENTRY>)>( | |
| symbol: 'bssl_dart_X509_NAME_ENTRY_get_object', | |
| ) | |
| external ffi.Pointer<ASN1_OBJECT> X509_NAME_ENTRY_get_object( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ); | |
| /// X509_NAME_ENTRY_new returns a new, empty `X509_NAME_ENTRY`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME_ENTRY> Function()>( | |
| symbol: 'bssl_dart_X509_NAME_ENTRY_new', | |
| ) | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_ENTRY_new(); | |
| /// X509_NAME_ENTRY_set returns the zero-based index of the RDN which contains | |
| /// `entry`. Consecutive entries with the same index are part of the same RDN. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_NAME_ENTRY>)>( | |
| symbol: 'bssl_dart_X509_NAME_ENTRY_set', | |
| ) | |
| external int X509_NAME_ENTRY_set( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ); | |
| /// X509_NAME_ENTRY_set_data sets `entry`'s value to `len` bytes from `bytes`. It | |
| /// returns one on success and zero on error. If `len` is -1, `bytes` must be a | |
| /// NUL-terminated C string and the length is determined by `strlen`. `bytes` is | |
| /// converted to an ASN.1 type as follows: | |
| /// | |
| /// If `type` is a `MBSTRING_*` constant, the value is an ASN.1 string. The | |
| /// string is determined by decoding `bytes` in the encoding specified by `type`, | |
| /// and then re-encoding it in a form appropriate for `entry`'s attribute type. | |
| /// See `ASN1_STRING_set_by_NID` for details. | |
| /// | |
| /// Otherwise, the value is an `ASN1_STRING` with type `type` and value `bytes`. | |
| /// See `ASN1_STRING` for how to format ASN.1 types as an `ASN1_STRING`. If | |
| /// `type` is `V_ASN1_UNDEF` the previous `ASN1_STRING` type is reused. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_set_data') | |
| external int X509_NAME_ENTRY_set_data( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| ); | |
| /// X509_NAME_ENTRY_set_object sets `entry`'s attribute type to `obj`. It returns | |
| /// one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_NAME_ENTRY>, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_X509_NAME_ENTRY_set_object') | |
| external int X509_NAME_ENTRY_set_object( | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// X509_NAME_add_entry adds a copy of `entry` to `name` and returns one on | |
| /// success or zero on error. If `loc` is -1, the entry is appended to `name`. | |
| /// Otherwise, it is inserted at index `loc`. If `set` is -1, the entry is added | |
| /// to the previous entry's RDN. If it is 0, the entry becomes a singleton RDN. | |
| /// If 1, it is added to next entry's RDN. | |
| /// | |
| /// This function will internally update RDN indices (see `X509_NAME_ENTRY_set`) | |
| /// so they continue to be consecutive. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_add_entry') | |
| external int X509_NAME_add_entry( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<X509_NAME_ENTRY> entry, | |
| int loc, | |
| int set, | |
| ); | |
| /// X509_NAME_add_entry_by_NID behaves like `X509_NAME_add_entry_by_OBJ` but sets | |
| /// the entry's attribute type to `nid`, which should be one of the `NID_*` | |
| /// constants. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_add_entry_by_NID') | |
| external int X509_NAME_add_entry_by_NID( | |
| ffi.Pointer<X509_NAME> name, | |
| int nid, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| int loc, | |
| int set, | |
| ); | |
| /// X509_NAME_add_entry_by_OBJ adds a new entry to `name` and returns one on | |
| /// success or zero on error. The entry's attribute type is `obj`. The entry's | |
| /// attribute value is determined by `type`, `bytes`, and `len`, as in | |
| /// `X509_NAME_ENTRY_set_data`. The entry's position is determined by `loc` and | |
| /// `set` as in `X509_NAME_add_entry`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_add_entry_by_OBJ') | |
| external int X509_NAME_add_entry_by_OBJ( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| int loc, | |
| int set, | |
| ); | |
| /// X509_NAME_add_entry_by_txt behaves like `X509_NAME_add_entry_by_OBJ` but sets | |
| /// the entry's attribute type to `field`, which is passed to `OBJ_txt2obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Uint8>, | |
| ossl_ssize_t, | |
| ffi.Int, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_add_entry_by_txt') | |
| external int X509_NAME_add_entry_by_txt( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ffi.Char> field, | |
| int type, | |
| ffi.Pointer<ffi.Uint8> bytes, | |
| int len, | |
| int loc, | |
| int set, | |
| ); | |
| /// X509_NAME_cmp compares `a` and `b`'s canonicalized forms. It returns zero if | |
| /// they are equal, one if `a` sorts after `b`, -1 if `b` sorts after `a`, and -2 | |
| /// on error. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/355): The -2 return is very inconvenient to | |
| /// pass to a sorting function. Can we make this infallible? In the meantime, | |
| /// prefer to use this function only for equality checks rather than comparisons. | |
| /// Although even the library itself passes this to a sorting function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_NAME>, ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_cmp', | |
| ) | |
| external int X509_NAME_cmp( | |
| ffi.Pointer<X509_NAME> a, | |
| ffi.Pointer<X509_NAME> b, | |
| ); | |
| /// X509_NAME_delete_entry removes and returns the attribute in `name` at index | |
| /// `loc`, or NULL if `loc` is out of range. `loc` is interpreted using | |
| /// `X509_NAME`'s flattened representation. If the attribute is found, the caller | |
| /// is responsible for releasing the result with `X509_NAME_ENTRY_free`. | |
| /// | |
| /// This function will internally update RDN indices (see `X509_NAME_ENTRY_set`) | |
| /// so they continue to be consecutive. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function(ffi.Pointer<X509_NAME>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_NAME_delete_entry') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_delete_entry( | |
| ffi.Pointer<X509_NAME> name, | |
| int loc, | |
| ); | |
| /// X509_NAME_digest hashes `name`'s DER encoding with `md` and writes the result | |
| /// to `out`. `EVP_MD_CTX_size` bytes are written, which is at most | |
| /// `EVP_MAX_MD_SIZE`. If `out_len` is not NULL, `*out_len` is set to the number | |
| /// of bytes written. This function returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_digest') | |
| external int X509_NAME_digest( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// X509_NAME_dup returns a newly-allocated copy of `name`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function(ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_dup', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_NAME_dup( | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_NAME_entry_count returns the number of entries in `name`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_entry_count', | |
| ) | |
| external int X509_NAME_entry_count( | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_NAME_free releases memory associated with `name`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_free', | |
| ) | |
| external void X509_NAME_free( | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_NAME_get0_der marshals `name` as a DER-encoded X.509 Name (RFC 5280). On | |
| /// success, it returns one and sets `*out_der` and `*out_der_len` to a buffer | |
| /// containing the result. Otherwise, it returns zero. `*out_der` is owned by | |
| /// `name` and must not be freed by the caller. It is invalidated after `name` is | |
| /// mutated or freed. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Size>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_get0_der') | |
| external int X509_NAME_get0_der( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_der, | |
| ffi.Pointer<ffi.Size> out_der_len, | |
| ); | |
| /// X509_NAME_get_entry returns the attribute in `name` at index `loc`, or NULL | |
| /// if `loc` is out of range. `loc` is interpreted using `X509_NAME`'s flattened | |
| /// representation. This function returns a non-const pointer for OpenSSL | |
| /// compatibility, but callers should not mutate the result. Doing so will break | |
| /// internal invariants in the library. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME_ENTRY> Function(ffi.Pointer<X509_NAME>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_NAME_get_entry') | |
| external ffi.Pointer<X509_NAME_ENTRY> X509_NAME_get_entry( | |
| ffi.Pointer<X509_NAME> name, | |
| int loc, | |
| ); | |
| /// X509_NAME_get_index_by_NID returns the zero-based index of the first | |
| /// attribute in `name` with type `nid`, or -1 if there is none. `nid` should be | |
| /// one of the `NID_*` constants. If `lastpos` is non-negative, it begins | |
| /// searching at `lastpos+1`. To search all attributes, pass in -1, not zero. | |
| /// | |
| /// Indices from this function refer to `X509_NAME`'s flattened representation. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_NAME>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_NAME_get_index_by_NID', | |
| ) | |
| external int X509_NAME_get_index_by_NID( | |
| ffi.Pointer<X509_NAME> name, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509_NAME_get_index_by_OBJ behaves like `X509_NAME_get_index_by_NID` but | |
| /// looks for attributes with type `obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_NAME>, ffi.Pointer<ASN1_OBJECT>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_NAME_get_index_by_OBJ') | |
| external int X509_NAME_get_index_by_OBJ( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509_NAME_get_text_by_NID behaves like `X509_NAME_get_text_by_OBJ` except it | |
| /// finds an attribute of type `nid`, which should be one of the `NID_*` | |
| /// constants. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_get_text_by_NID') | |
| external int X509_NAME_get_text_by_NID( | |
| ffi.Pointer<X509_NAME> name, | |
| int nid, | |
| ffi.Pointer<ffi.Char> buf, | |
| int len, | |
| ); | |
| /// X509_NAME_get_text_by_OBJ finds the first attribute with type `obj` in | |
| /// `name`. If found, it writes the value's UTF-8 representation to `buf`. | |
| /// followed by a NUL byte, and returns the number of bytes in the output, | |
| /// excluding the NUL byte. This is unlike OpenSSL which returns the raw | |
| /// ASN1_STRING data. The UTF-8 encoding of the `ASN1_STRING` may not contain a 0 | |
| /// codepoint. | |
| /// | |
| /// This function writes at most `len` bytes, including the NUL byte. If `buf` | |
| /// is NULL, it writes nothing and returns the number of bytes in the | |
| /// output, excluding the NUL byte that would be required for the full UTF-8 | |
| /// output. | |
| /// | |
| /// This function may return -1 if an error occurs for any reason, including the | |
| /// value not being a recognized string type, `len` being of insufficient size to | |
| /// hold the full UTF-8 encoding and NUL byte, memory allocation failures, an | |
| /// object with type `obj` not existing in `name`, or if the UTF-8 encoding of | |
| /// the string contains a zero byte. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_get_text_by_OBJ') | |
| external int X509_NAME_get_text_by_OBJ( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ffi.Pointer<ffi.Char> buf, | |
| int len, | |
| ); | |
| /// X509_NAME_hash returns a hash of `name`, or zero on error. This is the new | |
| /// hash used by `X509_LOOKUP_add_dir`. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. It also depends on an OpenSSL-specific | |
| /// canonicalization process. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_hash', | |
| ) | |
| external int X509_NAME_hash( | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_NAME_hash_old returns a hash of `name`, or zero on error. This is the | |
| /// legacy hash used by `X509_LOOKUP_add_dir`, which is still supported for | |
| /// compatibility. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_NAME_hash_old', | |
| ) | |
| external int X509_NAME_hash_old( | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_NAME_new returns a new, empty `X509_NAME`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function()>( | |
| symbol: 'bssl_dart_X509_NAME_new', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_NAME_new(); | |
| /// X509_NAME_oneline writes a human-readable representation to `name` to a | |
| /// buffer as a NUL-terminated C string. | |
| /// | |
| /// If `buf` is NULL, returns a newly-allocated buffer containing the result on | |
| /// success, or NULL on error. The buffer must be released with `OPENSSL_free` | |
| /// when done. | |
| /// | |
| /// If `buf` is non-NULL, at most `size` bytes of output are written to `buf` | |
| /// instead. `size` includes the trailing NUL. The function then returns `buf` on | |
| /// success or NULL on error. If the output does not fit in `size` bytes, the | |
| /// output is silently truncated at an attribute boundary. | |
| /// | |
| /// This function outputs a legacy format that does not correctly handle string | |
| /// encodings and other cases. Prefer `X509_NAME_print_ex` if printing a name for | |
| /// debugging purposes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_oneline') | |
| external ffi.Pointer<ffi.Char> X509_NAME_oneline( | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ffi.Char> buf, | |
| int size, | |
| ); | |
| /// X509_NAME_print prints a human-readable representation of `name` to `bp`. It | |
| /// returns one on success and zero on error. `obase` is ignored. | |
| /// | |
| /// This function outputs a legacy format that does not correctly handle string | |
| /// encodings and other cases. Prefer `X509_NAME_print_ex` if printing a name for | |
| /// debugging purposes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_NAME>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_NAME_print') | |
| external int X509_NAME_print( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_NAME> name, | |
| int obase, | |
| ); | |
| /// X509_NAME_print_ex writes a human-readable representation of `nm` to `out`. | |
| /// Each line of output is indented by `indent` spaces. It returns the number of | |
| /// bytes written on success, and -1 on error. If `out` is NULL, it returns the | |
| /// number of bytes it would have written but does not write anything. `flags` | |
| /// should be some combination of `XN_FLAG_*` and `ASN1_STRFLGS_*` values and | |
| /// determines the output. If unsure, use `XN_FLAG_RFC2253`. | |
| /// | |
| /// If `flags` is `XN_FLAG_COMPAT`, or zero, this function calls | |
| /// `X509_NAME_print` instead. In that case, it returns one on success, rather | |
| /// than the output length. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_print_ex') | |
| external int X509_NAME_print_ex( | |
| ffi.Pointer<BIO> out, | |
| ffi.Pointer<X509_NAME> nm, | |
| int indent, | |
| int flags, | |
| ); | |
| /// X509_NAME_print_ex_fp behaves like `X509_NAME_print_ex` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_NAME_print_ex_fp') | |
| external int X509_NAME_print_ex_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_NAME> nm, | |
| int indent, | |
| int flags, | |
| ); | |
| /// X509_NAME_set makes a copy of `name`. On success, it frees `*xn`, sets `*xn` | |
| /// to the copy, and returns one. Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<X509_NAME>>, ffi.Pointer<X509_NAME>) | |
| >(symbol: 'bssl_dart_X509_NAME_set') | |
| external int X509_NAME_set( | |
| ffi.Pointer<ffi.Pointer<X509_NAME>> xn, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_OBJECT_free releases memory associated with `obj`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_OBJECT_free', | |
| ) | |
| external void X509_OBJECT_free( | |
| ffi.Pointer<X509_OBJECT> obj, | |
| ); | |
| /// X509_OBJECT_free_contents sets `obj` to the empty object, freeing any values | |
| /// that were previously there. | |
| /// | |
| /// TODO(davidben): Unexport this function after rust-openssl is fixed to no | |
| /// longer call it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_OBJECT_free_contents', | |
| ) | |
| external void X509_OBJECT_free_contents( | |
| ffi.Pointer<X509_OBJECT> obj, | |
| ); | |
| /// X509_OBJECT_get0_X509 returns `obj` as a certificate, or NULL if `obj` is not | |
| /// a certificate. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<X509_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_OBJECT_get0_X509', | |
| ) | |
| external ffi.Pointer<X509> X509_OBJECT_get0_X509( | |
| ffi.Pointer<X509_OBJECT> obj, | |
| ); | |
| /// X509_OBJECT_get_type returns the type of `obj`, which will be one of the | |
| /// `X509_LU_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_OBJECT_get_type', | |
| ) | |
| external int X509_OBJECT_get_type( | |
| ffi.Pointer<X509_OBJECT> obj, | |
| ); | |
| /// X509_OBJECT_new returns a newly-allocated, empty `X509_OBJECT` or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_OBJECT> Function()>( | |
| symbol: 'bssl_dart_X509_OBJECT_new', | |
| ) | |
| external ffi.Pointer<X509_OBJECT> X509_OBJECT_new(); | |
| /// X509_PUBKEY_free releases memory associated with `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_PUBKEY>)>( | |
| symbol: 'bssl_dart_X509_PUBKEY_free', | |
| ) | |
| external void X509_PUBKEY_free( | |
| ffi.Pointer<X509_PUBKEY> key, | |
| ); | |
| /// X509_PUBKEY_get behaves like `X509_PUBKEY_get0` but increments the reference | |
| /// count on the `EVP_PKEY`. The caller must release the result with | |
| /// `EVP_PKEY_free` when done. The `EVP_PKEY` is cached in `key`, so callers must | |
| /// not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509_PUBKEY>)>( | |
| symbol: 'bssl_dart_X509_PUBKEY_get', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_PUBKEY_get( | |
| ffi.Pointer<X509_PUBKEY> key, | |
| ); | |
| /// X509_PUBKEY_get0 returns `key` as an `EVP_PKEY`, or NULL if `key` either | |
| /// could not be parsed or is an unrecognized algorithm. The `EVP_PKEY` is cached | |
| /// in `key`, so callers must not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509_PUBKEY>)>( | |
| symbol: 'bssl_dart_X509_PUBKEY_get0', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_PUBKEY_get0( | |
| ffi.Pointer<X509_PUBKEY> key, | |
| ); | |
| /// X509_PUBKEY_get0_param outputs fields of `pub` and returns one. If `out_obj` | |
| /// is not NULL, it sets `*out_obj` to AlgorithmIdentifier's OID. If `out_key` | |
| /// is not NULL, it sets `*out_key` and `*out_key_len` to the encoded public key. | |
| /// If `out_alg` is not NULL, it sets `*out_alg` to the AlgorithmIdentifier. | |
| /// | |
| /// All pointers outputted by this function are internal to `pub` and must not be | |
| /// freed by the caller. Additionally, although some outputs are non-const, | |
| /// callers must not mutate the resulting objects. | |
| /// | |
| /// Note: X.509 SubjectPublicKeyInfo structures store the encoded public key as a | |
| /// BIT STRING. `*out_key` and `*out_key_len` will silently pad the key with zero | |
| /// bits if `pub` did not contain a whole number of bytes. Use | |
| /// `X509_PUBKEY_get0_public_key` to preserve this information. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<X509_PUBKEY>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_PUBKEY_get0_param') | |
| external int X509_PUBKEY_get0_param( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>> out_obj, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out_key, | |
| ffi.Pointer<ffi.Int> out_key_len, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ffi.Pointer<X509_PUBKEY> pub, | |
| ); | |
| /// X509_PUBKEY_get0_public_key returns `pub`'s encoded public key. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_BIT_STRING> Function(ffi.Pointer<X509_PUBKEY>)>( | |
| symbol: 'bssl_dart_X509_PUBKEY_get0_public_key', | |
| ) | |
| external ffi.Pointer<ASN1_BIT_STRING> X509_PUBKEY_get0_public_key( | |
| ffi.Pointer<X509_PUBKEY> pub, | |
| ); | |
| /// X509_PUBKEY_new returns a newly-allocated, empty `X509_PUBKEY` object, or | |
| /// NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_PUBKEY> Function()>( | |
| symbol: 'bssl_dart_X509_PUBKEY_new', | |
| ) | |
| external ffi.Pointer<X509_PUBKEY> X509_PUBKEY_new(); | |
| /// X509_PUBKEY_set serializes `pkey` into a newly-allocated `X509_PUBKEY` | |
| /// structure. On success, it frees `*x` if non-NULL, then sets `*x` to the new | |
| /// object, and returns one. Otherwise, it returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Pointer<X509_PUBKEY>>, ffi.Pointer<EVP_PKEY>) | |
| >(symbol: 'bssl_dart_X509_PUBKEY_set') | |
| external int X509_PUBKEY_set( | |
| ffi.Pointer<ffi.Pointer<X509_PUBKEY>> x, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_PUBKEY_set0_param sets `pub` to a key with AlgorithmIdentifier | |
| /// determined by `obj`, `param_type`, and `param_value`, and an encoded | |
| /// public key of `key`. On success, it gives `pub` ownership of all the other | |
| /// parameters and returns one. Otherwise, it returns zero. `key` must have been | |
| /// allocated by `OPENSSL_malloc`. `obj` and, if applicable, `param_value` must | |
| /// not be freed after a successful call, and must have been allocated in a | |
| /// manner compatible with `ASN1_OBJECT_free` or `ASN1_STRING_free`. | |
| /// | |
| /// `obj`, `param_type`, and `param_value` are interpreted as in | |
| /// `X509_ALGOR_set0`. See `X509_ALGOR_set0` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_PUBKEY>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_PUBKEY_set0_param') | |
| external int X509_PUBKEY_set0_param( | |
| ffi.Pointer<X509_PUBKEY> pub, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int param_type, | |
| ffi.Pointer<ffi.Void> param_value, | |
| ffi.Pointer<ffi.Uint8> key, | |
| int key_len, | |
| ); | |
| /// X509_PURPOSE_get0 returns the `X509_PURPOSE` object corresponding to `id`, | |
| /// which should be one of the `X509_PURPOSE_*` constants, or NULL if none | |
| /// exists. | |
| /// | |
| /// This function differs from OpenSSL, which takes an "index", returned from | |
| /// `X509_PURPOSE_get_by_sname`. In BoringSSL, indices and `X509_PURPOSE_*` IDs | |
| /// are the same. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_PURPOSE> Function(ffi.Int)>( | |
| symbol: 'bssl_dart_X509_PURPOSE_get0', | |
| ) | |
| external ffi.Pointer<X509_PURPOSE> X509_PURPOSE_get0( | |
| int id, | |
| ); | |
| /// X509_PURPOSE_get_by_sname returns the `X509_PURPOSE_*` constant corresponding | |
| /// a short name `sname`, or -1 if `sname` was not recognized. | |
| /// | |
| /// Use `X509_PURPOSE_*` constants directly instead. The short names used by this | |
| /// function look like "sslserver" or "smimeencrypt", so they do not make | |
| /// especially good APIs. | |
| /// | |
| /// This function differs from OpenSSL, which returns an "index" to be passed to | |
| /// `X509_PURPOSE_get0`, followed by `X509_PURPOSE_get_id`, to finally obtain an | |
| /// `X509_PURPOSE_*` value suitable for use with `X509_VERIFY_PARAM_set_purpose`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_X509_PURPOSE_get_by_sname', | |
| ) | |
| external int X509_PURPOSE_get_by_sname( | |
| ffi.Pointer<ffi.Char> sname, | |
| ); | |
| /// X509_PURPOSE_get_id returns `purpose`'s ID. This will be one of the | |
| /// `X509_PURPOSE_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_PURPOSE>)>( | |
| symbol: 'bssl_dart_X509_PURPOSE_get_id', | |
| ) | |
| external int X509_PURPOSE_get_id( | |
| ffi.Pointer<X509_PURPOSE> purpose, | |
| ); | |
| /// X509_REQ_add1_attr appends a copy of `attr` to `req`'s list of attributes. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<X509_ATTRIBUTE>) | |
| >(symbol: 'bssl_dart_X509_REQ_add1_attr') | |
| external int X509_REQ_add1_attr( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<X509_ATTRIBUTE> attr, | |
| ); | |
| /// X509_REQ_add1_attr_by_NID behaves like `X509_REQ_add1_attr_by_OBJ` except the | |
| /// attribute type is determined by `nid`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Int, | |
| ffi.Int, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_add1_attr_by_NID') | |
| external int X509_REQ_add1_attr_by_NID( | |
| ffi.Pointer<X509_REQ> req, | |
| int nid, | |
| int attrtype, | |
| ffi.Pointer<ffi.UnsignedChar> data, | |
| int len, | |
| ); | |
| /// X509_REQ_add1_attr_by_OBJ appends a new attribute to `req` with type `obj`. | |
| /// It returns one on success and zero on error. The value is determined by | |
| /// `X509_ATTRIBUTE_set1_data`. | |
| /// | |
| /// WARNING: The interpretation of `attrtype`, `data`, and `len` is complex and | |
| /// error-prone. See `X509_ATTRIBUTE_set1_data` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_add1_attr_by_OBJ') | |
| external int X509_REQ_add1_attr_by_OBJ( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int attrtype, | |
| ffi.Pointer<ffi.UnsignedChar> data, | |
| int len, | |
| ); | |
| /// X509_REQ_add1_attr_by_txt behaves like `X509_REQ_add1_attr_by_OBJ` except the | |
| /// attribute type is determined by calling `OBJ_txt2obj` with `attrname`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.UnsignedChar>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_add1_attr_by_txt') | |
| external int X509_REQ_add1_attr_by_txt( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ffi.Char> attrname, | |
| int attrtype, | |
| ffi.Pointer<ffi.UnsignedChar> data, | |
| int len, | |
| ); | |
| /// X509_REQ_add_extensions behaves like `X509_REQ_add_extensions_nid`, using the | |
| /// standard `NID_ext_req` for the attribute type. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<stack_st_X509_EXTENSION>) | |
| >(symbol: 'bssl_dart_X509_REQ_add_extensions') | |
| external int X509_REQ_add_extensions( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<stack_st_X509_EXTENSION> exts, | |
| ); | |
| /// X509_REQ_add_extensions_nid adds an attribute to `req` of type `nid`, to | |
| /// request the certificate extensions in `exts`. It returns one on success and | |
| /// zero on error. `nid` should be `NID_ext_req` or `NID_ms_ext_req`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_add_extensions_nid') | |
| external int X509_REQ_add_extensions_nid( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<stack_st_X509_EXTENSION> exts, | |
| int nid, | |
| ); | |
| /// X509_REQ_check_private_key returns one if `req`'s public key matches `pkey` | |
| /// and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_REQ_check_private_key', | |
| ) | |
| external int X509_REQ_check_private_key( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_REQ_delete_attr removes the attribute at index `loc` in `req`. It | |
| /// returns the removed attribute to the caller, or NULL if `loc` was out of | |
| /// bounds. If non-NULL, the caller must release the result with | |
| /// `X509_ATTRIBUTE_free` when done. It is also safe, but not necessary, to call | |
| /// `X509_ATTRIBUTE_free` if the result is NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function(ffi.Pointer<X509_REQ>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REQ_delete_attr') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_REQ_delete_attr( | |
| ffi.Pointer<X509_REQ> req, | |
| int loc, | |
| ); | |
| /// X509_REQ_digest hashes `req`'s DER encoding with `md` and writes the result | |
| /// to `out`. `EVP_MD_CTX_size` bytes are written, which is at most | |
| /// `EVP_MAX_MD_SIZE`. If `out_len` is not NULL, `*out_len` is set to the number | |
| /// of bytes written. This function returns one on success and zero on error. | |
| /// Note this digest covers the entire certificate request, not just the signed | |
| /// portion. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_digest') | |
| external int X509_REQ_digest( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// X509_REQ_dup returns a newly-allocated copy of `req`, or NULL on error. This | |
| /// function works by serializing the structure, so if `req` is incomplete, it | |
| /// may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_REQ> Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_dup', | |
| ) | |
| external ffi.Pointer<X509_REQ> X509_REQ_dup( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_extension_nid returns one if `nid` is a supported CSR attribute type | |
| /// for carrying extensions and zero otherwise. The supported types are | |
| /// `NID_ext_req` (pkcs-9-at-extensionRequest from RFC 2985) and `NID_ms_ext_req` | |
| /// (a Microsoft szOID_CERT_EXTENSIONS variant). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Int)>( | |
| symbol: 'bssl_dart_X509_REQ_extension_nid', | |
| ) | |
| external int X509_REQ_extension_nid( | |
| int nid, | |
| ); | |
| /// X509_REQ_free releases memory associated with `req`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_free', | |
| ) | |
| external void X509_REQ_free( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get0_pubkey returns `req`'s public key as an `EVP_PKEY`, or NULL if | |
| /// the public key was unsupported or could not be decoded. The `EVP_PKEY` is | |
| /// cached in `req`, so callers must not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get0_pubkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_REQ_get0_pubkey( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get0_signature sets `*out_sig` and `*out_alg` to the signature and | |
| /// signature algorithm of `req`, respectively. Either output pointer may be NULL | |
| /// to ignore the value. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_get0_signature') | |
| external void X509_REQ_get0_signature( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out_sig, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ); | |
| /// X509_REQ_get1_email returns a newly-allocated list of NUL-terminated strings | |
| /// containing all email addresses in `req`'s subject and all rfc822name names | |
| /// in `req`'s subject alternative names. The subject alternative names extension | |
| /// is extracted from the result of `X509_REQ_get_extensions`. Email addresses | |
| /// which contain embedded NUL bytes are skipped. The results are returned in an | |
| /// arbitrary order. | |
| /// | |
| /// On error, or if there are no such email addresses, it returns NULL. When | |
| /// done, the caller must release the result with `X509_email_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_OPENSSL_STRING> Function(ffi.Pointer<X509_REQ>) | |
| >(symbol: 'bssl_dart_X509_REQ_get1_email') | |
| external ffi.Pointer<stack_st_OPENSSL_STRING> X509_REQ_get1_email( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_attr returns the attribute at index `loc` in `req`, or NULL if | |
| /// out of bounds. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function(ffi.Pointer<X509_REQ>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REQ_get_attr') | |
| external ffi.Pointer<X509_ATTRIBUTE> X509_REQ_get_attr( | |
| ffi.Pointer<X509_REQ> req, | |
| int loc, | |
| ); | |
| /// X509_REQ_get_attr_by_NID returns the index of the attribute in `req` of type | |
| /// `nid`, or a negative number if not found. If found, callers can use | |
| /// `X509_REQ_get_attr` to look up the attribute by index. | |
| /// | |
| /// If `lastpos` is non-negative, it begins searching at `lastpos` + 1. Callers | |
| /// can thus loop over all matching attributes by first passing -1 and then | |
| /// passing the previously-returned value until no match is returned. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_REQ_get_attr_by_NID', | |
| ) | |
| external int X509_REQ_get_attr_by_NID( | |
| ffi.Pointer<X509_REQ> req, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509_REQ_get_attr_by_OBJ behaves like `X509_REQ_get_attr_by_NID` but looks | |
| /// for attributes of type `obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<ASN1_OBJECT>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REQ_get_attr_by_OBJ') | |
| external int X509_REQ_get_attr_by_OBJ( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509_REQ_get_attr_count returns the number of attributes in `req`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get_attr_count', | |
| ) | |
| external int X509_REQ_get_attr_count( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_extensions decodes the most preferred list of requested | |
| /// extensions in `req` and returns a newly-allocated `STACK_OF(X509_EXTENSION)` | |
| /// containing the result. It returns NULL on error, or if `req` did not request | |
| /// extensions. | |
| /// | |
| /// CSRs do not store extensions directly. Instead there are attribute types | |
| /// which are defined to hold extensions. See `X509_REQ_extension_nid`. This | |
| /// function supports both pkcs-9-at-extensionRequest from RFC 2985 and the | |
| /// Microsoft szOID_CERT_EXTENSIONS variant. If both are present, | |
| /// pkcs-9-at-extensionRequest is preferred. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_EXTENSION> Function(ffi.Pointer<X509_REQ>) | |
| >(symbol: 'bssl_dart_X509_REQ_get_extensions') | |
| external ffi.Pointer<stack_st_X509_EXTENSION> X509_REQ_get_extensions( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_pubkey behaves like `X509_REQ_get0_pubkey` but increments the | |
| /// reference count on the `EVP_PKEY`. The caller must release the result with | |
| /// `EVP_PKEY_free` when done. The `EVP_PKEY` is cached in `req`, so callers must | |
| /// not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get_pubkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_REQ_get_pubkey( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_signature_nid returns the NID corresponding to `req`'s signature | |
| /// algorithm, or `NID_undef` if the signature algorithm does not correspond to | |
| /// a known NID. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get_signature_nid', | |
| ) | |
| external int X509_REQ_get_signature_nid( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_subject_name returns `req`'s subject name. Note this function is | |
| /// not const-correct for legacy reasons. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get_subject_name', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_REQ_get_subject_name( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_get_version returns the numerical value of `req`'s version. This | |
| /// will always be `X509_REQ_VERSION_1` for valid CSRs. For compatibility, | |
| /// `d2i_X509_REQ` also accepts some invalid version numbers, in which case this | |
| /// function may return other values. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_get_version', | |
| ) | |
| external int X509_REQ_get_version( | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_new returns a newly-allocated, empty `X509_REQ` object, or NULL on | |
| /// error. This object may be filled in and then signed to construct a CSR. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_REQ> Function()>(symbol: 'bssl_dart_X509_REQ_new') | |
| external ffi.Pointer<X509_REQ> X509_REQ_new(); | |
| /// X509_REQ_print calls `X509_REQ_print_ex` with `XN_FLAG_COMPAT` and | |
| /// `X509_FLAG_COMPAT` flags. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_print', | |
| ) | |
| external int X509_REQ_print( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_print_ex writes a human-readable representation of `x` to `bp`. It | |
| /// returns one on success and zero on error. `nmflags` is the flags parameter | |
| /// for `X509_NAME_print_ex`, when printing the subject. `cflag` should be some | |
| /// combination of the `X509_FLAG_*` and `X509V3_EXT_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<X509_REQ>, | |
| ffi.UnsignedLong, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_print_ex') | |
| external int X509_REQ_print_ex( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_REQ> x, | |
| int nmflag, | |
| int cflag, | |
| ); | |
| /// X509_REQ_print_fp behaves like `X509_REQ_print` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_X509_REQ_print_fp', | |
| ) | |
| external int X509_REQ_print_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// X509_REQ_set1_signature_algo sets `req`'s signature algorithm to `algo` and | |
| /// returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_REQ_set1_signature_algo', | |
| ) | |
| external int X509_REQ_set1_signature_algo( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<X509_ALGOR> algo, | |
| ); | |
| /// X509_REQ_set1_signature_value sets `req`'s signature to a copy of the | |
| /// `sig_len` bytes pointed by `sig`. It returns one on success and zero on | |
| /// error. | |
| /// | |
| /// Due to a specification error, PKCS#10 certificate requests store signatures | |
| /// in ASN.1 BIT STRINGs, but signature algorithms return byte strings rather | |
| /// than bit strings. This function creates a BIT STRING containing a whole | |
| /// number of bytes, with the bit order matching the DER encoding. This matches | |
| /// the encoding used by all X.509 signature algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_X509_REQ_set1_signature_value') | |
| external int X509_REQ_set1_signature_value( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ); | |
| /// X509_REQ_set_pubkey sets `req`'s public key to `pkey`. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_REQ_set_pubkey', | |
| ) | |
| external int X509_REQ_set_pubkey( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_REQ_set_subject_name sets `req`'s subject to a copy of `name`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_REQ_set_subject_name', | |
| ) | |
| external int X509_REQ_set_subject_name( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_REQ_set_version sets `req`'s version to `version`, which should be | |
| /// `X509_REQ_VERSION_1`. It returns one on success and zero on error. | |
| /// | |
| /// The only defined CSR version is `X509_REQ_VERSION_1`, so there is no need to | |
| /// call this function. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Long)>( | |
| symbol: 'bssl_dart_X509_REQ_set_version', | |
| ) | |
| external int X509_REQ_set_version( | |
| ffi.Pointer<X509_REQ> req, | |
| int version, | |
| ); | |
| /// X509_REQ_sign signs `req` with `pkey` and replaces the signature algorithm | |
| /// and signature fields. It returns the length of the signature on success and | |
| /// zero on error. This function uses digest algorithm `md`, or `pkey`'s default | |
| /// if NULL. Other signing parameters use `pkey`'s defaults. To customize them, | |
| /// use `X509_REQ_sign_ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REQ>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REQ_sign') | |
| external int X509_REQ_sign( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// X509_REQ_sign_ctx signs `req` with `ctx` and replaces the signature algorithm | |
| /// and signature fields. It returns the length of the signature on success and | |
| /// zero on error. The signature algorithm and parameters come from `ctx`, which | |
| /// must have been initialized with `EVP_DigestSignInit`. The caller should | |
| /// configure the corresponding `EVP_PKEY_CTX` before calling this function. | |
| /// | |
| /// On success or failure, this function mutates `ctx` and resets it to the empty | |
| /// state. Caller should not rely on its contents after the function returns. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_X509_REQ_sign_ctx', | |
| ) | |
| external int X509_REQ_sign_ctx( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// X509_REQ_verify checks that `req` has a valid signature by `pkey`. It returns | |
| /// one if the signature is valid and zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_REQ_verify', | |
| ) | |
| external int X509_REQ_verify( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_REVOKED_add1_ext_i2d behaves like `X509V3_add1_i2d` but adds the | |
| /// extension to `x`'s extension list. | |
| /// | |
| /// WARNING: This function may return zero or -1 on error. The caller must also | |
| /// ensure `value`'s type matches `nid`. See the documentation for | |
| /// `X509V3_add1_i2d` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REVOKED_add1_ext_i2d') | |
| external int X509_REVOKED_add1_ext_i2d( | |
| ffi.Pointer<X509_REVOKED> x, | |
| int nid, | |
| ffi.Pointer<ffi.Void> value, | |
| int crit, | |
| int flags, | |
| ); | |
| /// X509_REVOKED_add_ext adds a copy of `ex` to `x`. It returns one on success | |
| /// and zero on failure. The caller retains ownership of `ex` and can release it | |
| /// independently of `x`. | |
| /// | |
| /// The new extension is inserted at index `loc`, shifting extensions to the | |
| /// right. If `loc` is -1 or out of bounds, the new extension is appended to the | |
| /// list. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REVOKED_add_ext') | |
| external int X509_REVOKED_add_ext( | |
| ffi.Pointer<X509_REVOKED> x, | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| int loc, | |
| ); | |
| /// X509_REVOKED_delete_ext removes the extension in `x` at index `loc` and | |
| /// returns the removed extension, or NULL if `loc` was out of bounds. If | |
| /// non-NULL, the caller must release the result with `X509_EXTENSION_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_REVOKED>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REVOKED_delete_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509_REVOKED_delete_ext( | |
| ffi.Pointer<X509_REVOKED> x, | |
| int loc, | |
| ); | |
| /// X509_REVOKED_dup returns a newly-allocated copy of `rev`, or NULL on error. | |
| /// This function works by serializing the structure, so if `rev` is incomplete, | |
| /// it may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_REVOKED> Function(ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_REVOKED_dup', | |
| ) | |
| external ffi.Pointer<X509_REVOKED> X509_REVOKED_dup( | |
| ffi.Pointer<X509_REVOKED> rev, | |
| ); | |
| /// X509_REVOKED_free releases memory associated with `rev`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_REVOKED_free', | |
| ) | |
| external void X509_REVOKED_free( | |
| ffi.Pointer<X509_REVOKED> rev, | |
| ); | |
| /// X509_REVOKED_get0_extensions returns `r`'s extensions list, or NULL if `r` | |
| /// omits it. A CRL can have extensions on individual entries, which is this | |
| /// function, or on the overall CRL, which is `X509_CRL_get0_extensions`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_EXTENSION> Function(ffi.Pointer<X509_REVOKED>) | |
| >(symbol: 'bssl_dart_X509_REVOKED_get0_extensions') | |
| external ffi.Pointer<stack_st_X509_EXTENSION> X509_REVOKED_get0_extensions( | |
| ffi.Pointer<X509_REVOKED> r, | |
| ); | |
| /// X509_REVOKED_get0_revocationDate returns the revocation time of the | |
| /// certificate revoked by `revoked`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_REVOKED_get0_revocationDate', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_REVOKED_get0_revocationDate( | |
| ffi.Pointer<X509_REVOKED> revoked, | |
| ); | |
| /// X509_REVOKED_get0_serialNumber returns the serial number of the certificate | |
| /// revoked by `revoked`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function(ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_REVOKED_get0_serialNumber', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> X509_REVOKED_get0_serialNumber( | |
| ffi.Pointer<X509_REVOKED> revoked, | |
| ); | |
| /// X509_REVOKED_get_ext returns the extension in `x` at index `loc`, or NULL if | |
| /// `loc` is out of bounds. This function returns a non-const pointer for OpenSSL | |
| /// compatibility, but callers should not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_REVOKED>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REVOKED_get_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509_REVOKED_get_ext( | |
| ffi.Pointer<X509_REVOKED> x, | |
| int loc, | |
| ); | |
| /// X509_REVOKED_get_ext_by_NID behaves like `X509v3_get_ext_by_NID` but searches | |
| /// for extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REVOKED>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_REVOKED_get_ext_by_NID', | |
| ) | |
| external int X509_REVOKED_get_ext_by_NID( | |
| ffi.Pointer<X509_REVOKED> x, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509_REVOKED_get_ext_by_OBJ behaves like `X509v3_get_ext_by_OBJ` but searches | |
| /// for extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REVOKED>, ffi.Pointer<ASN1_OBJECT>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_REVOKED_get_ext_by_OBJ') | |
| external int X509_REVOKED_get_ext_by_OBJ( | |
| ffi.Pointer<X509_REVOKED> x, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509_REVOKED_get_ext_by_critical behaves like `X509v3_get_ext_by_critical` | |
| /// but searches for extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REVOKED>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_REVOKED_get_ext_by_critical', | |
| ) | |
| external int X509_REVOKED_get_ext_by_critical( | |
| ffi.Pointer<X509_REVOKED> x, | |
| int crit, | |
| int lastpos, | |
| ); | |
| /// X509_REVOKED_get_ext_count returns the number of extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_REVOKED>)>( | |
| symbol: 'bssl_dart_X509_REVOKED_get_ext_count', | |
| ) | |
| external int X509_REVOKED_get_ext_count( | |
| ffi.Pointer<X509_REVOKED> x, | |
| ); | |
| /// X509_REVOKED_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the | |
| /// extension in `revoked`'s extension list. | |
| /// | |
| /// WARNING: This function is difficult to use correctly. See the documentation | |
| /// for `X509V3_get_d2i` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_REVOKED_get_ext_d2i') | |
| external ffi.Pointer<ffi.Void> X509_REVOKED_get_ext_d2i( | |
| ffi.Pointer<X509_REVOKED> revoked, | |
| int nid, | |
| ffi.Pointer<ffi.Int> out_critical, | |
| ffi.Pointer<ffi.Int> out_idx, | |
| ); | |
| /// X509_REVOKED_new returns a newly-allocated, empty `X509_REVOKED` object, or | |
| /// NULL on allocation error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_REVOKED> Function()>( | |
| symbol: 'bssl_dart_X509_REVOKED_new', | |
| ) | |
| external ffi.Pointer<X509_REVOKED> X509_REVOKED_new(); | |
| /// X509_REVOKED_set_revocationDate sets `revoked`'s revocation time to `tm`. It | |
| /// returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REVOKED>, ffi.Pointer<ASN1_TIME>) | |
| >(symbol: 'bssl_dart_X509_REVOKED_set_revocationDate') | |
| external int X509_REVOKED_set_revocationDate( | |
| ffi.Pointer<X509_REVOKED> revoked, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_REVOKED_set_serialNumber sets `revoked`'s serial number to `serial`. It | |
| /// returns one on success or zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REVOKED>, ffi.Pointer<ASN1_INTEGER>) | |
| >(symbol: 'bssl_dart_X509_REVOKED_set_serialNumber') | |
| external int X509_REVOKED_set_serialNumber( | |
| ffi.Pointer<X509_REVOKED> revoked, | |
| ffi.Pointer<ASN1_INTEGER> serial, | |
| ); | |
| /// X509_SIG_free releases memory associated with `key`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_SIG>)>( | |
| symbol: 'bssl_dart_X509_SIG_free', | |
| ) | |
| external void X509_SIG_free( | |
| ffi.Pointer<X509_SIG> key, | |
| ); | |
| /// X509_SIG_get0 sets `*out_alg` and `*out_digest` to non-owning pointers to | |
| /// `sig`'s algorithm and digest fields, respectively. Either `out_alg` and | |
| /// `out_digest` may be NULL to skip those fields. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509_SIG>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_SIG_get0') | |
| external void X509_SIG_get0( | |
| ffi.Pointer<X509_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>> out_digest, | |
| ); | |
| /// X509_SIG_getm behaves like `X509_SIG_get0` but returns mutable pointers. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509_SIG>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_SIG_getm') | |
| external void X509_SIG_getm( | |
| ffi.Pointer<X509_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>> out_digest, | |
| ); | |
| /// X509_SIG_new returns a newly-allocated, empty `X509_SIG` object, or NULL on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_SIG> Function()>(symbol: 'bssl_dart_X509_SIG_new') | |
| external ffi.Pointer<X509_SIG> X509_SIG_new(); | |
| /// X509_STORE_CTX_cleanup resets `ctx` to the empty state. | |
| /// | |
| /// This function is a remnant of when `X509_STORE_CTX` was stack-allocated and | |
| /// should not be used. If releasing `ctx`, call `X509_STORE_CTX_free`. If | |
| /// reusing `ctx` for a new verification, release the old one and create a new | |
| /// one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_cleanup', | |
| ) | |
| external void X509_STORE_CTX_cleanup( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_free releases memory associated with `ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_free', | |
| ) | |
| external void X509_STORE_CTX_free( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_cert returns the leaf certificate that `ctx` is | |
| /// verifying. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get0_cert', | |
| ) | |
| external ffi.Pointer<X509> X509_STORE_CTX_get0_cert( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_chain, after a successful `X509_verify_cert` call, | |
| /// returns the verified certificate chain. The chain begins with the leaf and | |
| /// ends with trust anchor. | |
| /// | |
| /// At other points, such as after a failed verification or during the deprecated | |
| /// verification callback, it returns the partial chain built so far. Callers | |
| /// should avoid relying on this as this exposes unstable library implementation | |
| /// details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get0_chain', | |
| ) | |
| external ffi.Pointer<stack_st_X509> X509_STORE_CTX_get0_chain( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_param returns `ctx`'s verification parameters. This | |
| /// object is mutable and may be modified by the caller. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_VERIFY_PARAM> Function(ffi.Pointer<X509_STORE_CTX>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get0_param') | |
| external ffi.Pointer<X509_VERIFY_PARAM> X509_STORE_CTX_get0_param( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_parent_ctx returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_STORE_CTX> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get0_parent_ctx', | |
| ) | |
| external ffi.Pointer<X509_STORE_CTX> X509_STORE_CTX_get0_parent_ctx( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_store returns the `X509_STORE` that `ctx` uses. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_STORE> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get0_store', | |
| ) | |
| external ffi.Pointer<X509_STORE> X509_STORE_CTX_get0_store( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get0_untrusted returns the stack of untrusted intermediates | |
| /// used by `ctx` for certificate verification. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get0_untrusted', | |
| ) | |
| external ffi.Pointer<stack_st_X509> X509_STORE_CTX_get0_untrusted( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get1_certs returns a newly-allocated stack containing all | |
| /// trusted certificates in `ctx`'s `X509_STORE` whose subject matches `name`, or | |
| /// NULL on error. The caller must release the result with `sk_X509_pop_free` and | |
| /// `X509_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509> Function( | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Pointer<X509_NAME>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get1_certs') | |
| external ffi.Pointer<stack_st_X509> X509_STORE_CTX_get1_certs( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_STORE_CTX_get1_chain behaves like `X509_STORE_CTX_get0_chain` but | |
| /// returns a newly-allocated `STACK_OF(X509)` containing the completed chain, | |
| /// with each certificate's reference count incremented. Callers must free the | |
| /// result with `sk_X509_pop_free` and `X509_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get1_chain', | |
| ) | |
| external ffi.Pointer<stack_st_X509> X509_STORE_CTX_get1_chain( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get1_crls returns a newly-allocated stack containing all | |
| /// CRLs in `ctx`'s `X509_STORE` whose subject matches `name`, or NULL on error. | |
| /// The caller must release the result with `sk_X509_CRL_pop_free` and | |
| /// `X509_CRL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_CRL> Function( | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Pointer<X509_NAME>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get1_crls') | |
| external ffi.Pointer<stack_st_X509_CRL> X509_STORE_CTX_get1_crls( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_STORE_CTX_get1_issuer looks up a candidate trusted issuer for `x509` out | |
| /// of `ctx`'s `X509_STORE`, based on the criteria in `X509_check_issued`. If one | |
| /// was found, it returns one and sets `*out_issuer` to the issuer. The caller | |
| /// must release `*out_issuer` with `X509_free` when done. If none was found, it | |
| /// returns zero and leaves `*out_issuer` unchanged. | |
| /// | |
| /// This function only searches for trusted issuers. It does not consider | |
| /// untrusted intermediates passed in to `X509_STORE_CTX_init`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Pointer<X509>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get1_issuer') | |
| external int X509_STORE_CTX_get1_issuer( | |
| ffi.Pointer<ffi.Pointer<X509>> out_issuer, | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_STORE_CTX_get_by_subject looks up an object of type `type` in `ctx`'s | |
| /// `X509_STORE` that matches `name`. `type` should be one of the `X509_LU_*` | |
| /// constants to indicate the type of object. If a match was found, it stores the | |
| /// result in `ret` and returns one. Otherwise, it returns zero. If multiple | |
| /// objects match, this function outputs an arbitrary one. | |
| /// | |
| /// WARNING: `ret` must be in the empty state, as returned by `X509_OBJECT_new`. | |
| /// Otherwise, the object currently in `ret` will be leaked when overwritten. | |
| /// https://crbug.com/boringssl/685 tracks fixing this. | |
| /// | |
| /// WARNING: Multiple trusted certificates or CRLs may share a name. In this | |
| /// case, this function returns an arbitrary match. Use | |
| /// `X509_STORE_CTX_get1_certs` or `X509_STORE_CTX_get1_crls` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Int, | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<X509_OBJECT>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get_by_subject') | |
| external int X509_STORE_CTX_get_by_subject( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int type, | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<X509_OBJECT> ret, | |
| ); | |
| /// X509_STORE_CTX_get_chain is a legacy alias for `X509_STORE_CTX_get0_chain`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get_chain', | |
| ) | |
| external ffi.Pointer<stack_st_X509> X509_STORE_CTX_get_chain( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get_current_cert returns the certificate which caused the | |
| /// error returned by `X509_STORE_CTX_get_error`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get_current_cert', | |
| ) | |
| external ffi.Pointer<X509> X509_STORE_CTX_get_current_cert( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get_error, after `X509_verify_cert` returns, returns | |
| /// `X509_V_OK` if verification succeeded or an `X509_V_ERR_*` describing why | |
| /// verification failed. This will be consistent with `X509_verify_cert`'s return | |
| /// value, unless the caller used the deprecated verification callback (see | |
| /// `X509_STORE_CTX_set_verify_cb`) in a way that breaks `ctx`'s invariants. | |
| /// | |
| /// If called during the deprecated verification callback when `ok` is zero, it | |
| /// returns the current error under consideration. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get_error', | |
| ) | |
| external int X509_STORE_CTX_get_error( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_STORE_CTX_get_error_depth returns the depth at which the error returned | |
| /// by `X509_STORE_CTX_get_error` occurred. This is zero-indexed integer into the | |
| /// certificate chain. Zero indicates the target certificate, one its issuer, and | |
| /// so on. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_get_error_depth', | |
| ) | |
| external int X509_STORE_CTX_get_error_depth( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get_ex_data') | |
| external ffi.Pointer<ffi.Void> X509_STORE_CTX_get_ex_data( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int idx, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_get_ex_new_index') | |
| external int X509_STORE_CTX_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// X509_STORE_CTX_init initializes `ctx` to verify `x509`, using trusted | |
| /// certificates and parameters in `store`. It returns one on success and zero on | |
| /// error. `chain` is a list of untrusted intermediate certificates to use in | |
| /// verification. | |
| /// | |
| /// `ctx` stores pointers to `store`, `x509`, and `chain`. Each of these objects | |
| /// must outlive `ctx` and may not be mutated for the duration of the certificate | |
| /// verification. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Pointer<X509_STORE>, | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<stack_st_X509>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_init') | |
| external int X509_STORE_CTX_init( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<stack_st_X509> chain, | |
| ); | |
| /// X509_STORE_CTX_new returns a newly-allocated, empty `X509_STORE_CTX`, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_STORE_CTX> Function()>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_new', | |
| ) | |
| external ffi.Pointer<X509_STORE_CTX> X509_STORE_CTX_new(); | |
| /// X509_STORE_CTX_set0_crls configures `ctx` to consider the CRLs in `sk` as | |
| /// candidates for CRL lookup. `sk` must remain valid for the duration of `ctx`. | |
| /// These CRLs are considered in addition to CRLs found in `X509_STORE`. | |
| /// | |
| /// WARNING: This function differs from most `set0` functions in that it does not | |
| /// take ownership of its input. The caller is required to ensure the lifetimes | |
| /// are consistent. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<stack_st_X509_CRL>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set0_crls') | |
| external void X509_STORE_CTX_set0_crls( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<stack_st_X509_CRL> sk, | |
| ); | |
| /// X509_STORE_CTX_set0_param returns `ctx`'s verification parameters to `param` | |
| /// and takes ownership of `param`. After this function returns, the caller | |
| /// should not free `param`. | |
| /// | |
| /// WARNING: This function discards any values which were previously applied in | |
| /// `ctx`, including the "default" parameters applied late in | |
| /// `X509_STORE_CTX_init`. These late defaults are not applied to parameters | |
| /// created standalone by `X509_VERIFY_PARAM_new`. | |
| /// | |
| /// TODO(crbug.com/boringssl/441): This behavior is very surprising. Should we | |
| /// re-apply the late defaults in `param`, or somehow avoid this notion of late | |
| /// defaults altogether? | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<X509_VERIFY_PARAM>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set0_param') | |
| external void X509_STORE_CTX_set0_param( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ); | |
| /// X509_STORE_CTX_set0_trusted_stack configures `ctx` to trust the certificates | |
| /// in `sk`. `sk` must remain valid for the duration of `ctx`. Calling this | |
| /// function causes `ctx` to ignore any certificates configured in the | |
| /// `X509_STORE`. Certificates in `sk` are still subject to the check described | |
| /// in `X509_VERIFY_PARAM_set_trust`. | |
| /// | |
| /// WARNING: This function differs from most `set0` functions in that it does not | |
| /// take ownership of its input. The caller is required to ensure the lifetimes | |
| /// are consistent. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<stack_st_X509>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set0_trusted_stack') | |
| external void X509_STORE_CTX_set0_trusted_stack( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<stack_st_X509> sk, | |
| ); | |
| /// X509_STORE_CTX_set_chain configures `ctx` to use `sk` for untrusted | |
| /// intermediate certificates to use in verification. This function is redundant | |
| /// with the `chain` parameter of `X509_STORE_CTX_init`. Use the parameter | |
| /// instead. | |
| /// | |
| /// WARNING: Despite the similar name, this function is unrelated to | |
| /// `X509_STORE_CTX_get0_chain`. | |
| /// | |
| /// WARNING: This function saves a pointer to `sk` without copying or | |
| /// incrementing reference counts. `sk` must outlive `ctx` and may not be mutated | |
| /// for the duration of the certificate verification. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<stack_st_X509>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_chain') | |
| external void X509_STORE_CTX_set_chain( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<stack_st_X509> sk, | |
| ); | |
| /// X509_STORE_CTX_set_default looks up the set of parameters named `name` and | |
| /// applies those default verification parameters for `ctx`. As in | |
| /// `X509_VERIFY_PARAM_inherit`, only unset parameters are changed. This function | |
| /// returns one on success and zero on error. | |
| /// | |
| /// The supported values of `name` are: | |
| /// - "default" is an internal value which configures some late defaults. See the | |
| /// discussion in `X509_STORE_get0_param`. | |
| /// - "pkcs7" configures default trust and purpose checks for PKCS#7 signatures. | |
| /// - "smime_sign" configures trust and purpose checks for S/MIME signatures. | |
| /// - "ssl_client" configures trust and purpose checks for TLS clients. | |
| /// - "ssl_server" configures trust and purpose checks for TLS servers. | |
| /// | |
| /// TODO(crbug.com/boringssl/441): Make "default" a no-op. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_default') | |
| external int X509_STORE_CTX_set_default( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<ffi.Char> name, | |
| ); | |
| /// X509_STORE_CTX_set_depth configures `ctx` to, by default, limit certificate | |
| /// chains to `depth` intermediate certificates. This count excludes both the | |
| /// target certificate and the trust anchor (root certificate). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_set_depth', | |
| ) | |
| external void X509_STORE_CTX_set_depth( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int depth, | |
| ); | |
| /// X509_STORE_CTX_set_error sets `ctx`'s error to `err`, which should be | |
| /// `X509_V_OK` or an `X509_V_ERR_*` constant. It is not expected to be called in | |
| /// typical `X509_STORE_CTX` usage, but may be used in callback APIs where | |
| /// applications synthesize `X509_STORE_CTX` error conditions. See also | |
| /// `X509_STORE_CTX_set_verify_cb` and `SSL_CTX_set_cert_verify_callback`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_set_error', | |
| ) | |
| external void X509_STORE_CTX_set_error( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int err, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_ex_data') | |
| external int X509_STORE_CTX_set_ex_data( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int idx, | |
| ffi.Pointer<ffi.Void> data, | |
| ); | |
| /// X509_STORE_CTX_set_flags enables all values in `flags` in `ctx`'s | |
| /// verification flags. `flags` should be a combination of `X509_V_FLAG_*` | |
| /// constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_set_flags', | |
| ) | |
| external void X509_STORE_CTX_set_flags( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int flags, | |
| ); | |
| /// X509_STORE_CTX_set_purpose simultaneously configures `ctx`'s purpose and | |
| /// trust checks, if unset. It returns one on success and zero if `purpose` is | |
| /// not a valid purpose value. `purpose` should be an `X509_PURPOSE_*` constant. | |
| /// If so, it configures `ctx` with a purpose check of `purpose` and a trust | |
| /// check of `purpose`'s corresponding trust value. If either the purpose or | |
| /// trust check had already been specified for `ctx`, that corresponding | |
| /// modification is silently dropped. | |
| /// | |
| /// See `X509_VERIFY_PARAM_set_purpose` and `X509_VERIFY_PARAM_set_trust` for | |
| /// details on the purpose and trust checks, respectively. | |
| /// | |
| /// If `purpose` is `X509_PURPOSE_ANY`, this function returns an error because it | |
| /// has no corresponding `X509_TRUST_*` value. It is not possible to set | |
| /// `X509_PURPOSE_ANY` with this function, only `X509_VERIFY_PARAM_set_purpose`. | |
| /// | |
| /// WARNING: Unlike similarly named functions in this header, this function | |
| /// silently does not behave the same as `X509_VERIFY_PARAM_set_purpose`. Callers | |
| /// may use `X509_VERIFY_PARAM_set_purpose` with `X509_STORE_CTX_get0_param` to | |
| /// avoid this difference. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_set_purpose', | |
| ) | |
| external int X509_STORE_CTX_set_purpose( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int purpose, | |
| ); | |
| /// X509_STORE_CTX_set_time configures certificate verification to use `t` | |
| /// instead of the current time. `flags` is ignored and should be zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.UnsignedLong, time_t) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_time') | |
| external void X509_STORE_CTX_set_time( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int flags, | |
| int t, | |
| ); | |
| /// X509_STORE_CTX_set_time_posix configures certificate verification to use `t` | |
| /// instead of the current time. `t` is interpreted as a POSIX timestamp in | |
| /// seconds. `flags` is ignored and should be zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.UnsignedLong, ffi.Int64) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_time_posix') | |
| external void X509_STORE_CTX_set_time_posix( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int flags, | |
| int t, | |
| ); | |
| /// X509_STORE_CTX_set_trust configures `ctx`'s trust check, if unset. It returns | |
| /// one on success and zero if `trust` is not a valid trust value. `trust` should | |
| /// be an `X509_TRUST_*` constant. If so, it configures `ctx` with a trust check | |
| /// of `trust`. If the trust check had already been specified for `ctx`, it | |
| /// silently does nothing. | |
| /// | |
| /// See `X509_VERIFY_PARAM_set_trust` for details on the purpose and trust check. | |
| /// | |
| /// WARNING: Unlike similarly named functions in this header, this function | |
| /// does not behave the same as `X509_VERIFY_PARAM_set_trust`. Callers may use | |
| /// `X509_VERIFY_PARAM_set_trust` with `X509_STORE_CTX_get0_param` to avoid this | |
| /// difference. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE_CTX>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_CTX_set_trust', | |
| ) | |
| external int X509_STORE_CTX_set_trust( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| int trust, | |
| ); | |
| /// X509_STORE_CTX_set_verify_cb configures a callback function for `ctx` that is | |
| /// called multiple times during `X509_verify_cert`. The callback returns zero to | |
| /// fail verification and one to proceed. Typically, it will return `ok`, which | |
| /// preserves the default behavior. Returning one when `ok` is zero will proceed | |
| /// past some error. The callback may inspect `ctx` and the error queue to | |
| /// attempt to determine the current stage of certificate verification, but this | |
| /// is often unreliable. When synthesizing an error, callbacks should use | |
| /// `X509_STORE_CTX_set_error` to set a corresponding error. | |
| /// | |
| /// WARNING: Do not use this function. It is extremely fragile and unpredictable. | |
| /// This callback exposes implementation details of certificate verification, | |
| /// which change as the library evolves. Attempting to use it for security checks | |
| /// can introduce vulnerabilities if making incorrect assumptions about when the | |
| /// callback is called. Some errors, when suppressed, may implicitly suppress | |
| /// other errors due to internal implementation details. Additionally, overriding | |
| /// `ok` may leave `ctx` in an inconsistent state and break invariants. | |
| /// | |
| /// Instead, customize certificate verification by configuring options on the | |
| /// `X509_STORE_CTX` before verification, or applying additional checks after | |
| /// `X509_verify_cert` completes successfully. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int ok, ffi.Pointer<X509_STORE_CTX> ctx) | |
| > | |
| >, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_set_verify_cb') | |
| external void X509_STORE_CTX_set_verify_cb( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int ok, ffi.Pointer<X509_STORE_CTX> ctx) | |
| > | |
| > | |
| verify_cb, | |
| ); | |
| /// X509_STORE_CTX_trusted_stack is a deprecated alias for | |
| /// `X509_STORE_CTX_set0_trusted_stack`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE_CTX>, ffi.Pointer<stack_st_X509>) | |
| >(symbol: 'bssl_dart_X509_STORE_CTX_trusted_stack') | |
| external void X509_STORE_CTX_trusted_stack( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ffi.Pointer<stack_st_X509> sk, | |
| ); | |
| /// X509_STORE_add_cert adds `x509` to `store` as a trusted certificate. It | |
| /// returns one on success and zero on error. This function internally increments | |
| /// `x509`'s reference count, so the caller retains ownership of `x509`. | |
| /// | |
| /// Certificates configured by this function are potential trust anchors, but | |
| /// whether they are trust anchors for any given verification depends on the | |
| /// checks described in `X509_VERIFY_PARAM_set_trust`. | |
| /// | |
| /// Although `store` is not const, this function's use of `store` is thread-safe. | |
| /// However, if this function is called concurrently with `X509_verify_cert`, it | |
| /// is a race condition whether `x509` is available for issuer lookups. | |
| /// Moreover, the result may differ for each issuer lookup performed by a single | |
| /// `X509_verify_cert` call. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_STORE_add_cert', | |
| ) | |
| external int X509_STORE_add_cert( | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_STORE_add_crl adds `crl` to `store`. It returns one on success and zero | |
| /// on error. This function internally increments `crl`'s reference count, so the | |
| /// caller retains ownership of `crl`. CRLs added in this way are candidates for | |
| /// CRL lookup when `X509_V_FLAG_CRL_CHECK` is set. | |
| /// | |
| /// Although `store` is not const, this function's use of `store` is thread-safe. | |
| /// However, if this function is called concurrently with `X509_verify_cert`, it | |
| /// is a race condition whether `crl` is available for CRL checks. Moreover, the | |
| /// result may differ for each CRL check performed by a single | |
| /// `X509_verify_cert` call. | |
| /// | |
| /// Note there are no supported APIs to remove CRLs from `store` once inserted. | |
| /// To vary the set of CRLs over time, callers should either create a new | |
| /// `X509_STORE` or configure CRLs on a per-verification basis with | |
| /// `X509_STORE_CTX_set0_crls`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_X509_STORE_add_crl', | |
| ) | |
| external int X509_STORE_add_crl( | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// X509_STORE_add_lookup returns an `X509_LOOKUP` associated with `store` with | |
| /// type `method`, or NULL on error. The result is owned by `store`, so callers | |
| /// are not expected to free it. This may be used with `X509_LOOKUP_add_dir` or | |
| /// `X509_LOOKUP_load_file`, depending on `method`, to configure `store`. | |
| /// | |
| /// A single `X509_LOOKUP` may be configured with multiple paths, and an | |
| /// `X509_STORE` only contains one `X509_LOOKUP` of each type, so there is no | |
| /// need to call this function multiple times for a single type. Calling it | |
| /// multiple times will return the previous `X509_LOOKUP` of that type. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_LOOKUP> Function( | |
| ffi.Pointer<X509_STORE>, | |
| ffi.Pointer<X509_LOOKUP_METHOD>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_add_lookup') | |
| external ffi.Pointer<X509_LOOKUP> X509_STORE_add_lookup( | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<X509_LOOKUP_METHOD> method, | |
| ); | |
| /// X509_STORE_dup_ref adds one to the reference count of `store` and returns | |
| /// the same handle. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_STORE> Function(ffi.Pointer<X509_STORE>)>( | |
| symbol: 'bssl_dart_X509_STORE_dup_ref', | |
| ) | |
| external ffi.Pointer<X509_STORE> X509_STORE_dup_ref( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_free releases memory associated with `store`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_STORE>)>( | |
| symbol: 'bssl_dart_X509_STORE_free', | |
| ) | |
| external void X509_STORE_free( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_get0_objects returns a non-owning pointer of `store`'s internal | |
| /// object list. Although this function is not const, callers must not modify | |
| /// the result of this function. | |
| /// | |
| /// WARNING: This function is not thread-safe. If `store` is shared across | |
| /// multiple threads, callers cannot safely inspect the result of this function, | |
| /// because another thread may have concurrently added to it. In particular, | |
| /// `X509_LOOKUP_add_dir` treats this list as a cache and may add to it in the | |
| /// course of certificate verification. This API additionally prevents fixing | |
| /// some quadratic worst-case behavior in `X509_STORE` and may be removed in the | |
| /// future. Use `X509_STORE_get1_objects` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_OBJECT> Function(ffi.Pointer<X509_STORE>) | |
| >(symbol: 'bssl_dart_X509_STORE_get0_objects') | |
| external ffi.Pointer<stack_st_X509_OBJECT> X509_STORE_get0_objects( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_get0_param returns `store`'s verification parameters. This object | |
| /// is mutable and may be modified by the caller. For an individual certificate | |
| /// verification operation, `X509_STORE_CTX_init` initializes the | |
| /// `X509_STORE_CTX`'s parameters with these parameters. | |
| /// | |
| /// WARNING: `X509_STORE_CTX_init` applies some default parameters (as in | |
| /// `X509_VERIFY_PARAM_inherit`) after copying `store`'s parameters. This means | |
| /// it is impossible to leave some parameters unset at `store`. They must be | |
| /// explicitly unset after creating the `X509_STORE_CTX`. | |
| /// | |
| /// As of writing these late defaults are a depth limit (see | |
| /// `X509_VERIFY_PARAM_set_depth`). This warning does not apply if the parameters | |
| /// were set in `store`. | |
| /// | |
| /// TODO(crbug.com/boringssl/441): This behavior is very surprising. Can we | |
| /// remove this notion of late defaults? The unsettable value at `X509_STORE` is | |
| /// -1, which rejects everything but explicitly-trusted self-signed certificates. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_VERIFY_PARAM> Function(ffi.Pointer<X509_STORE>)>( | |
| symbol: 'bssl_dart_X509_STORE_get0_param', | |
| ) | |
| external ffi.Pointer<X509_VERIFY_PARAM> X509_STORE_get0_param( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_get1_objects returns a newly-allocated stack containing the | |
| /// contents of `store`, or NULL on error. The caller must release the result | |
| /// with `sk_X509_OBJECT_pop_free` and `X509_OBJECT_free` when done. | |
| /// | |
| /// The result will include all certificates and CRLs added via | |
| /// `X509_STORE_add_cert` and `X509_STORE_add_crl`, as well as any cached objects | |
| /// added by `X509_LOOKUP_add_dir`. The last of these may change over time, as | |
| /// different objects are loaded from the filesystem. Callers should not depend | |
| /// on this caching behavior. The objects are returned in no particular order. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_OBJECT> Function(ffi.Pointer<X509_STORE>) | |
| >(symbol: 'bssl_dart_X509_STORE_get1_objects') | |
| external ffi.Pointer<stack_st_X509_OBJECT> X509_STORE_get1_objects( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_load_locations configures `store` to load data from filepaths | |
| /// `file` and `dir`. It returns one on success and zero on error. Either of | |
| /// `file` or `dir` may be NULL, but at least one must be non-NULL. | |
| /// | |
| /// If `file` is non-NULL, it loads CRLs and trusted certificates in PEM format | |
| /// from the file at `file`, and them to `store`, as in `X509_load_cert_crl_file` | |
| /// with `X509_FILETYPE_PEM`. | |
| /// | |
| /// If `dir` is non-NULL, it configures `store` to load CRLs and trusted | |
| /// certificates from the directory at `dir` in PEM format, as in | |
| /// `X509_LOOKUP_add_dir` with `X509_FILETYPE_PEM`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_STORE>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_STORE_load_locations') | |
| external int X509_STORE_load_locations( | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<ffi.Char> file, | |
| ffi.Pointer<ffi.Char> dir, | |
| ); | |
| /// X509_STORE_new returns a newly-allocated `X509_STORE`, or NULL on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_STORE> Function()>( | |
| symbol: 'bssl_dart_X509_STORE_new', | |
| ) | |
| external ffi.Pointer<X509_STORE> X509_STORE_new(); | |
| /// X509_STORE_set1_param copies verification parameters from `param` as in | |
| /// `X509_VERIFY_PARAM_set1`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Pointer<X509_VERIFY_PARAM>) | |
| >(symbol: 'bssl_dart_X509_STORE_set1_param') | |
| external int X509_STORE_set1_param( | |
| ffi.Pointer<X509_STORE> store, | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ); | |
| /// X509_STORE_set_default_paths configures `store` to read from some "default" | |
| /// filesystem paths. It returns one on success and zero on error. The filesystem | |
| /// paths are determined by a combination of hardcoded paths and the SSL_CERT_DIR | |
| /// and SSL_CERT_FILE environment variables. | |
| /// | |
| /// Using this function is not recommended. In OpenSSL, these defaults are | |
| /// determined by OpenSSL's install prefix. There is no corresponding concept for | |
| /// BoringSSL. Future versions of BoringSSL may change or remove this | |
| /// functionality. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>)>( | |
| symbol: 'bssl_dart_X509_STORE_set_default_paths', | |
| ) | |
| external int X509_STORE_set_default_paths( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_STORE_set_depth configures `store` to, by default, limit certificate | |
| /// chains to `depth` intermediate certificates. This count excludes both the | |
| /// target certificate and the trust anchor (root certificate). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_set_depth', | |
| ) | |
| external int X509_STORE_set_depth( | |
| ffi.Pointer<X509_STORE> store, | |
| int depth, | |
| ); | |
| /// X509_STORE_set_flags enables all values in `flags` in `store`'s verification | |
| /// flags. `flags` should be a combination of `X509_V_FLAG_*` constants. | |
| /// | |
| /// WARNING: These flags will be combined with default flags when copied to an | |
| /// `X509_STORE_CTX`. This means it is impossible to unset those defaults from | |
| /// the `X509_STORE`. See discussion in `X509_STORE_get0_param`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_X509_STORE_set_flags', | |
| ) | |
| external int X509_STORE_set_flags( | |
| ffi.Pointer<X509_STORE> store, | |
| int flags, | |
| ); | |
| /// X509_STORE_set_purpose configures the purpose check for `store`. See | |
| /// `X509_VERIFY_PARAM_set_purpose` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_set_purpose', | |
| ) | |
| external int X509_STORE_set_purpose( | |
| ffi.Pointer<X509_STORE> store, | |
| int purpose, | |
| ); | |
| /// X509_STORE_set_trust configures the trust check for `store`. See | |
| /// `X509_VERIFY_PARAM_set_trust` for details. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_STORE_set_trust', | |
| ) | |
| external int X509_STORE_set_trust( | |
| ffi.Pointer<X509_STORE> store, | |
| int trust, | |
| ); | |
| /// X509_STORE_set_verify_cb acts like `X509_STORE_CTX_set_verify_cb` but sets | |
| /// the verify callback for any `X509_STORE_CTX` created from this `X509_STORE` | |
| /// | |
| /// Do not use this function. See `X509_STORE_CTX_set_verify_cb` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<X509_STORE>, X509_STORE_CTX_verify_cb) | |
| >(symbol: 'bssl_dart_X509_STORE_set_verify_cb') | |
| external void X509_STORE_set_verify_cb( | |
| ffi.Pointer<X509_STORE> store, | |
| X509_STORE_CTX_verify_cb verify_cb, | |
| ); | |
| /// X509_STORE_up_ref adds one to the reference count of `store` and returns one. | |
| /// Although `store` is not const, this function's use of `store` is thread-safe. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE>)>( | |
| symbol: 'bssl_dart_X509_STORE_up_ref', | |
| ) | |
| external int X509_STORE_up_ref( | |
| ffi.Pointer<X509_STORE> store, | |
| ); | |
| /// X509_VERIFY_PARAM_add0_policy adds `policy` to the user-initial-policy-set | |
| /// (see Section 6.1.1 of RFC 5280). On success, it takes ownership of | |
| /// `policy` and returns one. Otherwise, it returns zero and the caller retains | |
| /// ownership of `policy`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_add0_policy') | |
| external int X509_VERIFY_PARAM_add0_policy( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ASN1_OBJECT> policy, | |
| ); | |
| /// X509_VERIFY_PARAM_add1_host adds `name` to the list of names checked by | |
| /// `param`. If any configured DNS name matches the certificate, verification | |
| /// succeeds. It returns one on success and zero on error. | |
| /// | |
| /// By default, both subject alternative names and the subject's common name | |
| /// attribute are checked. The latter has long been deprecated, so callers should | |
| /// call `X509_VERIFY_PARAM_set_hostflags` with | |
| /// `X509_CHECK_FLAG_NEVER_CHECK_SUBJECT` to use the standard behavior. | |
| /// https://crbug.com/boringssl/464 tracks fixing the default. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_add1_host') | |
| external int X509_VERIFY_PARAM_add1_host( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ffi.Char> name, | |
| int name_len, | |
| ); | |
| /// X509_VERIFY_PARAM_clear_flags disables all values in `flags` in `param`'s | |
| /// verification flags and returns one. `flags` should be a combination of | |
| /// `X509_V_FLAG_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_clear_flags', | |
| ) | |
| external int X509_VERIFY_PARAM_clear_flags( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int flags, | |
| ); | |
| /// X509_VERIFY_PARAM_free releases memory associated with `param`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_free', | |
| ) | |
| external void X509_VERIFY_PARAM_free( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ); | |
| /// X509_VERIFY_PARAM_get_depth returns the maximum depth configured in `param`. | |
| /// See `X509_VERIFY_PARAM_set_depth`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_get_depth', | |
| ) | |
| external int X509_VERIFY_PARAM_get_depth( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ); | |
| /// X509_VERIFY_PARAM_get_flags returns `param`'s verification flags. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.UnsignedLong Function(ffi.Pointer<X509_VERIFY_PARAM>)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_get_flags', | |
| ) | |
| external int X509_VERIFY_PARAM_get_flags( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ); | |
| /// X509_VERIFY_PARAM_inherit applies `from` as the default values for `to`. That | |
| /// is, for each parameter that is unset in `to`, it copies the value in `from`. | |
| /// This function returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_inherit') | |
| external int X509_VERIFY_PARAM_inherit( | |
| ffi.Pointer<X509_VERIFY_PARAM> to, | |
| ffi.Pointer<X509_VERIFY_PARAM> from, | |
| ); | |
| /// X509_VERIFY_PARAM_new returns a newly-allocated `X509_VERIFY_PARAM`, or NULL | |
| /// on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_VERIFY_PARAM> Function()>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_new', | |
| ) | |
| external ffi.Pointer<X509_VERIFY_PARAM> X509_VERIFY_PARAM_new(); | |
| /// X509_VERIFY_PARAM_set1 copies parameters from `from` to `to`. If a parameter | |
| /// is unset in `from`, the existing value in `to` is preserved. This function | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1') | |
| external int X509_VERIFY_PARAM_set1( | |
| ffi.Pointer<X509_VERIFY_PARAM> to, | |
| ffi.Pointer<X509_VERIFY_PARAM> from, | |
| ); | |
| /// X509_VERIFY_PARAM_set1_email configures `param` to check for the email | |
| /// address specified by `email`. It returns one on success and zero on error. | |
| /// | |
| /// By default, both subject alternative names and the subject's email address | |
| /// attribute are checked. The `X509_CHECK_FLAG_NEVER_CHECK_SUBJECT` flag may be | |
| /// used to change this behavior. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1_email') | |
| external int X509_VERIFY_PARAM_set1_email( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ffi.Char> email, | |
| int email_len, | |
| ); | |
| /// X509_VERIFY_PARAM_set1_host configures `param` to check for the DNS name | |
| /// specified by `name`. It returns one on success and zero on error. | |
| /// | |
| /// By default, both subject alternative names and the subject's common name | |
| /// attribute are checked. The latter has long been deprecated, so callers should | |
| /// call `X509_VERIFY_PARAM_set_hostflags` with | |
| /// `X509_CHECK_FLAG_NEVER_CHECK_SUBJECT` to use the standard behavior. | |
| /// https://crbug.com/boringssl/464 tracks fixing the default. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1_host') | |
| external int X509_VERIFY_PARAM_set1_host( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ffi.Char> name, | |
| int name_len, | |
| ); | |
| /// X509_VERIFY_PARAM_set1_ip configures `param` to check for the IP address | |
| /// specified by `ip`. It returns one on success and zero on error. The IP | |
| /// address is specified in its binary representation. `ip_len` must be 4 for an | |
| /// IPv4 address and 16 for an IPv6 address. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1_ip') | |
| external int X509_VERIFY_PARAM_set1_ip( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ffi.Uint8> ip, | |
| int ip_len, | |
| ); | |
| /// X509_VERIFY_PARAM_set1_ip_asc decodes `ipasc` as the ASCII representation of | |
| /// an IPv4 or IPv6 address, and configures `param` to check for it. It returns | |
| /// one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Pointer<ffi.Char>) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1_ip_asc') | |
| external int X509_VERIFY_PARAM_set1_ip_asc( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<ffi.Char> ipasc, | |
| ); | |
| /// X509_VERIFY_PARAM_set1_policies sets the user-initial-policy-set (see | |
| /// Section 6.1.1 of RFC 5280) to a copy of `policies`. It returns one on success | |
| /// and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_VERIFY_PARAM>, | |
| ffi.Pointer<stack_st_ASN1_OBJECT>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_VERIFY_PARAM_set1_policies') | |
| external int X509_VERIFY_PARAM_set1_policies( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| ffi.Pointer<stack_st_ASN1_OBJECT> policies, | |
| ); | |
| /// X509_VERIFY_PARAM_set_depth configures `param` to limit certificate chains to | |
| /// `depth` intermediate certificates. This count excludes both the target | |
| /// certificate and the trust anchor (root certificate). | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_depth', | |
| ) | |
| external void X509_VERIFY_PARAM_set_depth( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int depth, | |
| ); | |
| /// X509_VERIFY_PARAM_set_flags enables all values in `flags` in `param`'s | |
| /// verification flags and returns one. `flags` should be a combination of | |
| /// `X509_V_FLAG_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.UnsignedLong)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_flags', | |
| ) | |
| external int X509_VERIFY_PARAM_set_flags( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int flags, | |
| ); | |
| /// X509_VERIFY_PARAM_set_hostflags sets the name-checking flags on `param` to | |
| /// `flags`. `flags` should be a combination of `X509_CHECK_FLAG_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.UnsignedInt)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_hostflags', | |
| ) | |
| external void X509_VERIFY_PARAM_set_hostflags( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int flags, | |
| ); | |
| /// X509_VERIFY_PARAM_set_purpose configures `param` to validate certificates for | |
| /// a specified purpose. It returns one on success and zero if `purpose` is not a | |
| /// valid purpose type. `purpose` should be one of the `X509_PURPOSE_*` values. | |
| /// | |
| /// This option controls checking the extended key usage (EKU) and key usage | |
| /// extensions. These extensions specify how a certificate's public key may be | |
| /// used and are important to avoid cross-protocol attacks, particularly in PKIs | |
| /// that may issue certificates for multiple protocols, or for protocols that use | |
| /// keys in multiple ways. If not configured, these security checks are the | |
| /// caller's responsibility. | |
| /// | |
| /// This library applies the EKU checks to all untrusted intermediates. Although | |
| /// not defined in RFC 5280, this matches widely-deployed practice. It also does | |
| /// not accept anyExtendedKeyUsage. | |
| /// | |
| /// Many purpose values have a corresponding trust value, which is not configured | |
| /// by this function. See `X509_VERIFY_PARAM_set_trust` for details. Callers | |
| /// that wish to configure both should either call both functions, or use | |
| /// `X509_STORE_CTX_set_purpose`. | |
| /// | |
| /// It is currently not possible to configure custom EKU OIDs or key usage bits. | |
| /// Contact the BoringSSL maintainers if your application needs to do so. OpenSSL | |
| /// had an `X509_PURPOSE_add` API, but it was not thread-safe and relied on | |
| /// global mutable state, so we removed it. | |
| /// | |
| /// TODO(davidben): This function additionally configures checking the legacy | |
| /// Netscape certificate type extension. Remove this. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_purpose', | |
| ) | |
| external int X509_VERIFY_PARAM_set_purpose( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int purpose, | |
| ); | |
| /// X509_VERIFY_PARAM_set_time configures certificate verification to use `t` | |
| /// instead of the current time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>, time_t)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_time', | |
| ) | |
| external void X509_VERIFY_PARAM_set_time( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int t, | |
| ); | |
| /// X509_VERIFY_PARAM_set_time_posix configures certificate verification to use | |
| /// `t` instead of the current time. `t` is interpreted as a POSIX timestamp in | |
| /// seconds. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Int64)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_time_posix', | |
| ) | |
| external void X509_VERIFY_PARAM_set_time_posix( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int t, | |
| ); | |
| /// X509_VERIFY_PARAM_set_trust configures which certificates from `X509_STORE` | |
| /// are trust anchors. It returns one on success and zero if `trust` is not a | |
| /// valid trust value. `trust` should be one of the `X509_TRUST_*` constants. | |
| /// This function allows applications to vary trust anchors when the same set of | |
| /// trusted certificates is used in multiple contexts. | |
| /// | |
| /// Two properties determine whether a certificate is a trust anchor: | |
| /// | |
| /// - Whether it is trusted or distrusted for some OID, via auxiliary information | |
| /// configured by `X509_add1_trust_object` or `X509_add1_reject_object`. | |
| /// | |
| /// - Whether it is "self-signed". That is, whether `X509_get_extension_flags` | |
| /// includes `EXFLAG_SS`. The signature itself is not checked. | |
| /// | |
| /// When this function is called, `trust` determines the OID to check in the | |
| /// first case. If the certificate is not explicitly trusted or distrusted for | |
| /// any OID, it is trusted if self-signed instead. | |
| /// | |
| /// If unset, the default behavior is to check for the `NID_anyExtendedKeyUsage` | |
| /// OID. If the certificate is not explicitly trusted or distrusted for this OID, | |
| /// it is trusted if self-signed instead. Note this slightly differs from the | |
| /// above. | |
| /// | |
| /// If the `X509_V_FLAG_PARTIAL_CHAIN` is set, every certificate from | |
| /// `X509_STORE` is a trust anchor, unless it was explicitly distrusted for the | |
| /// OID. | |
| /// | |
| /// It is currently not possible to configure custom trust OIDs. Contact the | |
| /// BoringSSL maintainers if your application needs to do so. OpenSSL had an | |
| /// `X509_TRUST_add` API, but it was not thread-safe and relied on global mutable | |
| /// state, so we removed it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_VERIFY_PARAM>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_VERIFY_PARAM_set_trust', | |
| ) | |
| external int X509_VERIFY_PARAM_set_trust( | |
| ffi.Pointer<X509_VERIFY_PARAM> param, | |
| int trust, | |
| ); | |
| /// X509_add1_ext_i2d behaves like `X509V3_add1_i2d` but adds the extension to | |
| /// `x`'s extension list. | |
| /// | |
| /// WARNING: This function may return zero or -1 on error. The caller must also | |
| /// ensure `value`'s type matches `nid`. See the documentation for | |
| /// `X509V3_add1_i2d` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Int, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_add1_ext_i2d') | |
| external int X509_add1_ext_i2d( | |
| ffi.Pointer<X509> x, | |
| int nid, | |
| ffi.Pointer<ffi.Void> value, | |
| int crit, | |
| int flags, | |
| ); | |
| /// X509_add1_reject_object configures `x509` as distrusted for `obj`. It returns | |
| /// one on success and zero on error. `obj` should be a certificate usage OID | |
| /// associated with an `X509_TRUST_*` constant. | |
| /// | |
| /// See `X509_VERIFY_PARAM_set_trust` for details on how this value is evaluated. | |
| /// Note this only takes effect if `x509` was configured as a trusted certificate | |
| /// via `X509_STORE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_add1_reject_object', | |
| ) | |
| external int X509_add1_reject_object( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// X509_add1_trust_object configures `x509` as a valid trust anchor for `obj`. | |
| /// It returns one on success and zero on error. `obj` should be a certificate | |
| /// usage OID associated with an `X509_TRUST_*` constant. | |
| /// | |
| /// See `X509_VERIFY_PARAM_set_trust` for details on how this value is evaluated. | |
| /// Note this only takes effect if `x509` was configured as a trusted certificate | |
| /// via `X509_STORE`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_X509_add1_trust_object', | |
| ) | |
| external int X509_add1_trust_object( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| ); | |
| /// X509_add_ext adds a copy of `ex` to `x`. It returns one on success and zero | |
| /// on failure. The caller retains ownership of `ex` and can release it | |
| /// independently of `x`. | |
| /// | |
| /// The new extension is inserted at index `loc`, shifting extensions to the | |
| /// right. If `loc` is -1 or out of bounds, the new extension is appended to the | |
| /// list. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509_EXTENSION>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_add_ext') | |
| external int X509_add_ext( | |
| ffi.Pointer<X509> x, | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| int loc, | |
| ); | |
| /// X509_alias_get0 looks up `x509`'s alias. If found, it sets `*out_len` to the | |
| /// alias's length and returns a pointer to a buffer containing the contents. If | |
| /// not found, it outputs the empty string by returning NULL and setting | |
| /// `*out_len` to zero. | |
| /// | |
| /// If `x509` was parsed from a PKCS#12 structure (see | |
| /// `PKCS12_get_key_and_certs`), the alias will reflect the friendlyName | |
| /// attribute (RFC 2985). | |
| /// | |
| /// WARNING: In OpenSSL, this function did not set `*out_len` when the alias was | |
| /// missing. Callers that target both OpenSSL and BoringSSL should set the value | |
| /// to zero before calling this function. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_X509_alias_get0') | |
| external ffi.Pointer<ffi.Uint8> X509_alias_get0( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// X509_alias_set1 sets `x509`'s alias to `len` bytes from `name`. If `name` is | |
| /// NULL, the alias is cleared instead. Aliases are not part of the certificate | |
| /// itself and will not be serialized by `i2d_X509`. If `x509` is serialized in | |
| /// a PKCS#12 structure, the friendlyName attribute (RFC 2985) will contain this | |
| /// alias. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Uint8>, ossl_ssize_t) | |
| >(symbol: 'bssl_dart_X509_alias_set1') | |
| external int X509_alias_set1( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Uint8> name, | |
| int len, | |
| ); | |
| /// X509_chain_up_ref returns a newly-allocated `STACK_OF(X509)` containing a | |
| /// shallow copy of `chain`, or NULL on error. That is, the return value has the | |
| /// same contents as `chain`, and each `X509`'s reference count is incremented by | |
| /// one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509> Function(ffi.Pointer<stack_st_X509>)>( | |
| symbol: 'bssl_dart_X509_chain_up_ref', | |
| ) | |
| external ffi.Pointer<stack_st_X509> X509_chain_up_ref( | |
| ffi.Pointer<stack_st_X509> chain, | |
| ); | |
| /// X509_check_ca returns one if `x509` may be considered a CA certificate, | |
| /// according to basic constraints and key usage extensions. Otherwise, it | |
| /// returns zero. If `x509` is an X509v1 certificate, and thus has no extensions, | |
| /// it is considered eligible. | |
| /// | |
| /// This function returning one does not indicate that `x509` is trusted, only | |
| /// that it is eligible to be a CA. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_check_ca', | |
| ) | |
| external int X509_check_ca( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_check_email checks if `x509` matches the email address `chk`. It returns | |
| /// one on match, zero on mismatch, or a negative number on error. `flags` should | |
| /// be some combination of `X509_CHECK_FLAG_*` and modifies the behavior. | |
| /// | |
| /// By default, both subject alternative names and the subject's email address | |
| /// attribute are checked. The `X509_CHECK_FLAG_NEVER_CHECK_SUBJECT` flag may be | |
| /// used to change this behavior. | |
| /// | |
| /// This function does not check if `x509` is a trusted certificate, only if, | |
| /// were it trusted, it would match `chk`. | |
| /// | |
| /// WARNING: This function differs from the usual calling convention and may | |
| /// return either 0 or a negative number on error. | |
| /// | |
| /// TODO(davidben): Make the error case also return zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ) | |
| >(symbol: 'bssl_dart_X509_check_email') | |
| external int X509_check_email( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Char> chk, | |
| int chklen, | |
| int flags, | |
| ); | |
| /// X509_check_host checks if `x509` matches the DNS name `chk`. It returns one | |
| /// on match, zero on mismatch, or a negative number on error. `flags` should be | |
| /// some combination of `X509_CHECK_FLAG_*` and modifies the behavior. On match, | |
| /// if `out_peername` is non-NULL, it additionally sets `*out_peername` to a | |
| /// newly-allocated, NUL-terminated string containing the DNS name or wildcard in | |
| /// the certificate which matched. The caller must then free `*out_peername` with | |
| /// `OPENSSL_free` when done. | |
| /// | |
| /// By default, both subject alternative names and the subject's common name | |
| /// attribute are checked. The latter has long been deprecated, so callers should | |
| /// include `X509_CHECK_FLAG_NEVER_CHECK_SUBJECT` in `flags` to use the standard | |
| /// behavior. https://crbug.com/boringssl/464 tracks fixing the default. | |
| /// | |
| /// This function does not check if `x509` is a trusted certificate, only if, | |
| /// were it trusted, it would match `chk`. | |
| /// | |
| /// WARNING: This function differs from the usual calling convention and may | |
| /// return either 0 or a negative number on error. | |
| /// | |
| /// TODO(davidben): Make the error case also return zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_check_host') | |
| external int X509_check_host( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Char> chk, | |
| int chklen, | |
| int flags, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>> out_peername, | |
| ); | |
| /// X509_check_ip checks if `x509` matches the IP address `chk`. The IP address | |
| /// is represented in byte form and should be 4 bytes for an IPv4 address and 16 | |
| /// bytes for an IPv6 address. It returns one on match, zero on mismatch, or a | |
| /// negative number on error. `flags` should be some combination of | |
| /// `X509_CHECK_FLAG_*` and modifies the behavior. | |
| /// | |
| /// This function does not check if `x509` is a trusted certificate, only if, | |
| /// were it trusted, it would match `chk`. | |
| /// | |
| /// WARNING: This function differs from the usual calling convention and may | |
| /// return either 0 or a negative number on error. | |
| /// | |
| /// TODO(davidben): Make the error case also return zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Size, | |
| ffi.UnsignedInt, | |
| ) | |
| >(symbol: 'bssl_dart_X509_check_ip') | |
| external int X509_check_ip( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Uint8> chk, | |
| int chklen, | |
| int flags, | |
| ); | |
| /// X509_check_ip_asc behaves like `X509_check_ip` except the IP address is | |
| /// specified in textual form in `ipasc`. | |
| /// | |
| /// WARNING: This function differs from the usual calling convention and may | |
| /// return either 0 or a negative number on error. | |
| /// | |
| /// TODO(davidben): Make the error case also return zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Char>, ffi.UnsignedInt) | |
| >(symbol: 'bssl_dart_X509_check_ip_asc') | |
| external int X509_check_ip_asc( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Char> ipasc, | |
| int flags, | |
| ); | |
| /// X509_check_issued checks if `issuer` and `subject`'s name, authority key | |
| /// identifier, and key usage fields allow `issuer` to have issued `subject`. It | |
| /// returns `X509_V_OK` on success and an `X509_V_ERR_*` value otherwise. | |
| /// | |
| /// This function does not check the signature on `subject`. Rather, it is | |
| /// intended to prune the set of possible issuer certificates during | |
| /// path-building. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_check_issued', | |
| ) | |
| external int X509_check_issued( | |
| ffi.Pointer<X509> issuer, | |
| ffi.Pointer<X509> subject, | |
| ); | |
| /// X509_check_private_key returns one if `x509`'s public key matches `pkey` and | |
| /// zero otherwise. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_check_private_key', | |
| ) | |
| external int X509_check_private_key( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_check_purpose performs checks if `x509`'s basic constraints, key usage, | |
| /// and extended key usage extensions for the specified purpose. `purpose` should | |
| /// be one of `X509_PURPOSE_*` constants. See `X509_VERIFY_PARAM_set_purpose` for | |
| /// details. It returns one if `x509`'s extensions are consistent with `purpose` | |
| /// and zero otherwise. If `ca` is non-zero, `x509` is checked as a CA | |
| /// certificate. Otherwise, it is checked as an end-entity certificate. | |
| /// | |
| /// If `purpose` is -1, this function performs no purpose checks, but it parses | |
| /// some extensions in `x509` and may return zero on syntax error. Historically, | |
| /// callers primarily used this function to trigger this parsing, but this is no | |
| /// longer necessary. Functions acting on `X509` will internally parse as needed. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_check_purpose', | |
| ) | |
| external int X509_check_purpose( | |
| ffi.Pointer<X509> x509, | |
| int purpose, | |
| int ca, | |
| ); | |
| /// X509_check_trust checks if `x509` is a valid trust anchor for trust type | |
| /// `id`. See `X509_VERIFY_PARAM_set_trust` for details. It returns | |
| /// `X509_TRUST_TRUSTED` if `x509` is a trust anchor, `X509_TRUST_REJECTED` if it | |
| /// was distrusted, and `X509_TRUST_UNTRUSTED` otherwise. `id` should be one of | |
| /// the `X509_TRUST_*` constants, or zero to indicate the default behavior. | |
| /// `flags` should be zero and is ignored. | |
| /// | |
| /// WARNING: This function assumes `x509` is a trusted certificate, installed in | |
| /// an `X509_STORE`. If passed an arbitrary certificate from an untrusted source, | |
| /// it may return `X509_TRUST_TRUSTED`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_check_trust', | |
| ) | |
| external int X509_check_trust( | |
| ffi.Pointer<X509> x509, | |
| int id, | |
| int flags, | |
| ); | |
| /// X509_cmp compares `a` and `b` and returns zero if they are equal, a negative | |
| /// number if `b` sorts after `a` and a negative number if `a` sorts after `b`. | |
| /// The sort order implemented by this function is arbitrary and does not | |
| /// reflect properties of the certificate such as expiry. Applications should not | |
| /// rely on the order itself. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/355): This function works by comparing a | |
| /// cached hash of the encoded certificate. If `a` or `b` could not be | |
| /// serialized, the current behavior is to compare all unencodable certificates | |
| /// as equal. This function should only be used with `X509` objects that were | |
| /// parsed from bytes and never mutated. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_cmp', | |
| ) | |
| external int X509_cmp( | |
| ffi.Pointer<X509> a, | |
| ffi.Pointer<X509> b, | |
| ); | |
| /// X509_cmp_current_time behaves like `X509_cmp_time` but compares `s` against | |
| /// the current time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_cmp_current_time', | |
| ) | |
| external int X509_cmp_current_time( | |
| ffi.Pointer<ASN1_TIME> s, | |
| ); | |
| /// X509_cmp_time compares `s` against `*t`. On success, it returns a negative | |
| /// number if `s` <= `*t` and a positive number if `s` > `*t`. On error, it | |
| /// returns zero. If `t` is NULL, it uses the current time instead of `*t`. | |
| /// | |
| /// WARNING: Unlike most comparison functions, this function returns zero on | |
| /// error, not equality. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<time_t>)>( | |
| symbol: 'bssl_dart_X509_cmp_time', | |
| ) | |
| external int X509_cmp_time( | |
| ffi.Pointer<ASN1_TIME> s, | |
| ffi.Pointer<time_t> t, | |
| ); | |
| /// X509_cmp_time_posix compares `s` against `t`. On success, it returns a | |
| /// negative number if `s` <= `t` and a positive number if `s` > `t`. On error, | |
| /// it returns zero. | |
| /// | |
| /// If `s` has a time zone offset, it returns an error (0). | |
| /// | |
| /// WARNING: Unlike most comparison functions, this function returns zero on | |
| /// error, not equality. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Int64)>( | |
| symbol: 'bssl_dart_X509_cmp_time_posix', | |
| ) | |
| external int X509_cmp_time_posix( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int t, | |
| ); | |
| /// X509_cmp_time_posix_nonstandard compares `s` against `t`. On success, it | |
| /// returns a negative number if `s` <= `t` and a positive number if `s` > `t`. | |
| /// On error, it returns zero. | |
| /// | |
| /// If `s` has a time zone offset, it applies it before comparing to `t`. See | |
| /// `ASN1_TIME_to_posix_nonstandard` for more details. | |
| /// | |
| /// WARNING: Unlike most comparison functions, this function returns zero on | |
| /// error, not equality. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Int64)>( | |
| symbol: 'bssl_dart_X509_cmp_time_posix_nonstandard', | |
| ) | |
| external int X509_cmp_time_posix_nonstandard( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int t, | |
| ); | |
| /// X509_delete_ext removes the extension in `x` at index `loc` and returns the | |
| /// removed extension, or NULL if `loc` was out of bounds. If non-NULL, the | |
| /// caller must release the result with `X509_EXTENSION_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_delete_ext', | |
| ) | |
| external ffi.Pointer<X509_EXTENSION> X509_delete_ext( | |
| ffi.Pointer<X509> x, | |
| int loc, | |
| ); | |
| /// X509_digest hashes `x509`'s DER encoding with `md` and writes the result to | |
| /// `out`. `EVP_MD_CTX_size` bytes are written, which is at most | |
| /// `EVP_MAX_MD_SIZE`. If `out_len` is not NULL, `*out_len` is set to the number | |
| /// of bytes written. This function returns one on success and zero on error. | |
| /// Note this digest covers the entire certificate, not just the signed portion. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_digest') | |
| external int X509_digest( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// X509_dup returns a newly-allocated copy of `x509`, or NULL on error. This | |
| /// function works by serializing the structure, so auxiliary properties (see | |
| /// `i2d_X509_AUX`) are not preserved. Additionally, if `x509` is incomplete, | |
| /// this function may fail. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_dup', | |
| ) | |
| external ffi.Pointer<X509> X509_dup( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_dup_ref increments the reference count of `x509` and returns `x509`. | |
| /// The caller must call `X509_free` on the result to release the reference. | |
| /// | |
| /// WARNING: Although the result is non-const for use with `X509_free`, it is | |
| /// still shared with other parts of the application for the same object. Avoid | |
| /// mutating shared `X509`s. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_dup_ref', | |
| ) | |
| external ffi.Pointer<X509> X509_dup_ref( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_email_free releases memory associated with `sk`, including `sk` itself. | |
| /// Each `OPENSSL_STRING` in `sk` must be a NUL-terminated string allocated with | |
| /// `OPENSSL_malloc`. If `sk` is NULL, no action is taken. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<stack_st_OPENSSL_STRING>)>( | |
| symbol: 'bssl_dart_X509_email_free', | |
| ) | |
| external void X509_email_free( | |
| ffi.Pointer<stack_st_OPENSSL_STRING> sk, | |
| ); | |
| /// X509_find_by_issuer_and_serial returns the first `X509` in `sk` whose issuer | |
| /// and serial are `name` and `serial`, respectively. If no match is found, it | |
| /// returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<stack_st_X509>, | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_find_by_issuer_and_serial') | |
| external ffi.Pointer<X509> X509_find_by_issuer_and_serial( | |
| ffi.Pointer<stack_st_X509> sk, | |
| ffi.Pointer<X509_NAME> name, | |
| ffi.Pointer<ASN1_INTEGER> serial, | |
| ); | |
| /// X509_find_by_subject returns the first `X509` in `sk` whose subject is | |
| /// `name`. If no match is found, it returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function(ffi.Pointer<stack_st_X509>, ffi.Pointer<X509_NAME>) | |
| >(symbol: 'bssl_dart_X509_find_by_subject') | |
| external ffi.Pointer<X509> X509_find_by_subject( | |
| ffi.Pointer<stack_st_X509> sk, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_free decrements `x509`'s reference count and, if zero, releases memory | |
| /// associated with `x509`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509>)>(symbol: 'bssl_dart_X509_free') | |
| external void X509_free( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_authority_issuer returns the authorityCertIssuer of `x509`'s | |
| /// authority key identifier, if the extension and field are present. (See | |
| /// RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present, | |
| /// if it is present but lacks an authorityCertIssuer field, or if some extension | |
| /// in `x509` was invalid. | |
| /// | |
| /// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for | |
| /// invalid extensions. To detect the error case, call | |
| /// `X509_get_extension_flags` and check the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<GENERAL_NAMES> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_authority_issuer', | |
| ) | |
| external ffi.Pointer<GENERAL_NAMES> X509_get0_authority_issuer( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_authority_key_id returns keyIdentifier of `x509`'s authority key | |
| /// identifier, if the extension and field are present. (See RFC 5280, | |
| /// section 4.2.1.1.) It returns NULL if the extension is not present, if it is | |
| /// present but lacks a keyIdentifier field, or if some extension in `x509` was | |
| /// invalid. | |
| /// | |
| /// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for | |
| /// invalid extensions. To detect the error case, call | |
| /// `X509_get_extension_flags` and check the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_authority_key_id', | |
| ) | |
| external ffi.Pointer<ASN1_OCTET_STRING> X509_get0_authority_key_id( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_authority_serial returns the authorityCertSerialNumber of `x509`'s | |
| /// authority key identifier, if the extension and field are present. (See | |
| /// RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present, | |
| /// if it is present but lacks an authorityCertSerialNumber field, or if some | |
| /// extension in `x509` was invalid. | |
| /// | |
| /// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for | |
| /// invalid extensions. To detect the error case, call | |
| /// `X509_get_extension_flags` and check the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_authority_serial', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> X509_get0_authority_serial( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_extensions returns `x509`'s extension list, or NULL if `x509` omits | |
| /// it. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_X509_EXTENSION> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_extensions', | |
| ) | |
| external ffi.Pointer<stack_st_X509_EXTENSION> X509_get0_extensions( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_notAfter returns `x509`'s notAfter time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_notAfter', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_get0_notAfter( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_notBefore returns `x509`'s notBefore time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_notBefore', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_get0_notBefore( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_pubkey returns `x509`'s public key as an `EVP_PKEY`, or NULL if the | |
| /// public key was unsupported or could not be decoded. The `EVP_PKEY` is cached | |
| /// in `x509`, so callers must not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_pubkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_get0_pubkey( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_pubkey_bitstr returns the BIT STRING portion of `x509`'s public | |
| /// key. Note this does not contain the AlgorithmIdentifier portion. | |
| /// | |
| /// WARNING: This function returns a non-const pointer for OpenSSL compatibility, | |
| /// but the caller must not modify the resulting object. Doing so will break | |
| /// internal invariants in `x509`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_BIT_STRING> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_pubkey_bitstr', | |
| ) | |
| external ffi.Pointer<ASN1_BIT_STRING> X509_get0_pubkey_bitstr( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_serialNumber returns `x509`'s serial number. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_serialNumber', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> X509_get0_serialNumber( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_signature sets `*out_sig` and `*out_alg` to the signature and | |
| /// signature algorithm of `x509`, respectively. Either output pointer may be | |
| /// NULL to ignore the value. | |
| /// | |
| /// This function outputs the outer signature algorithm. For the one in the | |
| /// TBSCertificate, see `X509_get0_tbs_sigalg`. Certificates with mismatched | |
| /// signature algorithms will successfully parse, but they will be rejected when | |
| /// verifying. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<X509>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_get0_signature') | |
| external void X509_get0_signature( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out_sig, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out_alg, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_subject_key_id returns `x509`'s subject key identifier, if present. | |
| /// (See RFC 5280, section 4.2.1.2.) It returns NULL if the extension is not | |
| /// present or if some extension in `x509` was invalid. | |
| /// | |
| /// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for | |
| /// invalid extensions. To detect the error case, call | |
| /// `X509_get_extension_flags` and check the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_subject_key_id', | |
| ) | |
| external ffi.Pointer<ASN1_OCTET_STRING> X509_get0_subject_key_id( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_tbs_sigalg returns the signature algorithm in `x509`'s | |
| /// TBSCertificate. For the outer signature algorithm, see `X509_get0_signature`. | |
| /// | |
| /// Certificates with mismatched signature algorithms will successfully parse, | |
| /// but they will be rejected when verifying. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_ALGOR> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get0_tbs_sigalg', | |
| ) | |
| external ffi.Pointer<X509_ALGOR> X509_get0_tbs_sigalg( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get0_uids sets `*out_issuer_uid` to a non-owning pointer to the | |
| /// issuerUID field of `x509`, or NULL if `x509` has no issuerUID. It similarly | |
| /// outputs `x509`'s subjectUID field to `*out_subject_uid`. | |
| /// | |
| /// Callers may pass NULL to either `out_issuer_uid` or `out_subject_uid` to | |
| /// ignore the corresponding field. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_get0_uids') | |
| external void X509_get0_uids( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out_issuer_uid, | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out_subject_uid, | |
| ); | |
| /// X509_get1_email returns a newly-allocated list of NUL-terminated strings | |
| /// containing all email addresses in `x509`'s subject and all rfc822name names | |
| /// in `x509`'s subject alternative names. Email addresses which contain embedded | |
| /// NUL bytes are skipped. The results are returned in an arbitrary order. | |
| /// | |
| /// On error, or if there are no such email addresses, it returns NULL. When | |
| /// done, the caller must release the result with `X509_email_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_OPENSSL_STRING> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get1_email', | |
| ) | |
| external ffi.Pointer<stack_st_OPENSSL_STRING> X509_get1_email( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get1_ocsp returns a newly-allocated list of NUL-terminated strings | |
| /// containing all OCSP URIs in `x509`. That is, it collects all URI | |
| /// AccessDescriptions with an accessMethod of id-ad-ocsp in `x509`'s authority | |
| /// information access extension. URIs which contain embedded NUL bytes are | |
| /// skipped. The results are returned in an arbitrary order. | |
| /// | |
| /// On error, or if there are no such URIs, it returns NULL. When done, the | |
| /// caller must release the result with `X509_email_free`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<stack_st_OPENSSL_STRING> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get1_ocsp', | |
| ) | |
| external ffi.Pointer<stack_st_OPENSSL_STRING> X509_get1_ocsp( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_X509_PUBKEY returns the public key of `x509`. Note this function is | |
| /// not const-correct for legacy reasons. Callers should not modify the returned | |
| /// object. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_PUBKEY> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_X509_PUBKEY', | |
| ) | |
| external ffi.Pointer<X509_PUBKEY> X509_get_X509_PUBKEY( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// The following functions return filesystem paths used to determine the above | |
| /// "default" paths, when the corresponding environment variables are not set. | |
| /// | |
| /// Using these functions is not recommended. In OpenSSL, these defaults are | |
| /// determined by OpenSSL's install prefix. There is no corresponding concept for | |
| /// BoringSSL. Future versions of BoringSSL may change or remove this | |
| /// functionality. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_cert_area', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_cert_area(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_cert_dir', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_cert_dir(); | |
| /// X509_get_default_cert_dir_env returns "SSL_CERT_DIR", an environment variable | |
| /// used to determine the above "default" paths. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_cert_dir_env', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_cert_dir_env(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_cert_file', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_cert_file(); | |
| /// X509_get_default_cert_file_env returns "SSL_CERT_FILE", an environment | |
| /// variable used to determine the above "default" paths. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_cert_file_env', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_cert_file_env(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function()>( | |
| symbol: 'bssl_dart_X509_get_default_private_dir', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_get_default_private_dir(); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<X509>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_get_ex_data', | |
| ) | |
| external ffi.Pointer<ffi.Void> X509_get_ex_data( | |
| ffi.Pointer<X509> r, | |
| int idx, | |
| ); | |
| /// ex_data functions. | |
| /// | |
| /// See `ex_data.h` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Long, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<CRYPTO_EX_unused>, | |
| ffi.Pointer<CRYPTO_EX_dup>, | |
| ffi.Pointer<CRYPTO_EX_free>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_get_ex_new_index') | |
| external int X509_get_ex_new_index( | |
| int argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ffi.Pointer<CRYPTO_EX_unused> unused, | |
| ffi.Pointer<CRYPTO_EX_dup> dup_unused, | |
| ffi.Pointer<CRYPTO_EX_free> free_func, | |
| ); | |
| /// X509_get_ext returns the extension in `x` at index `loc`, or NULL if `loc` is | |
| /// out of bounds. This function returns a non-const pointer for OpenSSL | |
| /// compatibility, but callers should not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509>, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_get_ext', | |
| ) | |
| external ffi.Pointer<X509_EXTENSION> X509_get_ext( | |
| ffi.Pointer<X509> x, | |
| int loc, | |
| ); | |
| /// X509_get_ext_by_NID behaves like `X509v3_get_ext_by_NID` but searches for | |
| /// extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_get_ext_by_NID', | |
| ) | |
| external int X509_get_ext_by_NID( | |
| ffi.Pointer<X509> x, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509_get_ext_by_OBJ behaves like `X509v3_get_ext_by_OBJ` but searches for | |
| /// extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_OBJECT>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_get_ext_by_OBJ') | |
| external int X509_get_ext_by_OBJ( | |
| ffi.Pointer<X509> x, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509_get_ext_by_critical behaves like `X509v3_get_ext_by_critical` but | |
| /// searches for extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Int, ffi.Int)>( | |
| symbol: 'bssl_dart_X509_get_ext_by_critical', | |
| ) | |
| external int X509_get_ext_by_critical( | |
| ffi.Pointer<X509> x, | |
| int crit, | |
| int lastpos, | |
| ); | |
| /// X509_get_ext_count returns the number of extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_ext_count', | |
| ) | |
| external int X509_get_ext_count( | |
| ffi.Pointer<X509> x, | |
| ); | |
| /// X509_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the extension in | |
| /// `x509`'s extension list. | |
| /// | |
| /// WARNING: This function is difficult to use correctly. See the documentation | |
| /// for `X509V3_get_d2i` for details. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Int>, | |
| ffi.Pointer<ffi.Int>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_get_ext_d2i') | |
| external ffi.Pointer<ffi.Void> X509_get_ext_d2i( | |
| ffi.Pointer<X509> x509, | |
| int nid, | |
| ffi.Pointer<ffi.Int> out_critical, | |
| ffi.Pointer<ffi.Int> out_idx, | |
| ); | |
| /// X509_get_extended_key_usage returns a bitmask of extended key usages (see | |
| /// Section 4.2.1.12 of RFC 5280) which `x509` is valid for. The result will be | |
| /// a combination of `XKU_*` constants. If checking an extended key usage not | |
| /// defined above, callers should extract the extended key usage extension | |
| /// separately, e.g. via `X509_get_ext_d2i`. | |
| /// | |
| /// If `x509` has no extended key usage extension, all extended key usages are | |
| /// valid and this function returns `UINT32_MAX`. If there was an error | |
| /// processing `x509`'s extensions, or if `x509`'s extended key usage extension | |
| /// contained no recognized usages, this function returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_extended_key_usage', | |
| ) | |
| external int X509_get_extended_key_usage( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_extension_flags decodes a set of extensions from `x509` and returns | |
| /// a collection of `EXFLAG_*` bits which reflect `x509`. If there was an error | |
| /// in computing this bitmask, the result will include the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_extension_flags', | |
| ) | |
| external int X509_get_extension_flags( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_issuer_name returns `x509`'s issuer. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_issuer_name', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_get_issuer_name( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_key_usage returns a bitmask of key usages (see Section 4.2.1.3 of | |
| /// RFC 5280) which `x509` is valid for. This function only reports the first 16 | |
| /// bits, in a little-endian byte order, but big-endian bit order. That is, bits | |
| /// 0 though 7 are reported at 1<<7 through 1<<0, and bits 8 through 15 are | |
| /// reported at 1<<15 through 1<<8. | |
| /// | |
| /// Instead of depending on this bit order, callers should compare against the | |
| /// `X509v3_KU_*` constants. | |
| /// | |
| /// If `x509` has no key usage extension, all key usages are valid and this | |
| /// function returns `UINT32_MAX`. If there was an error processing `x509`'s | |
| /// extensions, or if the first 16 bits in the key usage extension were all zero, | |
| /// this function returns zero. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_key_usage', | |
| ) | |
| external int X509_get_key_usage( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_notAfter returns `x509`'s notAfter time. Note this function is not | |
| /// const-correct for legacy reasons. Use `X509_get0_notAfter` or | |
| /// `X509_getm_notAfter` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_notAfter', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_get_notAfter( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_notBefore returns `x509`'s notBefore time. Note this function is not | |
| /// const-correct for legacy reasons. Use `X509_get0_notBefore` or | |
| /// `X509_getm_notBefore` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_notBefore', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_get_notBefore( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_pathlen returns path length constraint from the basic constraints | |
| /// extension in `x509`. (See RFC 5280, section 4.2.1.9.) It returns -1 if the | |
| /// constraint is not present, or if some extension in `x509` was invalid. | |
| /// | |
| /// TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for | |
| /// invalid extensions. To detect the error case, call | |
| /// `X509_get_extension_flags` and check the `EXFLAG_INVALID` bit. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_pathlen', | |
| ) | |
| external int X509_get_pathlen( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_pubkey behaves like `X509_get0_pubkey` but increments the reference | |
| /// count on the `EVP_PKEY`. The caller must release the result with | |
| /// `EVP_PKEY_free` when done. The `EVP_PKEY` is cached in `x509`, so callers | |
| /// must not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_pubkey', | |
| ) | |
| external ffi.Pointer<EVP_PKEY> X509_get_pubkey( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_serialNumber returns a mutable pointer to `x509`'s serial number. | |
| /// Prefer `X509_get0_serialNumber`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_INTEGER> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_serialNumber', | |
| ) | |
| external ffi.Pointer<ASN1_INTEGER> X509_get_serialNumber( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_signature_nid returns the NID corresponding to `x509`'s signature | |
| /// algorithm, or `NID_undef` if the signature algorithm does not correspond to | |
| /// a known NID. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_signature_nid', | |
| ) | |
| external int X509_get_signature_nid( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_subject_name returns `x509`'s subject. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509_NAME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_subject_name', | |
| ) | |
| external ffi.Pointer<X509_NAME> X509_get_subject_name( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_get_version returns the numerical value of `x509`'s version, which will | |
| /// be one of the `X509_VERSION_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Long Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_get_version', | |
| ) | |
| external int X509_get_version( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_getm_notAfter returns a mutable pointer to `x509`'s notAfter time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_getm_notAfter', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_getm_notAfter( | |
| ffi.Pointer<X509> x, | |
| ); | |
| /// X509_getm_notBefore returns a mutable pointer to `x509`'s notBefore time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_getm_notBefore', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_getm_notBefore( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_gmtime_adj behaves like `X509_time_adj_ex` but adds `offset_sec` to the | |
| /// current time. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_TIME> Function(ffi.Pointer<ASN1_TIME>, ffi.Long)>( | |
| symbol: 'bssl_dart_X509_gmtime_adj', | |
| ) | |
| external ffi.Pointer<ASN1_TIME> X509_gmtime_adj( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int offset_sec, | |
| ); | |
| /// X509_issuer_name_cmp behaves like `X509_NAME_cmp`, but compares `a` and `b`'s | |
| /// issuer names. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_issuer_name_cmp', | |
| ) | |
| external int X509_issuer_name_cmp( | |
| ffi.Pointer<X509> a, | |
| ffi.Pointer<X509> b, | |
| ); | |
| /// X509_issuer_name_hash returns the hash of `x509`'s issuer name with | |
| /// `X509_NAME_hash`. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. It also depends on an OpenSSL-specific | |
| /// canonicalization process. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_issuer_name_hash', | |
| ) | |
| external int X509_issuer_name_hash( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_issuer_name_hash_old returns the hash of `x509`'s issuer name with | |
| /// `X509_NAME_hash_old`. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_issuer_name_hash_old', | |
| ) | |
| external int X509_issuer_name_hash_old( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_keyid_get0 looks up `x509`'s key ID. If found, it sets `*out_len` to the | |
| /// key ID's length and returns a pointer to a buffer containing the contents. If | |
| /// not found, it outputs the empty string by returning NULL and setting | |
| /// `*out_len` to zero. | |
| /// | |
| /// WARNING: In OpenSSL, this function did not set `*out_len` when the alias was | |
| /// missing. Callers that target both OpenSSL and BoringSSL should set the value | |
| /// to zero before calling this function. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Int>) | |
| >(symbol: 'bssl_dart_X509_keyid_get0') | |
| external ffi.Pointer<ffi.Uint8> X509_keyid_get0( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Int> out_len, | |
| ); | |
| /// X509_keyid_set1 sets `x509`'s key ID to `len` bytes from `id`. If `id` is | |
| /// NULL, the key ID is cleared instead. Key IDs are not part of the certificate | |
| /// itself and will not be serialized by `i2d_X509`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Uint8>, ossl_ssize_t) | |
| >(symbol: 'bssl_dart_X509_keyid_set1') | |
| external int X509_keyid_set1( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Uint8> id, | |
| int len, | |
| ); | |
| /// X509_load_cert_crl_file loads CRLs and trusted certificates from `file` and | |
| /// adds them to `lookup`'s `X509_STORE`. It returns one on success and zero on | |
| /// error. | |
| /// | |
| /// If `type` is `X509_FILETYPE_ASN1`, it loads a single DER-encoded certificate. | |
| /// This function cannot be used to load a DER-encoded CRL. If `type` is | |
| /// `X509_FILETYPE_PEM`, it loads a sequence of PEM-encoded certificates and | |
| /// CRLs. `type` may not be `X509_FILETYPE_DEFAULT`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_LOOKUP>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_load_cert_crl_file') | |
| external int X509_load_cert_crl_file( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| ffi.Pointer<ffi.Char> file, | |
| int type, | |
| ); | |
| /// X509_load_cert_file loads trusted certificates from `file` and adds them to | |
| /// `lookup`'s `X509_STORE`. It returns one on success and zero on error. | |
| /// | |
| /// If `type` is `X509_FILETYPE_ASN1`, it loads a single DER-encoded certificate. | |
| /// If `type` is `X509_FILETYPE_PEM`, it loads a sequence of PEM-encoded | |
| /// certificates. `type` may not be `X509_FILETYPE_DEFAULT`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_LOOKUP>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_load_cert_file') | |
| external int X509_load_cert_file( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| ffi.Pointer<ffi.Char> file, | |
| int type, | |
| ); | |
| /// X509_load_crl_file loads CRLs from `file` and add them it to `lookup`'s | |
| /// `X509_STORE`. It returns one on success and zero on error. | |
| /// | |
| /// If `type` is `X509_FILETYPE_ASN1`, it loads a single DER-encoded CRL. If | |
| /// `type` is `X509_FILETYPE_PEM`, it loads a sequence of PEM-encoded CRLs. | |
| /// `type` may not be `X509_FILETYPE_DEFAULT`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_LOOKUP>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_load_crl_file') | |
| external int X509_load_crl_file( | |
| ffi.Pointer<X509_LOOKUP> lookup, | |
| ffi.Pointer<ffi.Char> file, | |
| int type, | |
| ); | |
| /// X509_new returns a newly-allocated, empty `X509` object, or NULL on error. | |
| /// This produces an incomplete certificate which may be filled in to issue a new | |
| /// certificate. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function()>(symbol: 'bssl_dart_X509_new') | |
| external ffi.Pointer<X509> X509_new(); | |
| /// X509_parse_from_buffer behaves like `X509_parse_with_algorithms` but uses a | |
| /// default algorithm list. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<X509> Function(ffi.Pointer<CRYPTO_BUFFER>)>( | |
| symbol: 'bssl_dart_X509_parse_from_buffer', | |
| ) | |
| external ffi.Pointer<X509> X509_parse_from_buffer( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ); | |
| /// X509_parse_with_algorithms parses an X.509 structure from `buf` and returns a | |
| /// fresh X509 or NULL on error. There must not be any trailing data in `buf`. | |
| /// The returned structure (if any) increments `buf`'s reference count and | |
| /// retains a reference to it. | |
| /// | |
| /// Only the `num_algs` algorithms from `algs` will be considered when parsing | |
| /// the certificate's public key. If the certificate uses a different algorithm, | |
| /// it will still be parsed, but `X509_get0_pubkey` will return NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<CRYPTO_BUFFER>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_X509_parse_with_algorithms') | |
| external ffi.Pointer<X509> X509_parse_with_algorithms( | |
| ffi.Pointer<CRYPTO_BUFFER> buf, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY_ALG>> algs, | |
| int num_algs, | |
| ); | |
| /// X509_print calls `X509_print_ex` with `XN_FLAG_COMPAT` and `X509_FLAG_COMPAT` | |
| /// flags. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_print', | |
| ) | |
| external int X509_print( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509> x, | |
| ); | |
| /// X509_print_ex writes a human-readable representation of `x` to `bp`. It | |
| /// returns one on success and zero on error. `nmflags` is the flags parameter | |
| /// for `X509_NAME_print_ex` when printing the subject and issuer. `cflag` should | |
| /// be some combination of the `X509_FLAG_*` and `X509V3_EXT_*` constants. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<X509>, | |
| ffi.UnsignedLong, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_print_ex') | |
| external int X509_print_ex( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509> x, | |
| int nmflag, | |
| int cflag, | |
| ); | |
| /// X509_print_ex_fp behaves like `X509_print_ex` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<X509>, | |
| ffi.UnsignedLong, | |
| ffi.UnsignedLong, | |
| ) | |
| >(symbol: 'bssl_dart_X509_print_ex_fp') | |
| external int X509_print_ex_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509> x, | |
| int nmflag, | |
| int cflag, | |
| ); | |
| /// X509_print_fp behaves like `X509_print` but writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_print_fp', | |
| ) | |
| external int X509_print_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509> x, | |
| ); | |
| /// X509_pubkey_digest hashes the contents of the BIT STRING in `x509`'s | |
| /// subjectPublicKeyInfo field with `md` and writes the result to `out`. | |
| /// `EVP_MD_CTX_size` bytes are written, which is at most `EVP_MAX_MD_SIZE`. If | |
| /// `out_len` is not NULL, `*out_len` is set to the number of bytes written. This | |
| /// function returns one on success and zero on error. | |
| /// | |
| /// This hash omits the BIT STRING tag, length, and number of unused bits. It | |
| /// also omits the AlgorithmIdentifier which describes the key type. It | |
| /// corresponds to the OCSP KeyHash definition and is not suitable for other | |
| /// purposes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<EVP_MD>, | |
| ffi.Pointer<ffi.Uint8>, | |
| ffi.Pointer<ffi.UnsignedInt>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_pubkey_digest') | |
| external int X509_pubkey_digest( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_MD> md, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.UnsignedInt> out_len, | |
| ); | |
| /// X509_reject_clear clears the list of OIDs for which `x509` is distrusted. See | |
| /// also `X509_add1_reject_object`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_reject_clear', | |
| ) | |
| external void X509_reject_clear( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_set1_notAfter sets `x509`'s notAfter time to `tm`. it returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_set1_notAfter', | |
| ) | |
| external int X509_set1_notAfter( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_set1_notBefore sets `x509`'s notBefore time to `tm`. It returns one on | |
| /// success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_set1_notBefore', | |
| ) | |
| external int X509_set1_notBefore( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_set1_signature_algo sets `x509`'s signature algorithm to `algo` and | |
| /// returns one on success or zero on error. It updates both the signature field | |
| /// of the TBSCertificate structure, and the signatureAlgorithm field of the | |
| /// Certificate. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509_ALGOR>)>( | |
| symbol: 'bssl_dart_X509_set1_signature_algo', | |
| ) | |
| external int X509_set1_signature_algo( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<X509_ALGOR> algo, | |
| ); | |
| /// X509_set1_signature_value sets `x509`'s signature to a copy of the `sig_len` | |
| /// bytes pointed by `sig`. It returns one on success and zero on error. | |
| /// | |
| /// Due to a specification error, X.509 certificates store signatures in ASN.1 | |
| /// BIT STRINGs, but signature algorithms return byte strings rather than bit | |
| /// strings. This function creates a BIT STRING containing a whole number of | |
| /// bytes, with the bit order matching the DER encoding. This matches the | |
| /// encoding used by all X.509 signature algorithms. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Uint8>, ffi.Size) | |
| >(symbol: 'bssl_dart_X509_set1_signature_value') | |
| external int X509_set1_signature_value( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| int sig_len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Int, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_X509_set_ex_data') | |
| external int X509_set_ex_data( | |
| ffi.Pointer<X509> r, | |
| int idx, | |
| ffi.Pointer<ffi.Void> arg, | |
| ); | |
| /// X509_set_issuer_name sets `x509`'s issuer to a copy of `name`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_set_issuer_name', | |
| ) | |
| external int X509_set_issuer_name( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_set_notAfter calls `X509_set1_notAfter`. Use `X509_set1_notAfter` | |
| /// instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_set_notAfter', | |
| ) | |
| external int X509_set_notAfter( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_set_notBefore calls `X509_set1_notBefore`. Use `X509_set1_notBefore` | |
| /// instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_TIME>)>( | |
| symbol: 'bssl_dart_X509_set_notBefore', | |
| ) | |
| external int X509_set_notBefore( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_TIME> tm$1, | |
| ); | |
| /// X509_set_pubkey sets `x509`'s public key to `pkey`. It returns one on success | |
| /// and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_set_pubkey', | |
| ) | |
| external int X509_set_pubkey( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_set_serialNumber sets `x509`'s serial number to `serial`. It returns one | |
| /// on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ASN1_INTEGER>)>( | |
| symbol: 'bssl_dart_X509_set_serialNumber', | |
| ) | |
| external int X509_set_serialNumber( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ASN1_INTEGER> serial, | |
| ); | |
| /// X509_set_subject_name sets `x509`'s subject to a copy of `name`. It returns | |
| /// one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509_NAME>)>( | |
| symbol: 'bssl_dart_X509_set_subject_name', | |
| ) | |
| external int X509_set_subject_name( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<X509_NAME> name, | |
| ); | |
| /// X509_set_unsigned fills in the placeholder fields in `x509` to make an | |
| /// unsigned certificate (RFC 9925) and returns one on success or zero on error. | |
| /// It sets the signature algorithm to id-alg-unsigned and the signature value to | |
| /// the empty string. If the issuer is empty, it additionally sets the issuer to | |
| /// the id-rdna-unsigned placeholder value. Otherwise, it retains the existing | |
| /// issuer value. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_set_unsigned', | |
| ) | |
| external int X509_set_unsigned( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_set_version sets `x509`'s version to `version`, which should be one of | |
| /// the `X509V_VERSION_*` constants. It returns one on success and zero on error. | |
| /// | |
| /// If unsure, use `X509_VERSION_3`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Long)>( | |
| symbol: 'bssl_dart_X509_set_version', | |
| ) | |
| external int X509_set_version( | |
| ffi.Pointer<X509> x509, | |
| int version, | |
| ); | |
| /// X509_sign signs `x509` with `pkey` and replaces the signature algorithm and | |
| /// signature fields. It returns the length of the signature on success and zero | |
| /// on error. This function uses digest algorithm `md`, or `pkey`'s default if | |
| /// NULL. Other signing parameters use `pkey`'s defaults. To customize them, use | |
| /// `X509_sign_ctx`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_MD>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_sign') | |
| external int X509_sign( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<EVP_MD> md, | |
| ); | |
| /// X509_sign_ctx signs `x509` with `ctx` and replaces the signature algorithm | |
| /// and signature fields. It returns the length of the signature on success and | |
| /// zero on error. The signature algorithm and parameters come from `ctx`, which | |
| /// must have been initialized with `EVP_DigestSignInit`. The caller should | |
| /// configure the corresponding `EVP_PKEY_CTX` before calling this function. | |
| /// | |
| /// On success or failure, this function mutates `ctx` and resets it to the empty | |
| /// state. Caller should not rely on its contents after the function returns. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<EVP_MD_CTX>)>( | |
| symbol: 'bssl_dart_X509_sign_ctx', | |
| ) | |
| external int X509_sign_ctx( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_MD_CTX> ctx, | |
| ); | |
| /// X509_signature_dump writes a human-readable representation of `sig` to `bio`, | |
| /// indented with `indent` spaces. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_STRING>, ffi.Int) | |
| >(symbol: 'bssl_dart_X509_signature_dump') | |
| external int X509_signature_dump( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ASN1_STRING> sig, | |
| int indent, | |
| ); | |
| /// X509_signature_print writes a human-readable representation of `alg` and | |
| /// `sig` to `bio`. It returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ASN1_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_signature_print') | |
| external int X509_signature_print( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ffi.Pointer<ASN1_STRING> sig, | |
| ); | |
| /// X509_subject_name_cmp behaves like `X509_NAME_cmp`, but compares `a` and | |
| /// `b`'s subject names. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_subject_name_cmp', | |
| ) | |
| external int X509_subject_name_cmp( | |
| ffi.Pointer<X509> a, | |
| ffi.Pointer<X509> b, | |
| ); | |
| /// X509_subject_name_hash returns the hash of `x509`'s subject name with | |
| /// `X509_NAME_hash`. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. It also depends on an OpenSSL-specific | |
| /// canonicalization process. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_subject_name_hash', | |
| ) | |
| external int X509_subject_name_hash( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_subject_name_hash_old returns the hash of `x509`'s usjbect name with | |
| /// `X509_NAME_hash_old`. | |
| /// | |
| /// This hash is specific to the `X509_LOOKUP_add_dir` filesystem format and is | |
| /// not suitable for general-purpose X.509 name processing. It is very short, so | |
| /// there will be hash collisions. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Uint32 Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_subject_name_hash_old', | |
| ) | |
| external int X509_subject_name_hash_old( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_supported_extension returns one if `ex` is a critical X.509 certificate | |
| /// extension, supported by `X509_verify_cert`, and zero otherwise. | |
| /// | |
| /// Note this function only reports certificate extensions (as opposed to CRL or | |
| /// CRL extensions), and only extensions that are expected to be marked critical. | |
| /// Additionally, `X509_verify_cert` checks for unsupported critical extensions | |
| /// internally, so most callers will not need to call this function separately. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509_supported_extension', | |
| ) | |
| external int X509_supported_extension( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ); | |
| /// X509_time_adj calls `X509_time_adj_ex` with `offset_day` equal to zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TIME> Function( | |
| ffi.Pointer<ASN1_TIME>, | |
| ffi.Long, | |
| ffi.Pointer<time_t>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_time_adj') | |
| external ffi.Pointer<ASN1_TIME> X509_time_adj( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int offset_sec, | |
| ffi.Pointer<time_t> t, | |
| ); | |
| /// X509_time_adj_ex behaves like `ASN1_TIME_adj`, but adds an offset to `*t`. If | |
| /// `t` is NULL, it uses the current time instead of `*t`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TIME> Function( | |
| ffi.Pointer<ASN1_TIME>, | |
| ffi.Int, | |
| ffi.Long, | |
| ffi.Pointer<time_t>, | |
| ) | |
| >(symbol: 'bssl_dart_X509_time_adj_ex') | |
| external ffi.Pointer<ASN1_TIME> X509_time_adj_ex( | |
| ffi.Pointer<ASN1_TIME> s, | |
| int offset_day, | |
| int offset_sec, | |
| ffi.Pointer<time_t> t, | |
| ); | |
| /// X509_trust_clear clears the list of OIDs for which `x509` is trusted. See | |
| /// also `X509_add1_trust_object`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_trust_clear', | |
| ) | |
| external void X509_trust_clear( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_up_ref adds one to the reference count of `x509` and returns one. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_X509_up_ref', | |
| ) | |
| external int X509_up_ref( | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// X509_verify checks that `x509` has a valid signature by `pkey`. It returns | |
| /// one if the signature is valid and zero otherwise. Note this function only | |
| /// checks the signature itself and does not perform a full certificate | |
| /// validation. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_X509_verify', | |
| ) | |
| external int X509_verify( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// X509_verify_cert performs certificate verification with `ctx`, which must | |
| /// have been initialized with `X509_STORE_CTX_init`. It returns one on success | |
| /// and zero on error. On success, `X509_STORE_CTX_get0_chain` or | |
| /// `X509_STORE_CTX_get1_chain` may be used to return the verified certificate | |
| /// chain. On error, `X509_STORE_CTX_get_error` may be used to return additional | |
| /// error information. | |
| /// | |
| /// WARNING: Most failure conditions from this function do not use the error | |
| /// queue. Use `X509_STORE_CTX_get_error` to determine the cause of the error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<X509_STORE_CTX>)>( | |
| symbol: 'bssl_dart_X509_verify_cert', | |
| ) | |
| external int X509_verify_cert( | |
| ffi.Pointer<X509_STORE_CTX> ctx, | |
| ); | |
| /// X509_verify_cert_error_string returns `err` as a human-readable string, where | |
| /// `err` should be one of the `X509_V_*` values. If `err` is unknown, it returns | |
| /// a default description. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Long)>( | |
| symbol: 'bssl_dart_X509_verify_cert_error_string', | |
| ) | |
| external ffi.Pointer<ffi.Char> X509_verify_cert_error_string( | |
| int err, | |
| ); | |
| /// X509v3_add_ext adds a copy of `ex` to the extension list in `*x`. If `*x` is | |
| /// NULL, it allocates a new `STACK_OF(X509_EXTENSION)` to hold the copy and sets | |
| /// `*x` to the new list. It returns `*x` on success and NULL on error. The | |
| /// caller retains ownership of `ex` and can release it independently of `*x`. | |
| /// | |
| /// The new extension is inserted at index `loc`, shifting extensions to the | |
| /// right. If `loc` is -1 or out of bounds, the new extension is appended to the | |
| /// list. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_X509_EXTENSION> Function( | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>>, | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509v3_add_ext') | |
| external ffi.Pointer<stack_st_X509_EXTENSION> X509v3_add_ext( | |
| ffi.Pointer<ffi.Pointer<stack_st_X509_EXTENSION>> x, | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| int loc, | |
| ); | |
| /// X509v3_delete_ext removes the extension in `x` at index `loc` and returns the | |
| /// removed extension, or NULL if `loc` was out of bounds. If an extension was | |
| /// returned, the caller must release it with `X509_EXTENSION_free`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509v3_delete_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509v3_delete_ext( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| int loc, | |
| ); | |
| /// X509v3_get_ext returns the extension in `x` at index `loc`, or NULL if `loc` | |
| /// is out of bounds. This function returns a non-const pointer for OpenSSL | |
| /// compatibility, but callers should not mutate the result. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509v3_get_ext') | |
| external ffi.Pointer<X509_EXTENSION> X509v3_get_ext( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| int loc, | |
| ); | |
| /// X509v3_get_ext_by_NID returns the index of the first extension in `x` with | |
| /// type `nid`, or a negative number if not found. If found, callers can use | |
| /// `X509v3_get_ext` to look up the extension by index. | |
| /// | |
| /// If `lastpos` is non-negative, it begins searching at `lastpos` + 1. Callers | |
| /// can thus loop over all matching extensions by first passing -1 and then | |
| /// passing the previously-returned value until no match is returned. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<stack_st_X509_EXTENSION>, ffi.Int, ffi.Int) | |
| >(symbol: 'bssl_dart_X509v3_get_ext_by_NID') | |
| external int X509v3_get_ext_by_NID( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| int nid, | |
| int lastpos, | |
| ); | |
| /// X509v3_get_ext_by_OBJ behaves like `X509v3_get_ext_by_NID` but looks for | |
| /// extensions matching `obj`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<stack_st_X509_EXTENSION>, | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Int, | |
| ) | |
| >(symbol: 'bssl_dart_X509v3_get_ext_by_OBJ') | |
| external int X509v3_get_ext_by_OBJ( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| ffi.Pointer<ASN1_OBJECT> obj, | |
| int lastpos, | |
| ); | |
| /// X509v3_get_ext_by_critical returns the index of the first extension in `x` | |
| /// whose critical bit matches `crit`, or a negative number if no such extension | |
| /// was found. | |
| /// | |
| /// If `lastpos` is non-negative, it begins searching at `lastpos` + 1. Callers | |
| /// can thus loop over all matching extensions by first passing -1 and then | |
| /// passing the previously-returned value until no match is returned. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<stack_st_X509_EXTENSION>, ffi.Int, ffi.Int) | |
| >(symbol: 'bssl_dart_X509v3_get_ext_by_critical') | |
| external int X509v3_get_ext_by_critical( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| int crit, | |
| int lastpos, | |
| ); | |
| /// X509v3_get_ext_count returns the number of extensions in `x`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<stack_st_X509_EXTENSION>)>( | |
| symbol: 'bssl_dart_X509v3_get_ext_count', | |
| ) | |
| external int X509v3_get_ext_count( | |
| ffi.Pointer<stack_st_X509_EXTENSION> x, | |
| ); | |
| /// a2i_IPADDRESS decodes `ipasc` as the textual representation of an IPv4 or | |
| /// IPv6 address. On success, it returns a newly-allocated `ASN1_OCTET_STRING` | |
| /// containing the decoded IP address. IPv4 addresses are represented as 4-byte | |
| /// strings and IPv6 addresses as 16-byte strings. On failure, it returns NULL. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_a2i_IPADDRESS', | |
| ) | |
| external ffi.Pointer<ASN1_OCTET_STRING> a2i_IPADDRESS( | |
| ffi.Pointer<ffi.Char> ipasc, | |
| ); | |
| /// a2i_IPADDRESS_NC decodes `ipasc` as the textual representation of an IPv4 or | |
| /// IPv6 address range. On success, it returns a newly-allocated | |
| /// `ASN1_OCTET_STRING` containing the decoded IP address, followed by the | |
| /// decoded mask. IPv4 ranges are represented as 8-byte strings and IPv6 ranges | |
| /// as 32-byte strings. On failure, it returns NULL. | |
| /// | |
| /// The text format decoded by this function is not the standard CIDR notation. | |
| /// Instead, the mask after the "/" is represented as another IP address. For | |
| /// example, "192.168.0.0/16" would be written "192.168.0.0/255.255.0.0". | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ASN1_OCTET_STRING> Function(ffi.Pointer<ffi.Char>)>( | |
| symbol: 'bssl_dart_a2i_IPADDRESS_NC', | |
| ) | |
| external ffi.Pointer<ASN1_OCTET_STRING> a2i_IPADDRESS_NC( | |
| ffi.Pointer<ffi.Char> ipasc, | |
| ); | |
| /// c2i_ASN1_BIT_STRING decodes `len` bytes from `*inp` as the contents of a | |
| /// DER-encoded BIT STRING, excluding the tag and length. It behaves like | |
| /// `d2i_SAMPLE` except, on success, it always consumes all `len` bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_BIT_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_c2i_ASN1_BIT_STRING') | |
| external ffi.Pointer<ASN1_BIT_STRING> c2i_ASN1_BIT_STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// c2i_ASN1_INTEGER decodes `len` bytes from `*inp` as the contents of a | |
| /// DER-encoded INTEGER, excluding the tag and length. It behaves like | |
| /// `d2i_SAMPLE` except, on success, it always consumes all `len` bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_INTEGER> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_c2i_ASN1_INTEGER') | |
| external ffi.Pointer<ASN1_INTEGER> c2i_ASN1_INTEGER( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| int len, | |
| ); | |
| /// c2i_ASN1_OBJECT decodes `len` bytes from `*inp` as the contents of a | |
| /// DER-encoded OBJECT IDENTIFIER, excluding the tag and length. It behaves like | |
| /// `d2i_SAMPLE` except, on success, it always consumes all `len` bytes. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OBJECT> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_c2i_ASN1_OBJECT') | |
| external ffi.Pointer<ASN1_OBJECT> c2i_ASN1_OBJECT( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_BIT_STRING parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ASN.1 BIT STRING, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_BIT_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_BIT_STRING') | |
| external ffi.Pointer<ASN1_BIT_STRING> d2i_ASN1_BIT_STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_BIT_STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// The following functions parse up to `len` bytes from `*inp` as a | |
| /// DER-encoded ASN.1 value of the corresponding type, as described in | |
| /// `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_BMPSTRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_BMPSTRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_BMPSTRING') | |
| external ffi.Pointer<ASN1_BMPSTRING> d2i_ASN1_BMPSTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_BMPSTRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_BOOLEAN parses a DER-encoded ASN.1 BOOLEAN from up to `len` bytes at | |
| /// `*inp`. On success, it advances `*inp` by the number of bytes read and | |
| /// returns the result. If `out` is non-NULL, it additionally writes the result | |
| /// to `*out`. On error, it returns `ASN1_BOOLEAN_NONE`. | |
| /// | |
| /// This function does not reject trailing data in the input. This allows the | |
| /// caller to parse a sequence of concatenated structures. Callers parsing only | |
| /// one structure should check for trailing data by comparing the updated `*inp` | |
| /// with the end of the input. | |
| /// | |
| /// WARNING: This function's is slightly different from other `d2i_*` functions | |
| /// because `ASN1_BOOLEAN` is not a pointer type. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ASN1_BOOLEAN Function( | |
| ffi.Pointer<ASN1_BOOLEAN>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_BOOLEAN') | |
| external int d2i_ASN1_BOOLEAN( | |
| ffi.Pointer<ASN1_BOOLEAN> out, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_ENUMERATED parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ASN.1 ENUMERATED, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_ENUMERATED> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_ENUMERATED>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_ENUMERATED') | |
| external ffi.Pointer<ASN1_ENUMERATED> d2i_ASN1_ENUMERATED( | |
| ffi.Pointer<ffi.Pointer<ASN1_ENUMERATED>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_GENERALIZEDTIME parses up to `len` bytes from `*inp` as a | |
| /// DER-encoded ASN.1 GeneralizedTime, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALIZEDTIME>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_GENERALIZEDTIME') | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> d2i_ASN1_GENERALIZEDTIME( | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALIZEDTIME>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_GENERALSTRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALSTRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_GENERALSTRING') | |
| external ffi.Pointer<ASN1_GENERALSTRING> d2i_ASN1_GENERALSTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_GENERALSTRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_IA5STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_IA5STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_IA5STRING') | |
| external ffi.Pointer<ASN1_IA5STRING> d2i_ASN1_IA5STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_IA5STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_INTEGER parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ASN.1 INTEGER, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_INTEGER> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_INTEGER') | |
| external ffi.Pointer<ASN1_INTEGER> d2i_ASN1_INTEGER( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_NULL parses a DER-encoded ASN.1 NULL value from up to `len` bytes | |
| /// at `*inp`, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_NULL> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_NULL>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_NULL') | |
| external ffi.Pointer<ASN1_NULL> d2i_ASN1_NULL( | |
| ffi.Pointer<ffi.Pointer<ASN1_NULL>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_OBJECT parses a DER-encoded ASN.1 OBJECT IDENTIFIER from up to `len` | |
| /// bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OBJECT> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_OBJECT') | |
| external ffi.Pointer<ASN1_OBJECT> d2i_ASN1_OBJECT( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OCTET_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_OCTET_STRING') | |
| external ffi.Pointer<ASN1_OCTET_STRING> d2i_ASN1_OCTET_STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_OCTET_STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_PRINTABLESTRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_PRINTABLESTRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_PRINTABLESTRING') | |
| external ffi.Pointer<ASN1_PRINTABLESTRING> d2i_ASN1_PRINTABLESTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_PRINTABLESTRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_SEQUENCE_ANY parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ASN.1 SEQUENCE OF ANY structure, as described in `d2i_SAMPLE`. The resulting | |
| /// `ASN1_SEQUENCE_ANY` owns its contents and thus must be released with | |
| /// `sk_ASN1_TYPE_pop_free` and `ASN1_TYPE_free`, not `sk_ASN1_TYPE_free`. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/354): This function currently also accepts | |
| /// BER, but this will be removed in the future. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_SEQUENCE_ANY> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_SEQUENCE_ANY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_SEQUENCE_ANY') | |
| external ffi.Pointer<ASN1_SEQUENCE_ANY> d2i_ASN1_SEQUENCE_ANY( | |
| ffi.Pointer<ffi.Pointer<ASN1_SEQUENCE_ANY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_SET_ANY parses up to `len` bytes from `*inp` as a DER-encoded ASN.1 | |
| /// SET OF ANY structure, as described in `d2i_SAMPLE`. The resulting | |
| /// `ASN1_SEQUENCE_ANY` owns its contents and thus must be released with | |
| /// `sk_ASN1_TYPE_pop_free` and `ASN1_TYPE_free`, not `sk_ASN1_TYPE_free`. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/354): This function currently also accepts | |
| /// BER, but this will be removed in the future. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_SEQUENCE_ANY> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_SEQUENCE_ANY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_SET_ANY') | |
| external ffi.Pointer<ASN1_SEQUENCE_ANY> d2i_ASN1_SET_ANY( | |
| ffi.Pointer<ffi.Pointer<ASN1_SEQUENCE_ANY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_T61STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_T61STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_T61STRING') | |
| external ffi.Pointer<ASN1_T61STRING> d2i_ASN1_T61STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_T61STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_TIME parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// Time (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TIME> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_TIME>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_TIME') | |
| external ffi.Pointer<ASN1_TIME> d2i_ASN1_TIME( | |
| ffi.Pointer<ffi.Pointer<ASN1_TIME>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_TYPE parses up to `len` bytes from `*inp` as an ASN.1 value of any | |
| /// type, as described in `d2i_SAMPLE`. Note this function only validates | |
| /// primitive, universal types supported by this library. Values of type | |
| /// `V_ASN1_SEQUENCE`, `V_ASN1_SET`, `V_ASN1_OTHER`, or an unsupported primitive | |
| /// type must be validated by the caller when interpreting. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/354): This function currently also accepts | |
| /// BER, but this will be removed in the future. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_TYPE> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_TYPE') | |
| external ffi.Pointer<ASN1_TYPE> d2i_ASN1_TYPE( | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_UNIVERSALSTRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_UNIVERSALSTRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_UNIVERSALSTRING') | |
| external ffi.Pointer<ASN1_UNIVERSALSTRING> d2i_ASN1_UNIVERSALSTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_UNIVERSALSTRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ASN1_UTCTIME parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ASN.1 UTCTime, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_UTCTIME> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_UTCTIME>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_UTCTIME') | |
| external ffi.Pointer<ASN1_UTCTIME> d2i_ASN1_UTCTIME( | |
| ffi.Pointer<ffi.Pointer<ASN1_UTCTIME>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_UTF8STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_UTF8STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_UTF8STRING') | |
| external ffi.Pointer<ASN1_UTF8STRING> d2i_ASN1_UTF8STRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_UTF8STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_VISIBLESTRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_VISIBLESTRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ASN1_VISIBLESTRING') | |
| external ffi.Pointer<ASN1_VISIBLESTRING> d2i_ASN1_VISIBLESTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_VISIBLESTRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_AUTHORITY_INFO_ACCESS parses up to `len` bytes from `*inp` as a | |
| /// DER-encoded AuthorityInfoAccessSyntax (RFC 5280), as described in | |
| /// `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<AUTHORITY_INFO_ACCESS> Function( | |
| ffi.Pointer<ffi.Pointer<AUTHORITY_INFO_ACCESS>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_AUTHORITY_INFO_ACCESS') | |
| external ffi.Pointer<AUTHORITY_INFO_ACCESS> d2i_AUTHORITY_INFO_ACCESS( | |
| ffi.Pointer<ffi.Pointer<AUTHORITY_INFO_ACCESS>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_AUTHORITY_KEYID parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// AuthorityKeyIdentifier (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<AUTHORITY_KEYID> Function( | |
| ffi.Pointer<ffi.Pointer<AUTHORITY_KEYID>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_AUTHORITY_KEYID') | |
| external ffi.Pointer<AUTHORITY_KEYID> d2i_AUTHORITY_KEYID( | |
| ffi.Pointer<ffi.Pointer<AUTHORITY_KEYID>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_AutoPrivateKey acts the same as `d2i_PrivateKey`, but detects the type | |
| /// of the private key. | |
| /// | |
| /// This function tries to detect one of several formats. Instead, use | |
| /// `EVP_parse_private_key` for a PrivateKeyInfo, `RSA_parse_private_key` for an | |
| /// RSAPrivateKey, and `EC_parse_private_key` for an ECPrivateKey. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_AutoPrivateKey') | |
| external ffi.Pointer<EVP_PKEY> d2i_AutoPrivateKey( | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_BASIC_CONSTRAINTS parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// BasicConstraints (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<BASIC_CONSTRAINTS> Function( | |
| ffi.Pointer<ffi.Pointer<BASIC_CONSTRAINTS>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_BASIC_CONSTRAINTS') | |
| external ffi.Pointer<BASIC_CONSTRAINTS> d2i_BASIC_CONSTRAINTS( | |
| ffi.Pointer<ffi.Pointer<BASIC_CONSTRAINTS>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_CERTIFICATEPOLICIES parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// CertificatePolicies (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CERTIFICATEPOLICIES> Function( | |
| ffi.Pointer<ffi.Pointer<CERTIFICATEPOLICIES>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_CERTIFICATEPOLICIES') | |
| external ffi.Pointer<CERTIFICATEPOLICIES> d2i_CERTIFICATEPOLICIES( | |
| ffi.Pointer<ffi.Pointer<CERTIFICATEPOLICIES>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_CRL_DIST_POINTS parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// CRLDistributionPoints (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<CRL_DIST_POINTS> Function( | |
| ffi.Pointer<ffi.Pointer<CRL_DIST_POINTS>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_CRL_DIST_POINTS') | |
| external ffi.Pointer<CRL_DIST_POINTS> d2i_CRL_DIST_POINTS( | |
| ffi.Pointer<ffi.Pointer<CRL_DIST_POINTS>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_DHparams parses a DER-encoded DHParameter structure (PKCS #3) from `len` | |
| /// bytes at `*inp`, as in `d2i_SAMPLE`. | |
| /// | |
| /// Use `DH_parse_parameters` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DH> Function( | |
| ffi.Pointer<ffi.Pointer<DH>>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DHparams') | |
| external ffi.Pointer<DH> d2i_DHparams( | |
| ffi.Pointer<ffi.Pointer<DH>> ret, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DH> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<DH>>) | |
| >(symbol: 'bssl_dart_d2i_DHparams_bio') | |
| external ffi.Pointer<DH> d2i_DHparams_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<DH>> dh, | |
| ); | |
| /// d2i_DIRECTORYSTRING parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// X.509 DirectoryString (RFC 5280), as described in `d2i_SAMPLE`. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/354): This function currently also accepts | |
| /// BER, but this will be removed in the future. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/449): DirectoryString's non-empty string | |
| /// requirement is not currently enforced. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DIRECTORYSTRING') | |
| external ffi.Pointer<ASN1_STRING> d2i_DIRECTORYSTRING( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_DISPLAYTEXT parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// DisplayText (RFC 5280), as described in `d2i_SAMPLE`. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/354): This function currently also accepts | |
| /// BER, but this will be removed in the future. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/449): DisplayText's size limits are not | |
| /// currently enforced. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_STRING> Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DISPLAYTEXT') | |
| external ffi.Pointer<ASN1_STRING> d2i_DISPLAYTEXT( | |
| ffi.Pointer<ffi.Pointer<ASN1_STRING>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_DSAPrivateKey parses a DER-encoded DSA private key from `len` bytes at | |
| /// `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `DSA_parse_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DSAPrivateKey') | |
| external ffi.Pointer<DSA> d2i_DSAPrivateKey( | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<DSA>>) | |
| >(symbol: 'bssl_dart_d2i_DSAPrivateKey_bio') | |
| external ffi.Pointer<DSA> d2i_DSAPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<DSA>> dsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<DSA>>) | |
| >(symbol: 'bssl_dart_d2i_DSAPrivateKey_fp') | |
| external ffi.Pointer<DSA> d2i_DSAPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DSA>> dsa, | |
| ); | |
| /// d2i_DSAPublicKey parses a DER-encoded DSA public key from `len` bytes at | |
| /// `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `DSA_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DSAPublicKey') | |
| external ffi.Pointer<DSA> d2i_DSAPublicKey( | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_DSA_PUBKEY parses a DSA public key as a DER-encoded SubjectPublicKeyInfo | |
| /// from `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// SubjectPublicKeyInfo structures containing other key types are rejected. | |
| /// | |
| /// Use `EVP_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DSA_PUBKEY') | |
| external ffi.Pointer<DSA> d2i_DSA_PUBKEY( | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<DSA>>) | |
| >(symbol: 'bssl_dart_d2i_DSA_PUBKEY_bio') | |
| external ffi.Pointer<DSA> d2i_DSA_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<DSA>> dsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<DSA>>) | |
| >(symbol: 'bssl_dart_d2i_DSA_PUBKEY_fp') | |
| external ffi.Pointer<DSA> d2i_DSA_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<DSA>> dsa, | |
| ); | |
| /// d2i_DSA_SIG parses a DER-encoded DSA-Sig-Value structure from `len` bytes at | |
| /// `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `DSA_SIG_parse` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA_SIG> Function( | |
| ffi.Pointer<ffi.Pointer<DSA_SIG>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DSA_SIG') | |
| external ffi.Pointer<DSA_SIG> d2i_DSA_SIG( | |
| ffi.Pointer<ffi.Pointer<DSA_SIG>> out_sig, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_DSAparams parses a DER-encoded Dss-Parms structure (RFC 3279) from `len` | |
| /// bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `DSA_parse_parameters` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<DSA> Function( | |
| ffi.Pointer<ffi.Pointer<DSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_DSAparams') | |
| external ffi.Pointer<DSA> d2i_DSAparams( | |
| ffi.Pointer<ffi.Pointer<DSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ECDSA_SIG parses aa DER-encoded ECDSA-Sig-Value structure from `len` | |
| /// bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `ECDSA_SIG_parse` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ECDSA_SIG> Function( | |
| ffi.Pointer<ffi.Pointer<ECDSA_SIG>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECDSA_SIG') | |
| external ffi.Pointer<ECDSA_SIG> d2i_ECDSA_SIG( | |
| ffi.Pointer<ffi.Pointer<ECDSA_SIG>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ECPKParameters parses a DER-encoded ECParameters structure (RFC 5480) | |
| /// from `len` bytes at `*inp`, as described in `d2i_SAMPLE`. For legacy reasons, | |
| /// it recognizes the specifiedCurve form, but only for curves that are already | |
| /// supported as named curves. | |
| /// | |
| /// Use `EC_KEY_parse_parameters` or `EC_KEY_parse_curve_name` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_GROUP> Function( | |
| ffi.Pointer<ffi.Pointer<EC_GROUP>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECPKParameters') | |
| external ffi.Pointer<EC_GROUP> d2i_ECPKParameters( | |
| ffi.Pointer<ffi.Pointer<EC_GROUP>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ECParameters parses a DER-encoded ECParameters structure (RFC 5480) from | |
| /// `len` bytes at `*inp`, as described in `d2i_SAMPLE`. It returns the result as | |
| /// an `EC_KEY` with parameters, but no key, configured. | |
| /// | |
| /// Use `EC_KEY_parse_parameters` or `EC_KEY_parse_curve_name` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECParameters') | |
| external ffi.Pointer<EC_KEY> d2i_ECParameters( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out_key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ECPrivateKey parses a DER-encoded ECPrivateKey structure (RFC 5915) from | |
| /// `len` bytes at `*inp`, as described in `d2i_SAMPLE`. On input, if `*out_key` | |
| /// is non-NULL and has a group configured, the parameters field may be omitted | |
| /// but must match that group if present. | |
| /// | |
| /// Use `EC_KEY_parse_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECPrivateKey') | |
| external ffi.Pointer<EC_KEY> d2i_ECPrivateKey( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out_key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECPrivateKey_bio') | |
| external ffi.Pointer<EC_KEY> d2i_ECPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> eckey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ECPrivateKey_fp') | |
| external ffi.Pointer<EC_KEY> d2i_ECPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> eckey, | |
| ); | |
| /// d2i_EC_PUBKEY parses an EC public key as a DER-encoded SubjectPublicKeyInfo | |
| /// from `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// SubjectPublicKeyInfo structures containing other key types are rejected. | |
| /// | |
| /// Use `EVP_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_EC_PUBKEY') | |
| external ffi.Pointer<EC_KEY> d2i_EC_PUBKEY( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_EC_PUBKEY_bio') | |
| external ffi.Pointer<EC_KEY> d2i_EC_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> eckey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_EC_PUBKEY_fp') | |
| external ffi.Pointer<EC_KEY> d2i_EC_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> eckey, | |
| ); | |
| /// d2i_EXTENDED_KEY_USAGE parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// ExtKeyUsageSyntax (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EXTENDED_KEY_USAGE> Function( | |
| ffi.Pointer<ffi.Pointer<EXTENDED_KEY_USAGE>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_EXTENDED_KEY_USAGE') | |
| external ffi.Pointer<EXTENDED_KEY_USAGE> d2i_EXTENDED_KEY_USAGE( | |
| ffi.Pointer<ffi.Pointer<EXTENDED_KEY_USAGE>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_GENERAL_NAME parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// GeneralName (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<GENERAL_NAME> Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_GENERAL_NAME') | |
| external ffi.Pointer<GENERAL_NAME> d2i_GENERAL_NAME( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_GENERAL_NAMES parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// SEQUENCE OF GeneralName, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<GENERAL_NAMES> Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAMES>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_GENERAL_NAMES') | |
| external ffi.Pointer<GENERAL_NAMES> d2i_GENERAL_NAMES( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAMES>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_ISSUING_DIST_POINT parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// IssuingDistributionPoint (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ISSUING_DIST_POINT> Function( | |
| ffi.Pointer<ffi.Pointer<ISSUING_DIST_POINT>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_ISSUING_DIST_POINT') | |
| external ffi.Pointer<ISSUING_DIST_POINT> d2i_ISSUING_DIST_POINT( | |
| ffi.Pointer<ffi.Pointer<ISSUING_DIST_POINT>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_NETSCAPE_SPKAC parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// PublicKeyAndChallenge structure, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<NETSCAPE_SPKAC> Function( | |
| ffi.Pointer<ffi.Pointer<NETSCAPE_SPKAC>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_NETSCAPE_SPKAC') | |
| external ffi.Pointer<NETSCAPE_SPKAC> d2i_NETSCAPE_SPKAC( | |
| ffi.Pointer<ffi.Pointer<NETSCAPE_SPKAC>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_NETSCAPE_SPKI parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// SignedPublicKeyAndChallenge structure, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<NETSCAPE_SPKI> Function( | |
| ffi.Pointer<ffi.Pointer<NETSCAPE_SPKI>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_NETSCAPE_SPKI') | |
| external ffi.Pointer<NETSCAPE_SPKI> d2i_NETSCAPE_SPKI( | |
| ffi.Pointer<ffi.Pointer<NETSCAPE_SPKI>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_PKCS7 parses a BER-encoded, PKCS#7 signed data ContentInfo structure from | |
| /// `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS7> Function( | |
| ffi.Pointer<ffi.Pointer<PKCS7>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Size, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS7') | |
| external ffi.Pointer<PKCS7> d2i_PKCS7( | |
| ffi.Pointer<ffi.Pointer<PKCS7>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_PKCS7_bio behaves like `d2i_PKCS7` but reads the input from `bio`. If | |
| /// the length of the object is indefinite the full contents of `bio` are read. | |
| /// | |
| /// If the function fails then some unknown amount of data may have been read | |
| /// from `bio`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS7> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<PKCS7>>) | |
| >(symbol: 'bssl_dart_d2i_PKCS7_bio') | |
| external ffi.Pointer<PKCS7> d2i_PKCS7_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<PKCS7>> out, | |
| ); | |
| /// d2i_PKCS8PrivateKey_bio reads a DER-encoded EncryptedPrivateKey structure | |
| /// (RFC 5208) from `bio`, decrypts it with `PKCS8_decrypt`, and returns the | |
| /// result as a newly-allocated `EVP_PKEY`, or NULL on error. On success, if | |
| /// `out` is non-NULL, it additionally frees the previous value at `*out` and | |
| /// updates `*out` to the result. The password is determined by calling `cb`, or | |
| /// `PEM_def_callback` if NULL. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8PrivateKey_bio') | |
| external ffi.Pointer<EVP_PKEY> d2i_PKCS8PrivateKey_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// d2i_PKCS8PrivateKey_fp behaves like `d2i_PKCS8PrivateKey_bio` but reads from | |
| /// `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8PrivateKey_fp') | |
| external ffi.Pointer<EVP_PKEY> d2i_PKCS8PrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// d2i_PKCS8_PRIV_KEY_INFO parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// PrivateKeyInfo, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function( | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8_PRIV_KEY_INFO') | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> d2i_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8_PRIV_KEY_INFO_bio') | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> d2i_PKCS8_PRIV_KEY_INFO_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>> p8inf, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8_PRIV_KEY_INFO_fp') | |
| external ffi.Pointer<PKCS8_PRIV_KEY_INFO> d2i_PKCS8_PRIV_KEY_INFO_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<PKCS8_PRIV_KEY_INFO>> p8inf, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_SIG> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8_bio') | |
| external ffi.Pointer<X509_SIG> d2i_PKCS8_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>> p8, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_SIG> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PKCS8_fp') | |
| external ffi.Pointer<X509_SIG> d2i_PKCS8_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_SIG>> p8, | |
| ); | |
| /// d2i_PUBKEY parses a DER-encoded SubjectPublicKeyInfo from `len` bytes at | |
| /// `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `EVP_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PUBKEY') | |
| external ffi.Pointer<EVP_PKEY> d2i_PUBKEY( | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PUBKEY_bio') | |
| external ffi.Pointer<EVP_PKEY> d2i_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> a, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PUBKEY_fp') | |
| external ffi.Pointer<EVP_PKEY> d2i_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> a, | |
| ); | |
| /// d2i_PrivateKey parses a DER-encoded private key from `len` bytes at `*inp`, | |
| /// as described in `d2i_SAMPLE`. The private key must have type `type`, | |
| /// otherwise it will be rejected. | |
| /// | |
| /// This function tries to detect one of several formats. Instead, use | |
| /// `EVP_parse_private_key` for a PrivateKeyInfo, `RSA_parse_private_key` for an | |
| /// RSAPrivateKey, and `EC_parse_private_key` for an ECPrivateKey. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PrivateKey') | |
| external ffi.Pointer<EVP_PKEY> d2i_PrivateKey( | |
| int type, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_PrivateKey_bio behaves like `d2i_AutoPrivateKey`, but reads from `bp` | |
| /// instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PrivateKey_bio') | |
| external ffi.Pointer<EVP_PKEY> d2i_PrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> a, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PrivateKey_fp') | |
| external ffi.Pointer<EVP_PKEY> d2i_PrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> a, | |
| ); | |
| /// d2i_PublicKey parses a public key from `len` bytes at `*inp` in a type- | |
| /// specific format specified by `type`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// The only supported value for `type` is `EVP_PKEY_RSA`, which parses a | |
| /// DER-encoded RSAPublicKey (RFC 8017) structure. Parsing EC keys is not | |
| /// supported by this function. | |
| /// | |
| /// Use `RSA_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EVP_PKEY> Function( | |
| ffi.Int, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_PublicKey') | |
| external ffi.Pointer<EVP_PKEY> d2i_PublicKey( | |
| int type, | |
| ffi.Pointer<ffi.Pointer<EVP_PKEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_RSAPrivateKey parses a DER-encoded RSAPrivateKey structure (RFC 8017) | |
| /// from `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `RSA_parse_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_RSAPrivateKey') | |
| external ffi.Pointer<RSA> d2i_RSAPrivateKey( | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSAPrivateKey_bio') | |
| external ffi.Pointer<RSA> d2i_RSAPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSAPrivateKey_fp') | |
| external ffi.Pointer<RSA> d2i_RSAPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| /// d2i_RSAPublicKey parses a DER-encoded RSAPublicKey structure (RFC 8017) from | |
| /// `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// | |
| /// Use `RSA_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_RSAPublicKey') | |
| external ffi.Pointer<RSA> d2i_RSAPublicKey( | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSAPublicKey_bio') | |
| external ffi.Pointer<RSA> d2i_RSAPublicKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSAPublicKey_fp') | |
| external ffi.Pointer<RSA> d2i_RSAPublicKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| /// d2i_RSA_PSS_PARAMS parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// RSASSA-PSS-params (RFC 4055), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA_PSS_PARAMS> Function( | |
| ffi.Pointer<ffi.Pointer<RSA_PSS_PARAMS>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_RSA_PSS_PARAMS') | |
| external ffi.Pointer<RSA_PSS_PARAMS> d2i_RSA_PSS_PARAMS( | |
| ffi.Pointer<ffi.Pointer<RSA_PSS_PARAMS>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_RSA_PUBKEY parses an RSA public key as a DER-encoded SubjectPublicKeyInfo | |
| /// from `len` bytes at `*inp`, as described in `d2i_SAMPLE`. | |
| /// SubjectPublicKeyInfo structures containing other key types are rejected. | |
| /// | |
| /// Use `EVP_parse_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function( | |
| ffi.Pointer<ffi.Pointer<RSA>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_RSA_PUBKEY') | |
| external ffi.Pointer<RSA> d2i_RSA_PUBKEY( | |
| ffi.Pointer<ffi.Pointer<RSA>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSA_PUBKEY_bio') | |
| external ffi.Pointer<RSA> d2i_RSA_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<RSA> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<RSA>>) | |
| >(symbol: 'bssl_dart_d2i_RSA_PUBKEY_fp') | |
| external ffi.Pointer<RSA> d2i_RSA_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<RSA>> rsa, | |
| ); | |
| /// d2i_X509 parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// Certificate (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509') | |
| external ffi.Pointer<X509> d2i_X509( | |
| ffi.Pointer<ffi.Pointer<X509>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_ALGOR parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// AlgorithmIdentifier, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ALGOR> Function( | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_ALGOR') | |
| external ffi.Pointer<X509_ALGOR> d2i_X509_ALGOR( | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_ATTRIBUTE parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// Attribute (RFC 2986), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_ATTRIBUTE> Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_ATTRIBUTE') | |
| external ffi.Pointer<X509_ATTRIBUTE> d2i_X509_ATTRIBUTE( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_AUX parses up to `length` bytes from `*inp` as a DER-encoded X.509 | |
| /// Certificate (RFC 5280), followed optionally by a separate, OpenSSL-specific | |
| /// structure with auxiliary properties. It behaves as described in `d2i_SAMPLE`. | |
| /// | |
| /// WARNING: Passing untrusted input to this function allows an attacker to | |
| /// control auxiliary properties. This can allow unexpected influence over the | |
| /// application if the certificate is used in a context that reads auxiliary | |
| /// properties. This includes PKCS#12 serialization, trusted certificates in | |
| /// `X509_STORE`, and callers of `X509_alias_get0` or `X509_keyid_get0`. | |
| /// | |
| /// Unlike similarly-named functions, this function does not parse a single | |
| /// ASN.1 element. Trying to parse data directly embedded in a larger ASN.1 | |
| /// structure will not behave correctly. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function( | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_AUX') | |
| external ffi.Pointer<X509> d2i_X509_AUX( | |
| ffi.Pointer<ffi.Pointer<X509>> x509, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int length, | |
| ); | |
| /// d2i_X509_CRL parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// CertificateList (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_CRL') | |
| external ffi.Pointer<X509_CRL> d2i_X509_CRL( | |
| ffi.Pointer<ffi.Pointer<X509_CRL>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_CRL_bio') | |
| external ffi.Pointer<X509_CRL> d2i_X509_CRL_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>> crl, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_CRL_fp') | |
| external ffi.Pointer<X509_CRL> d2i_X509_CRL_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>> crl, | |
| ); | |
| /// d2i_X509_EXTENSION parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// X.509 Extension (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSION> Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_EXTENSION') | |
| external ffi.Pointer<X509_EXTENSION> d2i_X509_EXTENSION( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_EXTENSIONS parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// SEQUENCE OF Extension (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_EXTENSIONS> Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSIONS>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_EXTENSIONS') | |
| external ffi.Pointer<X509_EXTENSIONS> d2i_X509_EXTENSIONS( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSIONS>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_NAME parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// Name (RFC 5280), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_NAME> Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_NAME') | |
| external ffi.Pointer<X509_NAME> d2i_X509_NAME( | |
| ffi.Pointer<ffi.Pointer<X509_NAME>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_PUBKEY parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// SubjectPublicKeyInfo, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_PUBKEY> Function( | |
| ffi.Pointer<ffi.Pointer<X509_PUBKEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_PUBKEY') | |
| external ffi.Pointer<X509_PUBKEY> d2i_X509_PUBKEY( | |
| ffi.Pointer<ffi.Pointer<X509_PUBKEY>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_REQ parses up to `len` bytes from `*inp` as a DER-encoded | |
| /// CertificateRequest (RFC 2986), as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REQ> Function( | |
| ffi.Pointer<ffi.Pointer<X509_REQ>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_REQ') | |
| external ffi.Pointer<X509_REQ> d2i_X509_REQ( | |
| ffi.Pointer<ffi.Pointer<X509_REQ>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REQ> Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_REQ_bio') | |
| external ffi.Pointer<X509_REQ> d2i_X509_REQ_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>> req, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REQ> Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>>, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_REQ_fp') | |
| external ffi.Pointer<X509_REQ> d2i_X509_REQ_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509_REQ>> req, | |
| ); | |
| /// d2i_X509_REVOKED parses up to `len` bytes from `*inp` as a DER-encoded X.509 | |
| /// CRL entry, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_REVOKED> Function( | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_REVOKED') | |
| external ffi.Pointer<X509_REVOKED> d2i_X509_REVOKED( | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// d2i_X509_SIG parses up to `len` bytes from `*inp` as a DER-encoded algorithm | |
| /// and octet string pair, as described in `d2i_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509_SIG> Function( | |
| ffi.Pointer<ffi.Pointer<X509_SIG>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_d2i_X509_SIG') | |
| external ffi.Pointer<X509_SIG> d2i_X509_SIG( | |
| ffi.Pointer<ffi.Pointer<X509_SIG>> out, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// The following functions behave like the corresponding unsuffixed `d2i_*` | |
| /// functions, but read the result from `bp` instead. Callers using these | |
| /// functions with memory `BIO`s to parse structures already in memory should use | |
| /// `d2i_*` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function(ffi.Pointer<BIO>, ffi.Pointer<ffi.Pointer<X509>>) | |
| >(symbol: 'bssl_dart_d2i_X509_bio') | |
| external ffi.Pointer<X509> d2i_X509_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ffi.Pointer<X509>> x509, | |
| ); | |
| /// The following functions behave like the corresponding `d2i_*_bio` functions, | |
| /// but read from `fp` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<X509> Function(ffi.Pointer<FILE>, ffi.Pointer<ffi.Pointer<X509>>) | |
| >(symbol: 'bssl_dart_d2i_X509_fp') | |
| external ffi.Pointer<X509> d2i_X509_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<ffi.Pointer<X509>> x509, | |
| ); | |
| /// i2a_ASN1_ENUMERATED writes a human-readable representation of `a` to `bp`. It | |
| /// returns the number of bytes written on success, or a negative number on | |
| /// error. On error, this function may have written a partial output to `bp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_ENUMERATED>)>( | |
| symbol: 'bssl_dart_i2a_ASN1_ENUMERATED', | |
| ) | |
| external int i2a_ASN1_ENUMERATED( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ASN1_ENUMERATED> a, | |
| ); | |
| /// i2a_ASN1_INTEGER writes a human-readable representation of `a` to `bp`. It | |
| /// returns the number of bytes written on success, or a negative number on | |
| /// error. On error, this function may have written a partial output to `bp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_INTEGER>)>( | |
| symbol: 'bssl_dart_i2a_ASN1_INTEGER', | |
| ) | |
| external int i2a_ASN1_INTEGER( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ASN1_INTEGER> a, | |
| ); | |
| /// i2a_ASN1_OBJECT writes a human-readable representation of `a` to `bp`. It | |
| /// returns the number of bytes written on success, or a negative number on | |
| /// error. On error, this function may have written a partial output to `bp`. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_OBJECT>)>( | |
| symbol: 'bssl_dart_i2a_ASN1_OBJECT', | |
| ) | |
| external int i2a_ASN1_OBJECT( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ASN1_OBJECT> a, | |
| ); | |
| /// i2a_ASN1_STRING writes a text representation of `a`'s contents to `bp`. It | |
| /// returns the number of bytes written on success, or a negative number on | |
| /// error. On error, this function may have written a partial output to `bp`. | |
| /// `type` is ignored. | |
| /// | |
| /// This function does not decode `a` into a Unicode string. It only hex-encodes | |
| /// the internal representation of `a`. This is suitable for printing an OCTET | |
| /// STRING, but may not be human-readable for any other string type. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<ASN1_STRING>, ffi.Int) | |
| >(symbol: 'bssl_dart_i2a_ASN1_STRING') | |
| external int i2a_ASN1_STRING( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<ASN1_STRING> a, | |
| int type, | |
| ); | |
| /// i2c_ASN1_BIT_STRING encodes `in` as the contents of a DER-encoded BIT STRING, | |
| /// excluding the tag and length. If `outp` is non-NULL, it writes the result to | |
| /// `*outp`, advances `*outp` just past the output, and returns the number of | |
| /// bytes written. `*outp` must have space available for the result. If `outp` is | |
| /// NULL, it returns the number of bytes without writing anything. On error, it | |
| /// returns a value <= 0. | |
| /// | |
| /// Note this function differs slightly from `i2d_SAMPLE`. If `outp` is non-NULL | |
| /// and `*outp` is NULL, it does not allocate a new buffer. | |
| /// | |
| /// TODO(davidben): This function currently returns zero on error instead of -1, | |
| /// but it is also mostly infallible. I've currently documented <= 0 to suggest | |
| /// callers work with both. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2c_ASN1_BIT_STRING') | |
| external int i2c_ASN1_BIT_STRING( | |
| ffi.Pointer<ASN1_BIT_STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2c_ASN1_INTEGER encodes `in` as the contents of a DER-encoded INTEGER, | |
| /// excluding the tag and length. If `outp` is non-NULL, it writes the result to | |
| /// `*outp`, advances `*outp` just past the output, and returns the number of | |
| /// bytes written. `*outp` must have space available for the result. If `outp` is | |
| /// NULL, it returns the number of bytes without writing anything. On error, it | |
| /// returns a value <= 0. | |
| /// | |
| /// Note this function differs slightly from `i2d_SAMPLE`. If `outp` is non-NULL | |
| /// and `*outp` is NULL, it does not allocate a new buffer. | |
| /// | |
| /// TODO(davidben): This function currently returns zero on error instead of -1, | |
| /// but it is also mostly infallible. I've currently documented <= 0 to suggest | |
| /// callers work with both. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2c_ASN1_INTEGER') | |
| external int i2c_ASN1_INTEGER( | |
| ffi.Pointer<ASN1_INTEGER> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_BIT_STRING marshals `in` as a DER-encoded ASN.1 BIT STRING, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BIT_STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_BIT_STRING') | |
| external int i2d_ASN1_BIT_STRING( | |
| ffi.Pointer<ASN1_BIT_STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// The following functions marshal `in` as a DER-encoded ASN.1 value of the | |
| /// corresponding type, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_BMPSTRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_BMPSTRING') | |
| external int i2d_ASN1_BMPSTRING( | |
| ffi.Pointer<ASN1_BMPSTRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_BOOLEAN marshals `a` as a DER-encoded ASN.1 BOOLEAN, as described in | |
| /// `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ASN1_BOOLEAN, ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>) | |
| >(symbol: 'bssl_dart_i2d_ASN1_BOOLEAN') | |
| external int i2d_ASN1_BOOLEAN( | |
| int a, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| /// i2d_ASN1_ENUMERATED marshals `in` as a DER-encoded ASN.1 ENUMERATED, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_ENUMERATED>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_ENUMERATED') | |
| external int i2d_ASN1_ENUMERATED( | |
| ffi.Pointer<ASN1_ENUMERATED> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_GENERALIZEDTIME marshals `in` as a DER-encoded ASN.1 | |
| /// GeneralizedTime, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_GENERALIZEDTIME') | |
| external int i2d_ASN1_GENERALIZEDTIME( | |
| ffi.Pointer<ASN1_GENERALIZEDTIME> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_GENERALSTRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_GENERALSTRING') | |
| external int i2d_ASN1_GENERALSTRING( | |
| ffi.Pointer<ASN1_GENERALSTRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_IA5STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_IA5STRING') | |
| external int i2d_ASN1_IA5STRING( | |
| ffi.Pointer<ASN1_IA5STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_INTEGER marshals `in` as a DER-encoded ASN.1 INTEGER, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_INTEGER') | |
| external int i2d_ASN1_INTEGER( | |
| ffi.Pointer<ASN1_INTEGER> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_NULL marshals `in` as a DER-encoded ASN.1 NULL value, as described | |
| /// in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_NULL>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ASN1_NULL') | |
| external int i2d_ASN1_NULL( | |
| ffi.Pointer<ASN1_NULL> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_OBJECT marshals `in` as a DER-encoded ASN.1 OBJECT IDENTIFIER, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_OBJECT') | |
| external int i2d_ASN1_OBJECT( | |
| ffi.Pointer<ASN1_OBJECT> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_OCTET_STRING') | |
| external int i2d_ASN1_OCTET_STRING( | |
| ffi.Pointer<ASN1_OCTET_STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_PRINTABLESTRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_PRINTABLESTRING') | |
| external int i2d_ASN1_PRINTABLESTRING( | |
| ffi.Pointer<ASN1_PRINTABLESTRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_SEQUENCE_ANY marshals `in` as a DER-encoded SEQUENCE OF ANY | |
| /// structure, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_SEQUENCE_ANY>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_SEQUENCE_ANY') | |
| external int i2d_ASN1_SEQUENCE_ANY( | |
| ffi.Pointer<ASN1_SEQUENCE_ANY> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_SET_ANY marshals `in` as a DER-encoded SET OF ANY structure, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_SEQUENCE_ANY>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_SET_ANY') | |
| external int i2d_ASN1_SET_ANY( | |
| ffi.Pointer<ASN1_SEQUENCE_ANY> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_T61STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_T61STRING') | |
| external int i2d_ASN1_T61STRING( | |
| ffi.Pointer<ASN1_T61STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_TIME marshals `in` as a DER-encoded X.509 Time (RFC 5280), as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_TIME>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ASN1_TIME') | |
| external int i2d_ASN1_TIME( | |
| ffi.Pointer<ASN1_TIME> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_TYPE marshals `in` as DER, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ASN1_TYPE>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ASN1_TYPE') | |
| external int i2d_ASN1_TYPE( | |
| ffi.Pointer<ASN1_TYPE> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_UNIVERSALSTRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_UNIVERSALSTRING') | |
| external int i2d_ASN1_UNIVERSALSTRING( | |
| ffi.Pointer<ASN1_UNIVERSALSTRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ASN1_UTCTIME marshals `in` as a DER-encoded ASN.1 UTCTime, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_UTCTIME>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_UTCTIME') | |
| external int i2d_ASN1_UTCTIME( | |
| ffi.Pointer<ASN1_UTCTIME> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_UTF8STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_UTF8STRING') | |
| external int i2d_ASN1_UTF8STRING( | |
| ffi.Pointer<ASN1_UTF8STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_VISIBLESTRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ASN1_VISIBLESTRING') | |
| external int i2d_ASN1_VISIBLESTRING( | |
| ffi.Pointer<ASN1_VISIBLESTRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_AUTHORITY_INFO_ACCESS marshals `aia` as a DER-encoded | |
| /// AuthorityInfoAccessSyntax (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AUTHORITY_INFO_ACCESS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_AUTHORITY_INFO_ACCESS') | |
| external int i2d_AUTHORITY_INFO_ACCESS( | |
| ffi.Pointer<AUTHORITY_INFO_ACCESS> aia, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_AUTHORITY_KEYID marshals `akid` as a DER-encoded AuthorityKeyIdentifier | |
| /// (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<AUTHORITY_KEYID>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_AUTHORITY_KEYID') | |
| external int i2d_AUTHORITY_KEYID( | |
| ffi.Pointer<AUTHORITY_KEYID> akid, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_BASIC_CONSTRAINTS marshals `bcons` as a DER-encoded BasicConstraints (RFC | |
| /// 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BASIC_CONSTRAINTS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_BASIC_CONSTRAINTS') | |
| external int i2d_BASIC_CONSTRAINTS( | |
| ffi.Pointer<BASIC_CONSTRAINTS> bcons, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_CERTIFICATEPOLICIES marshals `policies` as a DER-encoded | |
| /// CertificatePolicies (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CERTIFICATEPOLICIES>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_CERTIFICATEPOLICIES') | |
| external int i2d_CERTIFICATEPOLICIES( | |
| ffi.Pointer<CERTIFICATEPOLICIES> policies, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_CRL_DIST_POINTS marshals `crldp` as a DER-encoded CRLDistributionPoints | |
| /// (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<CRL_DIST_POINTS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_CRL_DIST_POINTS') | |
| external int i2d_CRL_DIST_POINTS( | |
| ffi.Pointer<CRL_DIST_POINTS> crldp, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_DHparams marshals `in` to a DER-encoded DHParameter structure (PKCS #3), | |
| /// as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `DH_marshal_parameters` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DH>, ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>) | |
| >(symbol: 'bssl_dart_i2d_DHparams') | |
| external int i2d_DHparams( | |
| ffi.Pointer<DH> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DH>)>( | |
| symbol: 'bssl_dart_i2d_DHparams_bio', | |
| ) | |
| external int i2d_DHparams_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<DH> dh, | |
| ); | |
| /// i2d_DIRECTORYSTRING marshals `in` as a DER-encoded X.509 DirectoryString (RFC | |
| /// 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_DIRECTORYSTRING') | |
| external int i2d_DIRECTORYSTRING( | |
| ffi.Pointer<ASN1_STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_DISPLAYTEXT marshals `in` as a DER-encoded X.509 DisplayText (RFC 5280), | |
| /// as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ASN1_STRING>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_DISPLAYTEXT') | |
| external int i2d_DISPLAYTEXT( | |
| ffi.Pointer<ASN1_STRING> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_DSAPrivateKey marshals `in` as a DER-encoded DSA private key, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `DSA_marshal_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_DSAPrivateKey') | |
| external int i2d_DSAPrivateKey( | |
| ffi.Pointer<DSA> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_i2d_DSAPrivateKey_bio', | |
| ) | |
| external int i2d_DSAPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_i2d_DSAPrivateKey_fp', | |
| ) | |
| external int i2d_DSAPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// i2d_DSAPublicKey marshals `in` as a DER-encoded DSA public key, as described | |
| /// in `i2d_SAMPLE`. | |
| /// | |
| /// Use `DSA_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_DSAPublicKey') | |
| external int i2d_DSAPublicKey( | |
| ffi.Pointer<DSA> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_DSA_PUBKEY marshals `dsa` as a DER-encoded SubjectPublicKeyInfo, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EVP_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_DSA_PUBKEY') | |
| external int i2d_DSA_PUBKEY( | |
| ffi.Pointer<DSA> dsa, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_i2d_DSA_PUBKEY_bio', | |
| ) | |
| external int i2d_DSA_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<DSA>)>( | |
| symbol: 'bssl_dart_i2d_DSA_PUBKEY_fp', | |
| ) | |
| external int i2d_DSA_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<DSA> dsa, | |
| ); | |
| /// i2d_DSA_SIG marshals `in` to a DER-encoded DSA-Sig-Value structure, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `DSA_SIG_marshal` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA_SIG>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_DSA_SIG') | |
| external int i2d_DSA_SIG( | |
| ffi.Pointer<DSA_SIG> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_DSAparams marshals `in`'s parameters as a DER-encoded Dss-Parms structure | |
| /// (RFC 3279), as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `DSA_marshal_parameters` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<DSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_DSAparams') | |
| external int i2d_DSAparams( | |
| ffi.Pointer<DSA> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ECDSA_SIG marshals `sig` as a DER-encoded ECDSA-Sig-Value, as described | |
| /// in `i2d_SAMPLE`. | |
| /// | |
| /// Use `ECDSA_SIG_marshal` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ECDSA_SIG>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ECDSA_SIG') | |
| external int i2d_ECDSA_SIG( | |
| ffi.Pointer<ECDSA_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ECPKParameters marshals `group` as a DER-encoded ECParameters structure | |
| /// (RFC 5480), as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EC_KEY_marshal_curve_name` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_GROUP>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ECPKParameters') | |
| external int i2d_ECPKParameters( | |
| ffi.Pointer<EC_GROUP> group, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ECParameters marshals `key`'s parameters as a DER-encoded OBJECT | |
| /// IDENTIFIER, as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EC_KEY_marshal_curve_name` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ECParameters') | |
| external int i2d_ECParameters( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ECPrivateKey marshals `key` as a DER-encoded ECPrivateKey structure (RFC | |
| /// 5915), as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EC_KEY_marshal_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_ECPrivateKey') | |
| external int i2d_ECPrivateKey( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_i2d_ECPrivateKey_bio', | |
| ) | |
| external int i2d_ECPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_i2d_ECPrivateKey_fp', | |
| ) | |
| external int i2d_ECPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ); | |
| /// i2d_EC_PUBKEY marshals `ec_key` as a DER-encoded SubjectPublicKeyInfo, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EVP_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EC_KEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_EC_PUBKEY') | |
| external int i2d_EC_PUBKEY( | |
| ffi.Pointer<EC_KEY> ec_key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_i2d_EC_PUBKEY_bio', | |
| ) | |
| external int i2d_EC_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EC_KEY>)>( | |
| symbol: 'bssl_dart_i2d_EC_PUBKEY_fp', | |
| ) | |
| external int i2d_EC_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ); | |
| /// i2d_EXTENDED_KEY_USAGE marshals `eku` as a DER-encoded ExtKeyUsageSyntax (RFC | |
| /// 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EXTENDED_KEY_USAGE>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_EXTENDED_KEY_USAGE') | |
| external int i2d_EXTENDED_KEY_USAGE( | |
| ffi.Pointer<EXTENDED_KEY_USAGE> eku, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_GENERAL_NAME marshals `in` as a DER-encoded X.509 GeneralName (RFC 5280), | |
| /// as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_GENERAL_NAME') | |
| external int i2d_GENERAL_NAME( | |
| ffi.Pointer<GENERAL_NAME> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_GENERAL_NAMES marshals `in` as a DER-encoded SEQUENCE OF GeneralName, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<GENERAL_NAMES>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_GENERAL_NAMES') | |
| external int i2d_GENERAL_NAMES( | |
| ffi.Pointer<GENERAL_NAMES> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_ISSUING_DIST_POINT marshals `idp` as a DER-encoded | |
| /// IssuingDistributionPoint (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<ISSUING_DIST_POINT>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_ISSUING_DIST_POINT') | |
| external int i2d_ISSUING_DIST_POINT( | |
| ffi.Pointer<ISSUING_DIST_POINT> idp, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_NETSCAPE_SPKAC marshals `spkac` as a DER-encoded PublicKeyAndChallenge | |
| /// structure, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<NETSCAPE_SPKAC>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_NETSCAPE_SPKAC') | |
| external int i2d_NETSCAPE_SPKAC( | |
| ffi.Pointer<NETSCAPE_SPKAC> spkac, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_NETSCAPE_SPKI marshals `spki` as a DER-encoded | |
| /// SignedPublicKeyAndChallenge structure, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<NETSCAPE_SPKI>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_NETSCAPE_SPKI') | |
| external int i2d_NETSCAPE_SPKI( | |
| ffi.Pointer<NETSCAPE_SPKI> spki, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_PKCS7 marshals `p7` as a DER-encoded PKCS#7 ContentInfo structure, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<PKCS7>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_PKCS7') | |
| external int i2d_PKCS7( | |
| ffi.Pointer<PKCS7> p7, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> out, | |
| ); | |
| /// i2d_PKCS7_bio writes `p7` to `bio`. It returns one on success and zero on | |
| /// error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<PKCS7>)>( | |
| symbol: 'bssl_dart_i2d_PKCS7_bio', | |
| ) | |
| external int i2d_PKCS7_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<PKCS7> p7, | |
| ); | |
| /// i2d_PKCS8PrivateKeyInfo_bio encodes `key` as a PKCS#8 PrivateKeyInfo | |
| /// structure (see `EVP_marshal_private_key`) and writes the result to `bp`. It | |
| /// returns one on success and zero on error. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PKCS8PrivateKeyInfo_bio', | |
| ) | |
| external int i2d_PKCS8PrivateKeyInfo_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PKCS8PrivateKeyInfo_fp', | |
| ) | |
| external int i2d_PKCS8PrivateKeyInfo_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> key, | |
| ); | |
| /// i2d_PKCS8PrivateKey_bio encodes `in` as a DER-encoded structure and writes | |
| /// it to `bio`. It returns one on success and zero on error. The structure used | |
| /// depends on `enc`: | |
| /// | |
| /// - If `enc` is NULL, it writes a PrivateKeyInfo structure (RFC 5208). | |
| /// | |
| /// - If `enc` is non-NULL, it writes an EncryptedPrivateKeyInfo structure (RFC | |
| /// 5280). The key is encrypted with PBES2, as in `PKCS8_encrypt`. The password | |
| /// is specified by `pass`, `cb`, and `userdata`, as in `PEM_write_bio_SAMPLE`. | |
| /// | |
| /// WARNING: PrivateKeyInfo and EncryptedPrivateKeyInfo are different formats, | |
| /// and DER does not include a type header. The encrypted and unencrypted modes | |
| /// of this function should not be mixed in the same context. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_PKCS8PrivateKey_bio') | |
| external int i2d_PKCS8PrivateKey_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// i2d_PKCS8PrivateKey_fp behaves like `i2d_PKCS8PrivateKey_bio` but writes to | |
| /// `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Pointer<EVP_CIPHER>, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_PKCS8PrivateKey_fp') | |
| external int i2d_PKCS8PrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| ffi.Pointer<EVP_CIPHER> enc, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// i2d_PKCS8PrivateKey_nid_bio encodes `in` as a DER-encoded structure and | |
| /// writes it to `bio`. It returns one on success and zero on error. The | |
| /// structure used depends on `nid`: | |
| /// | |
| /// - If `nid` is -1, it writes a PrivateKeyInfo structure (RFC 5208). | |
| /// | |
| /// - Otherwise, it writes an EncryptedPrivateKeyInfo structure (RFC 5280). The | |
| /// key is encrypted with PBES1, as in `PKCS8_encrypt`. The password is | |
| /// specified by `pass`, `cb`, and `userdata`, as in `PEM_write_bio_SAMPLE`. | |
| /// | |
| /// WARNING: PrivateKeyInfo and EncryptedPrivateKeyInfo are different formats, | |
| /// and DER does not include a type header. The encrypted and unencrypted modes | |
| /// of this function should not be mixed in the same context. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_PKCS8PrivateKey_nid_bio') | |
| external int i2d_PKCS8PrivateKey_nid_bio( | |
| ffi.Pointer<BIO> bio, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| int nid, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// i2d_PKCS8PrivateKey_nid_fp behaves like `i2d_PKCS8PrivateKey_nid_bio` but | |
| /// writes to `fp`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<FILE>, | |
| ffi.Pointer<EVP_PKEY>, | |
| ffi.Int, | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Int, | |
| ffi.Pointer<pem_password_cb>, | |
| ffi.Pointer<ffi.Void>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_PKCS8PrivateKey_nid_fp') | |
| external int i2d_PKCS8PrivateKey_nid_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> in$, | |
| int nid, | |
| ffi.Pointer<ffi.Char> pass, | |
| int pass_len, | |
| ffi.Pointer<pem_password_cb> cb, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ); | |
| /// i2d_PKCS8_PRIV_KEY_INFO marshals `key` as a DER-encoded PrivateKeyInfo, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_PKCS8_PRIV_KEY_INFO') | |
| external int i2d_PKCS8_PRIV_KEY_INFO( | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<PKCS8_PRIV_KEY_INFO>) | |
| >(symbol: 'bssl_dart_i2d_PKCS8_PRIV_KEY_INFO_bio') | |
| external int i2d_PKCS8_PRIV_KEY_INFO_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> p8inf, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<PKCS8_PRIV_KEY_INFO>) | |
| >(symbol: 'bssl_dart_i2d_PKCS8_PRIV_KEY_INFO_fp') | |
| external int i2d_PKCS8_PRIV_KEY_INFO_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<PKCS8_PRIV_KEY_INFO> p8inf, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_SIG>)>( | |
| symbol: 'bssl_dart_i2d_PKCS8_bio', | |
| ) | |
| external int i2d_PKCS8_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_SIG> p8, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_SIG>)>( | |
| symbol: 'bssl_dart_i2d_PKCS8_fp', | |
| ) | |
| external int i2d_PKCS8_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_SIG> p8, | |
| ); | |
| /// i2d_PUBKEY marshals `pkey` as a DER-encoded SubjectPublicKeyInfo, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EVP_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_PUBKEY') | |
| external int i2d_PUBKEY( | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PUBKEY_bio', | |
| ) | |
| external int i2d_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PUBKEY_fp', | |
| ) | |
| external int i2d_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// i2d_PrivateKey marshals a private key from `key` to type-specific format, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// RSA keys are serialized as a DER-encoded RSAPublicKey (RFC 8017) structure. | |
| /// EC keys are serialized as a DER-encoded ECPrivateKey (RFC 5915) structure. | |
| /// | |
| /// Use `RSA_marshal_private_key` or `EC_KEY_marshal_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_PrivateKey') | |
| external int i2d_PrivateKey( | |
| ffi.Pointer<EVP_PKEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PrivateKey_bio', | |
| ) | |
| external int i2d_PrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<EVP_PKEY>)>( | |
| symbol: 'bssl_dart_i2d_PrivateKey_fp', | |
| ) | |
| external int i2d_PrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<EVP_PKEY> pkey, | |
| ); | |
| /// i2d_PublicKey marshals a public key from `key` to a type-specific format, as | |
| /// described in `i2d_SAMPLE`. | |
| /// | |
| /// RSA keys are serialized as a DER-encoded RSAPublicKey (RFC 8017) structure. | |
| /// EC keys are serialized as an EC point per SEC 1. | |
| /// | |
| /// Use `RSA_marshal_public_key` or `EC_POINT_point2cbb` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<EVP_PKEY>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_PublicKey') | |
| external int i2d_PublicKey( | |
| ffi.Pointer<EVP_PKEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_RSAPrivateKey marshals `in` to a DER-encoded RSAPrivateKey structure (RFC | |
| /// 8017), as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `RSA_marshal_private_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<RSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_RSAPrivateKey') | |
| external int i2d_RSAPrivateKey( | |
| ffi.Pointer<RSA> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSAPrivateKey_bio', | |
| ) | |
| external int i2d_RSAPrivateKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSAPrivateKey_fp', | |
| ) | |
| external int i2d_RSAPrivateKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// i2d_RSAPublicKey marshals `in` to a DER-encoded RSAPublicKey structure (RFC | |
| /// 8017), as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `RSA_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<RSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_RSAPublicKey') | |
| external int i2d_RSAPublicKey( | |
| ffi.Pointer<RSA> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSAPublicKey_bio', | |
| ) | |
| external int i2d_RSAPublicKey_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSAPublicKey_fp', | |
| ) | |
| external int i2d_RSAPublicKey_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// i2d_RSA_PSS_PARAMS marshals `in` as a DER-encoded RSASSA-PSS-params (RFC | |
| /// 4055), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA_PSS_PARAMS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_RSA_PSS_PARAMS') | |
| external int i2d_RSA_PSS_PARAMS( | |
| ffi.Pointer<RSA_PSS_PARAMS> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_RSA_PUBKEY marshals `rsa` as a DER-encoded SubjectPublicKeyInfo | |
| /// structure, as described in `i2d_SAMPLE`. | |
| /// | |
| /// Use `EVP_marshal_public_key` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<RSA>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_RSA_PUBKEY') | |
| external int i2d_RSA_PUBKEY( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSA_PUBKEY_bio', | |
| ) | |
| external int i2d_RSA_PUBKEY_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<RSA>)>( | |
| symbol: 'bssl_dart_i2d_RSA_PUBKEY_fp', | |
| ) | |
| external int i2d_RSA_PUBKEY_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<RSA> rsa, | |
| ); | |
| /// i2d_X509 marshals `x509` as a DER-encoded X.509 Certificate (RFC 5280), as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509') | |
| external int i2d_X509( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_ALGOR marshals `alg` as a DER-encoded AlgorithmIdentifier, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_ALGOR>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_ALGOR') | |
| external int i2d_X509_ALGOR( | |
| ffi.Pointer<X509_ALGOR> alg, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_ATTRIBUTE marshals `alg` as a DER-encoded Attribute (RFC 2986), as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_ATTRIBUTE') | |
| external int i2d_X509_ATTRIBUTE( | |
| ffi.Pointer<X509_ATTRIBUTE> alg, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_AUX marshals `x509` as a DER-encoded X.509 Certificate (RFC 5280), | |
| /// followed optionally by a separate, OpenSSL-specific structure with auxiliary | |
| /// properties. It behaves as described in `i2d_SAMPLE`. | |
| /// | |
| /// Unlike similarly-named functions, this function does not output a single | |
| /// ASN.1 element. Directly embedding the output in a larger ASN.1 structure will | |
| /// not behave correctly. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_AUX') | |
| external int i2d_X509_AUX( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_CRL marshals `crl` as a X.509 CertificateList (RFC 5280), as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_CRL>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_CRL') | |
| external int i2d_X509_CRL( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_i2d_X509_CRL_bio', | |
| ) | |
| external int i2d_X509_CRL_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_CRL>)>( | |
| symbol: 'bssl_dart_i2d_X509_CRL_fp', | |
| ) | |
| external int i2d_X509_CRL_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_CRL> crl, | |
| ); | |
| /// i2d_X509_CRL_tbs serializes the TBSCertList portion of `crl`, as described in | |
| /// `i2d_SAMPLE`. | |
| /// | |
| /// This function preserves the original encoding of the TBSCertList and may not | |
| /// reflect modifications made to `crl`. It may be used to manually verify the | |
| /// signature of an existing CRL. To generate CRLs, use `i2d_re_X509_CRL_tbs` | |
| /// instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_CRL_tbs') | |
| external int i2d_X509_CRL_tbs( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| /// i2d_X509_EXTENSION marshals `ex` as a DER-encoded X.509 Extension (RFC | |
| /// 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_EXTENSION') | |
| external int i2d_X509_EXTENSION( | |
| ffi.Pointer<X509_EXTENSION> ex, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_EXTENSIONS marshals `alg` as a DER-encoded SEQUENCE OF Extension | |
| /// (RFC 5280), as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_EXTENSIONS>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_EXTENSIONS') | |
| external int i2d_X509_EXTENSIONS( | |
| ffi.Pointer<X509_EXTENSIONS> alg, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_NAME marshals `in` as a DER-encoded X.509 Name (RFC 5280), as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_NAME>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_NAME') | |
| external int i2d_X509_NAME( | |
| ffi.Pointer<X509_NAME> in$, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_PUBKEY marshals `key` as a DER-encoded SubjectPublicKeyInfo, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_PUBKEY>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_PUBKEY') | |
| external int i2d_X509_PUBKEY( | |
| ffi.Pointer<X509_PUBKEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_REQ marshals `req` as a CertificateRequest (RFC 2986), as described | |
| /// in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_REQ') | |
| external int i2d_X509_REQ( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_i2d_X509_REQ_bio', | |
| ) | |
| external int i2d_X509_REQ_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509_REQ>)>( | |
| symbol: 'bssl_dart_i2d_X509_REQ_fp', | |
| ) | |
| external int i2d_X509_REQ_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509_REQ> req, | |
| ); | |
| /// i2d_X509_REVOKED marshals `alg` as a DER-encoded X.509 CRL entry, as | |
| /// described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_X509_REVOKED') | |
| external int i2d_X509_REVOKED( | |
| ffi.Pointer<X509_REVOKED> alg, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_X509_SIG marshals `sig` as a DER-encoded algorithm | |
| /// and octet string pair, as described in `i2d_SAMPLE`. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_SIG>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_SIG') | |
| external int i2d_X509_SIG( | |
| ffi.Pointer<X509_SIG> sig, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// The following functions behave like the corresponding unsuffixed `i2d_*` | |
| /// functions, but write the result to `bp`. They return one on success and zero | |
| /// on error. Callers using them with memory `BIO`s to encode structures to | |
| /// memory should use `i2d_*` directly instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<BIO>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_i2d_X509_bio', | |
| ) | |
| external int i2d_X509_bio( | |
| ffi.Pointer<BIO> bp, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// The following functions behave like the corresponding `i2d_*_bio` functions, | |
| /// but write to `fp` instead. | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Int Function(ffi.Pointer<FILE>, ffi.Pointer<X509>)>( | |
| symbol: 'bssl_dart_i2d_X509_fp', | |
| ) | |
| external int i2d_X509_fp( | |
| ffi.Pointer<FILE> fp, | |
| ffi.Pointer<X509> x509, | |
| ); | |
| /// i2d_X509_tbs serializes the TBSCertificate portion of `x509`, as described in | |
| /// `i2d_SAMPLE`. | |
| /// | |
| /// This function preserves the original encoding of the TBSCertificate and may | |
| /// not reflect modifications made to `x509`. It may be used to manually verify | |
| /// the signature of an existing certificate. To generate certificates, use | |
| /// `i2d_re_X509_tbs` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_X509_tbs') | |
| external int i2d_X509_tbs( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_re_X509_CRL_tbs serializes the TBSCertList portion of `crl`, as described | |
| /// in `i2d_SAMPLE`. | |
| /// | |
| /// This function re-encodes the TBSCertList and may not reflect `crl`'s original | |
| /// encoding. It may be used to manually generate a signature for a new CRL. To | |
| /// verify CRLs, use `i2d_X509_CRL_tbs` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2d_re_X509_CRL_tbs') | |
| external int i2d_re_X509_CRL_tbs( | |
| ffi.Pointer<X509_CRL> crl, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| /// i2d_re_X509_REQ_tbs serializes the CertificationRequestInfo (see RFC 2986) | |
| /// portion of `req`, as described in `i2d_SAMPLE`. | |
| /// | |
| /// This function re-encodes the CertificationRequestInfo and may not reflect | |
| /// `req`'s original encoding. It may be used to manually generate a signature | |
| /// for a new certificate request. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509_REQ>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_re_X509_REQ_tbs') | |
| external int i2d_re_X509_REQ_tbs( | |
| ffi.Pointer<X509_REQ> req, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2d_re_X509_tbs serializes the TBSCertificate portion of `x509`, as described | |
| /// in `i2d_SAMPLE`. | |
| /// | |
| /// This function re-encodes the TBSCertificate and may not reflect `x509`'s | |
| /// original encoding. It may be used to manually generate a signature for a new | |
| /// certificate. To verify certificates, use `i2d_X509_tbs` instead. | |
| /// | |
| /// Unlike `i2d_X509_tbs`, this function is not `const` and thus may not be to | |
| /// use concurrently with other functions that access `x509`. It mutates `x509` | |
| /// by dropping the cached encoding. This function is intended to be used during | |
| /// certificate construction, where `x509` is still single-threaded and being | |
| /// mutated. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<X509>, ffi.Pointer<ffi.Pointer<ffi.Uint8>>) | |
| >(symbol: 'bssl_dart_i2d_re_X509_tbs') | |
| external int i2d_re_X509_tbs( | |
| ffi.Pointer<X509> x509, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| /// i2o_ECPublicKey marshals an EC point from `key`, as described in | |
| /// `i2d_SAMPLE`, except it returns zero on error instead of a negative value. | |
| /// | |
| /// Use `EC_POINT_point2cbb` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function( | |
| ffi.Pointer<EC_KEY>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ) | |
| >(symbol: 'bssl_dart_i2o_ECPublicKey') | |
| external int i2o_ECPublicKey( | |
| ffi.Pointer<EC_KEY> key, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>> outp, | |
| ); | |
| /// i2s_ASN1_ENUMERATED returns a human-readable representation of `aint` as a | |
| /// newly-allocated, NUL-terminated string, or NULL on error. `method` is | |
| /// ignored. The caller must release the result with `OPENSSL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<ASN1_ENUMERATED>, | |
| ) | |
| >(symbol: 'bssl_dart_i2s_ASN1_ENUMERATED') | |
| external ffi.Pointer<ffi.Char> i2s_ASN1_ENUMERATED( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ASN1_ENUMERATED> aint, | |
| ); | |
| /// i2s_ASN1_INTEGER returns a human-readable representation of `aint` as a | |
| /// newly-allocated, NUL-terminated string, or NULL on error. `method` is | |
| /// ignored. The caller must release the result with `OPENSSL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ) | |
| >(symbol: 'bssl_dart_i2s_ASN1_INTEGER') | |
| external ffi.Pointer<ffi.Char> i2s_ASN1_INTEGER( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ASN1_INTEGER> aint, | |
| ); | |
| /// i2s_ASN1_OCTET_STRING returns a human-readable representation of `oct` as a | |
| /// newly-allocated, NUL-terminated string, or NULL on error. `method` is | |
| /// ignored. The caller must release the result with `OPENSSL_free` when done. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<ASN1_OCTET_STRING>, | |
| ) | |
| >(symbol: 'bssl_dart_i2s_ASN1_OCTET_STRING') | |
| external ffi.Pointer<ffi.Char> i2s_ASN1_OCTET_STRING( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ASN1_OCTET_STRING> oct, | |
| ); | |
| /// i2t_ASN1_OBJECT calls `OBJ_obj2txt` with `always_return_oid` set to zero. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Int Function(ffi.Pointer<ffi.Char>, ffi.Int, ffi.Pointer<ASN1_OBJECT>) | |
| >(symbol: 'bssl_dart_i2t_ASN1_OBJECT') | |
| external int i2t_ASN1_OBJECT( | |
| ffi.Pointer<ffi.Char> buf, | |
| int buf_len, | |
| ffi.Pointer<ASN1_OBJECT> a, | |
| ); | |
| /// i2v_GENERAL_NAME serializes `gen` as a `CONF_VALUE`. If `ret` is non-NULL, it | |
| /// appends the value to `ret` and returns `ret` on success or NULL on error. If | |
| /// it returns NULL, the caller is still responsible for freeing `ret`. If `ret` | |
| /// is NULL, it returns a newly-allocated `STACK_OF(CONF_VALUE)` containing the | |
| /// result. `method` is ignored. When done, the caller should release the result | |
| /// with `sk_CONF_VALUE_pop_free` and `X509V3_conf_free`. | |
| /// | |
| /// Do not use this function. This is an internal implementation detail of the | |
| /// human-readable print functions. If extracting a SAN list from a certificate, | |
| /// look at `gen` directly. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_CONF_VALUE> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<stack_st_CONF_VALUE>, | |
| ) | |
| >(symbol: 'bssl_dart_i2v_GENERAL_NAME') | |
| external ffi.Pointer<stack_st_CONF_VALUE> i2v_GENERAL_NAME( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<GENERAL_NAME> gen, | |
| ffi.Pointer<stack_st_CONF_VALUE> ret, | |
| ); | |
| /// i2v_GENERAL_NAMES serializes `gen` as a list of `CONF_VALUE`s. If `ret` is | |
| /// non-NULL, it appends the values to `ret` and returns `ret` on success or NULL | |
| /// on error. If it returns NULL, the caller is still responsible for freeing | |
| /// `ret`. If `ret` is NULL, it returns a newly-allocated `STACK_OF(CONF_VALUE)` | |
| /// containing the results. `method` is ignored. | |
| /// | |
| /// Do not use this function. This is an internal implementation detail of the | |
| /// human-readable print functions. If extracting a SAN list from a certificate, | |
| /// look at `gen` directly. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<stack_st_CONF_VALUE> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<GENERAL_NAMES>, | |
| ffi.Pointer<stack_st_CONF_VALUE>, | |
| ) | |
| >(symbol: 'bssl_dart_i2v_GENERAL_NAMES') | |
| external ffi.Pointer<stack_st_CONF_VALUE> i2v_GENERAL_NAMES( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<GENERAL_NAMES> gen, | |
| ffi.Pointer<stack_st_CONF_VALUE> extlist, | |
| ); | |
| /// o2i_ECPublicKey parses an EC point from `len` bytes at `*inp` into | |
| /// `*out_key`. Note that this differs from the d2i format in that `*out_key` | |
| /// must be non-NULL with a group set. On successful exit, `*inp` is advanced by | |
| /// `len` bytes. It returns `*out_key` or NULL on error. | |
| /// | |
| /// Use `EC_POINT_oct2point` instead. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<EC_KEY> Function( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>>, | |
| ffi.Long, | |
| ) | |
| >(symbol: 'bssl_dart_o2i_ECPublicKey') | |
| external ffi.Pointer<EC_KEY> o2i_ECPublicKey( | |
| ffi.Pointer<ffi.Pointer<EC_KEY>> out_key, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| /// s2i_ASN1_INTEGER decodes `value` as the ASCII representation of an integer, | |
| /// and returns a newly-allocated `ASN1_INTEGER` containing the result, or NULL | |
| /// on error. `method` is ignored. If `value` begins with "0x" or "0X", the input | |
| /// is decoded in hexadecimal, otherwise decimal. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_INTEGER> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_s2i_ASN1_INTEGER') | |
| external ffi.Pointer<ASN1_INTEGER> s2i_ASN1_INTEGER( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ffi.Char> value, | |
| ); | |
| /// s2i_ASN1_OCTET_STRING decodes `str` as a hexadecimal byte string, with | |
| /// optional colon separators between bytes. It returns a newly-allocated | |
| /// `ASN1_OCTET_STRING` with the result on success, or NULL on error. `method` | |
| /// and `ctx` are ignored. | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ASN1_OCTET_STRING> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD>, | |
| ffi.Pointer<X509V3_CTX>, | |
| ffi.Pointer<ffi.Char>, | |
| ) | |
| >(symbol: 'bssl_dart_s2i_ASN1_OCTET_STRING') | |
| external ffi.Pointer<ASN1_OCTET_STRING> s2i_ASN1_OCTET_STRING( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Void Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_sk_free', | |
| ) | |
| external void sk_free( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| /// The following functions call the corresponding `OPENSSL_sk_*` function. | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<OPENSSL_STACK> Function()>( | |
| symbol: 'bssl_dart_sk_new_null', | |
| ) | |
| external ffi.Pointer<OPENSSL_STACK> sk_new_null(); | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Size Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_sk_num', | |
| ) | |
| external int sk_num( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native<ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>)>( | |
| symbol: 'bssl_dart_sk_pop', | |
| ) | |
| external ffi.Pointer<ffi.Void> sk_pop( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ); | |
| /// sk_pop_free behaves like `OPENSSL_sk_pop_free_ex` but performs an invalid | |
| /// function pointer cast. It exists because some existing callers called | |
| /// `sk_pop_free` directly. | |
| /// | |
| /// TODO(davidben): Migrate callers to bssl::UniquePtr and remove this. | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function(ffi.Pointer<OPENSSL_STACK>, OPENSSL_sk_free_func) | |
| >(symbol: 'bssl_dart_sk_pop_free') | |
| external void sk_pop_free( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_free_func free_func, | |
| ); | |
| /// sk_pop_free_ex calls `OPENSSL_sk_pop_free_ex`. | |
| /// | |
| /// TODO(b/291994116): Remove this. | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Void Function( | |
| ffi.Pointer<OPENSSL_STACK>, | |
| OPENSSL_sk_call_free_func, | |
| OPENSSL_sk_free_func, | |
| ) | |
| >(symbol: 'bssl_dart_sk_pop_free_ex') | |
| external void sk_pop_free_ex( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| OPENSSL_sk_call_free_func call_free_func, | |
| OPENSSL_sk_free_func free_func, | |
| ); | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Size Function(ffi.Pointer<OPENSSL_STACK>, ffi.Pointer<ffi.Void>) | |
| >(symbol: 'bssl_dart_sk_push') | |
| external int sk_push( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| ffi.Pointer<ffi.Void> p, | |
| ); | |
| @Deprecated('Deprecated') | |
| @meta.RecordUse() | |
| @ffi.Native< | |
| ffi.Pointer<ffi.Void> Function(ffi.Pointer<OPENSSL_STACK>, ffi.Size) | |
| >(symbol: 'bssl_dart_sk_value') | |
| external ffi.Pointer<ffi.Void> sk_value( | |
| ffi.Pointer<OPENSSL_STACK> sk, | |
| int i, | |
| ); | |
| /// The addresses of the functions releasing BoringSSL objects, for | |
| /// `NativeFinalizer`s. | |
| /// | |
| /// Use these instead of `Native.addressOf`, which is not recorded as a | |
| /// use of the function, so the link hook would drop it. | |
| const addresses = SymbolAddresses._(null); | |
| /// The extension type for [addresses] providing access to the symbol | |
| /// addresses. | |
| extension type const SymbolAddresses._(Null _) { | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ACCESS_DESCRIPTION>)> | |
| > | |
| get ACCESS_DESCRIPTION_free => | |
| ffi.Native.addressOf(self.ACCESS_DESCRIPTION_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_BIT_STRING>)> | |
| > | |
| get ASN1_BIT_STRING_free => ffi.Native.addressOf(self.ASN1_BIT_STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_BMPSTRING>)> | |
| > | |
| get ASN1_BMPSTRING_free => ffi.Native.addressOf(self.ASN1_BMPSTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_ENUMERATED>)> | |
| > | |
| get ASN1_ENUMERATED_free => ffi.Native.addressOf(self.ASN1_ENUMERATED_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_GENERALIZEDTIME>)> | |
| > | |
| get ASN1_GENERALIZEDTIME_free => | |
| ffi.Native.addressOf(self.ASN1_GENERALIZEDTIME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_GENERALSTRING>)> | |
| > | |
| get ASN1_GENERALSTRING_free => | |
| ffi.Native.addressOf(self.ASN1_GENERALSTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_IA5STRING>)> | |
| > | |
| get ASN1_IA5STRING_free => ffi.Native.addressOf(self.ASN1_IA5STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_INTEGER>)>> | |
| get ASN1_INTEGER_free => ffi.Native.addressOf(self.ASN1_INTEGER_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_NULL>)>> | |
| get ASN1_NULL_free => ffi.Native.addressOf(self.ASN1_NULL_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_OBJECT>)>> | |
| get ASN1_OBJECT_free => ffi.Native.addressOf(self.ASN1_OBJECT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_OCTET_STRING>)> | |
| > | |
| get ASN1_OCTET_STRING_free => | |
| ffi.Native.addressOf(self.ASN1_OCTET_STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_PRINTABLESTRING>)> | |
| > | |
| get ASN1_PRINTABLESTRING_free => | |
| ffi.Native.addressOf(self.ASN1_PRINTABLESTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> | |
| get ASN1_STRING_TABLE_cleanup => | |
| ffi.Native.addressOf(self.ASN1_STRING_TABLE_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>> | |
| get ASN1_STRING_free => ffi.Native.addressOf(self.ASN1_STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_T61STRING>)> | |
| > | |
| get ASN1_T61STRING_free => ffi.Native.addressOf(self.ASN1_T61STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_TIME>)>> | |
| get ASN1_TIME_free => ffi.Native.addressOf(self.ASN1_TIME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_TYPE>)>> | |
| get ASN1_TYPE_free => ffi.Native.addressOf(self.ASN1_TYPE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_UNIVERSALSTRING>)> | |
| > | |
| get ASN1_UNIVERSALSTRING_free => | |
| ffi.Native.addressOf(self.ASN1_UNIVERSALSTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_UTCTIME>)>> | |
| get ASN1_UTCTIME_free => ffi.Native.addressOf(self.ASN1_UTCTIME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_UTF8STRING>)> | |
| > | |
| get ASN1_UTF8STRING_free => ffi.Native.addressOf(self.ASN1_UTF8STRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_VISIBLESTRING>)> | |
| > | |
| get ASN1_VISIBLESTRING_free => | |
| ffi.Native.addressOf(self.ASN1_VISIBLESTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ASN1_VALUE>, ffi.Pointer<ASN1_ITEM>) | |
| > | |
| > | |
| get ASN1_item_free => ffi.Native.addressOf(self.ASN1_item_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<AUTHORITY_INFO_ACCESS>)> | |
| > | |
| get AUTHORITY_INFO_ACCESS_free => | |
| ffi.Native.addressOf(self.AUTHORITY_INFO_ACCESS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<AUTHORITY_KEYID>)> | |
| > | |
| get AUTHORITY_KEYID_free => ffi.Native.addressOf(self.AUTHORITY_KEYID_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BASIC_CONSTRAINTS>)> | |
| > | |
| get BASIC_CONSTRAINTS_free => | |
| ffi.Native.addressOf(self.BASIC_CONSTRAINTS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>)>> | |
| get BIO_free => ffi.Native.addressOf(self.BIO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BIO_METHOD>)>> | |
| get BIO_meth_free => ffi.Native.addressOf(self.BIO_meth_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BN_CTX>)>> | |
| get BN_CTX_free => ffi.Native.addressOf(self.BN_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BN_GENCB>)>> | |
| get BN_GENCB_free => ffi.Native.addressOf(self.BN_GENCB_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BN_MONT_CTX>)>> | |
| get BN_MONT_CTX_free => ffi.Native.addressOf(self.BN_MONT_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BIGNUM>)>> | |
| get BN_clear_free => ffi.Native.addressOf(self.BN_clear_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BIGNUM>)>> | |
| get BN_free => ffi.Native.addressOf(self.BN_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<BUF_MEM>)>> | |
| get BUF_MEM_free => ffi.Native.addressOf(self.BUF_MEM_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CBB>)>> | |
| get CBB_cleanup => ffi.Native.addressOf(self.CBB_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CERTIFICATEPOLICIES>)> | |
| > | |
| get CERTIFICATEPOLICIES_free => | |
| ffi.Native.addressOf(self.CERTIFICATEPOLICIES_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get CONF_modules_free => | |
| ffi.Native.addressOf(self.CONF_modules_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CPACE_CTX>)>> | |
| get CPACE_CTX_free => ffi.Native.addressOf(self.CPACE_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CRL_DIST_POINTS>)> | |
| > | |
| get CRL_DIST_POINTS_free => ffi.Native.addressOf(self.CRL_DIST_POINTS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CRYPTO_BUFFER_POOL>)> | |
| > | |
| get CRYPTO_BUFFER_POOL_free => | |
| ffi.Native.addressOf(self.CRYPTO_BUFFER_POOL_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CRYPTO_BUFFER>)>> | |
| get CRYPTO_BUFFER_free => ffi.Native.addressOf(self.CRYPTO_BUFFER_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>, ffi.Int) | |
| > | |
| > | |
| get CRYPTO_free => ffi.Native.addressOf(self.CRYPTO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<DH>)>> | |
| get DH_free => ffi.Native.addressOf(self.DH_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>> | |
| get DIRECTORYSTRING_free => ffi.Native.addressOf(self.DIRECTORYSTRING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ASN1_STRING>)>> | |
| get DISPLAYTEXT_free => ffi.Native.addressOf(self.DISPLAYTEXT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<DIST_POINT_NAME>)> | |
| > | |
| get DIST_POINT_NAME_free => ffi.Native.addressOf(self.DIST_POINT_NAME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<DIST_POINT>)>> | |
| get DIST_POINT_free => ffi.Native.addressOf(self.DIST_POINT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<DSA_SIG>)>> | |
| get DSA_SIG_free => ffi.Native.addressOf(self.DSA_SIG_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<DSA>)>> | |
| get DSA_free => ffi.Native.addressOf(self.DSA_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ECDSA_SIG>)>> | |
| get ECDSA_SIG_free => ffi.Native.addressOf(self.ECDSA_SIG_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EC_GROUP>)>> | |
| get EC_GROUP_free => ffi.Native.addressOf(self.EC_GROUP_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EC_KEY>)>> | |
| get EC_KEY_free => ffi.Native.addressOf(self.EC_KEY_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EC_POINT>)>> | |
| get EC_POINT_clear_free => ffi.Native.addressOf(self.EC_POINT_clear_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EC_POINT>)>> | |
| get EC_POINT_free => ffi.Native.addressOf(self.EC_POINT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EDIPARTYNAME>)>> | |
| get EDIPARTYNAME_free => ffi.Native.addressOf(self.EDIPARTYNAME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get ENGINE_cleanup => | |
| ffi.Native.addressOf(self.ENGINE_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ENGINE>)>> | |
| get ENGINE_free => ffi.Native.addressOf(self.ENGINE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_AEAD_CTX>)>> | |
| get EVP_AEAD_CTX_cleanup => ffi.Native.addressOf(self.EVP_AEAD_CTX_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_AEAD_CTX>)>> | |
| get EVP_AEAD_CTX_free => ffi.Native.addressOf(self.EVP_AEAD_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<EVP_CIPHER_CTX>)>> | |
| get EVP_CIPHER_CTX_cleanup => | |
| ffi.Native.addressOf(self.EVP_CIPHER_CTX_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_CIPHER_CTX>)> | |
| > | |
| get EVP_CIPHER_CTX_free => ffi.Native.addressOf(self.EVP_CIPHER_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_ENCODE_CTX>)> | |
| > | |
| get EVP_ENCODE_CTX_free => ffi.Native.addressOf(self.EVP_ENCODE_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<EVP_MD_CTX>)>> | |
| get EVP_MD_CTX_cleanup => ffi.Native.addressOf(self.EVP_MD_CTX_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_MD_CTX>)>> | |
| get EVP_MD_CTX_free => ffi.Native.addressOf(self.EVP_MD_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_MD>)>> | |
| get EVP_MD_free => ffi.Native.addressOf(self.EVP_MD_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_PKEY_CTX>)>> | |
| get EVP_PKEY_CTX_free => ffi.Native.addressOf(self.EVP_PKEY_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EVP_PKEY>)>> | |
| get EVP_PKEY_free => ffi.Native.addressOf(self.EVP_PKEY_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get EVP_cleanup => | |
| ffi.Native.addressOf(self.EVP_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<EXTENDED_KEY_USAGE>)> | |
| > | |
| get EXTENDED_KEY_USAGE_free => | |
| ffi.Native.addressOf(self.EXTENDED_KEY_USAGE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<GENERAL_NAMES>)>> | |
| get GENERAL_NAMES_free => ffi.Native.addressOf(self.GENERAL_NAMES_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<GENERAL_NAME>)>> | |
| get GENERAL_NAME_free => ffi.Native.addressOf(self.GENERAL_NAME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<GENERAL_SUBTREE>)> | |
| > | |
| get GENERAL_SUBTREE_free => ffi.Native.addressOf(self.GENERAL_SUBTREE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>> | |
| get HMAC_CTX_cleanup => ffi.Native.addressOf(self.HMAC_CTX_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<HMAC_CTX>)>> | |
| get HMAC_CTX_free => ffi.Native.addressOf(self.HMAC_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ISSUING_DIST_POINT>)> | |
| > | |
| get ISSUING_DIST_POINT_free => | |
| ffi.Native.addressOf(self.ISSUING_DIST_POINT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<NAME_CONSTRAINTS>)> | |
| > | |
| get NAME_CONSTRAINTS_free => ffi.Native.addressOf(self.NAME_CONSTRAINTS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CONF>)>> | |
| get NCONF_free => ffi.Native.addressOf(self.NCONF_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<NETSCAPE_SPKAC>)> | |
| > | |
| get NETSCAPE_SPKAC_free => ffi.Native.addressOf(self.NETSCAPE_SPKAC_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<NETSCAPE_SPKI>)>> | |
| get NETSCAPE_SPKI_free => ffi.Native.addressOf(self.NETSCAPE_SPKI_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<NOTICEREF>)>> | |
| get NOTICEREF_free => ffi.Native.addressOf(self.NOTICEREF_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get OBJ_cleanup => | |
| ffi.Native.addressOf(self.OBJ_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get OPENSSL_cleanup => | |
| ffi.Native.addressOf(self.OPENSSL_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Size)> | |
| > | |
| get OPENSSL_clear_free => ffi.Native.addressOf(self.OPENSSL_clear_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>> | |
| get OPENSSL_free => ffi.Native.addressOf(self.OPENSSL_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Size)> | |
| > | |
| get OPENSSL_secure_clear_free => | |
| ffi.Native.addressOf(self.OPENSSL_secure_clear_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<OPENSSL_STACK>)>> | |
| get OPENSSL_sk_free => ffi.Native.addressOf(self.OPENSSL_sk_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<OTHERNAME>)>> | |
| get OTHERNAME_free => ffi.Native.addressOf(self.OTHERNAME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<PKCS7>)>> | |
| get PKCS7_free => ffi.Native.addressOf(self.PKCS7_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<PKCS8_PRIV_KEY_INFO>)> | |
| > | |
| get PKCS8_PRIV_KEY_INFO_free => | |
| ffi.Native.addressOf(self.PKCS8_PRIV_KEY_INFO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<POLICYINFO>)>> | |
| get POLICYINFO_free => ffi.Native.addressOf(self.POLICYINFO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<POLICYQUALINFO>)> | |
| > | |
| get POLICYQUALINFO_free => ffi.Native.addressOf(self.POLICYQUALINFO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<POLICY_CONSTRAINTS>)> | |
| > | |
| get POLICY_CONSTRAINTS_free => | |
| ffi.Native.addressOf(self.POLICY_CONSTRAINTS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<POLICY_MAPPING>)> | |
| > | |
| get POLICY_MAPPING_free => ffi.Native.addressOf(self.POLICY_MAPPING_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> get RAND_cleanup => | |
| ffi.Native.addressOf(self.RAND_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<RSA_PSS_PARAMS>)> | |
| > | |
| get RSA_PSS_PARAMS_free => ffi.Native.addressOf(self.RSA_PSS_PARAMS_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<RSA>)>> | |
| get RSA_free => ffi.Native.addressOf(self.RSA_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<SPAKE2_CTX>)>> | |
| get SPAKE2_CTX_free => ffi.Native.addressOf(self.SPAKE2_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<USERNOTICE>)>> | |
| get USERNOTICE_free => ffi.Native.addressOf(self.USERNOTICE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Int, ffi.Pointer<ffi.Void>)> | |
| > | |
| get X509V3_EXT_free => ffi.Native.addressOf(self.X509V3_EXT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<CONF_VALUE>)>> | |
| get X509V3_conf_free => ffi.Native.addressOf(self.X509V3_conf_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_ALGOR>)>> | |
| get X509_ALGOR_free => ffi.Native.addressOf(self.X509_ALGOR_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_ATTRIBUTE>)> | |
| > | |
| get X509_ATTRIBUTE_free => ffi.Native.addressOf(self.X509_ATTRIBUTE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_CRL>)>> | |
| get X509_CRL_free => ffi.Native.addressOf(self.X509_CRL_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_EXTENSION>)> | |
| > | |
| get X509_EXTENSION_free => ffi.Native.addressOf(self.X509_EXTENSION_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_INFO>)>> | |
| get X509_INFO_free => ffi.Native.addressOf(self.X509_INFO_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_LOOKUP>)>> | |
| get X509_LOOKUP_free => ffi.Native.addressOf(self.X509_LOOKUP_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_NAME_ENTRY>)> | |
| > | |
| get X509_NAME_ENTRY_free => ffi.Native.addressOf(self.X509_NAME_ENTRY_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_NAME>)>> | |
| get X509_NAME_free => ffi.Native.addressOf(self.X509_NAME_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_OBJECT>)>> | |
| get X509_OBJECT_free => ffi.Native.addressOf(self.X509_OBJECT_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_PUBKEY>)>> | |
| get X509_PUBKEY_free => ffi.Native.addressOf(self.X509_PUBKEY_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_REQ>)>> | |
| get X509_REQ_free => ffi.Native.addressOf(self.X509_REQ_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_REVOKED>)>> | |
| get X509_REVOKED_free => ffi.Native.addressOf(self.X509_REVOKED_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_SIG>)>> | |
| get X509_SIG_free => ffi.Native.addressOf(self.X509_SIG_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>)> | |
| > | |
| get X509_STORE_CTX_cleanup => | |
| ffi.Native.addressOf(self.X509_STORE_CTX_cleanup); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_STORE_CTX>)> | |
| > | |
| get X509_STORE_CTX_free => ffi.Native.addressOf(self.X509_STORE_CTX_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_STORE>)>> | |
| get X509_STORE_free => ffi.Native.addressOf(self.X509_STORE_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509_VERIFY_PARAM>)> | |
| > | |
| get X509_VERIFY_PARAM_free => | |
| ffi.Native.addressOf(self.X509_VERIFY_PARAM_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction<ffi.Void Function(ffi.Pointer<stack_st_OPENSSL_STRING>)> | |
| > | |
| get X509_email_free => ffi.Native.addressOf(self.X509_email_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<X509>)>> | |
| get X509_free => ffi.Native.addressOf(self.X509_free); | |
| @meta.RecordUse() | |
| ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<OPENSSL_STACK>)>> | |
| get sk_free => ffi.Native.addressOf(self.sk_free); | |
| @meta.RecordUse() | |
| ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<OPENSSL_STACK>, OPENSSL_sk_free_func) | |
| > | |
| > | |
| get sk_pop_free => ffi.Native.addressOf(self.sk_pop_free); | |
| } | |
| typedef ACCESS_DESCRIPTION = ACCESS_DESCRIPTION_st; | |
| /// An ACCESS_DESCRIPTION represents an AccessDescription structure (RFC 5280). | |
| final class ACCESS_DESCRIPTION_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> method; | |
| external ffi.Pointer<GENERAL_NAME> location; | |
| static ffi.Pointer<ACCESS_DESCRIPTION_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OBJECT> method, | |
| required ffi.Pointer<GENERAL_NAME> location, | |
| }) => $allocator<ACCESS_DESCRIPTION_st>() | |
| ..ref.method = method | |
| ..ref.location = location; | |
| } | |
| const int AES_BLOCK_SIZE = 16; | |
| const int AES_DECRYPT = 0; | |
| const int AES_ENCRYPT = 1; | |
| typedef AES_KEY = aes_key_st; | |
| const int AES_MAXNR = 14; | |
| typedef ASN1_BIT_STRING = asn1_string_st; | |
| typedef ASN1_BMPSTRING = asn1_string_st; | |
| typedef ASN1_BOOLEAN = ffi.Int; | |
| typedef DartASN1_BOOLEAN = int; | |
| typedef ASN1_ENUMERATED = asn1_string_st; | |
| typedef ASN1_GENERALIZEDTIME = asn1_string_st; | |
| typedef ASN1_GENERALSTRING = asn1_string_st; | |
| typedef ASN1_IA5STRING = asn1_string_st; | |
| typedef ASN1_INTEGER = asn1_string_st; | |
| typedef ASN1_ITEM = ASN1_ITEM_st; | |
| /// ASN1_ITEM_EXP is an abstraction for referencing an `ASN1_ITEM` in a | |
| /// constant-initialized structure, such as a method table. It exists because, on | |
| /// some OpenSSL platforms, `ASN1_ITEM` references are indirected through | |
| /// functions. Structures reference the `ASN1_ITEM` by declaring a field like | |
| /// `ASN1_ITEM_EXP *item` and initializing it with `ASN1_ITEM_ref`. | |
| typedef ASN1_ITEM_EXP = ASN1_ITEM; | |
| final class ASN1_ITEM_st extends ffi.Opaque {} | |
| /// An `ASN1_NULL` is an opaque type. asn1.h represents the ASN.1 NULL value as | |
| /// an opaque, non-NULL `ASN1_NULL*` pointer. | |
| typedef ASN1_NULL = asn1_null_st; | |
| typedef ASN1_OBJECT = asn1_object_st; | |
| typedef ASN1_OCTET_STRING = asn1_string_st; | |
| typedef ASN1_PCTX = asn1_pctx_st; | |
| typedef ASN1_PRINTABLESTRING = asn1_string_st; | |
| typedef ASN1_SEQUENCE_ANY = stack_st_ASN1_TYPE; | |
| typedef ASN1_STRING = asn1_string_st; | |
| typedef ASN1_T61STRING = asn1_string_st; | |
| typedef ASN1_TIME = asn1_string_st; | |
| typedef ASN1_TYPE = asn1_type_st; | |
| typedef ASN1_UNIVERSALSTRING = asn1_string_st; | |
| typedef ASN1_UTCTIME = asn1_string_st; | |
| typedef ASN1_UTF8STRING = asn1_string_st; | |
| /// ASN1_VALUE_st (aka `ASN1_VALUE`) is an opaque type used as a placeholder for | |
| /// the C type corresponding to an `ASN1_ITEM`. | |
| typedef ASN1_VALUE = ASN1_VALUE_st; | |
| final class ASN1_VALUE_st extends ffi.Opaque {} | |
| typedef ASN1_VISIBLESTRING = asn1_string_st; | |
| typedef AUTHORITY_INFO_ACCESS = stack_st_ACCESS_DESCRIPTION; | |
| typedef AUTHORITY_KEYID = AUTHORITY_KEYID_st; | |
| /// A AUTHORITY_KEYID_st, aka `AUTHORITY_KEYID`, represents an | |
| /// AuthorityKeyIdentifier structure (RFC 5280). | |
| final class AUTHORITY_KEYID_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OCTET_STRING> keyid; | |
| external ffi.Pointer<GENERAL_NAMES> issuer; | |
| external ffi.Pointer<ASN1_INTEGER> serial; | |
| static ffi.Pointer<AUTHORITY_KEYID_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OCTET_STRING> keyid, | |
| required ffi.Pointer<GENERAL_NAMES> issuer, | |
| required ffi.Pointer<ASN1_INTEGER> serial, | |
| }) => $allocator<AUTHORITY_KEYID_st>() | |
| ..ref.keyid = keyid | |
| ..ref.issuer = issuer | |
| ..ref.serial = serial; | |
| } | |
| typedef BASIC_CONSTRAINTS = BASIC_CONSTRAINTS_st; | |
| /// A BASIC_CONSTRAINTS_st, aka `BASIC_CONSTRAINTS` represents an | |
| /// BasicConstraints structure (RFC 5280). | |
| final class BASIC_CONSTRAINTS_st extends ffi.Struct { | |
| @ASN1_BOOLEAN() | |
| external int ca; | |
| external ffi.Pointer<ASN1_INTEGER> pathlen; | |
| static ffi.Pointer<BASIC_CONSTRAINTS_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int ca, | |
| required ffi.Pointer<ASN1_INTEGER> pathlen, | |
| }) => $allocator<BASIC_CONSTRAINTS_st>() | |
| ..ref.ca = ca | |
| ..ref.pathlen = pathlen; | |
| } | |
| typedef BIGNUM = bignum_st; | |
| typedef BIO = bio_st; | |
| typedef BIO_METHOD = bio_method_st; | |
| typedef BIO_info_cb = | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<BIO>, ffi.Int, ffi.Int)>; | |
| typedef BLAKE2B_CTX = blake2b_state_st; | |
| typedef BN_CTX = bignum_ctx; | |
| typedef BN_GENCB = bn_gencb_st; | |
| typedef BN_MONT_CTX = bn_mont_ctx_st; | |
| typedef BUF_MEM = buf_mem_st; | |
| typedef CBB = cbb_st; | |
| typedef CBS = cbs_st; | |
| const int CBS_ASN1_APPLICATION = 1073741824; | |
| const int CBS_ASN1_BITSTRING = 3; | |
| const int CBS_ASN1_BMPSTRING = 30; | |
| const int CBS_ASN1_BOOLEAN = 1; | |
| const int CBS_ASN1_CLASS_MASK = 3221225472; | |
| const int CBS_ASN1_CONSTRUCTED = 536870912; | |
| const int CBS_ASN1_CONTEXT_SPECIFIC = 2147483648; | |
| const int CBS_ASN1_ENUMERATED = 10; | |
| const int CBS_ASN1_GENERALIZEDTIME = 24; | |
| const int CBS_ASN1_GENERALSTRING = 27; | |
| const int CBS_ASN1_GRAPHICSTRING = 25; | |
| const int CBS_ASN1_IA5STRING = 22; | |
| const int CBS_ASN1_INTEGER = 2; | |
| const int CBS_ASN1_NULL = 5; | |
| const int CBS_ASN1_NUMERICSTRING = 18; | |
| const int CBS_ASN1_OBJECT = 6; | |
| const int CBS_ASN1_OCTETSTRING = 4; | |
| const int CBS_ASN1_PRINTABLESTRING = 19; | |
| const int CBS_ASN1_PRIVATE = 3221225472; | |
| const int CBS_ASN1_RELATIVE_OID = 13; | |
| const int CBS_ASN1_SEQUENCE = 536870928; | |
| const int CBS_ASN1_SET = 536870929; | |
| const int CBS_ASN1_T61STRING = 20; | |
| /// CBS_ASN1_TAG is the type used by `CBS` and `CBB` for ASN.1 tags. See that | |
| /// header for details. This type is defined in base.h as a forward declaration. | |
| typedef CBS_ASN1_TAG = ffi.Uint32; | |
| typedef DartCBS_ASN1_TAG = int; | |
| const int CBS_ASN1_TAG_NUMBER_MASK = 536870911; | |
| const int CBS_ASN1_TAG_SHIFT = 24; | |
| const int CBS_ASN1_UNIVERSAL = 0; | |
| const int CBS_ASN1_UNIVERSALSTRING = 28; | |
| const int CBS_ASN1_UTCTIME = 23; | |
| const int CBS_ASN1_UTF8STRING = 12; | |
| const int CBS_ASN1_VIDEOTEXSTRING = 21; | |
| const int CBS_ASN1_VISIBLESTRING = 26; | |
| typedef CERTIFICATEPOLICIES = stack_st_POLICYINFO; | |
| typedef CMAC_CTX = cmac_ctx_st; | |
| typedef CMS_ContentInfo = CMS_ContentInfo_st; | |
| final class CMS_ContentInfo_st extends ffi.Opaque {} | |
| typedef CMS_SignerInfo = CMS_SignerInfo_st; | |
| final class CMS_SignerInfo_st extends ffi.Opaque {} | |
| typedef CONF = conf_st; | |
| typedef CONF_VALUE = conf_value_st; | |
| typedef CPACE_CTX = cpace_ctx_st; | |
| typedef CRL_DIST_POINTS = stack_st_DIST_POINT; | |
| typedef CRYPTO_BUFFER = crypto_buffer_st; | |
| typedef CRYPTO_BUFFER_POOL = crypto_buffer_pool_st; | |
| /// CRYPTO_EX_DATA, in the public API, is an opaque struct that is never returned | |
| /// from the library. | |
| typedef CRYPTO_EX_DATA = crypto_ex_data_st; | |
| /// CRYPTO_EX_dup is a legacy callback function type which is ignored. | |
| typedef CRYPTO_EX_dup = | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<CRYPTO_EX_DATA> to, | |
| ffi.Pointer<CRYPTO_EX_DATA> from, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> from_d, | |
| ffi.Int index, | |
| ffi.Long argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ) | |
| >; | |
| /// CRYPTO_EX_free is a callback function that is called when an object of the | |
| /// class with extra data pointers is being destroyed. For example, if this | |
| /// callback has been passed to `SSL_get_ex_new_index` then it may be called each | |
| /// time an `SSL*` is destroyed. | |
| /// | |
| /// `parent` and `ad` will be NULL. Historically, the parent object was passed in | |
| /// `parent`, but accessing the pointer was not safe because `parent` was in the | |
| /// process of being destroyed. If the callback has access to some other pointer | |
| /// to the parent object, it must not pass the pointer to any BoringSSL APIs. | |
| /// Mid-destruction, invariants on the parent object no longer hold. | |
| /// | |
| /// The arguments `argl` and `argp` contain opaque values that were given to | |
| /// `CRYPTO_get_ex_new_index_ex`. | |
| /// | |
| /// This callback may be called with a NULL value for `ptr` if the object has no | |
| /// value set for this index. However, the callbacks may also be skipped entirely | |
| /// if no extra data pointers are set on the object at all. | |
| typedef CRYPTO_EX_free = | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Void> parent, | |
| ffi.Pointer<ffi.Void> ptr, | |
| ffi.Pointer<CRYPTO_EX_DATA> ad, | |
| ffi.Int index, | |
| ffi.Long argl, | |
| ffi.Pointer<ffi.Void> argp, | |
| ) | |
| >; | |
| /// CRYPTO_EX_unused is a placeholder for an unused callback. It is aliased to | |
| /// int to ensure non-NULL callers fail to compile rather than fail silently. | |
| typedef CRYPTO_EX_unused = ffi.Int; | |
| typedef DartCRYPTO_EX_unused = int; | |
| typedef CRYPTO_IOVEC = crypto_iovec_st; | |
| typedef CRYPTO_IVEC = crypto_ivec_st; | |
| /// CRYPTO_MUST_BE_NULL is an opaque type that is never returned from BoringSSL. | |
| /// It is used in function parameters that must be NULL. | |
| typedef CRYPTO_MUST_BE_NULL = crypto_must_be_null_st; | |
| /// CRYPTO_THREADID is a dummy value. | |
| typedef CRYPTO_THREADID = ffi.Int; | |
| typedef DartCRYPTO_THREADID = int; | |
| final class CRYPTO_dynlock extends ffi.Struct { | |
| @ffi.Int() | |
| external int references; | |
| external ffi.Pointer<CRYPTO_dynlock_value> data; | |
| static ffi.Pointer<CRYPTO_dynlock> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int references, | |
| required ffi.Pointer<CRYPTO_dynlock_value> data, | |
| }) => $allocator<CRYPTO_dynlock>() | |
| ..ref.references = references | |
| ..ref.data = data; | |
| } | |
| final class CRYPTO_dynlock_value extends ffi.Opaque {} | |
| typedef CTR_DRBG_STATE = ctr_drbg_state_st; | |
| typedef DH = dh_st; | |
| typedef DIST_POINT = DIST_POINT_st; | |
| typedef DIST_POINT_NAME = DIST_POINT_NAME_st; | |
| /// A DIST_POINT_NAME represents a DistributionPointName structure (RFC 5280). | |
| /// The `name` field contains the CHOICE value and is determined by `type`. If | |
| /// `type` is zero, `name` must be a `fullname`. If `type` is one, `name` must be | |
| /// a `relativename`. | |
| /// | |
| /// WARNING: `type` and `name` must be kept consistent. An inconsistency will | |
| /// result in a potentially exploitable memory error. | |
| final class DIST_POINT_NAME_st extends ffi.Struct { | |
| @ffi.Int() | |
| external int type; | |
| external UnnamedUnion$4 name; | |
| } | |
| /// A DIST_POINT_st, aka `DIST_POINT`, represents a DistributionPoint structure | |
| /// (RFC 5280). | |
| final class DIST_POINT_st extends ffi.Struct { | |
| external ffi.Pointer<DIST_POINT_NAME> distpoint; | |
| external ffi.Pointer<ASN1_BIT_STRING> reasons; | |
| external ffi.Pointer<GENERAL_NAMES> CRLissuer; | |
| static ffi.Pointer<DIST_POINT_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<DIST_POINT_NAME> distpoint, | |
| required ffi.Pointer<ASN1_BIT_STRING> reasons, | |
| required ffi.Pointer<GENERAL_NAMES> CRLissuer, | |
| }) => $allocator<DIST_POINT_st>() | |
| ..ref.distpoint = distpoint | |
| ..ref.reasons = reasons | |
| ..ref.CRLissuer = CRLissuer; | |
| } | |
| typedef DSA = dsa_st; | |
| typedef DSA_SIG = DSA_SIG_st; | |
| /// DSA_SIG_st (aka `DSA_SIG`) contains a DSA signature as a pair of integers. | |
| final class DSA_SIG_st extends ffi.Struct { | |
| external ffi.Pointer<BIGNUM> r; | |
| external ffi.Pointer<BIGNUM> s; | |
| static ffi.Pointer<DSA_SIG_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<BIGNUM> r, | |
| required ffi.Pointer<BIGNUM> s, | |
| }) => $allocator<DSA_SIG_st>() | |
| ..ref.r = r | |
| ..ref.s = s; | |
| } | |
| typedef ECDSA_METHOD = ecdsa_method_st; | |
| typedef ECDSA_SIG = ecdsa_sig_st; | |
| typedef EC_GROUP = ec_group_st; | |
| typedef EC_KEY = ec_key_st; | |
| typedef EC_METHOD = ec_method_st; | |
| const int EC_PKEY_NO_PARAMETERS = 1; | |
| const int EC_PKEY_NO_PUBKEY = 2; | |
| typedef EC_POINT = ec_point_st; | |
| const int EC_R_BIGNUM_OUT_OF_RANGE = 126; | |
| const int EC_R_BUFFER_TOO_SMALL = 100; | |
| const int EC_R_COORDINATES_OUT_OF_RANGE = 101; | |
| const int EC_R_D2I_ECPKPARAMETERS_FAILURE = 102; | |
| const int EC_R_DECODE_ERROR = 128; | |
| const int EC_R_EC_GROUP_NEW_BY_NAME_FAILURE = 103; | |
| const int EC_R_ENCODE_ERROR = 129; | |
| const int EC_R_GROUP2PKPARAMETERS_FAILURE = 104; | |
| const int EC_R_GROUP_MISMATCH = 130; | |
| const int EC_R_I2D_ECPKPARAMETERS_FAILURE = 105; | |
| const int EC_R_INCOMPATIBLE_OBJECTS = 106; | |
| const int EC_R_INVALID_COFACTOR = 131; | |
| const int EC_R_INVALID_COMPRESSED_POINT = 107; | |
| const int EC_R_INVALID_COMPRESSION_BIT = 108; | |
| const int EC_R_INVALID_ENCODING = 109; | |
| const int EC_R_INVALID_FIELD = 110; | |
| const int EC_R_INVALID_FORM = 111; | |
| const int EC_R_INVALID_GROUP_ORDER = 112; | |
| const int EC_R_INVALID_PRIVATE_KEY = 113; | |
| const int EC_R_INVALID_SCALAR = 133; | |
| const int EC_R_MISSING_PARAMETERS = 114; | |
| const int EC_R_MISSING_PRIVATE_KEY = 115; | |
| const int EC_R_NON_NAMED_CURVE = 116; | |
| const int EC_R_NOT_INITIALIZED = 117; | |
| const int EC_R_PKPARAMETERS2GROUP_FAILURE = 118; | |
| const int EC_R_POINT_AT_INFINITY = 119; | |
| const int EC_R_POINT_IS_NOT_ON_CURVE = 120; | |
| const int EC_R_PUBLIC_KEY_VALIDATION_FAILED = 132; | |
| const int EC_R_SLOT_FULL = 121; | |
| const int EC_R_UNDEFINED_GENERATOR = 122; | |
| const int EC_R_UNKNOWN_GROUP = 123; | |
| const int EC_R_UNKNOWN_ORDER = 124; | |
| const int EC_R_WRONG_CURVE_PARAMETERS = 127; | |
| const int EC_R_WRONG_ORDER = 125; | |
| /// EC_builtin_curve describes a supported elliptic curve. | |
| final class EC_builtin_curve extends ffi.Struct { | |
| @ffi.Int() | |
| external int nid; | |
| external ffi.Pointer<ffi.Char> comment; | |
| static ffi.Pointer<EC_builtin_curve> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int nid, | |
| required ffi.Pointer<ffi.Char> comment, | |
| }) => $allocator<EC_builtin_curve>() | |
| ..ref.nid = nid | |
| ..ref.comment = comment; | |
| } | |
| typedef EDIPARTYNAME = EDIPartyName_st; | |
| final class EDIPartyName_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_STRING> nameAssigner; | |
| external ffi.Pointer<ASN1_STRING> partyName; | |
| static ffi.Pointer<EDIPartyName_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_STRING> nameAssigner, | |
| required ffi.Pointer<ASN1_STRING> partyName, | |
| }) => $allocator<EDIPartyName_st>() | |
| ..ref.nameAssigner = nameAssigner | |
| ..ref.partyName = partyName; | |
| } | |
| typedef ENGINE = engine_st; | |
| typedef ERR_FNS = st_ERR_FNS; | |
| const int ERR_LIB_ASN1 = 12; | |
| const int ERR_LIB_BIO = 17; | |
| const int ERR_LIB_BN = 3; | |
| const int ERR_LIB_BUF = 7; | |
| const int ERR_LIB_CIPHER = 30; | |
| const int ERR_LIB_CMS = 33; | |
| const int ERR_LIB_COMP = 25; | |
| const int ERR_LIB_CONF = 13; | |
| const int ERR_LIB_CRYPTO = 14; | |
| const int ERR_LIB_DH = 5; | |
| const int ERR_LIB_DIGEST = 29; | |
| const int ERR_LIB_DSA = 10; | |
| const int ERR_LIB_EC = 15; | |
| const int ERR_LIB_ECDH = 27; | |
| const int ERR_LIB_ECDSA = 26; | |
| const int ERR_LIB_ENGINE = 22; | |
| const int ERR_LIB_EVP = 6; | |
| const int ERR_LIB_HKDF = 31; | |
| const int ERR_LIB_HMAC = 28; | |
| const int ERR_LIB_NONE = 1; | |
| const int ERR_LIB_OBJ = 8; | |
| const int ERR_LIB_OCSP = 23; | |
| const int ERR_LIB_PEM = 9; | |
| const int ERR_LIB_PKCS7 = 18; | |
| const int ERR_LIB_PKCS8 = 19; | |
| const int ERR_LIB_RAND = 21; | |
| const int ERR_LIB_RSA = 4; | |
| const int ERR_LIB_SSL = 16; | |
| const int ERR_LIB_SYS = 2; | |
| const int ERR_LIB_TRUST_TOKEN = 32; | |
| const int ERR_LIB_UI = 24; | |
| const int ERR_LIB_USER = 34; | |
| const int ERR_LIB_X509 = 11; | |
| const int ERR_LIB_X509V3 = 20; | |
| /// ERR_print_errors_callback_t is the type of a function used by | |
| /// `ERR_print_errors_cb`. It takes a pointer to a human readable string (and | |
| /// its length) that describes an entry in the error queue. The `ctx` argument | |
| /// is an opaque pointer given to `ERR_print_errors_cb`. | |
| /// | |
| /// It should return one on success or zero on error, which will stop the | |
| /// iteration over the error queue. | |
| typedef ERR_print_errors_callback_t = | |
| ffi.Pointer<ffi.NativeFunction<ERR_print_errors_callback_tFunction>>; | |
| typedef ERR_print_errors_callback_tFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Char> str, | |
| ffi.Size len, | |
| ffi.Pointer<ffi.Void> ctx, | |
| ); | |
| typedef DartERR_print_errors_callback_tFunction = int Function( | |
| ffi.Pointer<ffi.Char> str, | |
| int len, | |
| ffi.Pointer<ffi.Void> ctx, | |
| ); | |
| typedef EVP_AEAD = evp_aead_st; | |
| typedef EVP_AEAD_CTX = evp_aead_ctx_st; | |
| const int EVP_AEAD_DEFAULT_TAG_LENGTH = 0; | |
| const int EVP_AEAD_MAX_KEY_LENGTH = 80; | |
| const int EVP_AEAD_MAX_NONCE_LENGTH = 24; | |
| const int EVP_AEAD_MAX_OPEN_OVERHEAD = 320; | |
| const int EVP_AEAD_MAX_OVERHEAD = 64; | |
| typedef EVP_CIPHER = evp_cipher_st; | |
| typedef EVP_CIPHER_CTX = evp_cipher_ctx_st; | |
| const int EVP_CIPHER_CTX_FLAG_WRAP_ALLOW = 0; | |
| typedef EVP_CIPHER_INFO = evp_cipher_info_st; | |
| const int EVP_CIPH_ALWAYS_CALL_INIT = 128; | |
| const int EVP_CIPH_CBC_MODE = 2; | |
| const int EVP_CIPH_CCM_MODE = 8; | |
| const int EVP_CIPH_CFB_MODE = 3; | |
| const int EVP_CIPH_CTRL_INIT = 512; | |
| const int EVP_CIPH_CTR_MODE = 5; | |
| const int EVP_CIPH_CUSTOM_COPY = 4096; | |
| const int EVP_CIPH_CUSTOM_IV = 256; | |
| const int EVP_CIPH_ECB_MODE = 1; | |
| const int EVP_CIPH_FLAG_AEAD_CIPHER = 2048; | |
| const int EVP_CIPH_FLAG_CUSTOM_CIPHER = 1024; | |
| const int EVP_CIPH_FLAG_NON_FIPS_ALLOW = 0; | |
| const int EVP_CIPH_GCM_MODE = 6; | |
| const int EVP_CIPH_NO_PADDING = 2048; | |
| const int EVP_CIPH_OCB_MODE = 9; | |
| const int EVP_CIPH_OFB_MODE = 4; | |
| const int EVP_CIPH_STREAM_CIPHER = 0; | |
| const int EVP_CIPH_VARIABLE_LENGTH = 64; | |
| const int EVP_CIPH_WRAP_MODE = 10; | |
| const int EVP_CIPH_XTS_MODE = 7; | |
| const int EVP_CTRL_AEAD_GET_TAG = 16; | |
| const int EVP_CTRL_AEAD_SET_IVLEN = 9; | |
| const int EVP_CTRL_AEAD_SET_IV_FIXED = 18; | |
| const int EVP_CTRL_AEAD_SET_MAC_KEY = 23; | |
| const int EVP_CTRL_AEAD_SET_TAG = 17; | |
| const int EVP_CTRL_COPY = 8; | |
| const int EVP_CTRL_GCM_GET_TAG = 16; | |
| const int EVP_CTRL_GCM_IV_GEN = 19; | |
| const int EVP_CTRL_GCM_SET_IVLEN = 9; | |
| const int EVP_CTRL_GCM_SET_IV_FIXED = 18; | |
| const int EVP_CTRL_GCM_SET_IV_INV = 24; | |
| const int EVP_CTRL_GCM_SET_TAG = 17; | |
| const int EVP_CTRL_GET_IVLEN = 25; | |
| const int EVP_CTRL_GET_RC2_KEY_BITS = 2; | |
| const int EVP_CTRL_GET_RC5_ROUNDS = 4; | |
| const int EVP_CTRL_INIT = 0; | |
| const int EVP_CTRL_PBE_PRF_NID = 7; | |
| const int EVP_CTRL_RAND_KEY = 6; | |
| const int EVP_CTRL_SET_KEY_LENGTH = 1; | |
| const int EVP_CTRL_SET_RC2_KEY_BITS = 3; | |
| const int EVP_CTRL_SET_RC5_ROUNDS = 5; | |
| typedef EVP_ENCODE_CTX = evp_encode_ctx_st; | |
| const int EVP_GCM_TLS_EXPLICIT_IV_LEN = 8; | |
| const int EVP_GCM_TLS_FIXED_IV_LEN = 4; | |
| const int EVP_GCM_TLS_TAG_LEN = 16; | |
| typedef EVP_HPKE_AEAD = evp_hpke_aead_st; | |
| typedef EVP_HPKE_CTX = evp_hpke_ctx_st; | |
| typedef EVP_HPKE_KDF = evp_hpke_kdf_st; | |
| typedef EVP_HPKE_KEM = evp_hpke_kem_st; | |
| typedef EVP_HPKE_KEY = evp_hpke_key_st; | |
| typedef EVP_KEM = evp_kem_st; | |
| const int EVP_MAX_BLOCK_LENGTH = 32; | |
| const int EVP_MAX_IV_LENGTH = 16; | |
| const int EVP_MAX_KEY_LENGTH = 64; | |
| const int EVP_MAX_MD_BLOCK_SIZE = 136; | |
| const int EVP_MAX_MD_DATA_SIZE = 240; | |
| const int EVP_MAX_MD_SIZE = 64; | |
| typedef EVP_MD = env_md_st; | |
| typedef EVP_MD_CTX = env_md_ctx_st; | |
| const int EVP_MD_CTX_FLAG_NON_FIPS_ALLOW = 0; | |
| const int EVP_MD_FLAG_DIGALGID_ABSENT = 2; | |
| const int EVP_MD_FLAG_XOF = 4; | |
| typedef EVP_PKEY = evp_pkey_st; | |
| typedef EVP_PKEY_ALG = evp_pkey_alg_st; | |
| typedef EVP_PKEY_CTX = evp_pkey_ctx_st; | |
| const int EVP_PKEY_DH = 28; | |
| const int EVP_PKEY_DSA = 116; | |
| const int EVP_PKEY_EC = 408; | |
| const int EVP_PKEY_ED25519 = 949; | |
| const int EVP_PKEY_ED448 = 960; | |
| const int EVP_PKEY_HKDF = 963; | |
| const int EVP_PKEY_ML_DSA_44 = 967; | |
| const int EVP_PKEY_ML_DSA_65 = 968; | |
| const int EVP_PKEY_ML_DSA_87 = 969; | |
| const int EVP_PKEY_ML_KEM_1024 = 966; | |
| const int EVP_PKEY_ML_KEM_768 = 970; | |
| const int EVP_PKEY_NONE = 0; | |
| const int EVP_PKEY_RSA = 6; | |
| const int EVP_PKEY_RSA2 = 19; | |
| const int EVP_PKEY_RSA_PSS = 912; | |
| const int EVP_PKEY_SLH_DSA_SHA2_128S = 973; | |
| const int EVP_PKEY_SLH_DSA_SHA2_128S_WITH_SHA256 = 975; | |
| const int EVP_PKEY_SLH_DSA_SHAKE_256F = 974; | |
| const int EVP_PKEY_X25519 = 948; | |
| const int EVP_PKEY_X448 = 961; | |
| const int EVP_PKEY_XWING = 972; | |
| const int EVP_R_BUFFER_TOO_SMALL = 100; | |
| const int EVP_R_COMMAND_NOT_SUPPORTED = 101; | |
| const int EVP_R_DECODE_ERROR = 102; | |
| const int EVP_R_DIFFERENT_KEY_TYPES = 103; | |
| const int EVP_R_DIFFERENT_PARAMETERS = 104; | |
| const int EVP_R_EMPTY_PSK = 136; | |
| const int EVP_R_ENCODE_ERROR = 105; | |
| const int EVP_R_EXPECTING_AN_RSA_KEY = 107; | |
| const int EVP_R_EXPECTING_A_DH_KEY = 138; | |
| const int EVP_R_EXPECTING_A_DSA_KEY = 108; | |
| const int EVP_R_EXPECTING_A_EC_KEY = 106; | |
| const int EVP_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE = 109; | |
| const int EVP_R_INVALID_BUFFER_SIZE = 137; | |
| const int EVP_R_INVALID_CIPHERTEXT_LENGTH = 141; | |
| const int EVP_R_INVALID_DIGEST_LENGTH = 110; | |
| const int EVP_R_INVALID_DIGEST_TYPE = 111; | |
| const int EVP_R_INVALID_ENTROPY_LENGTH = 143; | |
| const int EVP_R_INVALID_KEYBITS = 112; | |
| const int EVP_R_INVALID_MGF1_MD = 113; | |
| const int EVP_R_INVALID_OPERATION = 114; | |
| const int EVP_R_INVALID_PADDING_MODE = 115; | |
| const int EVP_R_INVALID_PARAMETERS = 133; | |
| const int EVP_R_INVALID_PEER_KEY = 134; | |
| const int EVP_R_INVALID_PSS_SALTLEN = 116; | |
| const int EVP_R_INVALID_SECRET_LENGTH = 142; | |
| const int EVP_R_INVALID_SIGNATURE = 131; | |
| const int EVP_R_KEYS_NOT_SET = 117; | |
| const int EVP_R_MEMORY_LIMIT_EXCEEDED = 132; | |
| const int EVP_R_MISSING_PARAMETERS = 118; | |
| const int EVP_R_MISSING_PUBLIC_KEY = 140; | |
| const int EVP_R_NOT_A_PRIVATE_KEY = 130; | |
| const int EVP_R_NOT_XOF_OR_INVALID_LENGTH = 135; | |
| const int EVP_R_NO_DEFAULT_DIGEST = 119; | |
| const int EVP_R_NO_KEY_SET = 120; | |
| const int EVP_R_NO_MDC2_SUPPORT = 121; | |
| const int EVP_R_NO_NID_FOR_CURVE = 122; | |
| const int EVP_R_NO_OPERATION_SET = 123; | |
| const int EVP_R_NO_PARAMETERS_SET = 124; | |
| const int EVP_R_OPERATION_NOT_INITIALIZED = 126; | |
| const int EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE = 125; | |
| const int EVP_R_OPERATON_NOT_INITIALIZED = 126; | |
| const int EVP_R_PRIVATE_KEY_WAS_NOT_SEED = 139; | |
| const int EVP_R_UNKNOWN_PUBLIC_KEY_TYPE = 127; | |
| const int EVP_R_UNSUPPORTED_ALGORITHM = 128; | |
| const int EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE = 129; | |
| /// Extended key usage. | |
| /// | |
| /// The extended key usage extension (RFC 5280, section 4.2.1.12) indicates the | |
| /// purposes of the certificate's public key. Such constraints are important to | |
| /// avoid cross-protocol attacks. | |
| typedef EXTENDED_KEY_USAGE = stack_st_ASN1_OBJECT; | |
| typedef FILE = _IO_FILE; | |
| typedef GENERAL_NAME = GENERAL_NAME_st; | |
| typedef GENERAL_NAMES = stack_st_GENERAL_NAME; | |
| /// A GENERAL_NAME_st, aka `GENERAL_NAME`, represents an X.509 GeneralName. The | |
| /// `type` field determines which member of `d` is active. A `GENERAL_NAME` may | |
| /// also be empty, in which case `type` is -1 and `d` is NULL. Empty | |
| /// `GENERAL_NAME`s are invalid and will never be returned from the parser, but | |
| /// may be created temporarily, e.g. by `GENERAL_NAME_new`. | |
| /// | |
| /// WARNING: `type` and `d` must be kept consistent. An inconsistency will result | |
| /// in a potentially exploitable memory error. | |
| final class GENERAL_NAME_st extends ffi.Struct { | |
| @ffi.Int() | |
| external int type; | |
| external UnnamedUnion d; | |
| } | |
| typedef GENERAL_SUBTREE = GENERAL_SUBTREE_st; | |
| /// A GENERAL_SUBTREE represents a GeneralSubtree structure (RFC 5280). | |
| final class GENERAL_SUBTREE_st extends ffi.Struct { | |
| external ffi.Pointer<GENERAL_NAME> base; | |
| external ffi.Pointer<ASN1_INTEGER> minimum; | |
| external ffi.Pointer<ASN1_INTEGER> maximum; | |
| static ffi.Pointer<GENERAL_SUBTREE_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<GENERAL_NAME> base, | |
| required ffi.Pointer<ASN1_INTEGER> minimum, | |
| required ffi.Pointer<ASN1_INTEGER> maximum, | |
| }) => $allocator<GENERAL_SUBTREE_st>() | |
| ..ref.base = base | |
| ..ref.minimum = minimum | |
| ..ref.maximum = maximum; | |
| } | |
| const int HKDF_R_OUTPUT_TOO_LARGE = 100; | |
| typedef HMAC_CTX = hmac_ctx_st; | |
| typedef ISSUING_DIST_POINT = ISSUING_DIST_POINT_st; | |
| /// A ISSUING_DIST_POINT_st, aka `ISSUING_DIST_POINT`, represents a | |
| /// IssuingDistributionPoint structure (RFC 5280). | |
| final class ISSUING_DIST_POINT_st extends ffi.Struct { | |
| external ffi.Pointer<DIST_POINT_NAME> distpoint; | |
| @ASN1_BOOLEAN() | |
| external int onlyuser; | |
| @ASN1_BOOLEAN() | |
| external int onlyCA; | |
| external ffi.Pointer<ASN1_BIT_STRING> onlysomereasons; | |
| @ASN1_BOOLEAN() | |
| external int indirectCRL; | |
| @ASN1_BOOLEAN() | |
| external int onlyattr; | |
| static ffi.Pointer<ISSUING_DIST_POINT_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<DIST_POINT_NAME> distpoint, | |
| required int onlyuser, | |
| required int onlyCA, | |
| required ffi.Pointer<ASN1_BIT_STRING> onlysomereasons, | |
| required int indirectCRL, | |
| required int onlyattr, | |
| }) => $allocator<ISSUING_DIST_POINT_st>() | |
| ..ref.distpoint = distpoint | |
| ..ref.onlyuser = onlyuser | |
| ..ref.onlyCA = onlyCA | |
| ..ref.onlysomereasons = onlysomereasons | |
| ..ref.indirectCRL = indirectCRL | |
| ..ref.onlyattr = onlyattr; | |
| } | |
| const int MBSTRING_ASC = 4097; | |
| const int MBSTRING_BMP = 4098; | |
| const int MBSTRING_FLAG = 4096; | |
| const int MBSTRING_UNIV = 4100; | |
| const int MBSTRING_UTF8 = 4096; | |
| typedef MD4_CTX = md4_state_st; | |
| typedef MD5_CTX = md5_state_st; | |
| typedef NAME_CONSTRAINTS = NAME_CONSTRAINTS_st; | |
| /// A NAME_CONSTRAINTS_st, aka `NAME_CONSTRAINTS`, represents a NameConstraints | |
| /// structure (RFC 5280). | |
| final class NAME_CONSTRAINTS_st extends ffi.Struct { | |
| external ffi.Pointer<stack_st_GENERAL_SUBTREE> permittedSubtrees; | |
| external ffi.Pointer<stack_st_GENERAL_SUBTREE> excludedSubtrees; | |
| static ffi.Pointer<NAME_CONSTRAINTS_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<stack_st_GENERAL_SUBTREE> permittedSubtrees, | |
| required ffi.Pointer<stack_st_GENERAL_SUBTREE> excludedSubtrees, | |
| }) => $allocator<NAME_CONSTRAINTS_st>() | |
| ..ref.permittedSubtrees = permittedSubtrees | |
| ..ref.excludedSubtrees = excludedSubtrees; | |
| } | |
| typedef NETSCAPE_SPKAC = Netscape_spkac_st; | |
| typedef NETSCAPE_SPKI = Netscape_spki_st; | |
| const int NID_Directory = 382; | |
| const int NID_Domain = 392; | |
| const int NID_ED25519 = 949; | |
| const int NID_ED448 = 960; | |
| const int NID_Enterprises = 389; | |
| const int NID_Experimental = 384; | |
| const int NID_ISO_US = 183; | |
| const int NID_Independent = 667; | |
| const int NID_LocalKeySet = 856; | |
| const int NID_ML_DSA_44 = 967; | |
| const int NID_ML_DSA_65 = 968; | |
| const int NID_ML_DSA_87 = 969; | |
| const int NID_ML_KEM_1024 = 966; | |
| const int NID_ML_KEM_768 = 970; | |
| const int NID_Mail = 388; | |
| const int NID_Management = 383; | |
| const int NID_OCSP_sign = 180; | |
| const int NID_Private = 385; | |
| const int NID_SLH_DSA_SHA2_128s = 973; | |
| const int NID_SLH_DSA_SHA2_128s_WITH_SHA256 = 975; | |
| const int NID_SLH_DSA_SHAKE_256f = 974; | |
| const int NID_SMIME = 188; | |
| const int NID_SMIMECapabilities = 167; | |
| const int NID_SNMPv2 = 387; | |
| const int NID_Security = 386; | |
| const int NID_X25519 = 948; | |
| const int NID_X25519Kyber768Draft00 = 964; | |
| const int NID_X25519MLKEM768 = 965; | |
| const int NID_X448 = 961; | |
| const int NID_X500 = 11; | |
| const int NID_X500algorithms = 378; | |
| const int NID_X509 = 12; | |
| const int NID_X9_57 = 184; | |
| const int NID_X9_62_c2onb191v4 = 691; | |
| const int NID_X9_62_c2onb191v5 = 692; | |
| const int NID_X9_62_c2onb239v4 = 697; | |
| const int NID_X9_62_c2onb239v5 = 698; | |
| const int NID_X9_62_c2pnb163v1 = 684; | |
| const int NID_X9_62_c2pnb163v2 = 685; | |
| const int NID_X9_62_c2pnb163v3 = 686; | |
| const int NID_X9_62_c2pnb176v1 = 687; | |
| const int NID_X9_62_c2pnb208w1 = 693; | |
| const int NID_X9_62_c2pnb272w1 = 699; | |
| const int NID_X9_62_c2pnb304w1 = 700; | |
| const int NID_X9_62_c2pnb368w1 = 702; | |
| const int NID_X9_62_c2tnb191v1 = 688; | |
| const int NID_X9_62_c2tnb191v2 = 689; | |
| const int NID_X9_62_c2tnb191v3 = 690; | |
| const int NID_X9_62_c2tnb239v1 = 694; | |
| const int NID_X9_62_c2tnb239v2 = 695; | |
| const int NID_X9_62_c2tnb239v3 = 696; | |
| const int NID_X9_62_c2tnb359v1 = 701; | |
| const int NID_X9_62_c2tnb431r1 = 703; | |
| const int NID_X9_62_characteristic_two_field = 407; | |
| const int NID_X9_62_id_characteristic_two_basis = 680; | |
| const int NID_X9_62_id_ecPublicKey = 408; | |
| const int NID_X9_62_onBasis = 681; | |
| const int NID_X9_62_ppBasis = 683; | |
| const int NID_X9_62_prime192v1 = 409; | |
| const int NID_X9_62_prime192v2 = 410; | |
| const int NID_X9_62_prime192v3 = 411; | |
| const int NID_X9_62_prime239v1 = 412; | |
| const int NID_X9_62_prime239v2 = 413; | |
| const int NID_X9_62_prime239v3 = 414; | |
| const int NID_X9_62_prime256v1 = 415; | |
| const int NID_X9_62_prime_field = 406; | |
| const int NID_X9_62_tpBasis = 682; | |
| const int NID_X9cm = 185; | |
| const int NID_X_Wing = 972; | |
| const int NID_aRecord = 478; | |
| const int NID_aaControls = 289; | |
| const int NID_ac_auditEntity = 287; | |
| const int NID_ac_proxying = 397; | |
| const int NID_ac_targeting = 288; | |
| const int NID_account = 446; | |
| const int NID_ad_OCSP = 178; | |
| const int NID_ad_ca_issuers = 179; | |
| const int NID_ad_dvcs = 364; | |
| const int NID_ad_timeStamping = 363; | |
| const int NID_aes_128_cbc = 419; | |
| const int NID_aes_128_cbc_hmac_sha1 = 916; | |
| const int NID_aes_128_ccm = 896; | |
| const int NID_aes_128_cfb1 = 650; | |
| const int NID_aes_128_cfb128 = 421; | |
| const int NID_aes_128_cfb8 = 653; | |
| const int NID_aes_128_ctr = 904; | |
| const int NID_aes_128_ecb = 418; | |
| const int NID_aes_128_gcm = 895; | |
| const int NID_aes_128_ofb128 = 420; | |
| const int NID_aes_128_xts = 913; | |
| const int NID_aes_192_cbc = 423; | |
| const int NID_aes_192_cbc_hmac_sha1 = 917; | |
| const int NID_aes_192_ccm = 899; | |
| const int NID_aes_192_cfb1 = 651; | |
| const int NID_aes_192_cfb128 = 425; | |
| const int NID_aes_192_cfb8 = 654; | |
| const int NID_aes_192_ctr = 905; | |
| const int NID_aes_192_ecb = 422; | |
| const int NID_aes_192_gcm = 898; | |
| const int NID_aes_192_ofb128 = 424; | |
| const int NID_aes_256_cbc = 427; | |
| const int NID_aes_256_cbc_hmac_sha1 = 918; | |
| const int NID_aes_256_ccm = 902; | |
| const int NID_aes_256_cfb1 = 652; | |
| const int NID_aes_256_cfb128 = 429; | |
| const int NID_aes_256_cfb8 = 655; | |
| const int NID_aes_256_ctr = 906; | |
| const int NID_aes_256_ecb = 426; | |
| const int NID_aes_256_gcm = 901; | |
| const int NID_aes_256_ofb128 = 428; | |
| const int NID_aes_256_xts = 914; | |
| const int NID_alg_mtcProof = 976; | |
| const int NID_alg_unsigned = 979; | |
| const int NID_algorithm = 376; | |
| const int NID_ansi_X9_62 = 405; | |
| const int NID_anyExtendedKeyUsage = 910; | |
| const int NID_any_policy = 746; | |
| const int NID_associatedDomain = 484; | |
| const int NID_associatedName = 485; | |
| const int NID_audio = 501; | |
| const int NID_auth_any = 958; | |
| const int NID_auth_ecdsa = 955; | |
| const int NID_auth_psk = 956; | |
| const int NID_auth_rsa = 954; | |
| const int NID_authorityRevocationList = 882; | |
| const int NID_authority_key_identifier = 90; | |
| const int NID_basic_constraints = 87; | |
| const int NID_bf_cbc = 91; | |
| const int NID_bf_cfb64 = 93; | |
| const int NID_bf_ecb = 92; | |
| const int NID_bf_ofb64 = 94; | |
| const int NID_biometricInfo = 285; | |
| const int NID_brainpoolP160r1 = 921; | |
| const int NID_brainpoolP160t1 = 922; | |
| const int NID_brainpoolP192r1 = 923; | |
| const int NID_brainpoolP192t1 = 924; | |
| const int NID_brainpoolP224r1 = 925; | |
| const int NID_brainpoolP224t1 = 926; | |
| const int NID_brainpoolP256r1 = 927; | |
| const int NID_brainpoolP256t1 = 928; | |
| const int NID_brainpoolP320r1 = 929; | |
| const int NID_brainpoolP320t1 = 930; | |
| const int NID_brainpoolP384r1 = 931; | |
| const int NID_brainpoolP384t1 = 932; | |
| const int NID_brainpoolP512r1 = 933; | |
| const int NID_brainpoolP512t1 = 934; | |
| const int NID_buildingName = 494; | |
| const int NID_businessCategory = 860; | |
| const int NID_cACertificate = 881; | |
| const int NID_cNAMERecord = 483; | |
| const int NID_caRepository = 785; | |
| const int NID_camellia_128_cbc = 751; | |
| const int NID_camellia_128_cfb1 = 760; | |
| const int NID_camellia_128_cfb128 = 757; | |
| const int NID_camellia_128_cfb8 = 763; | |
| const int NID_camellia_128_ecb = 754; | |
| const int NID_camellia_128_ofb128 = 766; | |
| const int NID_camellia_192_cbc = 752; | |
| const int NID_camellia_192_cfb1 = 761; | |
| const int NID_camellia_192_cfb128 = 758; | |
| const int NID_camellia_192_cfb8 = 764; | |
| const int NID_camellia_192_ecb = 755; | |
| const int NID_camellia_192_ofb128 = 767; | |
| const int NID_camellia_256_cbc = 753; | |
| const int NID_camellia_256_cfb1 = 762; | |
| const int NID_camellia_256_cfb128 = 759; | |
| const int NID_camellia_256_cfb8 = 765; | |
| const int NID_camellia_256_ecb = 756; | |
| const int NID_camellia_256_ofb128 = 768; | |
| const int NID_caseIgnoreIA5StringSyntax = 443; | |
| const int NID_cast5_cbc = 108; | |
| const int NID_cast5_cfb64 = 110; | |
| const int NID_cast5_ecb = 109; | |
| const int NID_cast5_ofb64 = 111; | |
| const int NID_certBag = 152; | |
| const int NID_certicom_arc = 677; | |
| const int NID_certificateRevocationList = 883; | |
| const int NID_certificate_issuer = 771; | |
| const int NID_certificate_policies = 89; | |
| const int NID_chacha20_poly1305 = 950; | |
| const int NID_clearance = 395; | |
| const int NID_client_auth = 130; | |
| const int NID_cmac = 894; | |
| const int NID_code_sign = 131; | |
| const int NID_commonName = 13; | |
| const int NID_countryName = 14; | |
| const int NID_crlBag = 153; | |
| const int NID_crl_distribution_points = 103; | |
| const int NID_crl_number = 88; | |
| const int NID_crl_reason = 141; | |
| const int NID_crossCertificatePair = 884; | |
| const int NID_cryptocom = 806; | |
| const int NID_cryptopro = 805; | |
| const int NID_dITRedirect = 500; | |
| const int NID_dNSDomain = 451; | |
| const int NID_dSAQuality = 495; | |
| const int NID_data = 434; | |
| const int NID_dcObject = 390; | |
| const int NID_deltaRevocationList = 891; | |
| const int NID_delta_crl = 140; | |
| const int NID_des_cbc = 31; | |
| const int NID_des_cdmf = 643; | |
| const int NID_des_cfb1 = 656; | |
| const int NID_des_cfb64 = 30; | |
| const int NID_des_cfb8 = 657; | |
| const int NID_des_ecb = 29; | |
| const int NID_des_ede3_cbc = 44; | |
| const int NID_des_ede3_cfb1 = 658; | |
| const int NID_des_ede3_cfb64 = 61; | |
| const int NID_des_ede3_cfb8 = 659; | |
| const int NID_des_ede3_ecb = 33; | |
| const int NID_des_ede3_ofb64 = 63; | |
| const int NID_des_ede_cbc = 43; | |
| const int NID_des_ede_cfb64 = 60; | |
| const int NID_des_ede_ecb = 32; | |
| const int NID_des_ede_ofb64 = 62; | |
| const int NID_des_ofb64 = 45; | |
| const int NID_description = 107; | |
| const int NID_destinationIndicator = 871; | |
| const int NID_desx_cbc = 80; | |
| const int NID_dhKeyAgreement = 28; | |
| const int NID_dhSinglePass_cofactorDH_sha1kdf_scheme = 941; | |
| const int NID_dhSinglePass_cofactorDH_sha224kdf_scheme = 942; | |
| const int NID_dhSinglePass_cofactorDH_sha256kdf_scheme = 943; | |
| const int NID_dhSinglePass_cofactorDH_sha384kdf_scheme = 944; | |
| const int NID_dhSinglePass_cofactorDH_sha512kdf_scheme = 945; | |
| const int NID_dhSinglePass_stdDH_sha1kdf_scheme = 936; | |
| const int NID_dhSinglePass_stdDH_sha224kdf_scheme = 937; | |
| const int NID_dhSinglePass_stdDH_sha256kdf_scheme = 938; | |
| const int NID_dhSinglePass_stdDH_sha384kdf_scheme = 939; | |
| const int NID_dhSinglePass_stdDH_sha512kdf_scheme = 940; | |
| const int NID_dh_cofactor_kdf = 947; | |
| const int NID_dh_std_kdf = 946; | |
| const int NID_dhpublicnumber = 920; | |
| const int NID_distinguishedName = 887; | |
| const int NID_dmdName = 892; | |
| const int NID_dnQualifier = 174; | |
| const int NID_document = 447; | |
| const int NID_documentAuthor = 471; | |
| const int NID_documentIdentifier = 468; | |
| const int NID_documentLocation = 472; | |
| const int NID_documentPublisher = 502; | |
| const int NID_documentSeries = 449; | |
| const int NID_documentTitle = 469; | |
| const int NID_documentVersion = 470; | |
| const int NID_dod = 380; | |
| const int NID_domainComponent = 391; | |
| const int NID_domainRelatedObject = 452; | |
| const int NID_dsa = 116; | |
| const int NID_dsaWithSHA = 66; | |
| const int NID_dsaWithSHA1 = 113; | |
| const int NID_dsaWithSHA1_2 = 70; | |
| const int NID_dsa_2 = 67; | |
| const int NID_dsa_with_SHA224 = 802; | |
| const int NID_dsa_with_SHA256 = 803; | |
| const int NID_dvcs = 297; | |
| const int NID_ecdsa_with_Recommended = 791; | |
| const int NID_ecdsa_with_SHA1 = 416; | |
| const int NID_ecdsa_with_SHA224 = 793; | |
| const int NID_ecdsa_with_SHA256 = 794; | |
| const int NID_ecdsa_with_SHA384 = 795; | |
| const int NID_ecdsa_with_SHA512 = 796; | |
| const int NID_ecdsa_with_Specified = 792; | |
| const int NID_email_protect = 132; | |
| const int NID_enhancedSearchGuide = 885; | |
| const int NID_ext_key_usage = 126; | |
| const int NID_ext_req = 172; | |
| const int NID_facsimileTelephoneNumber = 867; | |
| const int NID_favouriteDrink = 462; | |
| const int NID_freshest_crl = 857; | |
| const int NID_friendlyCountry = 453; | |
| const int NID_friendlyCountryName = 490; | |
| const int NID_friendlyName = 156; | |
| const int NID_generationQualifier = 509; | |
| const int NID_givenName = 99; | |
| const int NID_gost89_cnt = 814; | |
| const int NID_hkdf = 963; | |
| const int NID_hmac = 855; | |
| const int NID_hmacWithMD5 = 797; | |
| const int NID_hmacWithSHA1 = 163; | |
| const int NID_hmacWithSHA224 = 798; | |
| const int NID_hmacWithSHA256 = 799; | |
| const int NID_hmacWithSHA384 = 800; | |
| const int NID_hmacWithSHA512 = 801; | |
| const int NID_hmac_md5 = 780; | |
| const int NID_hmac_sha1 = 781; | |
| const int NID_hold_instruction_call_issuer = 432; | |
| const int NID_hold_instruction_code = 430; | |
| const int NID_hold_instruction_none = 431; | |
| const int NID_hold_instruction_reject = 433; | |
| const int NID_homePostalAddress = 486; | |
| const int NID_homeTelephoneNumber = 473; | |
| const int NID_host = 466; | |
| const int NID_houseIdentifier = 889; | |
| const int NID_iA5StringSyntax = 442; | |
| const int NID_iana = 381; | |
| const int NID_id_DHBasedMac = 783; | |
| const int NID_id_Gost28147_89 = 813; | |
| const int NID_id_Gost28147_89_CryptoPro_A_ParamSet = 824; | |
| const int NID_id_Gost28147_89_CryptoPro_B_ParamSet = 825; | |
| const int NID_id_Gost28147_89_CryptoPro_C_ParamSet = 826; | |
| const int NID_id_Gost28147_89_CryptoPro_D_ParamSet = 827; | |
| const int NID_id_Gost28147_89_CryptoPro_KeyMeshing = 819; | |
| const int NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet = 829; | |
| const int NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet = 828; | |
| const int NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet = 830; | |
| const int NID_id_Gost28147_89_MAC = 815; | |
| const int NID_id_Gost28147_89_None_KeyMeshing = 820; | |
| const int NID_id_Gost28147_89_TestParamSet = 823; | |
| const int NID_id_Gost28147_89_cc = 849; | |
| const int NID_id_GostR3410_2001 = 811; | |
| const int NID_id_GostR3410_2001DH = 817; | |
| const int NID_id_GostR3410_2001_CryptoPro_A_ParamSet = 840; | |
| const int NID_id_GostR3410_2001_CryptoPro_B_ParamSet = 841; | |
| const int NID_id_GostR3410_2001_CryptoPro_C_ParamSet = 842; | |
| const int NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet = 843; | |
| const int NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet = 844; | |
| const int NID_id_GostR3410_2001_ParamSet_cc = 854; | |
| const int NID_id_GostR3410_2001_TestParamSet = 839; | |
| const int NID_id_GostR3410_2001_cc = 851; | |
| const int NID_id_GostR3410_94 = 812; | |
| const int NID_id_GostR3410_94DH = 818; | |
| const int NID_id_GostR3410_94_CryptoPro_A_ParamSet = 832; | |
| const int NID_id_GostR3410_94_CryptoPro_B_ParamSet = 833; | |
| const int NID_id_GostR3410_94_CryptoPro_C_ParamSet = 834; | |
| const int NID_id_GostR3410_94_CryptoPro_D_ParamSet = 835; | |
| const int NID_id_GostR3410_94_CryptoPro_XchA_ParamSet = 836; | |
| const int NID_id_GostR3410_94_CryptoPro_XchB_ParamSet = 837; | |
| const int NID_id_GostR3410_94_CryptoPro_XchC_ParamSet = 838; | |
| const int NID_id_GostR3410_94_TestParamSet = 831; | |
| const int NID_id_GostR3410_94_a = 845; | |
| const int NID_id_GostR3410_94_aBis = 846; | |
| const int NID_id_GostR3410_94_b = 847; | |
| const int NID_id_GostR3410_94_bBis = 848; | |
| const int NID_id_GostR3410_94_cc = 850; | |
| const int NID_id_GostR3411_94 = 809; | |
| const int NID_id_GostR3411_94_CryptoProParamSet = 822; | |
| const int NID_id_GostR3411_94_TestParamSet = 821; | |
| const int NID_id_GostR3411_94_prf = 816; | |
| const int NID_id_GostR3411_94_with_GostR3410_2001 = 807; | |
| const int NID_id_GostR3411_94_with_GostR3410_2001_cc = 853; | |
| const int NID_id_GostR3411_94_with_GostR3410_94 = 808; | |
| const int NID_id_GostR3411_94_with_GostR3410_94_cc = 852; | |
| const int NID_id_HMACGostR3411_94 = 810; | |
| const int NID_id_PasswordBasedMAC = 782; | |
| const int NID_id_aca = 266; | |
| const int NID_id_aca_accessIdentity = 355; | |
| const int NID_id_aca_authenticationInfo = 354; | |
| const int NID_id_aca_chargingIdentity = 356; | |
| const int NID_id_aca_encAttrs = 399; | |
| const int NID_id_aca_group = 357; | |
| const int NID_id_aca_role = 358; | |
| const int NID_id_ad = 176; | |
| const int NID_id_aes128_wrap = 788; | |
| const int NID_id_aes128_wrap_pad = 897; | |
| const int NID_id_aes192_wrap = 789; | |
| const int NID_id_aes192_wrap_pad = 900; | |
| const int NID_id_aes256_wrap = 790; | |
| const int NID_id_aes256_wrap_pad = 903; | |
| const int NID_id_alg = 262; | |
| const int NID_id_alg_PWRI_KEK = 893; | |
| const int NID_id_alg_des40 = 323; | |
| const int NID_id_alg_dh_pop = 326; | |
| const int NID_id_alg_dh_sig_hmac_sha1 = 325; | |
| const int NID_id_alg_noSignature = 324; | |
| const int NID_id_camellia128_wrap = 907; | |
| const int NID_id_camellia192_wrap = 908; | |
| const int NID_id_camellia256_wrap = 909; | |
| const int NID_id_cct = 268; | |
| const int NID_id_cct_PKIData = 361; | |
| const int NID_id_cct_PKIResponse = 362; | |
| const int NID_id_cct_crs = 360; | |
| const int NID_id_ce = 81; | |
| const int NID_id_cmc = 263; | |
| const int NID_id_cmc_addExtensions = 334; | |
| const int NID_id_cmc_confirmCertAcceptance = 346; | |
| const int NID_id_cmc_dataReturn = 330; | |
| const int NID_id_cmc_decryptedPOP = 336; | |
| const int NID_id_cmc_encryptedPOP = 335; | |
| const int NID_id_cmc_getCRL = 339; | |
| const int NID_id_cmc_getCert = 338; | |
| const int NID_id_cmc_identification = 328; | |
| const int NID_id_cmc_identityProof = 329; | |
| const int NID_id_cmc_lraPOPWitness = 337; | |
| const int NID_id_cmc_popLinkRandom = 344; | |
| const int NID_id_cmc_popLinkWitness = 345; | |
| const int NID_id_cmc_queryPending = 343; | |
| const int NID_id_cmc_recipientNonce = 333; | |
| const int NID_id_cmc_regInfo = 341; | |
| const int NID_id_cmc_responseInfo = 342; | |
| const int NID_id_cmc_revokeRequest = 340; | |
| const int NID_id_cmc_senderNonce = 332; | |
| const int NID_id_cmc_statusInfo = 327; | |
| const int NID_id_cmc_transactionId = 331; | |
| const int NID_id_ct_asciiTextWithCRLF = 787; | |
| const int NID_id_hex_multipart_message = 508; | |
| const int NID_id_hex_partial_message = 507; | |
| const int NID_id_it = 260; | |
| const int NID_id_it_caKeyUpdateInfo = 302; | |
| const int NID_id_it_caProtEncCert = 298; | |
| const int NID_id_it_confirmWaitTime = 311; | |
| const int NID_id_it_currentCRL = 303; | |
| const int NID_id_it_encKeyPairTypes = 300; | |
| const int NID_id_it_implicitConfirm = 310; | |
| const int NID_id_it_keyPairParamRep = 308; | |
| const int NID_id_it_keyPairParamReq = 307; | |
| const int NID_id_it_origPKIMessage = 312; | |
| const int NID_id_it_preferredSymmAlg = 301; | |
| const int NID_id_it_revPassphrase = 309; | |
| const int NID_id_it_signKeyPairTypes = 299; | |
| const int NID_id_it_subscriptionRequest = 305; | |
| const int NID_id_it_subscriptionResponse = 306; | |
| const int NID_id_it_suppLangTags = 784; | |
| const int NID_id_it_unsupportedOIDs = 304; | |
| const int NID_id_kp = 128; | |
| const int NID_id_mod_attribute_cert = 280; | |
| const int NID_id_mod_cmc = 274; | |
| const int NID_id_mod_cmp = 277; | |
| const int NID_id_mod_cmp2000 = 284; | |
| const int NID_id_mod_crmf = 273; | |
| const int NID_id_mod_dvcs = 283; | |
| const int NID_id_mod_kea_profile_88 = 275; | |
| const int NID_id_mod_kea_profile_93 = 276; | |
| const int NID_id_mod_ocsp = 282; | |
| const int NID_id_mod_qualified_cert_88 = 278; | |
| const int NID_id_mod_qualified_cert_93 = 279; | |
| const int NID_id_mod_timestamp_protocol = 281; | |
| const int NID_id_on = 264; | |
| const int NID_id_on_permanentIdentifier = 858; | |
| const int NID_id_on_personalData = 347; | |
| const int NID_id_pbkdf2 = 69; | |
| const int NID_id_pda = 265; | |
| const int NID_id_pda_countryOfCitizenship = 352; | |
| const int NID_id_pda_countryOfResidence = 353; | |
| const int NID_id_pda_dateOfBirth = 348; | |
| const int NID_id_pda_gender = 351; | |
| const int NID_id_pda_placeOfBirth = 349; | |
| const int NID_id_pe = 175; | |
| const int NID_id_pkip = 261; | |
| const int NID_id_pkix = 127; | |
| const int NID_id_pkix1_explicit_88 = 269; | |
| const int NID_id_pkix1_explicit_93 = 271; | |
| const int NID_id_pkix1_implicit_88 = 270; | |
| const int NID_id_pkix1_implicit_93 = 272; | |
| const int NID_id_pkix_OCSP_CrlID = 367; | |
| const int NID_id_pkix_OCSP_Nonce = 366; | |
| const int NID_id_pkix_OCSP_acceptableResponses = 368; | |
| const int NID_id_pkix_OCSP_archiveCutoff = 370; | |
| const int NID_id_pkix_OCSP_basic = 365; | |
| const int NID_id_pkix_OCSP_extendedStatus = 372; | |
| const int NID_id_pkix_OCSP_noCheck = 369; | |
| const int NID_id_pkix_OCSP_path = 374; | |
| const int NID_id_pkix_OCSP_serviceLocator = 371; | |
| const int NID_id_pkix_OCSP_trustRoot = 375; | |
| const int NID_id_pkix_OCSP_valid = 373; | |
| const int NID_id_pkix_mod = 258; | |
| const int NID_id_ppl = 662; | |
| const int NID_id_ppl_anyLanguage = 664; | |
| const int NID_id_ppl_inheritAll = 665; | |
| const int NID_id_qcs = 267; | |
| const int NID_id_qcs_pkixQCSyntax_v1 = 359; | |
| const int NID_id_qt = 259; | |
| const int NID_id_qt_cps = 164; | |
| const int NID_id_qt_unotice = 165; | |
| const int NID_id_regCtrl = 313; | |
| const int NID_id_regCtrl_authenticator = 316; | |
| const int NID_id_regCtrl_oldCertID = 319; | |
| const int NID_id_regCtrl_pkiArchiveOptions = 318; | |
| const int NID_id_regCtrl_pkiPublicationInfo = 317; | |
| const int NID_id_regCtrl_protocolEncrKey = 320; | |
| const int NID_id_regCtrl_regToken = 315; | |
| const int NID_id_regInfo = 314; | |
| const int NID_id_regInfo_certReq = 322; | |
| const int NID_id_regInfo_utf8Pairs = 321; | |
| const int NID_id_set = 512; | |
| const int NID_id_smime_aa = 191; | |
| const int NID_id_smime_aa_contentHint = 215; | |
| const int NID_id_smime_aa_contentIdentifier = 218; | |
| const int NID_id_smime_aa_contentReference = 221; | |
| const int NID_id_smime_aa_dvcs_dvc = 240; | |
| const int NID_id_smime_aa_encapContentType = 217; | |
| const int NID_id_smime_aa_encrypKeyPref = 222; | |
| const int NID_id_smime_aa_equivalentLabels = 220; | |
| const int NID_id_smime_aa_ets_CertificateRefs = 232; | |
| const int NID_id_smime_aa_ets_RevocationRefs = 233; | |
| const int NID_id_smime_aa_ets_archiveTimeStamp = 238; | |
| const int NID_id_smime_aa_ets_certCRLTimestamp = 237; | |
| const int NID_id_smime_aa_ets_certValues = 234; | |
| const int NID_id_smime_aa_ets_commitmentType = 227; | |
| const int NID_id_smime_aa_ets_contentTimestamp = 231; | |
| const int NID_id_smime_aa_ets_escTimeStamp = 236; | |
| const int NID_id_smime_aa_ets_otherSigCert = 230; | |
| const int NID_id_smime_aa_ets_revocationValues = 235; | |
| const int NID_id_smime_aa_ets_sigPolicyId = 226; | |
| const int NID_id_smime_aa_ets_signerAttr = 229; | |
| const int NID_id_smime_aa_ets_signerLocation = 228; | |
| const int NID_id_smime_aa_macValue = 219; | |
| const int NID_id_smime_aa_mlExpandHistory = 214; | |
| const int NID_id_smime_aa_msgSigDigest = 216; | |
| const int NID_id_smime_aa_receiptRequest = 212; | |
| const int NID_id_smime_aa_securityLabel = 213; | |
| const int NID_id_smime_aa_signatureType = 239; | |
| const int NID_id_smime_aa_signingCertificate = 223; | |
| const int NID_id_smime_aa_smimeEncryptCerts = 224; | |
| const int NID_id_smime_aa_timeStampToken = 225; | |
| const int NID_id_smime_alg = 192; | |
| const int NID_id_smime_alg_3DESwrap = 243; | |
| const int NID_id_smime_alg_CMS3DESwrap = 246; | |
| const int NID_id_smime_alg_CMSRC2wrap = 247; | |
| const int NID_id_smime_alg_ESDH = 245; | |
| const int NID_id_smime_alg_ESDHwith3DES = 241; | |
| const int NID_id_smime_alg_ESDHwithRC2 = 242; | |
| const int NID_id_smime_alg_RC2wrap = 244; | |
| const int NID_id_smime_cd = 193; | |
| const int NID_id_smime_cd_ldap = 248; | |
| const int NID_id_smime_ct = 190; | |
| const int NID_id_smime_ct_DVCSRequestData = 210; | |
| const int NID_id_smime_ct_DVCSResponseData = 211; | |
| const int NID_id_smime_ct_TDTInfo = 208; | |
| const int NID_id_smime_ct_TSTInfo = 207; | |
| const int NID_id_smime_ct_authData = 205; | |
| const int NID_id_smime_ct_compressedData = 786; | |
| const int NID_id_smime_ct_contentInfo = 209; | |
| const int NID_id_smime_ct_publishCert = 206; | |
| const int NID_id_smime_ct_receipt = 204; | |
| const int NID_id_smime_cti = 195; | |
| const int NID_id_smime_cti_ets_proofOfApproval = 255; | |
| const int NID_id_smime_cti_ets_proofOfCreation = 256; | |
| const int NID_id_smime_cti_ets_proofOfDelivery = 253; | |
| const int NID_id_smime_cti_ets_proofOfOrigin = 251; | |
| const int NID_id_smime_cti_ets_proofOfReceipt = 252; | |
| const int NID_id_smime_cti_ets_proofOfSender = 254; | |
| const int NID_id_smime_mod = 189; | |
| const int NID_id_smime_mod_cms = 196; | |
| const int NID_id_smime_mod_ess = 197; | |
| const int NID_id_smime_mod_ets_eSigPolicy_88 = 202; | |
| const int NID_id_smime_mod_ets_eSigPolicy_97 = 203; | |
| const int NID_id_smime_mod_ets_eSignature_88 = 200; | |
| const int NID_id_smime_mod_ets_eSignature_97 = 201; | |
| const int NID_id_smime_mod_msg_v3 = 199; | |
| const int NID_id_smime_mod_oid = 198; | |
| const int NID_id_smime_spq = 194; | |
| const int NID_id_smime_spq_ets_sqt_unotice = 250; | |
| const int NID_id_smime_spq_ets_sqt_uri = 249; | |
| const int NID_idea_cbc = 34; | |
| const int NID_idea_cfb64 = 35; | |
| const int NID_idea_ecb = 36; | |
| const int NID_idea_ofb64 = 46; | |
| const int NID_identified_organization = 676; | |
| const int NID_info = 461; | |
| const int NID_info_access = 177; | |
| const int NID_inhibit_any_policy = 748; | |
| const int NID_initials = 101; | |
| const int NID_international_organizations = 647; | |
| const int NID_internationaliSDNNumber = 869; | |
| const int NID_invalidity_date = 142; | |
| const int NID_ipsec3 = 749; | |
| const int NID_ipsec4 = 750; | |
| const int NID_ipsecEndSystem = 294; | |
| const int NID_ipsecTunnel = 295; | |
| const int NID_ipsecUser = 296; | |
| const int NID_iso = 181; | |
| const int NID_issuer_alt_name = 86; | |
| const int NID_issuing_distribution_point = 770; | |
| const int NID_itu_t = 645; | |
| const int NID_janetMailbox = 492; | |
| const int NID_joint_iso_itu_t = 646; | |
| const int NID_keyBag = 150; | |
| const int NID_key_usage = 83; | |
| const int NID_kisa = 773; | |
| const int NID_kx_any = 957; | |
| const int NID_kx_ecdhe = 952; | |
| const int NID_kx_psk = 953; | |
| const int NID_kx_rsa = 951; | |
| const int NID_lastModifiedBy = 477; | |
| const int NID_lastModifiedTime = 476; | |
| const int NID_localKeyID = 157; | |
| const int NID_localityName = 15; | |
| const int NID_mXRecord = 480; | |
| const int NID_mailPreferenceOption = 493; | |
| const int NID_manager = 467; | |
| const int NID_md2 = 3; | |
| const int NID_md2WithRSAEncryption = 7; | |
| const int NID_md4 = 257; | |
| const int NID_md4WithRSAEncryption = 396; | |
| const int NID_md5 = 4; | |
| const int NID_md5WithRSA = 104; | |
| const int NID_md5WithRSAEncryption = 8; | |
| const int NID_md5_sha1 = 114; | |
| const int NID_mdc2 = 95; | |
| const int NID_mdc2WithRSA = 96; | |
| const int NID_member = 875; | |
| const int NID_member_body = 182; | |
| const int NID_mgf1 = 911; | |
| const int NID_mime_mhs = 504; | |
| const int NID_mime_mhs_bodies = 506; | |
| const int NID_mime_mhs_headings = 505; | |
| const int NID_mobileTelephoneNumber = 488; | |
| const int NID_ms_code_com = 135; | |
| const int NID_ms_code_ind = 134; | |
| const int NID_ms_csp_name = 417; | |
| const int NID_ms_ctl_sign = 136; | |
| const int NID_ms_efs = 138; | |
| const int NID_ms_ext_req = 171; | |
| const int NID_ms_sgc = 137; | |
| const int NID_ms_smartcard_login = 648; | |
| const int NID_ms_upn = 649; | |
| const int NID_nSRecord = 481; | |
| const int NID_name = 173; | |
| const int NID_name_constraints = 666; | |
| const int NID_netscape = 57; | |
| const int NID_netscape_base_url = 72; | |
| const int NID_netscape_ca_policy_url = 76; | |
| const int NID_netscape_ca_revocation_url = 74; | |
| const int NID_netscape_cert_extension = 58; | |
| const int NID_netscape_cert_sequence = 79; | |
| const int NID_netscape_cert_type = 71; | |
| const int NID_netscape_comment = 78; | |
| const int NID_netscape_data_type = 59; | |
| const int NID_netscape_renewal_url = 75; | |
| const int NID_netscape_revocation_url = 73; | |
| const int NID_netscape_ssl_server_name = 77; | |
| const int NID_no_rev_avail = 403; | |
| const int NID_ns_sgc = 139; | |
| const int NID_org = 379; | |
| const int NID_organizationName = 17; | |
| const int NID_organizationalStatus = 491; | |
| const int NID_organizationalUnitName = 18; | |
| const int NID_otherMailbox = 475; | |
| const int NID_owner = 876; | |
| const int NID_pSpecified = 935; | |
| const int NID_pagerTelephoneNumber = 489; | |
| const int NID_pbeWithMD2AndDES_CBC = 9; | |
| const int NID_pbeWithMD2AndRC2_CBC = 168; | |
| const int NID_pbeWithMD5AndCast5_CBC = 112; | |
| const int NID_pbeWithMD5AndDES_CBC = 10; | |
| const int NID_pbeWithMD5AndRC2_CBC = 169; | |
| const int NID_pbeWithSHA1AndDES_CBC = 170; | |
| const int NID_pbeWithSHA1AndRC2_CBC = 68; | |
| const int NID_pbe_WithSHA1And128BitRC2_CBC = 148; | |
| const int NID_pbe_WithSHA1And128BitRC4 = 144; | |
| const int NID_pbe_WithSHA1And2_Key_TripleDES_CBC = 147; | |
| const int NID_pbe_WithSHA1And3_Key_TripleDES_CBC = 146; | |
| const int NID_pbe_WithSHA1And40BitRC2_CBC = 149; | |
| const int NID_pbe_WithSHA1And40BitRC4 = 145; | |
| const int NID_pbes2 = 161; | |
| const int NID_pbmac1 = 162; | |
| const int NID_pe_mtcCertificationAuthority_SHA256 = 978; | |
| const int NID_personalSignature = 499; | |
| const int NID_personalTitle = 487; | |
| const int NID_photo = 464; | |
| const int NID_physicalDeliveryOfficeName = 863; | |
| const int NID_pilot = 437; | |
| const int NID_pilotAttributeSyntax = 439; | |
| const int NID_pilotAttributeType = 438; | |
| const int NID_pilotAttributeType27 = 479; | |
| const int NID_pilotDSA = 456; | |
| const int NID_pilotGroups = 441; | |
| const int NID_pilotObject = 444; | |
| const int NID_pilotObjectClass = 440; | |
| const int NID_pilotOrganization = 455; | |
| const int NID_pilotPerson = 445; | |
| const int NID_pkcs = 2; | |
| const int NID_pkcs1 = 186; | |
| const int NID_pkcs3 = 27; | |
| const int NID_pkcs5 = 187; | |
| const int NID_pkcs7 = 20; | |
| const int NID_pkcs7_data = 21; | |
| const int NID_pkcs7_digest = 25; | |
| const int NID_pkcs7_encrypted = 26; | |
| const int NID_pkcs7_enveloped = 23; | |
| const int NID_pkcs7_signed = 22; | |
| const int NID_pkcs7_signedAndEnveloped = 24; | |
| const int NID_pkcs8ShroudedKeyBag = 151; | |
| const int NID_pkcs9 = 47; | |
| const int NID_pkcs9_challengePassword = 54; | |
| const int NID_pkcs9_contentType = 50; | |
| const int NID_pkcs9_countersignature = 53; | |
| const int NID_pkcs9_emailAddress = 48; | |
| const int NID_pkcs9_extCertAttributes = 56; | |
| const int NID_pkcs9_messageDigest = 51; | |
| const int NID_pkcs9_signingTime = 52; | |
| const int NID_pkcs9_unstructuredAddress = 55; | |
| const int NID_pkcs9_unstructuredName = 49; | |
| const int NID_policy_constraints = 401; | |
| const int NID_policy_mappings = 747; | |
| const int NID_postOfficeBox = 862; | |
| const int NID_postalAddress = 861; | |
| const int NID_postalCode = 661; | |
| const int NID_preferredDeliveryMethod = 872; | |
| const int NID_presentationAddress = 873; | |
| const int NID_private_key_usage_period = 84; | |
| const int NID_protocolInformation = 886; | |
| const int NID_proxyCertInfo = 663; | |
| const int NID_pseudonym = 510; | |
| const int NID_pss = 435; | |
| const int NID_qcStatements = 286; | |
| const int NID_qualityLabelledData = 457; | |
| const int NID_rFC822localPart = 450; | |
| const int NID_rc2_40_cbc = 98; | |
| const int NID_rc2_64_cbc = 166; | |
| const int NID_rc2_cbc = 37; | |
| const int NID_rc2_cfb64 = 39; | |
| const int NID_rc2_ecb = 38; | |
| const int NID_rc2_ofb64 = 40; | |
| const int NID_rc4 = 5; | |
| const int NID_rc4_40 = 97; | |
| const int NID_rc4_hmac_md5 = 915; | |
| const int NID_rc5_cbc = 120; | |
| const int NID_rc5_cfb64 = 122; | |
| const int NID_rc5_ecb = 121; | |
| const int NID_rc5_ofb64 = 123; | |
| const int NID_rdna_trustAnchorID = 977; | |
| const int NID_rdna_unsigned = 980; | |
| const int NID_registeredAddress = 870; | |
| const int NID_rfc822Mailbox = 460; | |
| const int NID_ripemd160 = 117; | |
| const int NID_ripemd160WithRSA = 119; | |
| const int NID_role = 400; | |
| const int NID_roleOccupant = 877; | |
| const int NID_room = 448; | |
| const int NID_roomNumber = 463; | |
| const int NID_rsa = 19; | |
| const int NID_rsaEncryption = 6; | |
| const int NID_rsaOAEPEncryptionSET = 644; | |
| const int NID_rsaSignature = 377; | |
| const int NID_rsadsi = 1; | |
| const int NID_rsaesOaep = 919; | |
| const int NID_rsassaPss = 912; | |
| const int NID_sOARecord = 482; | |
| const int NID_safeContentsBag = 155; | |
| const int NID_sbgp_autonomousSysNum = 291; | |
| const int NID_sbgp_ipAddrBlock = 290; | |
| const int NID_sbgp_routerIdentifier = 292; | |
| const int NID_sdsiCertificate = 159; | |
| const int NID_searchGuide = 859; | |
| const int NID_secp112r1 = 704; | |
| const int NID_secp112r2 = 705; | |
| const int NID_secp128r1 = 706; | |
| const int NID_secp128r2 = 707; | |
| const int NID_secp160k1 = 708; | |
| const int NID_secp160r1 = 709; | |
| const int NID_secp160r2 = 710; | |
| const int NID_secp192k1 = 711; | |
| const int NID_secp224k1 = 712; | |
| const int NID_secp224r1 = 713; | |
| const int NID_secp256k1 = 714; | |
| const int NID_secp384r1 = 715; | |
| const int NID_secp521r1 = 716; | |
| const int NID_secretBag = 154; | |
| const int NID_secretary = 474; | |
| const int NID_sect113r1 = 717; | |
| const int NID_sect113r2 = 718; | |
| const int NID_sect131r1 = 719; | |
| const int NID_sect131r2 = 720; | |
| const int NID_sect163k1 = 721; | |
| const int NID_sect163r1 = 722; | |
| const int NID_sect163r2 = 723; | |
| const int NID_sect193r1 = 724; | |
| const int NID_sect193r2 = 725; | |
| const int NID_sect233k1 = 726; | |
| const int NID_sect233r1 = 727; | |
| const int NID_sect239k1 = 728; | |
| const int NID_sect283k1 = 729; | |
| const int NID_sect283r1 = 730; | |
| const int NID_sect409k1 = 731; | |
| const int NID_sect409r1 = 732; | |
| const int NID_sect571k1 = 733; | |
| const int NID_sect571r1 = 734; | |
| const int NID_seeAlso = 878; | |
| const int NID_seed_cbc = 777; | |
| const int NID_seed_cfb128 = 779; | |
| const int NID_seed_ecb = 776; | |
| const int NID_seed_ofb128 = 778; | |
| const int NID_selected_attribute_types = 394; | |
| const int NID_serialNumber = 105; | |
| const int NID_server_auth = 129; | |
| const int NID_setAttr_Cert = 620; | |
| const int NID_setAttr_GenCryptgrm = 631; | |
| const int NID_setAttr_IssCap = 623; | |
| const int NID_setAttr_IssCap_CVM = 628; | |
| const int NID_setAttr_IssCap_Sig = 630; | |
| const int NID_setAttr_IssCap_T2 = 629; | |
| const int NID_setAttr_PGWYcap = 621; | |
| const int NID_setAttr_SecDevSig = 635; | |
| const int NID_setAttr_T2Enc = 632; | |
| const int NID_setAttr_T2cleartxt = 633; | |
| const int NID_setAttr_TokICCsig = 634; | |
| const int NID_setAttr_TokenType = 622; | |
| const int NID_setAttr_Token_B0Prime = 627; | |
| const int NID_setAttr_Token_EMV = 626; | |
| const int NID_setCext_IssuerCapabilities = 619; | |
| const int NID_setCext_PGWYcapabilities = 615; | |
| const int NID_setCext_TokenIdentifier = 616; | |
| const int NID_setCext_TokenType = 618; | |
| const int NID_setCext_Track2Data = 617; | |
| const int NID_setCext_cCertRequired = 611; | |
| const int NID_setCext_certType = 609; | |
| const int NID_setCext_hashedRoot = 608; | |
| const int NID_setCext_merchData = 610; | |
| const int NID_setCext_setExt = 613; | |
| const int NID_setCext_setQualf = 614; | |
| const int NID_setCext_tunneling = 612; | |
| const int NID_set_addPolicy = 625; | |
| const int NID_set_attr = 515; | |
| const int NID_set_brand = 518; | |
| const int NID_set_brand_AmericanExpress = 638; | |
| const int NID_set_brand_Diners = 637; | |
| const int NID_set_brand_IATA_ATA = 636; | |
| const int NID_set_brand_JCB = 639; | |
| const int NID_set_brand_MasterCard = 641; | |
| const int NID_set_brand_Novus = 642; | |
| const int NID_set_brand_Visa = 640; | |
| const int NID_set_certExt = 517; | |
| const int NID_set_ctype = 513; | |
| const int NID_set_msgExt = 514; | |
| const int NID_set_policy = 516; | |
| const int NID_set_policy_root = 607; | |
| const int NID_set_rootKeyThumb = 624; | |
| const int NID_setct_AcqCardCodeMsg = 540; | |
| const int NID_setct_AcqCardCodeMsgTBE = 576; | |
| const int NID_setct_AuthReqTBE = 570; | |
| const int NID_setct_AuthReqTBS = 534; | |
| const int NID_setct_AuthResBaggage = 527; | |
| const int NID_setct_AuthResTBE = 571; | |
| const int NID_setct_AuthResTBEX = 572; | |
| const int NID_setct_AuthResTBS = 535; | |
| const int NID_setct_AuthResTBSX = 536; | |
| const int NID_setct_AuthRevReqBaggage = 528; | |
| const int NID_setct_AuthRevReqTBE = 577; | |
| const int NID_setct_AuthRevReqTBS = 541; | |
| const int NID_setct_AuthRevResBaggage = 529; | |
| const int NID_setct_AuthRevResData = 542; | |
| const int NID_setct_AuthRevResTBE = 578; | |
| const int NID_setct_AuthRevResTBEB = 579; | |
| const int NID_setct_AuthRevResTBS = 543; | |
| const int NID_setct_AuthTokenTBE = 573; | |
| const int NID_setct_AuthTokenTBS = 537; | |
| const int NID_setct_BCIDistributionTBS = 600; | |
| const int NID_setct_BatchAdminReqData = 558; | |
| const int NID_setct_BatchAdminReqTBE = 592; | |
| const int NID_setct_BatchAdminResData = 559; | |
| const int NID_setct_BatchAdminResTBE = 593; | |
| const int NID_setct_CRLNotificationResTBS = 599; | |
| const int NID_setct_CRLNotificationTBS = 598; | |
| const int NID_setct_CapReqTBE = 580; | |
| const int NID_setct_CapReqTBEX = 581; | |
| const int NID_setct_CapReqTBS = 544; | |
| const int NID_setct_CapReqTBSX = 545; | |
| const int NID_setct_CapResData = 546; | |
| const int NID_setct_CapResTBE = 582; | |
| const int NID_setct_CapRevReqTBE = 583; | |
| const int NID_setct_CapRevReqTBEX = 584; | |
| const int NID_setct_CapRevReqTBS = 547; | |
| const int NID_setct_CapRevReqTBSX = 548; | |
| const int NID_setct_CapRevResData = 549; | |
| const int NID_setct_CapRevResTBE = 585; | |
| const int NID_setct_CapTokenData = 538; | |
| const int NID_setct_CapTokenSeq = 530; | |
| const int NID_setct_CapTokenTBE = 574; | |
| const int NID_setct_CapTokenTBEX = 575; | |
| const int NID_setct_CapTokenTBS = 539; | |
| const int NID_setct_CardCInitResTBS = 560; | |
| const int NID_setct_CertInqReqTBS = 566; | |
| const int NID_setct_CertReqData = 563; | |
| const int NID_setct_CertReqTBE = 595; | |
| const int NID_setct_CertReqTBEX = 596; | |
| const int NID_setct_CertReqTBS = 564; | |
| const int NID_setct_CertResData = 565; | |
| const int NID_setct_CertResTBE = 597; | |
| const int NID_setct_CredReqTBE = 586; | |
| const int NID_setct_CredReqTBEX = 587; | |
| const int NID_setct_CredReqTBS = 550; | |
| const int NID_setct_CredReqTBSX = 551; | |
| const int NID_setct_CredResData = 552; | |
| const int NID_setct_CredResTBE = 588; | |
| const int NID_setct_CredRevReqTBE = 589; | |
| const int NID_setct_CredRevReqTBEX = 590; | |
| const int NID_setct_CredRevReqTBS = 553; | |
| const int NID_setct_CredRevReqTBSX = 554; | |
| const int NID_setct_CredRevResData = 555; | |
| const int NID_setct_CredRevResTBE = 591; | |
| const int NID_setct_ErrorTBS = 567; | |
| const int NID_setct_HODInput = 526; | |
| const int NID_setct_MeAqCInitResTBS = 561; | |
| const int NID_setct_OIData = 522; | |
| const int NID_setct_PANData = 519; | |
| const int NID_setct_PANOnly = 521; | |
| const int NID_setct_PANToken = 520; | |
| const int NID_setct_PCertReqData = 556; | |
| const int NID_setct_PCertResTBS = 557; | |
| const int NID_setct_PI = 523; | |
| const int NID_setct_PIData = 524; | |
| const int NID_setct_PIDataUnsigned = 525; | |
| const int NID_setct_PIDualSignedTBE = 568; | |
| const int NID_setct_PIUnsignedTBE = 569; | |
| const int NID_setct_PI_TBS = 532; | |
| const int NID_setct_PInitResData = 531; | |
| const int NID_setct_PResData = 533; | |
| const int NID_setct_RegFormReqTBE = 594; | |
| const int NID_setct_RegFormResTBS = 562; | |
| const int NID_setext_cv = 606; | |
| const int NID_setext_genCrypt = 601; | |
| const int NID_setext_miAuth = 602; | |
| const int NID_setext_pinAny = 604; | |
| const int NID_setext_pinSecure = 603; | |
| const int NID_setext_track2 = 605; | |
| const int NID_sha = 41; | |
| const int NID_sha1 = 64; | |
| const int NID_sha1WithRSA = 115; | |
| const int NID_sha1WithRSAEncryption = 65; | |
| const int NID_sha224 = 675; | |
| const int NID_sha224WithRSAEncryption = 671; | |
| const int NID_sha256 = 672; | |
| const int NID_sha256WithRSAEncryption = 668; | |
| const int NID_sha384 = 673; | |
| const int NID_sha384WithRSAEncryption = 669; | |
| const int NID_sha512 = 674; | |
| const int NID_sha512WithRSAEncryption = 670; | |
| const int NID_sha512_256 = 962; | |
| const int NID_shaWithRSAEncryption = 42; | |
| const int NID_simpleSecurityObject = 454; | |
| const int NID_sinfo_access = 398; | |
| const int NID_singleLevelQuality = 496; | |
| const int NID_stateOrProvinceName = 16; | |
| const int NID_streetAddress = 660; | |
| const int NID_subject_alt_name = 85; | |
| const int NID_subject_directory_attributes = 769; | |
| const int NID_subject_key_identifier = 82; | |
| const int NID_subtreeMaximumQuality = 498; | |
| const int NID_subtreeMinimumQuality = 497; | |
| const int NID_supportedAlgorithms = 890; | |
| const int NID_supportedApplicationContext = 874; | |
| const int NID_surname = 100; | |
| const int NID_sxnet = 143; | |
| const int NID_target_information = 402; | |
| const int NID_telephoneNumber = 864; | |
| const int NID_teletexTerminalIdentifier = 866; | |
| const int NID_telexNumber = 865; | |
| const int NID_textEncodedORAddress = 459; | |
| const int NID_textNotice = 293; | |
| const int NID_time_stamp = 133; | |
| const int NID_title = 106; | |
| const int NID_ucl = 436; | |
| const int NID_undef = 0; | |
| const int NID_uniqueMember = 888; | |
| const int NID_userCertificate = 880; | |
| const int NID_userClass = 465; | |
| const int NID_userId = 458; | |
| const int NID_userPassword = 879; | |
| const int NID_wap = 678; | |
| const int NID_wap_wsg = 679; | |
| const int NID_wap_wsg_idm_ecid_wtls1 = 735; | |
| const int NID_wap_wsg_idm_ecid_wtls10 = 743; | |
| const int NID_wap_wsg_idm_ecid_wtls11 = 744; | |
| const int NID_wap_wsg_idm_ecid_wtls12 = 745; | |
| const int NID_wap_wsg_idm_ecid_wtls3 = 736; | |
| const int NID_wap_wsg_idm_ecid_wtls4 = 737; | |
| const int NID_wap_wsg_idm_ecid_wtls5 = 738; | |
| const int NID_wap_wsg_idm_ecid_wtls6 = 739; | |
| const int NID_wap_wsg_idm_ecid_wtls7 = 740; | |
| const int NID_wap_wsg_idm_ecid_wtls8 = 741; | |
| const int NID_wap_wsg_idm_ecid_wtls9 = 742; | |
| const int NID_whirlpool = 804; | |
| const int NID_x121Address = 868; | |
| const int NID_x500UniqueIdentifier = 503; | |
| const int NID_x509Certificate = 158; | |
| const int NID_x509Crl = 160; | |
| const int NID_zlib_compression = 125; | |
| typedef NOTICEREF = NOTICEREF_st; | |
| /// A NOTICEREF represents a NoticeReference structure (RFC 5280). | |
| final class NOTICEREF_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_STRING> organization; | |
| external ffi.Pointer<stack_st_ASN1_INTEGER> noticenos; | |
| static ffi.Pointer<NOTICEREF_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_STRING> organization, | |
| required ffi.Pointer<stack_st_ASN1_INTEGER> noticenos, | |
| }) => $allocator<NOTICEREF_st>() | |
| ..ref.organization = organization | |
| ..ref.noticenos = noticenos; | |
| } | |
| /// A Netscape_spkac_st, or `NETSCAPE_SPKAC`, represents a PublicKeyAndChallenge | |
| /// structure. This type is misnamed. The full SPKAC includes the signature, | |
| /// which is represented with the `NETSCAPE_SPKI` type. | |
| final class Netscape_spkac_st extends ffi.Struct { | |
| external ffi.Pointer<X509_PUBKEY> pubkey; | |
| external ffi.Pointer<ASN1_IA5STRING> challenge; | |
| static ffi.Pointer<Netscape_spkac_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<X509_PUBKEY> pubkey, | |
| required ffi.Pointer<ASN1_IA5STRING> challenge, | |
| }) => $allocator<Netscape_spkac_st>() | |
| ..ref.pubkey = pubkey | |
| ..ref.challenge = challenge; | |
| } | |
| /// A Netscape_spki_st, or `NETSCAPE_SPKI`, represents a | |
| /// SignedPublicKeyAndChallenge structure. Although this structure contains a | |
| /// `spkac` field of type `NETSCAPE_SPKAC`, these are misnamed. The SPKAC is the | |
| /// entire structure, not the signed portion. | |
| final class Netscape_spki_st extends ffi.Struct { | |
| external ffi.Pointer<NETSCAPE_SPKAC> spkac; | |
| external ffi.Pointer<X509_ALGOR> sig_algor; | |
| external ffi.Pointer<ASN1_BIT_STRING> signature; | |
| static ffi.Pointer<Netscape_spki_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<NETSCAPE_SPKAC> spkac, | |
| required ffi.Pointer<X509_ALGOR> sig_algor, | |
| required ffi.Pointer<ASN1_BIT_STRING> signature, | |
| }) => $allocator<Netscape_spki_st>() | |
| ..ref.spkac = spkac | |
| ..ref.sig_algor = sig_algor | |
| ..ref.signature = signature; | |
| } | |
| typedef OBJ_NAME = obj_name_st; | |
| typedef OPENSSL_BLOCK = ffi.Pointer<ffi.Void>; | |
| typedef OPENSSL_INIT_SETTINGS = ossl_init_settings_st; | |
| /// An OPENSSL_STACK contains an array of pointers. It is not designed to be used | |
| /// directly, rather the wrapper macros should be used. | |
| typedef OPENSSL_STACK = stack_st; | |
| /// Built-in stacks. | |
| typedef OPENSSL_STRING = ffi.Pointer<ffi.Char>; | |
| typedef OPENSSL_sk_call_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_call_cmp_funcFunction>>; | |
| typedef OPENSSL_sk_call_cmp_funcFunction = ffi.Int Function( | |
| OPENSSL_sk_cmp_func, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef DartOPENSSL_sk_call_cmp_funcFunction = int Function( | |
| OPENSSL_sk_cmp_func, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef OPENSSL_sk_call_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_call_copy_funcFunction>>; | |
| typedef OPENSSL_sk_call_copy_funcFunction = ffi.Pointer<ffi.Void> Function( | |
| OPENSSL_sk_copy_func, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef OPENSSL_sk_call_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_call_delete_if_funcFunction>>; | |
| typedef OPENSSL_sk_call_delete_if_funcFunction = ffi.Int Function( | |
| OPENSSL_sk_delete_if_func, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef DartOPENSSL_sk_call_delete_if_funcFunction = int Function( | |
| OPENSSL_sk_delete_if_func, | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// The following function types call the above type-erased signatures with the | |
| /// true types. | |
| typedef OPENSSL_sk_call_free_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_call_free_funcFunction>>; | |
| typedef OPENSSL_sk_call_free_funcFunction = ffi.Void Function( | |
| OPENSSL_sk_free_func, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef DartOPENSSL_sk_call_free_funcFunction = void Function( | |
| OPENSSL_sk_free_func, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// OPENSSL_sk_cmp_func is a comparison function that returns a value < 0, 0 or > | |
| /// 0 if `*a` is less than, equal to or greater than `*b`, respectively. Note | |
| /// the extra indirection - the function is given a pointer to a pointer to the | |
| /// element. This differs from the usual qsort/bsearch comparison function. | |
| /// | |
| /// Note its actual type is `int (*)(const T *const *a, const T *const *b)`. | |
| /// Low-level `sk_*` functions will be passed a type-specific wrapper to call it | |
| /// correctly. | |
| typedef OPENSSL_sk_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_cmp_funcFunction>>; | |
| typedef OPENSSL_sk_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> a, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> b, | |
| ); | |
| typedef DartOPENSSL_sk_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> a, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>> b, | |
| ); | |
| /// OPENSSL_sk_copy_func is a function that copies an element in a stack. Note | |
| /// its actual type is T *(*)(const T *) for some T. Low-level `sk_*` functions | |
| /// will be passed a type-specific wrapper to call it correctly. | |
| typedef OPENSSL_sk_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_copy_funcFunction>>; | |
| typedef OPENSSL_sk_copy_funcFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| /// OPENSSL_sk_delete_if_func is the generic version of | |
| /// `sk_SAMPLE_delete_if_func`. | |
| typedef OPENSSL_sk_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_delete_if_funcFunction>>; | |
| typedef OPENSSL_sk_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Void> obj, | |
| ffi.Pointer<ffi.Void> data, | |
| ); | |
| typedef DartOPENSSL_sk_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ffi.Void> obj, | |
| ffi.Pointer<ffi.Void> data, | |
| ); | |
| /// OPENSSL_sk_free_func is a function that frees an element in a stack. Note its | |
| /// actual type is void (*)(T *) for some T. Low-level `sk_*` functions will be | |
| /// passed a type-specific wrapper to call it correctly. | |
| typedef OPENSSL_sk_free_func = | |
| ffi.Pointer<ffi.NativeFunction<OPENSSL_sk_free_funcFunction>>; | |
| typedef OPENSSL_sk_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| typedef DartOPENSSL_sk_free_funcFunction = void Function( | |
| ffi.Pointer<ffi.Void> ptr, | |
| ); | |
| typedef OSSL_LIB_CTX = ossl_lib_ctx_st; | |
| typedef OSSL_PARAM = ossl_param_st; | |
| typedef OTHERNAME = otherName_st; | |
| typedef PKCS12 = pkcs12_st; | |
| final class PKCS7 extends ffi.Struct { | |
| external ffi.Pointer<ffi.Uint8> ber_bytes; | |
| @ffi.Size() | |
| external int ber_len; | |
| /// Unlike OpenSSL, the following fields are immutable. They filled in when the | |
| /// object is parsed and ignored in serialization. | |
| external ffi.Pointer<ASN1_OBJECT> type; | |
| external UnnamedUnion$5 d; | |
| } | |
| typedef PKCS7_DIGEST = ffi.Void; | |
| typedef DartPKCS7_DIGEST = void; | |
| typedef PKCS7_ENCRYPT = ffi.Void; | |
| typedef DartPKCS7_ENCRYPT = void; | |
| typedef PKCS7_ENVELOPE = ffi.Void; | |
| typedef DartPKCS7_ENVELOPE = void; | |
| /// Deprecated functions. | |
| /// | |
| /// These functions are a compatibility layer over a subset of OpenSSL's PKCS#7 | |
| /// API. It intentionally does not implement the whole thing, only the minimum | |
| /// needed to build cryptography.io. | |
| final class PKCS7_SIGNED extends ffi.Struct { | |
| external ffi.Pointer<stack_st_X509> cert; | |
| external ffi.Pointer<stack_st_X509_CRL> crl; | |
| static ffi.Pointer<PKCS7_SIGNED> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<stack_st_X509> cert, | |
| required ffi.Pointer<stack_st_X509_CRL> crl, | |
| }) => $allocator<PKCS7_SIGNED>() | |
| ..ref.cert = cert | |
| ..ref.crl = crl; | |
| } | |
| typedef PKCS7_SIGNER_INFO = ffi.Void; | |
| typedef DartPKCS7_SIGNER_INFO = void; | |
| final class PKCS7_SIGN_ENVELOPE extends ffi.Struct { | |
| external ffi.Pointer<stack_st_X509> cert; | |
| external ffi.Pointer<stack_st_X509_CRL> crl; | |
| static ffi.Pointer<PKCS7_SIGN_ENVELOPE> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<stack_st_X509> cert, | |
| required ffi.Pointer<stack_st_X509_CRL> crl, | |
| }) => $allocator<PKCS7_SIGN_ENVELOPE>() | |
| ..ref.cert = cert | |
| ..ref.crl = crl; | |
| } | |
| typedef PKCS8_PRIV_KEY_INFO = pkcs8_priv_key_info_st; | |
| typedef POLICYINFO = POLICYINFO_st; | |
| /// A POLICYINFO represents a PolicyInformation structure (RFC 5280). | |
| final class POLICYINFO_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> policyid; | |
| external ffi.Pointer<stack_st_POLICYQUALINFO> qualifiers; | |
| static ffi.Pointer<POLICYINFO_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OBJECT> policyid, | |
| required ffi.Pointer<stack_st_POLICYQUALINFO> qualifiers, | |
| }) => $allocator<POLICYINFO_st>() | |
| ..ref.policyid = policyid | |
| ..ref.qualifiers = qualifiers; | |
| } | |
| typedef POLICYQUALINFO = POLICYQUALINFO_st; | |
| /// A POLICYQUALINFO represents a PolicyQualifierInfo structure (RFC 5280). `d` | |
| /// contains the qualifier field of the PolicyQualifierInfo. Its type is | |
| /// determined by `pqualid`. If `pqualid` is `NID_id_qt_cps`, `d` must be | |
| /// `cpsuri`. If `pqualid` is `NID_id_qt_unotice`, `d` must be `usernotice`. | |
| /// Otherwise, `d` must be `other`. | |
| /// | |
| /// WARNING: `pqualid` and `d` must be kept consistent. An inconsistency will | |
| /// result in a potentially exploitable memory error. | |
| final class POLICYQUALINFO_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> pqualid; | |
| external UnnamedUnion$6 d; | |
| } | |
| typedef POLICY_CONSTRAINTS = POLICY_CONSTRAINTS_st; | |
| /// A POLICY_CONSTRAINTS represents a PolicyConstraints structure (RFC 5280). | |
| final class POLICY_CONSTRAINTS_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_INTEGER> requireExplicitPolicy; | |
| external ffi.Pointer<ASN1_INTEGER> inhibitPolicyMapping; | |
| static ffi.Pointer<POLICY_CONSTRAINTS_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_INTEGER> requireExplicitPolicy, | |
| required ffi.Pointer<ASN1_INTEGER> inhibitPolicyMapping, | |
| }) => $allocator<POLICY_CONSTRAINTS_st>() | |
| ..ref.requireExplicitPolicy = requireExplicitPolicy | |
| ..ref.inhibitPolicyMapping = inhibitPolicyMapping; | |
| } | |
| typedef POLICY_MAPPING = POLICY_MAPPING_st; | |
| typedef POLICY_MAPPINGS = stack_st_POLICY_MAPPING; | |
| /// A POLICY_MAPPING represents an individual element of a PolicyMappings | |
| /// structure (RFC 5280). | |
| final class POLICY_MAPPING_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> issuerDomainPolicy; | |
| external ffi.Pointer<ASN1_OBJECT> subjectDomainPolicy; | |
| static ffi.Pointer<POLICY_MAPPING_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OBJECT> issuerDomainPolicy, | |
| required ffi.Pointer<ASN1_OBJECT> subjectDomainPolicy, | |
| }) => $allocator<POLICY_MAPPING_st>() | |
| ..ref.issuerDomainPolicy = issuerDomainPolicy | |
| ..ref.subjectDomainPolicy = subjectDomainPolicy; | |
| } | |
| typedef RAND_METHOD = rand_meth_st; | |
| typedef RC4_KEY = rc4_key_st; | |
| typedef RIPEMD160_CTX = RIPEMD160state_st; | |
| final class RIPEMD160state_st extends ffi.Opaque {} | |
| typedef RSA = rsa_st; | |
| const int RSA_3 = 3; | |
| const int RSA_F4 = 65537; | |
| const int RSA_FLAG_EXT_PKEY = 32; | |
| const int RSA_FLAG_LARGE_PUBLIC_EXPONENT = 128; | |
| const int RSA_FLAG_NO_BLINDING = 8; | |
| const int RSA_FLAG_NO_PUBLIC_EXPONENT = 64; | |
| const int RSA_FLAG_OPAQUE = 1; | |
| typedef RSA_METHOD = rsa_meth_st; | |
| const int RSA_METHOD_FLAG_NO_CHECK = 1; | |
| const int RSA_NO_PADDING = 3; | |
| const int RSA_PKCS1_OAEP_PADDING = 4; | |
| const int RSA_PKCS1_PADDING = 1; | |
| const int RSA_PKCS1_PSS_PADDING = 6; | |
| typedef RSA_PSS_PARAMS = rsa_pss_params_st; | |
| const int RSA_PSS_SALTLEN_AUTO = -2; | |
| const int RSA_PSS_SALTLEN_DIGEST = -1; | |
| const int RSA_R_BAD_ENCODING = 100; | |
| const int RSA_R_BAD_E_VALUE = 101; | |
| const int RSA_R_BAD_FIXED_HEADER_DECRYPT = 102; | |
| const int RSA_R_BAD_PAD_BYTE_COUNT = 103; | |
| const int RSA_R_BAD_RSA_PARAMETERS = 104; | |
| const int RSA_R_BAD_SIGNATURE = 105; | |
| const int RSA_R_BAD_VERSION = 106; | |
| const int RSA_R_BLOCK_TYPE_IS_NOT_01 = 107; | |
| const int RSA_R_BLOCK_TYPE_IS_NOT_02 = 148; | |
| const int RSA_R_BN_NOT_INITIALIZED = 108; | |
| const int RSA_R_CANNOT_RECOVER_MULTI_PRIME_KEY = 109; | |
| const int RSA_R_CRT_PARAMS_ALREADY_GIVEN = 110; | |
| const int RSA_R_CRT_VALUES_INCORRECT = 111; | |
| const int RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN = 112; | |
| const int RSA_R_DATA_TOO_LARGE = 113; | |
| const int RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = 114; | |
| const int RSA_R_DATA_TOO_LARGE_FOR_MODULUS = 115; | |
| const int RSA_R_DATA_TOO_SMALL = 116; | |
| const int RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = 117; | |
| const int RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY = 118; | |
| const int RSA_R_D_E_NOT_CONGRUENT_TO_1 = 119; | |
| const int RSA_R_D_OUT_OF_RANGE = 147; | |
| const int RSA_R_EMPTY_PUBLIC_KEY = 120; | |
| const int RSA_R_ENCODE_ERROR = 121; | |
| const int RSA_R_FIRST_OCTET_INVALID = 122; | |
| const int RSA_R_INCONSISTENT_SET_OF_CRT_VALUES = 123; | |
| const int RSA_R_INTERNAL_ERROR = 124; | |
| const int RSA_R_INVALID_MESSAGE_LENGTH = 125; | |
| const int RSA_R_KEY_SIZE_TOO_SMALL = 126; | |
| const int RSA_R_LAST_OCTET_INVALID = 127; | |
| const int RSA_R_MODULUS_TOO_LARGE = 128; | |
| const int RSA_R_MUST_HAVE_AT_LEAST_TWO_PRIMES = 129; | |
| const int RSA_R_NO_PUBLIC_EXPONENT = 130; | |
| const int RSA_R_NULL_BEFORE_BLOCK_MISSING = 131; | |
| const int RSA_R_N_NOT_EQUAL_P_Q = 132; | |
| const int RSA_R_OAEP_DECODING_ERROR = 133; | |
| const int RSA_R_ONLY_ONE_OF_P_Q_GIVEN = 134; | |
| const int RSA_R_OUTPUT_BUFFER_TOO_SMALL = 135; | |
| const int RSA_R_PADDING_CHECK_FAILED = 136; | |
| const int RSA_R_PKCS_DECODING_ERROR = 137; | |
| const int RSA_R_PUBLIC_KEY_VALIDATION_FAILED = 146; | |
| const int RSA_R_SLEN_CHECK_FAILED = 138; | |
| const int RSA_R_SLEN_RECOVERY_FAILED = 139; | |
| const int RSA_R_TOO_LONG = 140; | |
| const int RSA_R_TOO_MANY_ITERATIONS = 141; | |
| const int RSA_R_UNKNOWN_ALGORITHM_TYPE = 142; | |
| const int RSA_R_UNKNOWN_PADDING_TYPE = 143; | |
| const int RSA_R_VALUE_MISSING = 144; | |
| const int RSA_R_WRONG_SIGNATURE_LENGTH = 145; | |
| typedef SHA256_CTX = sha256_state_st; | |
| typedef SHA512_CTX = sha512_state_st; | |
| typedef SHA_CTX = sha_state_st; | |
| typedef SPAKE2_CTX = spake2_ctx_st; | |
| typedef SRTP_PROTECTION_PROFILE = srtp_protection_profile_st; | |
| typedef SSL = ssl_st; | |
| typedef SSL_CIPHER = ssl_cipher_st; | |
| typedef SSL_CLIENT_HELLO = ssl_early_callback_ctx; | |
| typedef SSL_CREDENTIAL = ssl_credential_st; | |
| typedef SSL_CTX = ssl_ctx_st; | |
| typedef SSL_ECH_KEYS = ssl_ech_keys_st; | |
| typedef SSL_METHOD = ssl_method_st; | |
| typedef SSL_PRIVATE_KEY_METHOD = ssl_private_key_method_st; | |
| typedef SSL_QUIC_METHOD = ssl_quic_method_st; | |
| typedef SSL_SESSION = ssl_session_st; | |
| typedef SSL_TICKET_AEAD_METHOD = ssl_ticket_aead_method_st; | |
| typedef TRUST_TOKEN = trust_token_st; | |
| typedef TRUST_TOKEN_CLIENT = trust_token_client_st; | |
| typedef TRUST_TOKEN_ISSUER = trust_token_issuer_st; | |
| typedef TRUST_TOKEN_METHOD = trust_token_method_st; | |
| typedef USERNOTICE = USERNOTICE_st; | |
| /// A USERNOTICE represents a UserNotice structure (RFC 5280). | |
| final class USERNOTICE_st extends ffi.Struct { | |
| external ffi.Pointer<NOTICEREF> noticeref; | |
| external ffi.Pointer<ASN1_STRING> exptext; | |
| static ffi.Pointer<USERNOTICE_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<NOTICEREF> noticeref, | |
| required ffi.Pointer<ASN1_STRING> exptext, | |
| }) => $allocator<USERNOTICE_st>() | |
| ..ref.noticeref = noticeref | |
| ..ref.exptext = exptext; | |
| } | |
| final class UnnamedStruct extends ffi.Struct { | |
| @ffi.Uint32() | |
| external int h0; | |
| @ffi.Uint32() | |
| external int h1; | |
| @ffi.Uint32() | |
| external int h2; | |
| @ffi.Uint32() | |
| external int h3; | |
| @ffi.Uint32() | |
| external int h4; | |
| static ffi.Pointer<UnnamedStruct> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int h0, | |
| required int h1, | |
| required int h2, | |
| required int h3, | |
| required int h4, | |
| }) => $allocator<UnnamedStruct>() | |
| ..ref.h0 = h0 | |
| ..ref.h1 = h1 | |
| ..ref.h2 = h2 | |
| ..ref.h3 = h3 | |
| ..ref.h4 = h4; | |
| } | |
| final class UnnamedUnion extends ffi.Union { | |
| external ffi.Pointer<ffi.Char> ptr; | |
| external ffi.Pointer<OTHERNAME> otherName; | |
| external ffi.Pointer<ASN1_IA5STRING> rfc822Name; | |
| external ffi.Pointer<ASN1_IA5STRING> dNSName; | |
| external ffi.Pointer<ASN1_STRING> x400Address; | |
| external ffi.Pointer<X509_NAME> directoryName; | |
| external ffi.Pointer<EDIPARTYNAME> ediPartyName; | |
| external ffi.Pointer<ASN1_IA5STRING> uniformResourceIdentifier; | |
| external ffi.Pointer<ASN1_OCTET_STRING> iPAddress; | |
| external ffi.Pointer<ASN1_OBJECT> registeredID; | |
| /// iPAddress | |
| external ffi.Pointer<ASN1_OCTET_STRING> ip; | |
| /// dirn | |
| external ffi.Pointer<X509_NAME> dirn; | |
| /// rfc822Name, dNSName, uniformResourceIdentifier | |
| external ffi.Pointer<ASN1_IA5STRING> ia5; | |
| /// registeredID | |
| external ffi.Pointer<ASN1_OBJECT> rid; | |
| } | |
| final class UnnamedUnion$1 extends ffi.Union { | |
| external ffi.Pointer<ffi.Char> ptr; | |
| @ASN1_BOOLEAN() | |
| external int boolean; | |
| external ffi.Pointer<ASN1_STRING> asn1_string; | |
| external ffi.Pointer<ASN1_OBJECT> object; | |
| external ffi.Pointer<ASN1_INTEGER> integer; | |
| external ffi.Pointer<ASN1_ENUMERATED> enumerated; | |
| external ffi.Pointer<ASN1_BIT_STRING> bit_string; | |
| external ffi.Pointer<ASN1_OCTET_STRING> octet_string; | |
| external ffi.Pointer<ASN1_PRINTABLESTRING> printablestring; | |
| external ffi.Pointer<ASN1_T61STRING> t61string; | |
| external ffi.Pointer<ASN1_IA5STRING> ia5string; | |
| external ffi.Pointer<ASN1_GENERALSTRING> generalstring; | |
| external ffi.Pointer<ASN1_BMPSTRING> bmpstring; | |
| external ffi.Pointer<ASN1_UNIVERSALSTRING> universalstring; | |
| external ffi.Pointer<ASN1_UTCTIME> utctime; | |
| external ffi.Pointer<ASN1_GENERALIZEDTIME> generalizedtime; | |
| external ffi.Pointer<ASN1_VISIBLESTRING> visiblestring; | |
| external ffi.Pointer<ASN1_UTF8STRING> utf8string; | |
| /// set and sequence are left complete and still contain the entire element. | |
| external ffi.Pointer<ASN1_STRING> set; | |
| external ffi.Pointer<ASN1_STRING> sequence; | |
| external ffi.Pointer<ASN1_VALUE> asn1_value; | |
| } | |
| /// md_data contains the hash-specific context. | |
| final class UnnamedUnion$2 extends ffi.Union { | |
| @ffi.Array.multi([240]) | |
| external ffi.Array<ffi.Uint8> md_data; | |
| @ffi.Uint64() | |
| external int alignment; | |
| } | |
| final class UnnamedUnion$3 extends ffi.Union { | |
| external cbb_buffer_st base; | |
| external cbb_child_st child; | |
| } | |
| final class UnnamedUnion$4 extends ffi.Union { | |
| external ffi.Pointer<GENERAL_NAMES> fullname; | |
| external ffi.Pointer<stack_st_X509_NAME_ENTRY> relativename; | |
| } | |
| final class UnnamedUnion$5 extends ffi.Union { | |
| external ffi.Pointer<ffi.Char> ptr; | |
| external ffi.Pointer<ASN1_OCTET_STRING> data; | |
| external ffi.Pointer<PKCS7_SIGNED> sign; | |
| external ffi.Pointer<PKCS7_ENVELOPE> enveloped; | |
| external ffi.Pointer<PKCS7_SIGN_ENVELOPE> signed_and_enveloped; | |
| external ffi.Pointer<PKCS7_DIGEST> digest; | |
| external ffi.Pointer<PKCS7_ENCRYPT> encrypted; | |
| external ffi.Pointer<ASN1_TYPE> other; | |
| } | |
| final class UnnamedUnion$6 extends ffi.Union { | |
| external ffi.Pointer<ASN1_IA5STRING> cpsuri; | |
| external ffi.Pointer<USERNOTICE> usernotice; | |
| external ffi.Pointer<ASN1_TYPE> other; | |
| } | |
| /// wpa_supplicant accesses `h0`..`h4` so we must support those names for | |
| /// compatibility with it until it can be updated. Anonymous unions are only | |
| /// standard in C11, so disable this workaround in C++. | |
| final class UnnamedUnion$7 extends ffi.Union { | |
| @ffi.Array.multi([5]) | |
| external ffi.Array<ffi.Uint32> h; | |
| external UnnamedStruct unnamed; | |
| } | |
| const int V_ASN1_ANY = -4; | |
| const int V_ASN1_APPLICATION = 64; | |
| const int V_ASN1_BIT_STRING = 3; | |
| const int V_ASN1_BMPSTRING = 30; | |
| const int V_ASN1_BOOLEAN = 1; | |
| const int V_ASN1_CONSTRUCTED = 32; | |
| const int V_ASN1_CONTEXT_SPECIFIC = 128; | |
| const int V_ASN1_ENUMERATED = 10; | |
| const int V_ASN1_EOC = 0; | |
| const int V_ASN1_EXTERNAL = 8; | |
| const int V_ASN1_GENERALIZEDTIME = 24; | |
| const int V_ASN1_GENERALSTRING = 27; | |
| const int V_ASN1_GRAPHICSTRING = 25; | |
| const int V_ASN1_IA5STRING = 22; | |
| const int V_ASN1_INTEGER = 2; | |
| const int V_ASN1_ISO64STRING = 26; | |
| const int V_ASN1_MAX_UNIVERSAL = 255; | |
| const int V_ASN1_NEG = 256; | |
| const int V_ASN1_NEG_ENUMERATED = 266; | |
| const int V_ASN1_NEG_INTEGER = 258; | |
| const int V_ASN1_NULL = 5; | |
| const int V_ASN1_NUMERICSTRING = 18; | |
| const int V_ASN1_OBJECT = 6; | |
| const int V_ASN1_OBJECT_DESCRIPTOR = 7; | |
| const int V_ASN1_OCTET_STRING = 4; | |
| const int V_ASN1_OTHER = -3; | |
| const int V_ASN1_PRIMITIVE_TAG = 31; | |
| const int V_ASN1_PRINTABLESTRING = 19; | |
| const int V_ASN1_PRIVATE = 192; | |
| const int V_ASN1_REAL = 9; | |
| const int V_ASN1_RELATIVE_OID = 13; | |
| const int V_ASN1_SEQUENCE = 16; | |
| const int V_ASN1_SET = 17; | |
| const int V_ASN1_T61STRING = 20; | |
| const int V_ASN1_TELETEXSTRING = 20; | |
| const int V_ASN1_UNDEF = -1; | |
| const int V_ASN1_UNIVERSAL = 0; | |
| const int V_ASN1_UNIVERSALSTRING = 28; | |
| const int V_ASN1_UTCTIME = 23; | |
| const int V_ASN1_UTF8STRING = 12; | |
| const int V_ASN1_VIDEOTEXSTRING = 21; | |
| const int V_ASN1_VISIBLESTRING = 26; | |
| typedef X509 = x509_st; | |
| typedef X509V3_CTX = v3_ext_ctx; | |
| typedef X509V3_EXT_D2I = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_D2IFunction>>; | |
| typedef X509V3_EXT_D2IFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| ffi.Long len, | |
| ); | |
| typedef DartX509V3_EXT_D2IFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> inp, | |
| int len, | |
| ); | |
| typedef X509V3_EXT_FREE = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_FREEFunction>>; | |
| typedef X509V3_EXT_FREEFunction = ffi.Void Function(ffi.Pointer<ffi.Void> ext); | |
| typedef DartX509V3_EXT_FREEFunction = void Function(ffi.Pointer<ffi.Void> ext); | |
| typedef X509V3_EXT_I2D = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_I2DFunction>>; | |
| typedef X509V3_EXT_I2DFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| typedef DartX509V3_EXT_I2DFunction = int Function( | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<ffi.Pointer<ffi.Uint8>> outp, | |
| ); | |
| typedef X509V3_EXT_I2R = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_I2RFunction>>; | |
| typedef X509V3_EXT_I2RFunction = ffi.Int Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<BIO> out, | |
| ffi.Int indent, | |
| ); | |
| typedef DartX509V3_EXT_I2RFunction = int Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<BIO> out, | |
| int indent, | |
| ); | |
| typedef X509V3_EXT_I2S = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_I2SFunction>>; | |
| typedef X509V3_EXT_I2SFunction = ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ffi.Void> ext, | |
| ); | |
| typedef X509V3_EXT_I2V = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_I2VFunction>>; | |
| typedef X509V3_EXT_I2VFunction = ffi.Pointer<stack_st_CONF_VALUE> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<ffi.Void> ext, | |
| ffi.Pointer<stack_st_CONF_VALUE> extlist, | |
| ); | |
| typedef X509V3_EXT_METHOD = v3_ext_method; | |
| /// The following function pointer types are used in `X509V3_EXT_METHOD`. | |
| typedef X509V3_EXT_NEW = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_NEWFunction>>; | |
| typedef X509V3_EXT_NEWFunction = ffi.Pointer<ffi.Void> Function(); | |
| typedef X509V3_EXT_R2I = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_R2IFunction>>; | |
| typedef X509V3_EXT_R2IFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| typedef X509V3_EXT_S2I = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_S2IFunction>>; | |
| typedef X509V3_EXT_S2IFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<ffi.Char> str, | |
| ); | |
| typedef X509V3_EXT_V2I = | |
| ffi.Pointer<ffi.NativeFunction<X509V3_EXT_V2IFunction>>; | |
| typedef X509V3_EXT_V2IFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<X509V3_EXT_METHOD> method, | |
| ffi.Pointer<X509V3_CTX> ctx, | |
| ffi.Pointer<stack_st_CONF_VALUE> values, | |
| ); | |
| typedef X509_ALGOR = X509_algor_st; | |
| typedef X509_ATTRIBUTE = x509_attributes_st; | |
| const int X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT = 0; | |
| const int X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS = 0; | |
| const int X509_CHECK_FLAG_NEVER_CHECK_SUBJECT = 32; | |
| const int X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS = 0; | |
| const int X509_CHECK_FLAG_NO_WILDCARDS = 2; | |
| const int X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS = 0; | |
| typedef X509_CRL = X509_crl_st; | |
| const int X509_CRL_VERSION_1 = 0; | |
| const int X509_CRL_VERSION_2 = 1; | |
| typedef X509_EXTENSION = X509_extension_st; | |
| typedef X509_EXTENSIONS = stack_st_X509_EXTENSION; | |
| const int X509_FILETYPE_ASN1 = 2; | |
| const int X509_FILETYPE_DEFAULT = 3; | |
| const int X509_FILETYPE_PEM = 1; | |
| const int X509_FLAG_COMPAT = 0; | |
| const int X509_FLAG_NO_ATTRIBUTES = 2048; | |
| const int X509_FLAG_NO_AUX = 1024; | |
| const int X509_FLAG_NO_EXTENSIONS = 256; | |
| const int X509_FLAG_NO_HEADER = 1; | |
| const int X509_FLAG_NO_IDS = 4096; | |
| const int X509_FLAG_NO_ISSUER = 16; | |
| const int X509_FLAG_NO_PUBKEY = 128; | |
| const int X509_FLAG_NO_SERIAL = 4; | |
| const int X509_FLAG_NO_SIGDUMP = 512; | |
| const int X509_FLAG_NO_SIGNAME = 8; | |
| const int X509_FLAG_NO_SUBJECT = 64; | |
| const int X509_FLAG_NO_VALIDITY = 32; | |
| const int X509_FLAG_NO_VERSION = 2; | |
| typedef X509_INFO = X509_info_st; | |
| typedef X509_LOOKUP = x509_lookup_st; | |
| typedef X509_LOOKUP_METHOD = x509_lookup_method_st; | |
| const int X509_LU_CRL = 2; | |
| const int X509_LU_NONE = 0; | |
| const int X509_LU_PKEY = 3; | |
| const int X509_LU_X509 = 1; | |
| const int X509_L_ADD_DIR = 2; | |
| const int X509_L_FILE_LOAD = 1; | |
| typedef X509_NAME = X509_name_st; | |
| typedef X509_NAME_ENTRY = X509_name_entry_st; | |
| typedef X509_OBJECT = x509_object_st; | |
| typedef X509_PKEY = private_key_st; | |
| typedef X509_PUBKEY = X509_pubkey_st; | |
| typedef X509_PURPOSE = x509_purpose_st; | |
| const int X509_PURPOSE_ANY = 7; | |
| const int X509_PURPOSE_CRL_SIGN = 6; | |
| const int X509_PURPOSE_NS_SSL_SERVER = 3; | |
| const int X509_PURPOSE_OCSP_HELPER = 8; | |
| const int X509_PURPOSE_SMIME_ENCRYPT = 5; | |
| const int X509_PURPOSE_SMIME_SIGN = 4; | |
| const int X509_PURPOSE_SSL_CLIENT = 1; | |
| const int X509_PURPOSE_SSL_SERVER = 2; | |
| const int X509_PURPOSE_TIMESTAMP_SIGN = 9; | |
| typedef X509_REQ = X509_req_st; | |
| const int X509_REQ_VERSION_1 = 0; | |
| typedef X509_REVOKED = x509_revoked_st; | |
| const int X509_R_AKID_MISMATCH = 100; | |
| const int X509_R_BAD_PKCS7_VERSION = 101; | |
| const int X509_R_BAD_X509_FILETYPE = 102; | |
| const int X509_R_BASE64_DECODE_ERROR = 103; | |
| const int X509_R_CANT_CHECK_DH_KEY = 104; | |
| const int X509_R_CERT_ALREADY_IN_HASH_TABLE = 105; | |
| const int X509_R_CRL_ALREADY_DELTA = 106; | |
| const int X509_R_CRL_VERIFY_FAILURE = 107; | |
| const int X509_R_DELTA_CRL_WITHOUT_CRL_NUMBER = 138; | |
| const int X509_R_IDP_MISMATCH = 108; | |
| const int X509_R_INVALID_BIT_STRING_BITS_LEFT = 109; | |
| const int X509_R_INVALID_DIRECTORY = 110; | |
| const int X509_R_INVALID_FIELD_FOR_VERSION = 139; | |
| const int X509_R_INVALID_FIELD_NAME = 111; | |
| const int X509_R_INVALID_MTC_CA = 145; | |
| const int X509_R_INVALID_MTC_PROOF = 146; | |
| const int X509_R_INVALID_PARAMETER = 136; | |
| const int X509_R_INVALID_POLICY_EXTENSION = 144; | |
| const int X509_R_INVALID_PSS_PARAMETERS = 112; | |
| const int X509_R_INVALID_TRUST = 113; | |
| const int X509_R_INVALID_VERSION = 140; | |
| const int X509_R_ISSUER_MISMATCH = 114; | |
| const int X509_R_KEY_TYPE_MISMATCH = 115; | |
| const int X509_R_KEY_VALUES_MISMATCH = 116; | |
| const int X509_R_LOADING_CERT_DIR = 117; | |
| const int X509_R_LOADING_DEFAULTS = 118; | |
| const int X509_R_NAME_TOO_LONG = 135; | |
| const int X509_R_NEWER_CRL_NOT_NEWER = 119; | |
| const int X509_R_NOT_PKCS7_SIGNED_DATA = 120; | |
| const int X509_R_NO_CERTIFICATES_INCLUDED = 121; | |
| const int X509_R_NO_CERTIFICATE_FOUND = 141; | |
| const int X509_R_NO_CERTIFICATE_OR_CRL_FOUND = 142; | |
| const int X509_R_NO_CERT_SET_FOR_US_TO_VERIFY = 122; | |
| const int X509_R_NO_CRLS_INCLUDED = 123; | |
| const int X509_R_NO_CRL_FOUND = 143; | |
| const int X509_R_NO_CRL_NUMBER = 124; | |
| const int X509_R_PUBLIC_KEY_DECODE_ERROR = 125; | |
| const int X509_R_PUBLIC_KEY_ENCODE_ERROR = 126; | |
| const int X509_R_SHOULD_RETRY = 127; | |
| const int X509_R_SIGNATURE_ALGORITHM_MISMATCH = 137; | |
| const int X509_R_UNKNOWN_KEY_TYPE = 128; | |
| const int X509_R_UNKNOWN_NID = 129; | |
| const int X509_R_UNKNOWN_PURPOSE_ID = 130; | |
| const int X509_R_UNKNOWN_TRUST_ID = 131; | |
| const int X509_R_UNSUPPORTED_ALGORITHM = 132; | |
| const int X509_R_WRONG_LOOKUP_TYPE = 133; | |
| const int X509_R_WRONG_TYPE = 134; | |
| typedef X509_SIG = X509_sig_st; | |
| typedef X509_STORE = x509_store_st; | |
| typedef X509_STORE_CTX = x509_store_ctx_st; | |
| typedef X509_STORE_CTX_verify_cb = | |
| ffi.Pointer<ffi.NativeFunction<X509_STORE_CTX_verify_cbFunction>>; | |
| typedef X509_STORE_CTX_verify_cbFunction = ffi.Int Function( | |
| ffi.Int, | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ); | |
| typedef DartX509_STORE_CTX_verify_cbFunction = int Function( | |
| int, | |
| ffi.Pointer<X509_STORE_CTX>, | |
| ); | |
| const int X509_TRUST_COMPAT = 1; | |
| const int X509_TRUST_EMAIL = 4; | |
| const int X509_TRUST_OBJECT_SIGN = 5; | |
| const int X509_TRUST_REJECTED = 2; | |
| const int X509_TRUST_SSL_CLIENT = 2; | |
| const int X509_TRUST_SSL_SERVER = 3; | |
| const int X509_TRUST_TRUSTED = 1; | |
| const int X509_TRUST_TSA = 8; | |
| const int X509_TRUST_UNTRUSTED = 3; | |
| typedef X509_VERIFY_PARAM = X509_VERIFY_PARAM_st; | |
| final class X509_VERIFY_PARAM_st extends ffi.Opaque {} | |
| const int X509_VERSION_1 = 0; | |
| const int X509_VERSION_2 = 1; | |
| const int X509_VERSION_3 = 2; | |
| const int X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31; | |
| const int X509_V_ERR_AKID_SKID_MISMATCH = 30; | |
| const int X509_V_ERR_APPLICATION_VERIFICATION = 50; | |
| const int X509_V_ERR_CERT_CHAIN_TOO_LONG = 22; | |
| const int X509_V_ERR_CERT_HAS_EXPIRED = 10; | |
| const int X509_V_ERR_CERT_NOT_YET_VALID = 9; | |
| const int X509_V_ERR_CERT_REJECTED = 28; | |
| const int X509_V_ERR_CERT_REVOKED = 23; | |
| const int X509_V_ERR_CERT_SIGNATURE_FAILURE = 7; | |
| const int X509_V_ERR_CERT_UNTRUSTED = 27; | |
| const int X509_V_ERR_CRL_HAS_EXPIRED = 12; | |
| const int X509_V_ERR_CRL_NOT_YET_VALID = 11; | |
| const int X509_V_ERR_CRL_PATH_VALIDATION_ERROR = 54; | |
| const int X509_V_ERR_CRL_SIGNATURE_FAILURE = 8; | |
| const int X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18; | |
| const int X509_V_ERR_DIFFERENT_CRL_SCOPE = 44; | |
| const int X509_V_ERR_EMAIL_MISMATCH = 63; | |
| const int X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14; | |
| const int X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13; | |
| const int X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15; | |
| const int X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16; | |
| const int X509_V_ERR_EXCLUDED_VIOLATION = 48; | |
| const int X509_V_ERR_HOSTNAME_MISMATCH = 62; | |
| const int X509_V_ERR_INVALID_CA = 24; | |
| const int X509_V_ERR_INVALID_CALL = 65; | |
| const int X509_V_ERR_INVALID_EXTENSION = 41; | |
| const int X509_V_ERR_INVALID_NON_CA = 37; | |
| const int X509_V_ERR_INVALID_POLICY_EXTENSION = 42; | |
| const int X509_V_ERR_INVALID_PURPOSE = 26; | |
| const int X509_V_ERR_IP_ADDRESS_MISMATCH = 64; | |
| const int X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32; | |
| const int X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35; | |
| const int X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39; | |
| const int X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS = 67; | |
| const int X509_V_ERR_NO_EXPLICIT_POLICY = 43; | |
| const int X509_V_ERR_OUT_OF_MEM = 17; | |
| const int X509_V_ERR_PATH_LENGTH_EXCEEDED = 25; | |
| const int X509_V_ERR_PERMITTED_VIOLATION = 47; | |
| const int X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40; | |
| const int X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38; | |
| const int X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19; | |
| const int X509_V_ERR_STORE_LOOKUP = 66; | |
| const int X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29; | |
| const int X509_V_ERR_SUBTREE_MINMAX = 49; | |
| const int X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6; | |
| const int X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4; | |
| const int X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5; | |
| const int X509_V_ERR_UNABLE_TO_GET_CRL = 3; | |
| const int X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33; | |
| const int X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2; | |
| const int X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20; | |
| const int X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21; | |
| const int X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36; | |
| const int X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34; | |
| const int X509_V_ERR_UNNESTED_RESOURCE = 46; | |
| const int X509_V_ERR_UNSPECIFIED = 1; | |
| const int X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX = 52; | |
| const int X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE = 51; | |
| const int X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE = 45; | |
| const int X509_V_ERR_UNSUPPORTED_NAME_SYNTAX = 53; | |
| const int X509_V_FLAG_ALLOW_PROXY_CERTS = 64; | |
| const int X509_V_FLAG_ALLOW_SHA1 = 33554432; | |
| const int X509_V_FLAG_ALLOW_TIMEZONE_OFFSET = 16777216; | |
| const int X509_V_FLAG_CB_ISSUER_CHECK = 1; | |
| const int X509_V_FLAG_CHECK_SS_SIGNATURE = 0; | |
| const int X509_V_FLAG_CRL_CHECK = 4; | |
| const int X509_V_FLAG_CRL_CHECK_ALL = 8; | |
| const int X509_V_FLAG_EXPLICIT_POLICY = 256; | |
| const int X509_V_FLAG_EXTENDED_CRL_SUPPORT = 4096; | |
| const int X509_V_FLAG_IGNORE_CRITICAL = 16; | |
| const int X509_V_FLAG_INHIBIT_ANY = 512; | |
| const int X509_V_FLAG_INHIBIT_MAP = 1024; | |
| const int X509_V_FLAG_NOTIFY_POLICY = 2048; | |
| const int X509_V_FLAG_NO_ALT_CHAINS = 0; | |
| const int X509_V_FLAG_NO_CHECK_TIME = 2097152; | |
| const int X509_V_FLAG_PARTIAL_CHAIN = 524288; | |
| const int X509_V_FLAG_POLICY_CHECK = 128; | |
| const int X509_V_FLAG_TRUSTED_FIRST = 0; | |
| const int X509_V_FLAG_USE_CHECK_TIME = 2; | |
| const int X509_V_FLAG_USE_DELTAS = 8192; | |
| const int X509_V_FLAG_USE_MTC_DRAFT_PLANTS_07 = 4194304; | |
| const int X509_V_FLAG_X509_STRICT = 0; | |
| const int X509_V_OK = 0; | |
| /// Private structures. | |
| final class X509_algor_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> algorithm; | |
| external ffi.Pointer<ASN1_TYPE> parameter; | |
| static ffi.Pointer<X509_algor_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OBJECT> algorithm, | |
| required ffi.Pointer<ASN1_TYPE> parameter, | |
| }) => $allocator<X509_algor_st>() | |
| ..ref.algorithm = algorithm | |
| ..ref.parameter = parameter; | |
| } | |
| final class X509_crl_st extends ffi.Opaque {} | |
| final class X509_extension_st extends ffi.Opaque {} | |
| final class X509_info_st extends ffi.Struct { | |
| external ffi.Pointer<X509> x509; | |
| external ffi.Pointer<X509_CRL> crl; | |
| external ffi.Pointer<X509_PKEY> x_pkey; | |
| external EVP_CIPHER_INFO enc_cipher; | |
| @ffi.Int() | |
| external int enc_len; | |
| external ffi.Pointer<ffi.Char> enc_data; | |
| } | |
| final class X509_name_entry_st extends ffi.Opaque {} | |
| final class X509_name_st extends ffi.Opaque {} | |
| final class X509_pubkey_st extends ffi.Opaque {} | |
| final class X509_req_st extends ffi.Opaque {} | |
| final class X509_sig_st extends ffi.Opaque {} | |
| final class _IO_FILE extends ffi.Opaque {} | |
| /// aes_key_st should be an opaque type, but EVP requires that the size be | |
| /// known. | |
| final class aes_key_st extends ffi.Struct { | |
| @ffi.Array.multi([60]) | |
| external ffi.Array<ffi.Uint32> rd_key; | |
| @ffi.UnsignedInt() | |
| external int rounds; | |
| } | |
| final class asn1_null_st extends ffi.Opaque {} | |
| final class asn1_object_st extends ffi.Opaque {} | |
| final class asn1_pctx_st extends ffi.Opaque {} | |
| /// An asn1_string_st (aka `ASN1_STRING`) represents a value of a string-like | |
| /// ASN.1 type. It contains a `type` field, and a byte string `data` field with a | |
| /// type-specific representation. This type-specific representation does not | |
| /// always correspond to the DER encoding of the type. | |
| /// | |
| /// If `type` is one of `V_ASN1_OCTET_STRING`, `V_ASN1_UTF8STRING`, | |
| /// `V_ASN1_NUMERICSTRING`, `V_ASN1_PRINTABLESTRING`, `V_ASN1_T61STRING`, | |
| /// `V_ASN1_VIDEOTEXSTRING`, `V_ASN1_IA5STRING`, `V_ASN1_GRAPHICSTRING`, | |
| /// `V_ASN1_ISO64STRING`, `V_ASN1_VISIBLESTRING`, `V_ASN1_GENERALSTRING`, | |
| /// `V_ASN1_UNIVERSALSTRING`, or `V_ASN1_BMPSTRING`, the object represents an | |
| /// ASN.1 string type. The data contains the byte representation of the | |
| /// string. | |
| /// | |
| /// If `type` is `V_ASN1_BIT_STRING`, the object represents a BIT STRING value. | |
| /// See bit string documentation below for the data and flags. | |
| /// | |
| /// If `type` is one of `V_ASN1_INTEGER`, `V_ASN1_NEG_INTEGER`, | |
| /// `V_ASN1_ENUMERATED`, or `V_ASN1_NEG_ENUMERATED`, the object represents an | |
| /// INTEGER or ENUMERATED value. See integer documentation below for details. | |
| /// | |
| /// If `type` is `V_ASN1_GENERALIZEDTIME` or `V_ASN1_UTCTIME`, the object | |
| /// represents a GeneralizedTime or UTCTime value, respectively. The data | |
| /// contains the DER encoding of the value. For example, the UNIX epoch would be | |
| /// "19700101000000Z" for a GeneralizedTime and "700101000000Z" for a UTCTime. | |
| /// | |
| /// If `type` is `V_ASN1_SEQUENCE`, `V_ASN1_SET`, or `V_ASN1_OTHER`, the object | |
| /// represents a SEQUENCE, SET, or arbitrary ASN.1 value, respectively. Unlike | |
| /// the above cases, the data contains the DER encoding of the entire structure, | |
| /// including the header. If the value is explicitly or implicitly tagged, this | |
| /// too will be reflected in the data field. As this case handles unknown types, | |
| /// the contents are not checked when parsing or serializing. | |
| /// | |
| /// Other values of `type` do not represent a valid ASN.1 value, though | |
| /// default-constructed objects may set `type` to -1. Such objects cannot be | |
| /// serialized. | |
| /// | |
| /// `ASN1_STRING` additionally has the following typedefs: `ASN1_BIT_STRING`, | |
| /// `ASN1_BMPSTRING`, `ASN1_ENUMERATED`, `ASN1_GENERALIZEDTIME`, | |
| /// `ASN1_GENERALSTRING`, `ASN1_IA5STRING`, `ASN1_INTEGER`, `ASN1_OCTET_STRING`, | |
| /// `ASN1_PRINTABLESTRING`, `ASN1_T61STRING`, `ASN1_TIME`, | |
| /// `ASN1_UNIVERSALSTRING`, `ASN1_UTCTIME`, `ASN1_UTF8STRING`, and | |
| /// `ASN1_VISIBLESTRING`. Other than `ASN1_TIME`, these correspond to universal | |
| /// ASN.1 types. `ASN1_TIME` represents a CHOICE of UTCTime and GeneralizedTime, | |
| /// with a cutoff of 2049, as used in Section 4.1.2.5 of RFC 5280. | |
| /// | |
| /// For clarity, callers are encouraged to use the appropriate typedef when | |
| /// available. They are the same type as `ASN1_STRING`, so a caller may freely | |
| /// pass them into functions expecting `ASN1_STRING`, such as | |
| /// `ASN1_STRING_length`. | |
| /// | |
| /// If a function returns an `ASN1_STRING` where the typedef or ASN.1 structure | |
| /// implies constraints on `type`, callers may assume that `type` is correct. | |
| /// However, if a function takes an `ASN1_STRING` as input, callers must ensure | |
| /// `type` matches. These invariants are not captured by the C type system and | |
| /// may not be checked at runtime. For example, callers may assume the output of | |
| /// `X509_get0_serialNumber` has type `V_ASN1_INTEGER` or `V_ASN1_NEG_INTEGER`. | |
| /// Callers must not pass a string of type `V_ASN1_OCTET_STRING` to | |
| /// `X509_set_serialNumber`. Doing so may break invariants on the `X509` object | |
| /// and break the `X509_get0_serialNumber` invariant. | |
| /// | |
| /// TODO(https://crbug.com/boringssl/445): This is very unfriendly. Getting the | |
| /// type field wrong should not cause memory errors, but it may do strange | |
| /// things. We should add runtime checks to anything that consumes `ASN1_STRING`s | |
| /// from the caller. | |
| final class asn1_string_st extends ffi.Struct { | |
| @ffi.Int() | |
| external int length; | |
| @ffi.Int() | |
| external int type; | |
| external ffi.Pointer<ffi.UnsignedChar> data; | |
| @ffi.Long() | |
| external int flags; | |
| static ffi.Pointer<asn1_string_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int length, | |
| required int type, | |
| required ffi.Pointer<ffi.UnsignedChar> data, | |
| required int flags, | |
| }) => $allocator<asn1_string_st>() | |
| ..ref.length = length | |
| ..ref.type = type | |
| ..ref.data = data | |
| ..ref.flags = flags; | |
| } | |
| /// An asn1_type_st (aka `ASN1_TYPE`) represents an arbitrary ASN.1 element, | |
| /// typically used for ANY types. It contains a `type` field and a `value` union | |
| /// dependent on `type`. | |
| /// | |
| /// WARNING: This struct has a complex representation. Callers must not construct | |
| /// `ASN1_TYPE` values manually. Use `ASN1_TYPE_set` and `ASN1_TYPE_set1` | |
| /// instead. Additionally, callers performing non-trivial operations on this type | |
| /// are encouraged to use `CBS` and `CBB` from <openssl/bytestring.h>, and | |
| /// convert to or from `ASN1_TYPE` with `d2i_ASN1_TYPE` or `i2d_ASN1_TYPE`. | |
| /// | |
| /// The `type` field corresponds to the tag of the ASN.1 element being | |
| /// represented: | |
| /// | |
| /// If `type` is a `V_ASN1_*` constant for an ASN.1 string-like type, as defined | |
| /// by `ASN1_STRING`, the tag matches the constant. `value` contains an | |
| /// `ASN1_STRING` pointer (equivalently, one of the more specific typedefs). See | |
| /// `ASN1_STRING` for details on the representation. Unlike `ASN1_STRING`, | |
| /// `ASN1_TYPE` does not use the `V_ASN1_NEG` flag for negative INTEGER and | |
| /// ENUMERATE values. For a negative value, the `ASN1_TYPE`'s `type` will be | |
| /// `V_ASN1_INTEGER` or `V_ASN1_ENUMERATED`, but `value` will an `ASN1_STRING` | |
| /// whose `type` is `V_ASN1_NEG_INTEGER` or `V_ASN1_NEG_ENUMERATED`. | |
| /// | |
| /// If `type` is `V_ASN1_OBJECT`, the tag is OBJECT IDENTIFIER and `value` | |
| /// contains an `ASN1_OBJECT` pointer. | |
| /// | |
| /// If `type` is `V_ASN1_NULL`, the tag is NULL. `value` contains a NULL pointer. | |
| /// | |
| /// If `type` is `V_ASN1_BOOLEAN`, the tag is BOOLEAN. `value` contains an | |
| /// `ASN1_BOOLEAN`. | |
| /// | |
| /// If `type` is `V_ASN1_SEQUENCE`, `V_ASN1_SET`, or `V_ASN1_OTHER`, the tag is | |
| /// SEQUENCE, SET, or some arbitrary tag, respectively. `value` uses the | |
| /// corresponding `ASN1_STRING` representation. Although any type may be | |
| /// represented in `V_ASN1_OTHER`, the parser will always return the more | |
| /// specific encoding when available. | |
| /// | |
| /// Other values of `type` do not represent a valid ASN.1 value, though | |
| /// default-constructed objects may set `type` to -1. Such objects cannot be | |
| /// serialized. | |
| final class asn1_type_st extends ffi.Struct { | |
| @ffi.Int() | |
| external int type; | |
| external UnnamedUnion$1 value; | |
| } | |
| final class bignum_ctx extends ffi.Opaque {} | |
| /// Private functions | |
| final class bignum_st extends ffi.Struct { | |
| /// d is a pointer to an array of `width` `BN_BITS2`-bit chunks in | |
| /// little-endian order. This stores the absolute value of the number. | |
| external ffi.Pointer<ffi.UintPtr> d; | |
| /// width is the number of elements of `d` which are valid. This value is not | |
| /// necessarily minimal; the most-significant words of `d` may be zero. | |
| /// `width` determines a potentially loose upper-bound on the absolute value | |
| /// of the `BIGNUM`. | |
| /// | |
| /// Functions taking `BIGNUM` inputs must compute the same answer for all | |
| /// possible widths. `bn_minimal_width`, `bn_set_minimal_width`, and other | |
| /// helpers may be used to recover the minimal width, provided it is not | |
| /// secret. If it is secret, use a different algorithm. Functions may output | |
| /// minimal or non-minimal `BIGNUM`s depending on secrecy requirements, but | |
| /// those which cause widths to unboundedly grow beyond the minimal value | |
| /// should be documented such. | |
| /// | |
| /// Note this is different from historical `BIGNUM` semantics. | |
| @ffi.Int() | |
| external int width; | |
| /// dmax is number of elements of `d` which are allocated. | |
| @ffi.Int() | |
| external int dmax; | |
| /// neg is one if the number if negative and zero otherwise. | |
| @ffi.Int() | |
| external int neg; | |
| /// flags is a bitmask of `BN_FLG_*` values | |
| @ffi.Int() | |
| external int flags; | |
| static ffi.Pointer<bignum_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.UintPtr> d, | |
| required int width, | |
| required int dmax, | |
| required int neg, | |
| required int flags, | |
| }) => $allocator<bignum_st>() | |
| ..ref.d = d | |
| ..ref.width = width | |
| ..ref.dmax = dmax | |
| ..ref.neg = neg | |
| ..ref.flags = flags; | |
| } | |
| typedef bio_info_cb = BIO_info_cb; | |
| final class bio_method_st extends ffi.Opaque {} | |
| final class bio_st extends ffi.Opaque {} | |
| final class blake2b_state_st extends ffi.Opaque {} | |
| /// bn_gencb_st, or `BN_GENCB`, holds a callback function that is used by | |
| /// generation functions that can take a very long time to complete. Use | |
| /// `BN_GENCB_set` to initialise a `BN_GENCB` structure. | |
| /// | |
| /// The callback receives the address of that `BN_GENCB` structure as its last | |
| /// argument and the user is free to put an arbitrary pointer in `arg`. The other | |
| /// arguments are set as follows: | |
| /// - event=BN_GENCB_GENERATED, n=i: after generating the i'th possible prime | |
| /// number. | |
| /// - event=BN_GENCB_PRIME_TEST, n=-1: when finished trial division primality | |
| /// checks. | |
| /// - event=BN_GENCB_PRIME_TEST, n=i: when the i'th primality test has finished. | |
| /// | |
| /// The callback can return zero to abort the generation progress or one to | |
| /// allow it to continue. | |
| /// | |
| /// When other code needs to call a BN generation function it will often take a | |
| /// BN_GENCB argument and may call the function with other argument values. | |
| final class bn_gencb_st extends ffi.Struct { | |
| /// callback-specific data | |
| external ffi.Pointer<ffi.Void> arg; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int, ffi.Int, ffi.Pointer<bn_gencb_st>) | |
| > | |
| > | |
| callback; | |
| static ffi.Pointer<bn_gencb_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Void> arg, | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Int, ffi.Int, ffi.Pointer<bn_gencb_st>) | |
| > | |
| > | |
| callback, | |
| }) => $allocator<bn_gencb_st>() | |
| ..ref.arg = arg | |
| ..ref.callback = callback; | |
| } | |
| final class bn_mont_ctx_st extends ffi.Opaque {} | |
| /// bn_primality_result_t enumerates the outcomes of primality-testing. | |
| sealed class bn_primality_result_t { | |
| static const bn_probably_prime = 0; | |
| static const bn_composite = 1; | |
| static const bn_non_prime_power_composite = 2; | |
| } | |
| /// buf_mem_st (aka `BUF_MEM`) is a generic buffer object used by OpenSSL. | |
| final class buf_mem_st extends ffi.Struct { | |
| /// current number of bytes | |
| @ffi.Size() | |
| external int length; | |
| external ffi.Pointer<ffi.Char> data; | |
| /// size of buffer | |
| @ffi.Size() | |
| external int max; | |
| static ffi.Pointer<buf_mem_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int length, | |
| required ffi.Pointer<ffi.Char> data, | |
| required int max, | |
| }) => $allocator<buf_mem_st>() | |
| ..ref.length = length | |
| ..ref.data = data | |
| ..ref.max = max; | |
| } | |
| final class cbb_buffer_st extends ffi.Struct { | |
| external ffi.Pointer<ffi.Uint8> buf; | |
| @ffi.Size() | |
| external int len; | |
| @ffi.Size() | |
| external int cap; | |
| @ffi.UnsignedInt() | |
| external int flags; | |
| static ffi.Pointer<cbb_buffer_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Uint8> buf, | |
| required int len, | |
| required int cap, | |
| required int flags, | |
| }) => $allocator<cbb_buffer_st>() | |
| ..ref.buf = buf | |
| ..ref.len = len | |
| ..ref.cap = cap | |
| ..ref.flags = flags; | |
| } | |
| final class cbb_child_st extends ffi.Struct { | |
| external ffi.Pointer<cbb_buffer_st> base; | |
| @ffi.Size() | |
| external int offset; | |
| @ffi.Uint8() | |
| external int pending_len_len; | |
| @ffi.Uint8() | |
| external int pending_is_asn1; | |
| static ffi.Pointer<cbb_child_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<cbb_buffer_st> base, | |
| required int offset, | |
| required int pending_len_len, | |
| required int pending_is_asn1, | |
| }) => $allocator<cbb_child_st>() | |
| ..ref.base = base | |
| ..ref.offset = offset | |
| ..ref.pending_len_len = pending_len_len | |
| ..ref.pending_is_asn1 = pending_is_asn1; | |
| } | |
| final class cbb_st extends ffi.Struct { | |
| external ffi.Pointer<CBB> child; | |
| @ffi.Char() | |
| external int is_child; | |
| external UnnamedUnion$3 u; | |
| } | |
| /// CRYPTO ByteString | |
| final class cbs_st extends ffi.Struct { | |
| external ffi.Pointer<ffi.Uint8> data; | |
| @ffi.Size() | |
| external int len; | |
| static ffi.Pointer<cbs_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Uint8> data, | |
| required int len, | |
| }) => $allocator<cbs_st>() | |
| ..ref.data = data | |
| ..ref.len = len; | |
| } | |
| final class cmac_ctx_st extends ffi.Opaque {} | |
| final class conf_st extends ffi.Opaque {} | |
| /// Config files. | |
| /// | |
| /// This library handles OpenSSL's config files, which look like: | |
| /// | |
| /// # Comment | |
| /// | |
| /// # This key is in the default section. | |
| /// key=value | |
| /// | |
| /// [section_name] | |
| /// key2=value2 | |
| /// | |
| /// Config files are represented by a `CONF`. Use of this module is strongly | |
| /// discouraged. It is a remnant of the OpenSSL command-line tool. Parsing an | |
| /// untrusted input as a config file risks string injection and denial of service | |
| /// vulnerabilities. | |
| final class conf_value_st extends ffi.Struct { | |
| external ffi.Pointer<ffi.Char> section; | |
| external ffi.Pointer<ffi.Char> name; | |
| external ffi.Pointer<ffi.Char> value; | |
| static ffi.Pointer<conf_value_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Char> section, | |
| required ffi.Pointer<ffi.Char> name, | |
| required ffi.Pointer<ffi.Char> value, | |
| }) => $allocator<conf_value_st>() | |
| ..ref.section = section | |
| ..ref.name = name | |
| ..ref.value = value; | |
| } | |
| final class cpace_ctx_st extends ffi.Opaque {} | |
| /// The role that a party plays in the CPACE key agreement protocol. | |
| sealed class cpace_role_t { | |
| /// This role corresponds to the party A in the specification. | |
| static const cpace_role_initiator = 0; | |
| /// This role corresponds to the party B in the specification. | |
| static const cpace_role_responder = 1; | |
| } | |
| final class crypto_buffer_pool_st extends ffi.Opaque {} | |
| final class crypto_buffer_st extends ffi.Opaque {} | |
| final class crypto_ex_data_st extends ffi.Opaque {} | |
| /// crypto_iovec_st (aka `CRYPTO_IOVEC` combines a pointer to input data and a | |
| /// pointer to an output buffer with their common length. | |
| final class crypto_iovec_st extends ffi.Struct { | |
| /// `out` and `in` must be disjoint or equal | |
| external ffi.Pointer<ffi.Uint8> out; | |
| external ffi.Pointer<ffi.Uint8> in$; | |
| @ffi.Size() | |
| external int len; | |
| static ffi.Pointer<crypto_iovec_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Uint8> out, | |
| required ffi.Pointer<ffi.Uint8> in$, | |
| required int len, | |
| }) => $allocator<crypto_iovec_st>() | |
| ..ref.out = out | |
| ..ref.in$ = in$ | |
| ..ref.len = len; | |
| } | |
| /// crypto_ivec_st (aka `CRYPTO_IVEC`) combines a pointer to input data with its | |
| /// length. It is usually passed as an array. | |
| final class crypto_ivec_st extends ffi.Struct { | |
| external ffi.Pointer<ffi.Uint8> in$; | |
| @ffi.Size() | |
| external int len; | |
| static ffi.Pointer<crypto_ivec_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ffi.Uint8> in$, | |
| required int len, | |
| }) => $allocator<crypto_ivec_st>() | |
| ..ref.in$ = in$ | |
| ..ref.len = len; | |
| } | |
| final class crypto_must_be_null_st extends ffi.Opaque {} | |
| final class ctr_drbg_state_st extends ffi.Opaque {} | |
| /// The following typedefs are sometimes used for pointers to functions like | |
| /// `d2i_SAMPLE` and `i2d_SAMPLE`. Note, however, that these act on `void*`. | |
| /// Calling a function with a different pointer type is undefined in C, so this | |
| /// is only valid with a wrapper. | |
| typedef d2i_of_void = | |
| ffi.NativeFunction< | |
| ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ffi.Long, | |
| ) | |
| >; | |
| final class dh_st extends ffi.Opaque {} | |
| final class dsa_st extends ffi.Opaque {} | |
| final class ec_group_st extends ffi.Opaque {} | |
| final class ec_key_st extends ffi.Opaque {} | |
| final class ec_method_st extends ffi.Opaque {} | |
| final class ec_point_st extends ffi.Opaque {} | |
| /// ecdsa_method_st is a structure of function pointers for implementing ECDSA. | |
| /// See engine.h. | |
| final class ecdsa_method_st extends ffi.Struct { | |
| external openssl_method_common_st common; | |
| external ffi.Pointer<ffi.Void> app_data; | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<EC_KEY> key)> | |
| > | |
| init; | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<EC_KEY> key)> | |
| > | |
| finish; | |
| /// sign matches the arguments and behaviour of `ECDSA_sign`. | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Uint8> digest, | |
| ffi.Size digest_len, | |
| ffi.Pointer<ffi.Uint8> sig, | |
| ffi.Pointer<ffi.UnsignedInt> sig_len, | |
| ffi.Pointer<EC_KEY> eckey, | |
| ) | |
| > | |
| > | |
| sign; | |
| @ffi.Int() | |
| external int flags; | |
| } | |
| /// Low-level signing and verification. | |
| /// | |
| /// Low-level functions handle signatures as `ECDSA_SIG` structures which allow | |
| /// the two values in an ECDSA signature to be handled separately. | |
| final class ecdsa_sig_st extends ffi.Struct { | |
| external ffi.Pointer<BIGNUM> r; | |
| external ffi.Pointer<BIGNUM> s; | |
| static ffi.Pointer<ecdsa_sig_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<BIGNUM> r, | |
| required ffi.Pointer<BIGNUM> s, | |
| }) => $allocator<ecdsa_sig_st>() | |
| ..ref.r = r | |
| ..ref.s = s; | |
| } | |
| final class engine_st extends ffi.Opaque {} | |
| /// env_md_ctx_st is typoed ("evp" -> "env"), but the typo comes from OpenSSL | |
| /// and some consumers forward-declare these structures so we're leaving it | |
| /// alone. | |
| final class env_md_ctx_st extends ffi.Struct { | |
| external UnnamedUnion$2 unnamed; | |
| /// digest is the underlying digest function, or NULL if not set. | |
| external ffi.Pointer<EVP_MD> digest; | |
| /// pctx is an opaque (at this layer) pointer to additional context that | |
| /// EVP_PKEY functions may store in this object. | |
| external ffi.Pointer<EVP_PKEY_CTX> pctx; | |
| /// pctx_ops, if not NULL, points to a vtable that contains functions to | |
| /// manipulate `pctx`. | |
| external ffi.Pointer<evp_md_pctx_ops> pctx_ops; | |
| } | |
| final class env_md_st extends ffi.Opaque {} | |
| /// An evp_aead_ctx_st (typedefed as `EVP_AEAD_CTX` in base.h) represents an AEAD | |
| /// algorithm configured with a specific key and message-independent IV. | |
| final class evp_aead_ctx_st extends ffi.Struct { | |
| external ffi.Pointer<EVP_AEAD> aead; | |
| external evp_aead_ctx_st_state state; | |
| /// tag_len may contain the actual length of the authentication tag if it is | |
| /// known at initialization time. | |
| @ffi.Uint8() | |
| external int tag_len; | |
| } | |
| /// AEAD operations. | |
| final class evp_aead_ctx_st_state extends ffi.Union { | |
| @ffi.Array.multi([560]) | |
| external ffi.Array<ffi.Uint8> opaque; | |
| @ffi.Uint64() | |
| external int alignment; | |
| } | |
| /// evp_aead_direction_t denotes the direction of an AEAD operation. | |
| sealed class evp_aead_direction_t { | |
| static const evp_aead_open = 0; | |
| static const evp_aead_seal = 1; | |
| } | |
| final class evp_aead_st extends ffi.Opaque {} | |
| final class evp_cipher_ctx_st extends ffi.Struct { | |
| /// cipher contains the underlying cipher for this context. | |
| external ffi.Pointer<EVP_CIPHER> cipher; | |
| /// application stuff | |
| external ffi.Pointer<ffi.Void> app_data; | |
| /// cipher_data points to the `cipher` specific state. | |
| external ffi.Pointer<ffi.Void> cipher_data; | |
| /// key_len contains the length of the key, which may differ from | |
| /// `cipher->key_len` if the cipher can take a variable key length. | |
| @ffi.UnsignedInt() | |
| external int key_len; | |
| /// encrypt is one if encrypting and zero if decrypting. | |
| @ffi.Int() | |
| external int encrypt; | |
| /// flags contains the OR of zero or more `EVP_CIPH_*` flags, above. | |
| @ffi.Uint32() | |
| external int flags; | |
| /// oiv contains the original IV value. | |
| @ffi.Array.multi([16]) | |
| external ffi.Array<ffi.Uint8> oiv; | |
| /// iv contains the current IV value, which may have been updated. | |
| @ffi.Array.multi([16]) | |
| external ffi.Array<ffi.Uint8> iv; | |
| /// buf contains a partial block which is used by, for example, CTR mode to | |
| /// store unused keystream bytes. | |
| @ffi.Array.multi([32]) | |
| external ffi.Array<ffi.Uint8> buf; | |
| /// buf_len contains the number of bytes of a partial block contained in | |
| /// `buf`. | |
| @ffi.Int() | |
| external int buf_len; | |
| /// num contains the number of bytes of `iv` which are valid for modes that | |
| /// manage partial blocks themselves. | |
| @ffi.UnsignedInt() | |
| external int num; | |
| /// final_used is non-zero if the `final` buffer contains plaintext. | |
| @ffi.Int() | |
| external int final_used; | |
| /// possible final block | |
| @ffi.Array.multi([32]) | |
| external ffi.Array<ffi.Uint8> final$; | |
| } | |
| final class evp_cipher_info_st extends ffi.Struct { | |
| external ffi.Pointer<EVP_CIPHER> cipher; | |
| @ffi.Array.multi([16]) | |
| external ffi.Array<ffi.UnsignedChar> iv; | |
| } | |
| final class evp_cipher_st extends ffi.Opaque {} | |
| final class evp_encode_ctx_st extends ffi.Struct { | |
| /// data_used indicates the number of bytes of `data` that are valid. When | |
| /// encoding, `data` will be filled and encoded as a lump. When decoding, only | |
| /// the first four bytes of `data` will be used. | |
| @ffi.UnsignedInt() | |
| external int data_used; | |
| @ffi.Array.multi([48]) | |
| external ffi.Array<ffi.Uint8> data; | |
| /// eof_seen indicates that the end of the base64 data has been seen when | |
| /// decoding. Only whitespace can follow. | |
| @ffi.Char() | |
| external int eof_seen; | |
| /// error_encountered indicates that invalid base64 data was found. This will | |
| /// cause all future calls to fail. | |
| @ffi.Char() | |
| external int error_encountered; | |
| } | |
| final class evp_hpke_aead_st extends ffi.Opaque {} | |
| final class evp_hpke_ctx_st extends ffi.Opaque {} | |
| final class evp_hpke_kdf_st extends ffi.Opaque {} | |
| final class evp_hpke_kem_st extends ffi.Opaque {} | |
| final class evp_hpke_key_st extends ffi.Opaque {} | |
| final class evp_kem_st extends ffi.Opaque {} | |
| /// Internal constants and structures (hidden). | |
| final class evp_md_pctx_ops extends ffi.Opaque {} | |
| final class evp_pkey_alg_st extends ffi.Opaque {} | |
| final class evp_pkey_ctx_st extends ffi.Opaque {} | |
| final class evp_pkey_st extends ffi.Opaque {} | |
| /// fips_counter_t denotes specific APIs/algorithms. A counter is maintained for | |
| /// each in FIPS mode so that tests can be written to assert that the expected, | |
| /// FIPS functions are being called by a certain piece of code. | |
| sealed class fips_counter_t { | |
| static const fips_counter_evp_aes_128_gcm = 0; | |
| static const fips_counter_evp_aes_256_gcm = 1; | |
| static const fips_counter_evp_aes_128_ctr = 2; | |
| static const fips_counter_evp_aes_256_ctr = 3; | |
| static const fips_counter_max = 3; | |
| } | |
| /// Private functions | |
| final class hmac_ctx_st extends ffi.Struct { | |
| external ffi.Pointer<EVP_MD> md; | |
| external EVP_MD_CTX md_ctx; | |
| external EVP_MD_CTX i_ctx; | |
| external EVP_MD_CTX o_ctx; | |
| } | |
| typedef i2d_of_void = | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Pointer<ffi.UnsignedChar>>, | |
| ) | |
| >; | |
| final class md4_state_st extends ffi.Opaque {} | |
| final class md5_state_st extends ffi.Opaque {} | |
| /// Deprecated functions. | |
| final class obj_name_st extends ffi.Struct { | |
| @ffi.Int() | |
| external int type; | |
| @ffi.Int() | |
| external int alias; | |
| external ffi.Pointer<ffi.Char> name; | |
| external ffi.Pointer<ffi.Char> data; | |
| static ffi.Pointer<obj_name_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int type, | |
| required int alias, | |
| required ffi.Pointer<ffi.Char> name, | |
| required ffi.Pointer<ffi.Char> data, | |
| }) => $allocator<obj_name_st>() | |
| ..ref.type = type | |
| ..ref.alias = alias | |
| ..ref.name = name | |
| ..ref.data = data; | |
| } | |
| /// openssl_method_common_st contains the common part of all method structures. | |
| /// This must be the first member of all method structures. | |
| final class openssl_method_common_st extends ffi.Struct { | |
| /// dummy – not used. | |
| @ffi.Int() | |
| external int references; | |
| @ffi.Char() | |
| external int is_static; | |
| static ffi.Pointer<openssl_method_common_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int references, | |
| required int is_static, | |
| }) => $allocator<openssl_method_common_st>() | |
| ..ref.references = references | |
| ..ref.is_static = is_static; | |
| } | |
| final class ossl_init_settings_st extends ffi.Opaque {} | |
| final class ossl_lib_ctx_st extends ffi.Opaque {} | |
| final class ossl_param_st extends ffi.Opaque {} | |
| /// ossl_ssize_t is a signed type which is large enough to fit the size of any | |
| /// valid memory allocation. We prefer using `size_t`, but sometimes we need a | |
| /// signed type for OpenSSL API compatibility. This type can be used in such | |
| /// cases to avoid overflow. | |
| /// | |
| /// Not all `size_t` values fit in `ossl_ssize_t`, but all `size_t` values that | |
| /// are sizes of or indices into C objects, can be converted without overflow. | |
| typedef ossl_ssize_t = ptrdiff_t; | |
| /// General names. | |
| /// | |
| /// A `GENERAL_NAME` represents an X.509 GeneralName structure, defined in RFC | |
| /// 5280, Section 4.2.1.6. General names are distinct from names (`X509_NAME`). A | |
| /// general name is a CHOICE type which may contain one of several name types, | |
| /// most commonly a DNS name or an IP address. General names most commonly appear | |
| /// in the subject alternative name (SAN) extension, though they are also used in | |
| /// other extensions. | |
| /// | |
| /// Many extensions contain a SEQUENCE OF GeneralName, or GeneralNames, so | |
| /// `STACK_OF(GENERAL_NAME)` is defined and aliased to `GENERAL_NAMES`. | |
| final class otherName_st extends ffi.Struct { | |
| external ffi.Pointer<ASN1_OBJECT> type_id; | |
| external ffi.Pointer<ASN1_TYPE> value; | |
| static ffi.Pointer<otherName_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<ASN1_OBJECT> type_id, | |
| required ffi.Pointer<ASN1_TYPE> value, | |
| }) => $allocator<otherName_st>() | |
| ..ref.type_id = type_id | |
| ..ref.value = value; | |
| } | |
| /// pem_password_cb is an application-supplied callback to supply a PEM password. | |
| /// On success, the callback should write the password into `out`, which has room | |
| /// for at most `max_out` bytes. On error, including if `max_out` is too small, | |
| /// it should return -1. `enc` is one if the password will be used for encrypting | |
| /// and zero if it is used for decrypting. `userdata` is the application-supplied | |
| /// parameter of the same name to the PEM function. | |
| typedef pem_password_cb = | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<ffi.Char> out, | |
| ffi.Int max_out, | |
| ffi.Int enc, | |
| ffi.Pointer<ffi.Void> userdata, | |
| ) | |
| >; | |
| final class pkcs12_st extends ffi.Opaque {} | |
| final class pkcs8_priv_key_info_st extends ffi.Opaque {} | |
| /// point_conversion_form_t enumerates forms, as defined in X9.62 (ECDSA), for | |
| /// the encoding of an elliptic curve point (x,y) | |
| sealed class point_conversion_form_t { | |
| /// POINT_CONVERSION_COMPRESSED indicates that the point is encoded as z||x, | |
| /// where the octet z specifies which solution of the quadratic equation y | |
| /// is. | |
| static const POINT_CONVERSION_COMPRESSED = 2; | |
| /// POINT_CONVERSION_UNCOMPRESSED indicates that the point is encoded as | |
| /// z||x||y, where z is the octet 0x04. | |
| static const POINT_CONVERSION_UNCOMPRESSED = 4; | |
| /// POINT_CONVERSION_HYBRID indicates that the point is encoded as z||x||y, | |
| /// where z specifies which solution of the quadratic equation y is. This is | |
| /// not supported by the code and has never been observed in use. | |
| /// | |
| /// TODO(agl): remove once node.js no longer references this. | |
| static const POINT_CONVERSION_HYBRID = 6; | |
| } | |
| /// X.509 information. | |
| /// | |
| /// `X509_INFO` is the return type for `PEM_X509_INFO_read_bio`, defined in | |
| /// <openssl/pem.h>. It is used to store a certificate, CRL, or private key. This | |
| /// type is defined in this header for OpenSSL compatibility. | |
| final class private_key_st extends ffi.Struct { | |
| external ffi.Pointer<EVP_PKEY> dec_pkey; | |
| static ffi.Pointer<private_key_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<EVP_PKEY> dec_pkey, | |
| }) => $allocator<private_key_st>()..ref.dec_pkey = dec_pkey; | |
| } | |
| typedef ptrdiff_t = ffi.Long; | |
| typedef Dartptrdiff_t = int; | |
| /// rand_meth_st is typedefed to `RAND_METHOD` in base.h. It isn't used; it | |
| /// exists only to be the return type of `RAND_SSLeay`. It's | |
| /// external so that variables of this type can be initialized. | |
| final class rand_meth_st extends ffi.Struct { | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ffi.Void> buf, ffi.Int num) | |
| > | |
| > | |
| seed; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8> buf, ffi.Size num) | |
| > | |
| > | |
| bytes; | |
| external ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> cleanup; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Void> buf, | |
| ffi.Int num, | |
| ffi.Double entropy, | |
| ) | |
| > | |
| > | |
| add; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8> buf, ffi.Size num) | |
| > | |
| > | |
| pseudorand; | |
| external ffi.Pointer<ffi.NativeFunction<ffi.Int Function()>> status; | |
| static ffi.Pointer<rand_meth_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function(ffi.Pointer<ffi.Void> buf, ffi.Int num) | |
| > | |
| > | |
| seed, | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8> buf, ffi.Size num) | |
| > | |
| > | |
| bytes, | |
| required ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> cleanup, | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Void Function( | |
| ffi.Pointer<ffi.Void> buf, | |
| ffi.Int num, | |
| ffi.Double entropy, | |
| ) | |
| > | |
| > | |
| add, | |
| required ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function(ffi.Pointer<ffi.Uint8> buf, ffi.Size num) | |
| > | |
| > | |
| pseudorand, | |
| required ffi.Pointer<ffi.NativeFunction<ffi.Int Function()>> status, | |
| }) => $allocator<rand_meth_st>() | |
| ..ref.seed = seed | |
| ..ref.bytes = bytes | |
| ..ref.cleanup = cleanup | |
| ..ref.add = add | |
| ..ref.pseudorand = pseudorand | |
| ..ref.status = status; | |
| } | |
| final class rc4_key_st extends ffi.Opaque {} | |
| final class rsa_meth_st extends ffi.Struct { | |
| external openssl_method_common_st common; | |
| external ffi.Pointer<ffi.Void> app_data; | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<RSA> rsa)> | |
| > | |
| init; | |
| external ffi.Pointer< | |
| ffi.NativeFunction<ffi.Int Function(ffi.Pointer<RSA> rsa)> | |
| > | |
| finish; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Int type, | |
| ffi.Pointer<ffi.Uint8> m, | |
| ffi.UnsignedInt m_length, | |
| ffi.Pointer<ffi.Uint8> sigret, | |
| ffi.Pointer<ffi.UnsignedInt> siglen, | |
| ffi.Pointer<RSA> rsa, | |
| ) | |
| > | |
| > | |
| sign; | |
| /// These functions mirror the `RSA_*` functions of the same name. | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Size max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Size in_len, | |
| ffi.Int padding, | |
| ) | |
| > | |
| > | |
| sign_raw; | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Size> out_len, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Size max_out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Size in_len, | |
| ffi.Int padding, | |
| ) | |
| > | |
| > | |
| decrypt; | |
| /// private_transform takes a big-endian integer from `in`, calculates the | |
| /// d'th power of it, modulo the RSA modulus and writes the result as a | |
| /// big-endian integer to `out`. Both `in` and `out` are `len` bytes long and | |
| /// `len` is always equal to `RSA_size(rsa)`. If the result of the transform | |
| /// can be represented in fewer than `len` bytes, then `out` must be zero | |
| /// padded on the left. | |
| /// | |
| /// It returns one on success and zero otherwise. | |
| /// | |
| /// RSA decrypt and sign operations will call this, thus an ENGINE might wish | |
| /// to override it in order to avoid having to implement the padding | |
| /// functionality demanded by those, higher level, operations. | |
| external ffi.Pointer< | |
| ffi.NativeFunction< | |
| ffi.Int Function( | |
| ffi.Pointer<RSA> rsa, | |
| ffi.Pointer<ffi.Uint8> out, | |
| ffi.Pointer<ffi.Uint8> in$, | |
| ffi.Size len, | |
| ) | |
| > | |
| > | |
| private_transform; | |
| @ffi.Int() | |
| external int flags; | |
| } | |
| /// An rsa_pss_params_st, aka `RSA_PSS_PARAMS`, represents a parsed | |
| /// RSASSA-PSS-params structure, as defined in (RFC 4055). | |
| final class rsa_pss_params_st extends ffi.Struct { | |
| external ffi.Pointer<X509_ALGOR> hashAlgorithm; | |
| external ffi.Pointer<X509_ALGOR> maskGenAlgorithm; | |
| external ffi.Pointer<ASN1_INTEGER> saltLength; | |
| external ffi.Pointer<ASN1_INTEGER> trailerField; | |
| /// OpenSSL caches the MGF hash on `RSA_PSS_PARAMS` in some cases. None of the | |
| /// cases apply to BoringSSL, so this is always NULL, but Node expects the | |
| /// field to be present. | |
| external ffi.Pointer<X509_ALGOR> maskHash; | |
| static ffi.Pointer<rsa_pss_params_st> $allocate( | |
| ffi.Allocator $allocator, { | |
| required ffi.Pointer<X509_ALGOR> hashAlgorithm, | |
| required ffi.Pointer<X509_ALGOR> maskGenAlgorithm, | |
| required ffi.Pointer<ASN1_INTEGER> saltLength, | |
| required ffi.Pointer<ASN1_INTEGER> trailerField, | |
| required ffi.Pointer<X509_ALGOR> maskHash, | |
| }) => $allocator<rsa_pss_params_st>() | |
| ..ref.hashAlgorithm = hashAlgorithm | |
| ..ref.maskGenAlgorithm = maskGenAlgorithm | |
| ..ref.saltLength = saltLength | |
| ..ref.trailerField = trailerField | |
| ..ref.maskHash = maskHash; | |
| } | |
| final class rsa_st extends ffi.Opaque {} | |
| final class sha256_state_st extends ffi.Struct { | |
| @ffi.Array.multi([8]) | |
| external ffi.Array<ffi.Uint32> h; | |
| @ffi.Uint32() | |
| external int Nl; | |
| @ffi.Uint32() | |
| external int Nh; | |
| @ffi.Array.multi([64]) | |
| external ffi.Array<ffi.Uint8> data; | |
| @ffi.UnsignedInt() | |
| external int num; | |
| @ffi.UnsignedInt() | |
| external int md_len; | |
| } | |
| final class sha512_state_st extends ffi.Struct { | |
| @ffi.Array.multi([8]) | |
| external ffi.Array<ffi.Uint64> h; | |
| @ffi.Uint16() | |
| external int num; | |
| @ffi.Uint16() | |
| external int md_len; | |
| @ffi.Uint32() | |
| external int bytes_so_far_high; | |
| @ffi.Uint64() | |
| external int bytes_so_far_low; | |
| @ffi.Array.multi([128]) | |
| external ffi.Array<ffi.Uint8> p; | |
| } | |
| final class sha_state_st extends ffi.Struct { | |
| external UnnamedUnion$7 unnamed; | |
| @ffi.Uint32() | |
| external int Nl; | |
| @ffi.Uint32() | |
| external int Nh; | |
| @ffi.Array.multi([64]) | |
| external ffi.Array<ffi.Uint8> data; | |
| @ffi.UnsignedInt() | |
| external int num; | |
| } | |
| typedef sk_ACCESS_DESCRIPTION_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ACCESS_DESCRIPTION_cmp_funcFunction>>; | |
| typedef sk_ACCESS_DESCRIPTION_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ACCESS_DESCRIPTION>>, | |
| ffi.Pointer<ffi.Pointer<ACCESS_DESCRIPTION>>, | |
| ); | |
| typedef Dartsk_ACCESS_DESCRIPTION_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ACCESS_DESCRIPTION>>, | |
| ffi.Pointer<ffi.Pointer<ACCESS_DESCRIPTION>>, | |
| ); | |
| typedef sk_ACCESS_DESCRIPTION_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ACCESS_DESCRIPTION_copy_funcFunction>>; | |
| typedef sk_ACCESS_DESCRIPTION_copy_funcFunction = | |
| ffi.Pointer<ACCESS_DESCRIPTION> Function(ffi.Pointer<ACCESS_DESCRIPTION>); | |
| typedef sk_ACCESS_DESCRIPTION_delete_if_func = | |
| ffi.Pointer< | |
| ffi.NativeFunction<sk_ACCESS_DESCRIPTION_delete_if_funcFunction> | |
| >; | |
| typedef sk_ACCESS_DESCRIPTION_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ACCESS_DESCRIPTION>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_ACCESS_DESCRIPTION_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ACCESS_DESCRIPTION>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_ACCESS_DESCRIPTION_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ACCESS_DESCRIPTION_free_funcFunction>>; | |
| typedef sk_ACCESS_DESCRIPTION_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ACCESS_DESCRIPTION>, | |
| ); | |
| typedef Dartsk_ACCESS_DESCRIPTION_free_funcFunction = void Function( | |
| ffi.Pointer<ACCESS_DESCRIPTION>, | |
| ); | |
| typedef sk_ASN1_INTEGER_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_INTEGER_cmp_funcFunction>>; | |
| typedef sk_ASN1_INTEGER_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ); | |
| typedef Dartsk_ASN1_INTEGER_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_INTEGER>>, | |
| ); | |
| typedef sk_ASN1_INTEGER_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_INTEGER_copy_funcFunction>>; | |
| typedef sk_ASN1_INTEGER_copy_funcFunction = ffi.Pointer<ASN1_INTEGER> Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ); | |
| typedef sk_ASN1_INTEGER_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_INTEGER_delete_if_funcFunction>>; | |
| typedef sk_ASN1_INTEGER_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_ASN1_INTEGER_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_ASN1_INTEGER_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_INTEGER_free_funcFunction>>; | |
| typedef sk_ASN1_INTEGER_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ); | |
| typedef Dartsk_ASN1_INTEGER_free_funcFunction = void Function( | |
| ffi.Pointer<ASN1_INTEGER>, | |
| ); | |
| typedef sk_ASN1_OBJECT_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_OBJECT_cmp_funcFunction>>; | |
| typedef sk_ASN1_OBJECT_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ); | |
| typedef Dartsk_ASN1_OBJECT_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_OBJECT>>, | |
| ); | |
| typedef sk_ASN1_OBJECT_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_OBJECT_copy_funcFunction>>; | |
| typedef sk_ASN1_OBJECT_copy_funcFunction = ffi.Pointer<ASN1_OBJECT> Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ); | |
| typedef sk_ASN1_OBJECT_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_OBJECT_delete_if_funcFunction>>; | |
| typedef sk_ASN1_OBJECT_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_ASN1_OBJECT_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_ASN1_OBJECT_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_OBJECT_free_funcFunction>>; | |
| typedef sk_ASN1_OBJECT_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ); | |
| typedef Dartsk_ASN1_OBJECT_free_funcFunction = void Function( | |
| ffi.Pointer<ASN1_OBJECT>, | |
| ); | |
| typedef sk_ASN1_TYPE_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_TYPE_cmp_funcFunction>>; | |
| typedef sk_ASN1_TYPE_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ); | |
| typedef Dartsk_ASN1_TYPE_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ffi.Pointer<ffi.Pointer<ASN1_TYPE>>, | |
| ); | |
| typedef sk_ASN1_TYPE_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_TYPE_copy_funcFunction>>; | |
| typedef sk_ASN1_TYPE_copy_funcFunction = ffi.Pointer<ASN1_TYPE> Function( | |
| ffi.Pointer<ASN1_TYPE>, | |
| ); | |
| typedef sk_ASN1_TYPE_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_TYPE_delete_if_funcFunction>>; | |
| typedef sk_ASN1_TYPE_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ASN1_TYPE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_ASN1_TYPE_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ASN1_TYPE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_ASN1_TYPE_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_ASN1_TYPE_free_funcFunction>>; | |
| typedef sk_ASN1_TYPE_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ASN1_TYPE>, | |
| ); | |
| typedef Dartsk_ASN1_TYPE_free_funcFunction = void Function( | |
| ffi.Pointer<ASN1_TYPE>, | |
| ); | |
| typedef sk_BIO_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_BIO_cmp_funcFunction>>; | |
| typedef sk_BIO_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ); | |
| typedef Dartsk_BIO_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ffi.Pointer<ffi.Pointer<BIO>>, | |
| ); | |
| typedef sk_BIO_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_BIO_copy_funcFunction>>; | |
| typedef sk_BIO_copy_funcFunction = ffi.Pointer<BIO> Function(ffi.Pointer<BIO>); | |
| typedef sk_BIO_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_BIO_delete_if_funcFunction>>; | |
| typedef sk_BIO_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_BIO_delete_if_funcFunction = int Function( | |
| ffi.Pointer<BIO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_BIO_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_BIO_free_funcFunction>>; | |
| typedef sk_BIO_free_funcFunction = ffi.Void Function(ffi.Pointer<BIO>); | |
| typedef Dartsk_BIO_free_funcFunction = void Function(ffi.Pointer<BIO>); | |
| typedef sk_CONF_VALUE_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CONF_VALUE_cmp_funcFunction>>; | |
| typedef sk_CONF_VALUE_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<CONF_VALUE>>, | |
| ffi.Pointer<ffi.Pointer<CONF_VALUE>>, | |
| ); | |
| typedef Dartsk_CONF_VALUE_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<CONF_VALUE>>, | |
| ffi.Pointer<ffi.Pointer<CONF_VALUE>>, | |
| ); | |
| typedef sk_CONF_VALUE_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CONF_VALUE_copy_funcFunction>>; | |
| typedef sk_CONF_VALUE_copy_funcFunction = ffi.Pointer<CONF_VALUE> Function( | |
| ffi.Pointer<CONF_VALUE>, | |
| ); | |
| typedef sk_CONF_VALUE_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CONF_VALUE_delete_if_funcFunction>>; | |
| typedef sk_CONF_VALUE_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<CONF_VALUE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_CONF_VALUE_delete_if_funcFunction = int Function( | |
| ffi.Pointer<CONF_VALUE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_CONF_VALUE_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CONF_VALUE_free_funcFunction>>; | |
| typedef sk_CONF_VALUE_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<CONF_VALUE>, | |
| ); | |
| typedef Dartsk_CONF_VALUE_free_funcFunction = void Function( | |
| ffi.Pointer<CONF_VALUE>, | |
| ); | |
| typedef sk_CRYPTO_BUFFER_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CRYPTO_BUFFER_cmp_funcFunction>>; | |
| typedef sk_CRYPTO_BUFFER_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<CRYPTO_BUFFER>>, | |
| ffi.Pointer<ffi.Pointer<CRYPTO_BUFFER>>, | |
| ); | |
| typedef Dartsk_CRYPTO_BUFFER_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<CRYPTO_BUFFER>>, | |
| ffi.Pointer<ffi.Pointer<CRYPTO_BUFFER>>, | |
| ); | |
| typedef sk_CRYPTO_BUFFER_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CRYPTO_BUFFER_copy_funcFunction>>; | |
| typedef sk_CRYPTO_BUFFER_copy_funcFunction = | |
| ffi.Pointer<CRYPTO_BUFFER> Function(ffi.Pointer<CRYPTO_BUFFER>); | |
| typedef sk_CRYPTO_BUFFER_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CRYPTO_BUFFER_delete_if_funcFunction>>; | |
| typedef sk_CRYPTO_BUFFER_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<CRYPTO_BUFFER>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_CRYPTO_BUFFER_delete_if_funcFunction = int Function( | |
| ffi.Pointer<CRYPTO_BUFFER>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// Buffers and buffer pools. | |
| /// | |
| /// `CRYPTO_BUFFER`s are simply reference-counted, immutable byte string. A | |
| /// single `CRYPTO_BUFFER` can be referenced from multiple parts of an | |
| /// application without storing multiple copies of the underlying data in | |
| /// memory. | |
| /// | |
| /// A `CRYPTO_BUFFER_POOL` can be used to additionally deduplicate | |
| /// `CRYPTO_BUFFER`s on construction. It maintains weak references to associated | |
| /// `CRYPTO_BUFFER`s and returns an existing `CRYPTO_BUFFER` if matching ones | |
| /// already exist. | |
| /// | |
| /// Without a `CRYPTO_BUFFER_POOL`, if two parts of application construct an | |
| /// identical `CRYPTO_BUFFER` (e.g. if two TLS connections received the same | |
| /// certificate), there will be two copies of the buffer in memory. A | |
| /// `CRYPTO_BUFFER_POOL` allows two parts of an application that construct | |
| /// `CRYPTO_BUFFER`s to deduplicate their contents, at the cost of more thread | |
| /// contention. | |
| typedef sk_CRYPTO_BUFFER_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_CRYPTO_BUFFER_free_funcFunction>>; | |
| typedef sk_CRYPTO_BUFFER_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<CRYPTO_BUFFER>, | |
| ); | |
| typedef Dartsk_CRYPTO_BUFFER_free_funcFunction = void Function( | |
| ffi.Pointer<CRYPTO_BUFFER>, | |
| ); | |
| typedef sk_DIST_POINT_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_DIST_POINT_cmp_funcFunction>>; | |
| typedef sk_DIST_POINT_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<DIST_POINT>>, | |
| ffi.Pointer<ffi.Pointer<DIST_POINT>>, | |
| ); | |
| typedef Dartsk_DIST_POINT_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<DIST_POINT>>, | |
| ffi.Pointer<ffi.Pointer<DIST_POINT>>, | |
| ); | |
| typedef sk_DIST_POINT_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_DIST_POINT_copy_funcFunction>>; | |
| typedef sk_DIST_POINT_copy_funcFunction = ffi.Pointer<DIST_POINT> Function( | |
| ffi.Pointer<DIST_POINT>, | |
| ); | |
| typedef sk_DIST_POINT_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_DIST_POINT_delete_if_funcFunction>>; | |
| typedef sk_DIST_POINT_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<DIST_POINT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_DIST_POINT_delete_if_funcFunction = int Function( | |
| ffi.Pointer<DIST_POINT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_DIST_POINT_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_DIST_POINT_free_funcFunction>>; | |
| typedef sk_DIST_POINT_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<DIST_POINT>, | |
| ); | |
| typedef Dartsk_DIST_POINT_free_funcFunction = void Function( | |
| ffi.Pointer<DIST_POINT>, | |
| ); | |
| typedef sk_GENERAL_NAME_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_NAME_cmp_funcFunction>>; | |
| typedef sk_GENERAL_NAME_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>>, | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>>, | |
| ); | |
| typedef Dartsk_GENERAL_NAME_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>>, | |
| ffi.Pointer<ffi.Pointer<GENERAL_NAME>>, | |
| ); | |
| typedef sk_GENERAL_NAME_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_NAME_copy_funcFunction>>; | |
| typedef sk_GENERAL_NAME_copy_funcFunction = ffi.Pointer<GENERAL_NAME> Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ); | |
| typedef sk_GENERAL_NAME_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_NAME_delete_if_funcFunction>>; | |
| typedef sk_GENERAL_NAME_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_GENERAL_NAME_delete_if_funcFunction = int Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_GENERAL_NAME_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_NAME_free_funcFunction>>; | |
| typedef sk_GENERAL_NAME_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ); | |
| typedef Dartsk_GENERAL_NAME_free_funcFunction = void Function( | |
| ffi.Pointer<GENERAL_NAME>, | |
| ); | |
| typedef sk_GENERAL_SUBTREE_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_SUBTREE_cmp_funcFunction>>; | |
| typedef sk_GENERAL_SUBTREE_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_SUBTREE>>, | |
| ffi.Pointer<ffi.Pointer<GENERAL_SUBTREE>>, | |
| ); | |
| typedef Dartsk_GENERAL_SUBTREE_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<GENERAL_SUBTREE>>, | |
| ffi.Pointer<ffi.Pointer<GENERAL_SUBTREE>>, | |
| ); | |
| typedef sk_GENERAL_SUBTREE_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_SUBTREE_copy_funcFunction>>; | |
| typedef sk_GENERAL_SUBTREE_copy_funcFunction = | |
| ffi.Pointer<GENERAL_SUBTREE> Function(ffi.Pointer<GENERAL_SUBTREE>); | |
| typedef sk_GENERAL_SUBTREE_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_SUBTREE_delete_if_funcFunction>>; | |
| typedef sk_GENERAL_SUBTREE_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<GENERAL_SUBTREE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_GENERAL_SUBTREE_delete_if_funcFunction = int Function( | |
| ffi.Pointer<GENERAL_SUBTREE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_GENERAL_SUBTREE_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_GENERAL_SUBTREE_free_funcFunction>>; | |
| typedef sk_GENERAL_SUBTREE_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<GENERAL_SUBTREE>, | |
| ); | |
| typedef Dartsk_GENERAL_SUBTREE_free_funcFunction = void Function( | |
| ffi.Pointer<GENERAL_SUBTREE>, | |
| ); | |
| typedef sk_OPENSSL_STRING_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_OPENSSL_STRING_cmp_funcFunction>>; | |
| typedef sk_OPENSSL_STRING_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ); | |
| typedef Dartsk_OPENSSL_STRING_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Char>>, | |
| ); | |
| typedef sk_OPENSSL_STRING_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_OPENSSL_STRING_copy_funcFunction>>; | |
| typedef sk_OPENSSL_STRING_copy_funcFunction = ffi.Pointer<ffi.Char> Function( | |
| ffi.Pointer<ffi.Char>, | |
| ); | |
| typedef sk_OPENSSL_STRING_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_OPENSSL_STRING_delete_if_funcFunction>>; | |
| typedef sk_OPENSSL_STRING_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_OPENSSL_STRING_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ffi.Char>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_OPENSSL_STRING_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_OPENSSL_STRING_free_funcFunction>>; | |
| typedef sk_OPENSSL_STRING_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<ffi.Char>, | |
| ); | |
| typedef Dartsk_OPENSSL_STRING_free_funcFunction = void Function( | |
| ffi.Pointer<ffi.Char>, | |
| ); | |
| typedef sk_POLICYINFO_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYINFO_cmp_funcFunction>>; | |
| typedef sk_POLICYINFO_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<POLICYINFO>>, | |
| ffi.Pointer<ffi.Pointer<POLICYINFO>>, | |
| ); | |
| typedef Dartsk_POLICYINFO_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<POLICYINFO>>, | |
| ffi.Pointer<ffi.Pointer<POLICYINFO>>, | |
| ); | |
| typedef sk_POLICYINFO_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYINFO_copy_funcFunction>>; | |
| typedef sk_POLICYINFO_copy_funcFunction = ffi.Pointer<POLICYINFO> Function( | |
| ffi.Pointer<POLICYINFO>, | |
| ); | |
| typedef sk_POLICYINFO_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYINFO_delete_if_funcFunction>>; | |
| typedef sk_POLICYINFO_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<POLICYINFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_POLICYINFO_delete_if_funcFunction = int Function( | |
| ffi.Pointer<POLICYINFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_POLICYINFO_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYINFO_free_funcFunction>>; | |
| typedef sk_POLICYINFO_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<POLICYINFO>, | |
| ); | |
| typedef Dartsk_POLICYINFO_free_funcFunction = void Function( | |
| ffi.Pointer<POLICYINFO>, | |
| ); | |
| typedef sk_POLICYQUALINFO_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYQUALINFO_cmp_funcFunction>>; | |
| typedef sk_POLICYQUALINFO_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<POLICYQUALINFO>>, | |
| ffi.Pointer<ffi.Pointer<POLICYQUALINFO>>, | |
| ); | |
| typedef Dartsk_POLICYQUALINFO_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<POLICYQUALINFO>>, | |
| ffi.Pointer<ffi.Pointer<POLICYQUALINFO>>, | |
| ); | |
| typedef sk_POLICYQUALINFO_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYQUALINFO_copy_funcFunction>>; | |
| typedef sk_POLICYQUALINFO_copy_funcFunction = | |
| ffi.Pointer<POLICYQUALINFO> Function(ffi.Pointer<POLICYQUALINFO>); | |
| typedef sk_POLICYQUALINFO_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYQUALINFO_delete_if_funcFunction>>; | |
| typedef sk_POLICYQUALINFO_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<POLICYQUALINFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_POLICYQUALINFO_delete_if_funcFunction = int Function( | |
| ffi.Pointer<POLICYQUALINFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_POLICYQUALINFO_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICYQUALINFO_free_funcFunction>>; | |
| typedef sk_POLICYQUALINFO_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<POLICYQUALINFO>, | |
| ); | |
| typedef Dartsk_POLICYQUALINFO_free_funcFunction = void Function( | |
| ffi.Pointer<POLICYQUALINFO>, | |
| ); | |
| typedef sk_POLICY_MAPPING_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICY_MAPPING_cmp_funcFunction>>; | |
| typedef sk_POLICY_MAPPING_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<POLICY_MAPPING>>, | |
| ffi.Pointer<ffi.Pointer<POLICY_MAPPING>>, | |
| ); | |
| typedef Dartsk_POLICY_MAPPING_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<POLICY_MAPPING>>, | |
| ffi.Pointer<ffi.Pointer<POLICY_MAPPING>>, | |
| ); | |
| typedef sk_POLICY_MAPPING_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICY_MAPPING_copy_funcFunction>>; | |
| typedef sk_POLICY_MAPPING_copy_funcFunction = | |
| ffi.Pointer<POLICY_MAPPING> Function(ffi.Pointer<POLICY_MAPPING>); | |
| typedef sk_POLICY_MAPPING_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICY_MAPPING_delete_if_funcFunction>>; | |
| typedef sk_POLICY_MAPPING_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<POLICY_MAPPING>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_POLICY_MAPPING_delete_if_funcFunction = int Function( | |
| ffi.Pointer<POLICY_MAPPING>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_POLICY_MAPPING_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_POLICY_MAPPING_free_funcFunction>>; | |
| typedef sk_POLICY_MAPPING_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<POLICY_MAPPING>, | |
| ); | |
| typedef Dartsk_POLICY_MAPPING_free_funcFunction = void Function( | |
| ffi.Pointer<POLICY_MAPPING>, | |
| ); | |
| typedef sk_X509_ALGOR_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ALGOR_cmp_funcFunction>>; | |
| typedef sk_X509_ALGOR_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ); | |
| typedef Dartsk_X509_ALGOR_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ffi.Pointer<ffi.Pointer<X509_ALGOR>>, | |
| ); | |
| typedef sk_X509_ALGOR_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ALGOR_copy_funcFunction>>; | |
| typedef sk_X509_ALGOR_copy_funcFunction = ffi.Pointer<X509_ALGOR> Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ); | |
| typedef sk_X509_ALGOR_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ALGOR_delete_if_funcFunction>>; | |
| typedef sk_X509_ALGOR_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_ALGOR_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_ALGOR_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ALGOR_free_funcFunction>>; | |
| typedef sk_X509_ALGOR_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ); | |
| typedef Dartsk_X509_ALGOR_free_funcFunction = void Function( | |
| ffi.Pointer<X509_ALGOR>, | |
| ); | |
| typedef sk_X509_ATTRIBUTE_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ATTRIBUTE_cmp_funcFunction>>; | |
| typedef sk_X509_ATTRIBUTE_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ); | |
| typedef Dartsk_X509_ATTRIBUTE_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ffi.Pointer<ffi.Pointer<X509_ATTRIBUTE>>, | |
| ); | |
| typedef sk_X509_ATTRIBUTE_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ATTRIBUTE_copy_funcFunction>>; | |
| typedef sk_X509_ATTRIBUTE_copy_funcFunction = | |
| ffi.Pointer<X509_ATTRIBUTE> Function(ffi.Pointer<X509_ATTRIBUTE>); | |
| typedef sk_X509_ATTRIBUTE_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ATTRIBUTE_delete_if_funcFunction>>; | |
| typedef sk_X509_ATTRIBUTE_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_ATTRIBUTE_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_ATTRIBUTE_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_ATTRIBUTE_free_funcFunction>>; | |
| typedef sk_X509_ATTRIBUTE_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ); | |
| typedef Dartsk_X509_ATTRIBUTE_free_funcFunction = void Function( | |
| ffi.Pointer<X509_ATTRIBUTE>, | |
| ); | |
| typedef sk_X509_CRL_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_CRL_cmp_funcFunction>>; | |
| typedef sk_X509_CRL_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ); | |
| typedef Dartsk_X509_CRL_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ffi.Pointer<ffi.Pointer<X509_CRL>>, | |
| ); | |
| typedef sk_X509_CRL_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_CRL_copy_funcFunction>>; | |
| typedef sk_X509_CRL_copy_funcFunction = ffi.Pointer<X509_CRL> Function( | |
| ffi.Pointer<X509_CRL>, | |
| ); | |
| typedef sk_X509_CRL_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_CRL_delete_if_funcFunction>>; | |
| typedef sk_X509_CRL_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_CRL_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_CRL>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// Certificate revocation lists. | |
| /// | |
| /// An `X509_CRL` object represents an X.509 certificate revocation list (CRL), | |
| /// defined in RFC 5280. A CRL is a signed list of certificates, the | |
| /// revokedCertificates field, which are no longer considered valid. Each entry | |
| /// of this list is represented with an `X509_REVOKED` object, documented in the | |
| /// "CRL entries" section below. | |
| /// | |
| /// Although an `X509_CRL` is a mutable object, mutating an `X509_CRL` or its | |
| /// `X509_REVOKED`s can give incorrect results. Callers typically obtain | |
| /// `X509_CRL`s by parsing some input with `d2i_X509_CRL`, etc. Such objects | |
| /// carry information such as the serialized TBSCertList and decoded extensions, | |
| /// which will become inconsistent when mutated. | |
| /// | |
| /// Instead, mutation functions should only be used when issuing new CRLs, as | |
| /// described in a later section. | |
| typedef sk_X509_CRL_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_CRL_free_funcFunction>>; | |
| typedef sk_X509_CRL_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_CRL>, | |
| ); | |
| typedef Dartsk_X509_CRL_free_funcFunction = void Function( | |
| ffi.Pointer<X509_CRL>, | |
| ); | |
| typedef sk_X509_EXTENSION_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_EXTENSION_cmp_funcFunction>>; | |
| typedef sk_X509_EXTENSION_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ); | |
| typedef Dartsk_X509_EXTENSION_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ffi.Pointer<ffi.Pointer<X509_EXTENSION>>, | |
| ); | |
| typedef sk_X509_EXTENSION_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_EXTENSION_copy_funcFunction>>; | |
| typedef sk_X509_EXTENSION_copy_funcFunction = | |
| ffi.Pointer<X509_EXTENSION> Function(ffi.Pointer<X509_EXTENSION>); | |
| typedef sk_X509_EXTENSION_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_EXTENSION_delete_if_funcFunction>>; | |
| typedef sk_X509_EXTENSION_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_EXTENSION_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_EXTENSION>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_EXTENSION_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_EXTENSION_free_funcFunction>>; | |
| typedef sk_X509_EXTENSION_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_EXTENSION>, | |
| ); | |
| typedef Dartsk_X509_EXTENSION_free_funcFunction = void Function( | |
| ffi.Pointer<X509_EXTENSION>, | |
| ); | |
| typedef sk_X509_INFO_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_INFO_cmp_funcFunction>>; | |
| typedef sk_X509_INFO_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_INFO>>, | |
| ffi.Pointer<ffi.Pointer<X509_INFO>>, | |
| ); | |
| typedef Dartsk_X509_INFO_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_INFO>>, | |
| ffi.Pointer<ffi.Pointer<X509_INFO>>, | |
| ); | |
| typedef sk_X509_INFO_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_INFO_copy_funcFunction>>; | |
| typedef sk_X509_INFO_copy_funcFunction = ffi.Pointer<X509_INFO> Function( | |
| ffi.Pointer<X509_INFO>, | |
| ); | |
| typedef sk_X509_INFO_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_INFO_delete_if_funcFunction>>; | |
| typedef sk_X509_INFO_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_INFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_INFO_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_INFO>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_INFO_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_INFO_free_funcFunction>>; | |
| typedef sk_X509_INFO_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_INFO>, | |
| ); | |
| typedef Dartsk_X509_INFO_free_funcFunction = void Function( | |
| ffi.Pointer<X509_INFO>, | |
| ); | |
| typedef sk_X509_NAME_ENTRY_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_ENTRY_cmp_funcFunction>>; | |
| typedef sk_X509_NAME_ENTRY_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ); | |
| typedef Dartsk_X509_NAME_ENTRY_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ffi.Pointer<ffi.Pointer<X509_NAME_ENTRY>>, | |
| ); | |
| typedef sk_X509_NAME_ENTRY_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_ENTRY_copy_funcFunction>>; | |
| typedef sk_X509_NAME_ENTRY_copy_funcFunction = | |
| ffi.Pointer<X509_NAME_ENTRY> Function(ffi.Pointer<X509_NAME_ENTRY>); | |
| typedef sk_X509_NAME_ENTRY_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_ENTRY_delete_if_funcFunction>>; | |
| typedef sk_X509_NAME_ENTRY_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_NAME_ENTRY_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_NAME_ENTRY_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_ENTRY_free_funcFunction>>; | |
| typedef sk_X509_NAME_ENTRY_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ); | |
| typedef Dartsk_X509_NAME_ENTRY_free_funcFunction = void Function( | |
| ffi.Pointer<X509_NAME_ENTRY>, | |
| ); | |
| typedef sk_X509_NAME_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_cmp_funcFunction>>; | |
| typedef sk_X509_NAME_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME>>, | |
| ffi.Pointer<ffi.Pointer<X509_NAME>>, | |
| ); | |
| typedef Dartsk_X509_NAME_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_NAME>>, | |
| ffi.Pointer<ffi.Pointer<X509_NAME>>, | |
| ); | |
| typedef sk_X509_NAME_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_copy_funcFunction>>; | |
| typedef sk_X509_NAME_copy_funcFunction = ffi.Pointer<X509_NAME> Function( | |
| ffi.Pointer<X509_NAME>, | |
| ); | |
| typedef sk_X509_NAME_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_delete_if_funcFunction>>; | |
| typedef sk_X509_NAME_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_NAME_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_NAME>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_NAME_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_NAME_free_funcFunction>>; | |
| typedef sk_X509_NAME_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_NAME>, | |
| ); | |
| typedef Dartsk_X509_NAME_free_funcFunction = void Function( | |
| ffi.Pointer<X509_NAME>, | |
| ); | |
| typedef sk_X509_OBJECT_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_OBJECT_cmp_funcFunction>>; | |
| typedef sk_X509_OBJECT_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<X509_OBJECT>>, | |
| ); | |
| typedef Dartsk_X509_OBJECT_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_OBJECT>>, | |
| ffi.Pointer<ffi.Pointer<X509_OBJECT>>, | |
| ); | |
| typedef sk_X509_OBJECT_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_OBJECT_copy_funcFunction>>; | |
| typedef sk_X509_OBJECT_copy_funcFunction = ffi.Pointer<X509_OBJECT> Function( | |
| ffi.Pointer<X509_OBJECT>, | |
| ); | |
| typedef sk_X509_OBJECT_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_OBJECT_delete_if_funcFunction>>; | |
| typedef sk_X509_OBJECT_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_OBJECT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_OBJECT_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_OBJECT>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_OBJECT_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_OBJECT_free_funcFunction>>; | |
| typedef sk_X509_OBJECT_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_OBJECT>, | |
| ); | |
| typedef Dartsk_X509_OBJECT_free_funcFunction = void Function( | |
| ffi.Pointer<X509_OBJECT>, | |
| ); | |
| typedef sk_X509_REVOKED_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_REVOKED_cmp_funcFunction>>; | |
| typedef sk_X509_REVOKED_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ); | |
| typedef Dartsk_X509_REVOKED_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ffi.Pointer<ffi.Pointer<X509_REVOKED>>, | |
| ); | |
| typedef sk_X509_REVOKED_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_REVOKED_copy_funcFunction>>; | |
| typedef sk_X509_REVOKED_copy_funcFunction = ffi.Pointer<X509_REVOKED> Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ); | |
| typedef sk_X509_REVOKED_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_REVOKED_delete_if_funcFunction>>; | |
| typedef sk_X509_REVOKED_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_REVOKED_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_X509_REVOKED_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_REVOKED_free_funcFunction>>; | |
| typedef sk_X509_REVOKED_free_funcFunction = ffi.Void Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ); | |
| typedef Dartsk_X509_REVOKED_free_funcFunction = void Function( | |
| ffi.Pointer<X509_REVOKED>, | |
| ); | |
| typedef sk_X509_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_cmp_funcFunction>>; | |
| typedef sk_X509_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ); | |
| typedef Dartsk_X509_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ffi.Pointer<ffi.Pointer<X509>>, | |
| ); | |
| typedef sk_X509_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_copy_funcFunction>>; | |
| typedef sk_X509_copy_funcFunction = ffi.Pointer<X509> Function( | |
| ffi.Pointer<X509>, | |
| ); | |
| typedef sk_X509_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_delete_if_funcFunction>>; | |
| typedef sk_X509_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_X509_delete_if_funcFunction = int Function( | |
| ffi.Pointer<X509>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// Certificates. | |
| /// | |
| /// An `X509` object represents an X.509 certificate, defined in RFC 5280. | |
| /// | |
| /// Although an `X509` is a mutable object, mutating an `X509` can give incorrect | |
| /// results. Callers typically obtain `X509`s by parsing some input with | |
| /// `d2i_X509`, etc. Such objects carry information such as the serialized | |
| /// TBSCertificate and decoded extensions, which will become inconsistent when | |
| /// mutated. | |
| /// | |
| /// Instead, mutation functions should only be used when issuing new | |
| /// certificates, as described in a later section. | |
| typedef sk_X509_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_X509_free_funcFunction>>; | |
| typedef sk_X509_free_funcFunction = ffi.Void Function(ffi.Pointer<X509>); | |
| typedef Dartsk_X509_free_funcFunction = void Function(ffi.Pointer<X509>); | |
| typedef sk_void_cmp_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_void_cmp_funcFunction>>; | |
| typedef sk_void_cmp_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ); | |
| typedef Dartsk_void_cmp_funcFunction = int Function( | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ffi.Pointer<ffi.Pointer<ffi.Void>>, | |
| ); | |
| typedef sk_void_copy_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_void_copy_funcFunction>>; | |
| typedef sk_void_copy_funcFunction = ffi.Pointer<ffi.Void> Function( | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef sk_void_delete_if_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_void_delete_if_funcFunction>>; | |
| typedef sk_void_delete_if_funcFunction = ffi.Int Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| typedef Dartsk_void_delete_if_funcFunction = int Function( | |
| ffi.Pointer<ffi.Void>, | |
| ffi.Pointer<ffi.Void>, | |
| ); | |
| /// We also disable -Wcast-qual. As part of this C-based type erasure setup, \ | |
| /// the wrapper macros need to cast away const in places. In C++, const_cast \ | |
| /// suppresses the warning, but it seemingly cannot be suppressed in C. | |
| typedef sk_void_free_func = | |
| ffi.Pointer<ffi.NativeFunction<sk_void_free_funcFunction>>; | |
| typedef sk_void_free_funcFunction = ffi.Void Function(ffi.Pointer<ffi.Void>); | |
| typedef Dartsk_void_free_funcFunction = void Function(ffi.Pointer<ffi.Void>); | |
| final class spake2_ctx_st extends ffi.Opaque {} | |
| /// spake2_role_t enumerates the different “roles” in SPAKE2. The protocol | |
| /// requires that the symmetry of the two parties be broken so one participant | |
| /// must be “Alice” and the other be “Bob”. | |
| sealed class spake2_role_t { | |
| static const spake2_role_alice = 0; | |
| static const spake2_role_bob = 1; | |
| } | |
| final class srtp_protection_profile_st extends ffi.Opaque {} | |
| final class ssl_cipher_st extends ffi.Opaque {} | |
| final class ssl_credential_st extends ffi.Opaque {} | |
| final class ssl_ctx_st extends ffi.Opaque {} | |
| final class ssl_early_callback_ctx extends ffi.Opaque {} | |
| final class ssl_ech_keys_st extends ffi.Opaque {} | |
| final class ssl_method_st extends ffi.Opaque {} | |
| final class ssl_private_key_method_st extends ffi.Opaque {} | |
| final class ssl_quic_method_st extends ffi.Opaque {} | |
| final class ssl_session_st extends ffi.Opaque {} | |
| final class ssl_st extends ffi.Opaque {} | |
| final class ssl_ticket_aead_method_st extends ffi.Opaque {} | |
| final class st_ERR_FNS extends ffi.Opaque {} | |
| final class stack_st extends ffi.Opaque {} | |
| final class stack_st_ACCESS_DESCRIPTION extends ffi.Opaque {} | |
| /// Integers and enumerated values. | |
| /// | |
| /// INTEGER and ENUMERATED values are represented as `ASN1_STRING`s where the | |
| /// data contains the big-endian encoding of the absolute value of the integer. | |
| /// The sign bit is encoded in the type: non-negative values have a type of | |
| /// `V_ASN1_INTEGER` or `V_ASN1_ENUMERATED`, while negative values have a type of | |
| /// `V_ASN1_NEG_INTEGER` or `V_ASN1_NEG_ENUMERATED`. Note this differs from DER's | |
| /// two's complement representation. | |
| /// | |
| /// The data in the `ASN1_STRING` may not have leading zeros. Note this means | |
| /// zero is represented as the empty string. Parsing functions will never return | |
| /// invalid representations. If an invalid input is constructed, the marshaling | |
| /// functions will skip leading zeros, however other functions, such as | |
| /// `ASN1_INTEGER_cmp` or `ASN1_INTEGER_get`, may not return the correct result. | |
| final class stack_st_ASN1_INTEGER extends ffi.Opaque {} | |
| /// Object identifiers. | |
| /// | |
| /// An `ASN1_OBJECT` represents an ASN.1 OBJECT IDENTIFIER. See also obj.h for | |
| /// additional functions relating to `ASN1_OBJECT`. | |
| /// | |
| /// TODO(davidben): What's the relationship between asn1.h and obj.h? Most of | |
| /// obj.h deals with the large NID table, but then functions like `OBJ_get0_data` | |
| /// or `OBJ_dup` are general `ASN1_OBJECT` functions. | |
| final class stack_st_ASN1_OBJECT extends ffi.Opaque {} | |
| final class stack_st_ASN1_TYPE extends ffi.Opaque {} | |
| /// Allocation and freeing. | |
| final class stack_st_BIO extends ffi.Opaque {} | |
| final class stack_st_CONF_VALUE extends ffi.Opaque {} | |
| /// PKCS#7. | |
| /// | |
| /// This library contains functions for extracting information from PKCS#7 | |
| /// structures (RFC 2315). | |
| final class stack_st_CRYPTO_BUFFER extends ffi.Opaque {} | |
| final class stack_st_DIST_POINT extends ffi.Opaque {} | |
| final class stack_st_GENERAL_NAME extends ffi.Opaque {} | |
| final class stack_st_GENERAL_SUBTREE extends ffi.Opaque {} | |
| final class stack_st_OPENSSL_STRING extends ffi.Opaque {} | |
| final class stack_st_POLICYINFO extends ffi.Opaque {} | |
| final class stack_st_POLICYQUALINFO extends ffi.Opaque {} | |
| final class stack_st_POLICY_MAPPING extends ffi.Opaque {} | |
| final class stack_st_X509 extends ffi.Opaque {} | |
| /// Algorithm identifiers. | |
| /// | |
| /// An `X509_ALGOR` represents an AlgorithmIdentifier structure, used in X.509 | |
| /// to represent signature algorithms and public key algorithms. | |
| final class stack_st_X509_ALGOR extends ffi.Opaque {} | |
| /// Attributes. | |
| /// | |
| /// Unlike certificates and CRLs, CSRs use a separate Attribute structure (RFC | |
| /// 2985, RFC 2986) for extensibility. This is represented by the library as | |
| /// `X509_ATTRIBUTE`. | |
| final class stack_st_X509_ATTRIBUTE extends ffi.Opaque {} | |
| final class stack_st_X509_CRL extends ffi.Opaque {} | |
| /// Extension lists. | |
| /// | |
| /// The following functions manipulate lists of extensions. Most of them have | |
| /// corresponding functions on the containing `X509`, `X509_CRL`, or | |
| /// `X509_REVOKED`. | |
| final class stack_st_X509_EXTENSION extends ffi.Opaque {} | |
| final class stack_st_X509_INFO extends ffi.Opaque {} | |
| final class stack_st_X509_NAME extends ffi.Opaque {} | |
| /// Names. | |
| /// | |
| /// An `X509_NAME` represents an X.509 Name structure (RFC 5280). X.509 names are | |
| /// a complex, hierarchical structure over a collection of attributes. Each name | |
| /// is sequence of relative distinguished names (RDNs), decreasing in | |
| /// specificity. For example, the first RDN may specify the country, while the | |
| /// next RDN may specify a locality. Each RDN is, itself, a set of attributes. | |
| /// Having more than one attribute in an RDN is uncommon, but possible. Within an | |
| /// RDN, attributes have the same level in specificity. Attribute types are | |
| /// OBJECT IDENTIFIERs. This determines the ASN.1 type of the value, which is | |
| /// commonly a string but may be other types. | |
| /// | |
| /// The `X509_NAME` representation flattens this two-level structure into a | |
| /// single list of attributes. Each attribute is stored in an `X509_NAME_ENTRY`, | |
| /// with also maintains the index of the RDN it is part of, accessible via | |
| /// `X509_NAME_ENTRY_set`. This can be used to recover the two-level structure. | |
| /// | |
| /// X.509 names are largely vestigial. Historically, DNS names were parsed out of | |
| /// the subject's common name attribute, but this is deprecated and has since | |
| /// moved to the subject alternative name extension. In modern usage, X.509 names | |
| /// are primarily opaque identifiers to link a certificate with its issuer. | |
| final class stack_st_X509_NAME_ENTRY extends ffi.Opaque {} | |
| final class stack_st_X509_OBJECT extends ffi.Opaque {} | |
| final class stack_st_X509_REVOKED extends ffi.Opaque {} | |
| final class stack_st_void extends ffi.Opaque {} | |
| typedef time_t = ffi.Long; | |
| final class tm extends ffi.Struct { | |
| @ffi.Int() | |
| external int tm_sec; | |
| @ffi.Int() | |
| external int tm_min; | |
| @ffi.Int() | |
| external int tm_hour; | |
| @ffi.Int() | |
| external int tm_mday; | |
| @ffi.Int() | |
| external int tm_mon; | |
| @ffi.Int() | |
| external int tm_year; | |
| @ffi.Int() | |
| external int tm_wday; | |
| @ffi.Int() | |
| external int tm_yday; | |
| @ffi.Int() | |
| external int tm_isdst; | |
| @ffi.Long() | |
| external int tm_gmtoff; | |
| external ffi.Pointer<ffi.Char> tm_zone; | |
| static ffi.Pointer<tm> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int tm_sec, | |
| required int tm_min, | |
| required int tm_hour, | |
| required int tm_mday, | |
| required int tm_mon, | |
| required int tm_year, | |
| required int tm_wday, | |
| required int tm_yday, | |
| required int tm_isdst, | |
| required int tm_gmtoff, | |
| required ffi.Pointer<ffi.Char> tm_zone, | |
| }) => $allocator<tm>() | |
| ..ref.tm_sec = tm_sec | |
| ..ref.tm_min = tm_min | |
| ..ref.tm_hour = tm_hour | |
| ..ref.tm_mday = tm_mday | |
| ..ref.tm_mon = tm_mon | |
| ..ref.tm_year = tm_year | |
| ..ref.tm_wday = tm_wday | |
| ..ref.tm_yday = tm_yday | |
| ..ref.tm_isdst = tm_isdst | |
| ..ref.tm_gmtoff = tm_gmtoff | |
| ..ref.tm_zone = tm_zone; | |
| } | |
| final class trust_token_client_st extends ffi.Opaque {} | |
| final class trust_token_issuer_st extends ffi.Opaque {} | |
| final class trust_token_method_st extends ffi.Opaque {} | |
| final class trust_token_st extends ffi.Opaque {} | |
| /// v3_ext_ctx, aka `X509V3_CTX`, contains additional context information for | |
| /// constructing extensions. Some string formats reference additional values in | |
| /// these objects. It must be initialized with `X509V3_set_ctx` or | |
| /// `X509V3_set_ctx_test` before use. | |
| final class v3_ext_ctx extends ffi.Struct { | |
| @ffi.Int() | |
| external int flags; | |
| external ffi.Pointer<X509> issuer_cert; | |
| external ffi.Pointer<X509> subject_cert; | |
| external ffi.Pointer<X509_REQ> subject_req; | |
| external ffi.Pointer<X509_CRL> crl; | |
| external ffi.Pointer<CONF> db; | |
| static ffi.Pointer<v3_ext_ctx> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int flags, | |
| required ffi.Pointer<X509> issuer_cert, | |
| required ffi.Pointer<X509> subject_cert, | |
| required ffi.Pointer<X509_REQ> subject_req, | |
| required ffi.Pointer<X509_CRL> crl, | |
| required ffi.Pointer<CONF> db, | |
| }) => $allocator<v3_ext_ctx>() | |
| ..ref.flags = flags | |
| ..ref.issuer_cert = issuer_cert | |
| ..ref.subject_cert = subject_cert | |
| ..ref.subject_req = subject_req | |
| ..ref.crl = crl | |
| ..ref.db = db; | |
| } | |
| /// A v3_ext_method, aka `X509V3_EXT_METHOD`, is a deprecated type which defines | |
| /// a custom extension. | |
| final class v3_ext_method extends ffi.Struct { | |
| /// ext_nid is the NID of the extension. | |
| @ffi.Int() | |
| external int ext_nid; | |
| /// ext_flags is a combination of `X509V3_EXT_*` constants. | |
| @ffi.Int() | |
| external int ext_flags; | |
| /// it determines how values of this extension are allocated, released, parsed, | |
| /// and marshalled. This must be non-NULL. | |
| external ffi.Pointer<ASN1_ITEM_EXP> it; | |
| /// The following functions are ignored in favor of `it`. They are retained in | |
| /// the struct only for source compatibility with existing struct definitions. | |
| external X509V3_EXT_NEW ext_new; | |
| external X509V3_EXT_FREE ext_free; | |
| external X509V3_EXT_D2I d2i; | |
| external X509V3_EXT_I2D i2d; | |
| /// The following functions are used for string extensions. | |
| external X509V3_EXT_I2S i2s; | |
| external X509V3_EXT_S2I s2i; | |
| /// The following functions are used for multi-valued extensions. | |
| external X509V3_EXT_I2V i2v; | |
| external X509V3_EXT_V2I v2i; | |
| /// The following functions are used for "raw" extensions, which implement | |
| /// custom printing behavior. | |
| external X509V3_EXT_I2R i2r; | |
| external X509V3_EXT_R2I r2i; | |
| /// Any extension specific data | |
| external ffi.Pointer<ffi.Void> usr_data; | |
| static ffi.Pointer<v3_ext_method> $allocate( | |
| ffi.Allocator $allocator, { | |
| required int ext_nid, | |
| required int ext_flags, | |
| required ffi.Pointer<ASN1_ITEM_EXP> it, | |
| required X509V3_EXT_NEW ext_new, | |
| required X509V3_EXT_FREE ext_free, | |
| required X509V3_EXT_D2I d2i, | |
| required X509V3_EXT_I2D i2d, | |
| required X509V3_EXT_I2S i2s, | |
| required X509V3_EXT_S2I s2i, | |
| required X509V3_EXT_I2V i2v, | |
| required X509V3_EXT_V2I v2i, | |
| required X509V3_EXT_I2R i2r, | |
| required X509V3_EXT_R2I r2i, | |
| required ffi.Pointer<ffi.Void> usr_data, | |
| }) => $allocator<v3_ext_method>() | |
| ..ref.ext_nid = ext_nid | |
| ..ref.ext_flags = ext_flags | |
| ..ref.it = it | |
| ..ref.ext_new = ext_new | |
| ..ref.ext_free = ext_free | |
| ..ref.d2i = d2i | |
| ..ref.i2d = i2d | |
| ..ref.i2s = i2s | |
| ..ref.s2i = s2i | |
| ..ref.i2v = i2v | |
| ..ref.v2i = v2i | |
| ..ref.i2r = i2r | |
| ..ref.r2i = r2i | |
| ..ref.usr_data = usr_data; | |
| } | |
| final class x509_attributes_st extends ffi.Opaque {} | |
| final class x509_lookup_method_st extends ffi.Opaque {} | |
| final class x509_lookup_st extends ffi.Opaque {} | |
| final class x509_object_st extends ffi.Opaque {} | |
| final class x509_purpose_st extends ffi.Opaque {} | |
| final class x509_revoked_st extends ffi.Opaque {} | |
| final class x509_st extends ffi.Opaque {} | |
| final class x509_store_ctx_st extends ffi.Opaque {} | |
| final class x509_store_st extends ffi.Opaque {} |