diff --git a/CHANGELOG.md b/CHANGELOG.md index d80865a57..2812cfbd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 0.6.2-wip * Fixed JS interop to enable WebAssembly. * Fixed native RSA public-key JWK imports to reject private key material. +* Upgrade `ffigen` and `hooks` versions. # 0.6.1 * Added Dart native build hooks and native asset lookup for the bundled diff --git a/example/webcrypto_demo_flutter_app/lib/main.dart b/example/webcrypto_demo_flutter_app/lib/main.dart index a96138829..3462bfe71 100644 --- a/example/webcrypto_demo_flutter_app/lib/main.dart +++ b/example/webcrypto_demo_flutter_app/lib/main.dart @@ -24,11 +24,13 @@ void main() { } class MyApp extends StatefulWidget { + const MyApp({super.key}); + @override - _MyAppState createState() => _MyAppState(); + MyAppState createState() => MyAppState(); } -class _MyAppState extends State { +class MyAppState extends State { String _output = '-'; final _input = TextEditingController(); @@ -37,29 +39,31 @@ class _MyAppState extends State { return MaterialApp( home: Scaffold( appBar: AppBar(title: const Text('SHA-1 Hashing')), - body: Container( - padding: EdgeInsets.all(10), - child: Column( - children: [ - Text( - 'Compute SHA-1 hash of input below.\n\n' - 'Click the button to refresh the computed output.' - 'Output will be displayed in hexadecimal encoding.', - ), - Text( - 'input', - textScaleFactor: 1.2, - style: TextStyle(fontWeight: FontWeight.bold), - ), - _textEntry(), - SizedBox(height: 50), - Text( - 'output', - textScaleFactor: 1.2, - style: TextStyle(fontWeight: FontWeight.bold), - ), - Text('$_output'), - ], + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(10), + child: Column( + children: [ + Text( + 'Compute SHA-1 hash of input below.\n\n' + 'Click the button to refresh the computed output.' + 'Output will be displayed in hexadecimal encoding.', + ), + Text( + 'input', + textScaler: TextScaler.linear(1.2), + style: TextStyle(fontWeight: FontWeight.bold), + ), + _textEntry(), + SizedBox(height: 20), + Text( + 'output', + textScaler: TextScaler.linear(1.2), + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text(_output), + ], + ), ), ), ), diff --git a/lib/src/boringssl/bindings/ffigen.yaml b/lib/src/boringssl/bindings/ffigen.yaml deleted file mode 100644 index 444fdc066..000000000 --- a/lib/src/boringssl/bindings/ffigen.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: WebCrypto -description: 'Bindings to src/webcrypto.h.' -output: generated_bindings.dart -ffi-native: - assetId: 'package:webcrypto/webcrypto.dart' -headers: - entry-points: - - ../../../../src/webcrypto.h -comments: - style: any - length: full -sort: true -macros: - include: [] -enums: - include: [] -unnamed-enums: - include: [] -globals: - include: [] -structs: - include: [] - dependency-only: opaque -functions: - include: - - webcrypto_get_CBB_size -preamble: | - // Copyright 2021 Google LLC - // - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // - // http://www.apache.org/licenses/LICENSE-2.0 - // - // Unless required by applicable law or agreed to in writing, software - // distributed under the License is distributed on an "AS IS" BASIS, - // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - // See the License for the specific language governing permissions and - // limitations under the License. - // - // ignore_for_file: unused_element - // ignore_for_file: non_constant_identifier_names diff --git a/lib/src/boringssl/bindings/generated_bindings.dart b/lib/src/boringssl/bindings/generated_bindings.dart index decbb4a9f..10fe0720b 100644 --- a/lib/src/boringssl/bindings/generated_bindings.dart +++ b/lib/src/boringssl/bindings/generated_bindings.dart @@ -18,12 +18,12 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -// ignore_for_file: type=lint +// ignore_for_file: type=lint, unused_import, deprecated_member_use_from_same_package +@ffi.DefaultAsset('package:webcrypto/webcrypto.dart') +library; + import 'dart:ffi' as ffi; /// Helper function to get the size of CBB structure for FFI allocation. -@ffi.Native( - symbol: 'webcrypto_get_CBB_size', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native() external int webcrypto_get_CBB_size(); diff --git a/lib/src/third_party/boringssl/ffigen.yaml b/lib/src/third_party/boringssl/ffigen.yaml deleted file mode 100644 index 2ba91c638..000000000 --- a/lib/src/third_party/boringssl/ffigen.yaml +++ /dev/null @@ -1,266 +0,0 @@ -name: BoringSsl -description: 'Bindings to BoringSSL.' -language: c -output: 'generated_bindings.dart' -ffi-native: - assetId: 'package:webcrypto/webcrypto.dart' -headers: - entry-points: - - '../../../../third_party/boringssl/src/include/openssl/aead.h' - - '../../../../third_party/boringssl/src/include/openssl/aes.h' - - '../../../../third_party/boringssl/src/include/openssl/bn.h' - - '../../../../third_party/boringssl/src/include/openssl/bytestring.h' - - '../../../../third_party/boringssl/src/include/openssl/cipher.h' - - '../../../../third_party/boringssl/src/include/openssl/crypto.h' - - '../../../../third_party/boringssl/src/include/openssl/digest.h' - - '../../../../third_party/boringssl/src/include/openssl/ec.h' - - '../../../../third_party/boringssl/src/include/openssl/ecdh.h' - - '../../../../third_party/boringssl/src/include/openssl/ec_key.h' - - '../../../../third_party/boringssl/src/include/openssl/ecdsa.h' - - '../../../../third_party/boringssl/src/include/openssl/err.h' - - '../../../../third_party/boringssl/src/include/openssl/evp.h' - - '../../../../third_party/boringssl/src/include/openssl/hkdf.h' - - '../../../../third_party/boringssl/src/include/openssl/hmac.h' - - '../../../../third_party/boringssl/src/include/openssl/mem.h' - - '../../../../third_party/boringssl/src/include/openssl/rand.h' - - '../../../../third_party/boringssl/src/include/openssl/rsa.h' -compiler-opts: - - '-Ithird_party/boringssl/src/include' - # Make Clang see BoringSSL's prefixed declarations instead of recording the - # original names with `#pragma redefine_extname`. - - '-DBORINGSSL_PREFIX=webcrypto' - - '-U__PRAGMA_REDEFINE_EXTNAME' -comments: - style: any - length: full -sort: true -macros: - include: - - AES_BLOCK_SIZE - - EC_PKEY_NO_PUBKEY - - EVP_PKEY_EC - - EVP_PKEY_RSA - - HKDF_R_OUTPUT_TOO_LARGE - - NID_secp384r1 - - NID_secp521r1 - - NID_X9_62_prime256v1 - - RSA_PKCS1_OAEP_PADDING - - RSA_PKCS1_PADDING - - RSA_PKCS1_PSS_PADDING -enums: - include: - - point_conversion_form_t -unnamed-enums: - include: - - ERR_LIB_HKDF -structs: - include: - - cbs_st - - cbb_st - dependency-only: opaque -unions: - include: [] - dependency-only: opaque -globals: - include: [] -functions: - rename: - 'webcrypto_(.*)': '$1' - include: - # Source of truth for BoringSSL entry points bound from Dart. - - webcrypto_BN_bin2bn - - webcrypto_BN_bn2bin_padded - - webcrypto_BN_free - - webcrypto_BN_new - - webcrypto_BN_num_bytes - - webcrypto_BN_set_word - - webcrypto_CBB_cleanup - - webcrypto_CBB_data - - webcrypto_CBB_flush - - webcrypto_CBB_init - - webcrypto_CBB_len - - webcrypto_CBB_zero - - webcrypto_CRYPTO_memcmp - - webcrypto_ECDH_compute_key - - webcrypto_ECDSA_SIG_free - - webcrypto_ECDSA_SIG_get0 - - webcrypto_ECDSA_SIG_marshal - - webcrypto_ECDSA_SIG_new - - webcrypto_ECDSA_SIG_parse - - webcrypto_EC_GROUP_get0_order - - webcrypto_EC_GROUP_get_curve_name - - webcrypto_EC_GROUP_get_degree - - webcrypto_EC_KEY_check_key - - webcrypto_EC_KEY_free - - webcrypto_EC_KEY_generate_key - - webcrypto_EC_KEY_get0_group - - webcrypto_EC_KEY_get0_private_key - - webcrypto_EC_KEY_get0_public_key - - webcrypto_EC_KEY_get_enc_flags - - webcrypto_EC_KEY_new_by_curve_name - - webcrypto_EC_KEY_set_enc_flags - - webcrypto_EC_KEY_set_private_key - - webcrypto_EC_KEY_set_public_key - - webcrypto_EC_KEY_set_public_key_affine_coordinates - - webcrypto_EC_POINT_free - - webcrypto_EC_POINT_get_affine_coordinates_GFp - - webcrypto_EC_POINT_new - - webcrypto_EC_POINT_oct2point - - webcrypto_EC_POINT_point2cbb - - webcrypto_ERR_clear_error - - webcrypto_ERR_error_string_n - - webcrypto_ERR_get_error - - webcrypto_ERR_peek_error - - webcrypto_EVP_aead_aes_128_gcm - - webcrypto_EVP_aead_aes_256_gcm - - webcrypto_EVP_AEAD_CTX_free - - webcrypto_EVP_AEAD_CTX_new - - webcrypto_EVP_AEAD_CTX_open - - webcrypto_EVP_AEAD_CTX_seal - - webcrypto_EVP_AEAD_max_overhead - - webcrypto_EVP_aes_128_cbc - - webcrypto_EVP_aes_128_ctr - - webcrypto_EVP_aes_256_cbc - - webcrypto_EVP_aes_256_ctr - - webcrypto_EVP_CIPHER_CTX_free - - webcrypto_EVP_CIPHER_CTX_new - - webcrypto_EVP_CipherFinal_ex - - webcrypto_EVP_CipherInit_ex - - webcrypto_EVP_CIPHER_iv_length - - webcrypto_EVP_CipherUpdate - - webcrypto_EVP_DigestFinal - - webcrypto_EVP_DigestInit - - webcrypto_EVP_DigestSignFinal - - webcrypto_EVP_DigestSignInit - - webcrypto_EVP_DigestSignUpdate - - webcrypto_EVP_DigestUpdate - - webcrypto_EVP_DigestVerifyFinal - - webcrypto_EVP_DigestVerifyInit - - webcrypto_EVP_DigestVerifyUpdate - - webcrypto_EVP_marshal_private_key - - webcrypto_EVP_marshal_public_key - - webcrypto_EVP_MD_CTX_free - - webcrypto_EVP_MD_CTX_new - - webcrypto_EVP_MD_CTX_size - - webcrypto_EVP_parse_private_key - - webcrypto_EVP_parse_public_key - - webcrypto_EVP_PKEY_CTX_free - - webcrypto_EVP_PKEY_CTX_new - - webcrypto_EVP_PKEY_CTX_set0_rsa_oaep_label - - webcrypto_EVP_PKEY_CTX_set_rsa_mgf1_md - - webcrypto_EVP_PKEY_CTX_set_rsa_oaep_md - - webcrypto_EVP_PKEY_CTX_set_rsa_padding - - webcrypto_EVP_PKEY_CTX_set_rsa_pss_saltlen - - webcrypto_EVP_PKEY_decrypt - - webcrypto_EVP_PKEY_decrypt_init - - webcrypto_EVP_PKEY_encrypt - - webcrypto_EVP_PKEY_encrypt_init - - webcrypto_EVP_PKEY_free - - webcrypto_EVP_PKEY_get1_EC_KEY - - webcrypto_EVP_PKEY_get1_RSA - - webcrypto_EVP_PKEY_id - - webcrypto_EVP_PKEY_new - - webcrypto_EVP_PKEY_set1_EC_KEY - - webcrypto_EVP_PKEY_set1_RSA - - webcrypto_EVP_sha1 - - webcrypto_EVP_sha256 - - webcrypto_EVP_sha384 - - webcrypto_EVP_sha512 - - webcrypto_HKDF - - webcrypto_HMAC_CTX_free - - webcrypto_HMAC_CTX_new - - webcrypto_HMAC_Final - - webcrypto_HMAC_Init_ex - - webcrypto_HMAC_size - - webcrypto_HMAC_Update - - webcrypto_OPENSSL_malloc - - webcrypto_PKCS5_PBKDF2_HMAC - - webcrypto_RAND_bytes - - webcrypto_RSA_check_key - - webcrypto_RSA_free - - webcrypto_RSA_generate_key_ex - - webcrypto_RSA_get0_crt_params - - webcrypto_RSA_get0_factors - - webcrypto_RSA_get0_key - - webcrypto_RSA_new - - webcrypto_RSAPublicKey_dup - - webcrypto_RSA_set0_crt_params - - webcrypto_RSA_set0_factors - - webcrypto_RSA_set0_key - # These are referenced, just need to be sorted right. - - webcrypto_OPENSSL_free - - webcrypto_OPENSSL_memdup - - webcrypto_EVP_MD_size - # Not used but maybe they should be: - - webcrypto_EVP_AEAD_nonce_length - - webcrypto_EVP_AEAD_max_tag_len - # Not used by nice to have, maybe, or maybe we remove / comment them out - - webcrypto_EVP_AEAD_key_length - - webcrypto_BN_value_one - - webcrypto_BN_add - - webcrypto_BN_sub - - webcrypto_BN_cmp - - webcrypto_BN_lshift - - webcrypto_EVP_CIPHER_block_size - - webcrypto_EC_GROUP_new_by_curve_name - - webcrypto_EC_GROUP_free - - webcrypto_EVP_PKEY_set_type - # Self testing only.. - - webcrypto_BORINGSSL_self_test -preamble: | - /* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - // 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 diff --git a/lib/src/third_party/boringssl/generated_bindings.dart b/lib/src/third_party/boringssl/generated_bindings.dart index cc237037b..b1fdb5da8 100644 --- a/lib/src/third_party/boringssl/generated_bindings.dart +++ b/lib/src/third_party/boringssl/generated_bindings.dart @@ -58,7 +58,10 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. -// ignore_for_file: type=lint +// ignore_for_file: type=lint, unused_import, deprecated_member_use_from_same_package +@ffi.DefaultAsset('package:webcrypto/webcrypto.dart') +library; + import 'dart:ffi' as ffi; /// BN_add sets |r| = |a| + |b|, where |r| may be the same pointer as either |a| @@ -69,7 +72,7 @@ import 'dart:ffi' as ffi; ffi.Pointer, ffi.Pointer, ) ->(symbol: 'webcrypto_BN_add', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_BN_add') external int BN_add( ffi.Pointer r, ffi.Pointer a, @@ -86,9 +89,9 @@ external int BN_add( ffi.Size, ffi.Pointer, ) ->(symbol: 'webcrypto_BN_bin2bn', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_BN_bin2bn') external ffi.Pointer BN_bin2bn( - ffi.Pointer in1, + ffi.Pointer in$, int len, ffi.Pointer ret, ); @@ -99,44 +102,34 @@ external ffi.Pointer BN_bin2bn( /// returns 0. Otherwise, it returns 1. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Pointer) ->( - symbol: 'webcrypto_BN_bn2bin_padded', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_BN_bn2bin_padded') external int BN_bn2bin_padded( ffi.Pointer out, int len, - ffi.Pointer in1, + ffi.Pointer in$, ); /// 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. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_BN_cmp', - assetId: 'package:webcrypto/webcrypto.dart', ) external int BN_cmp(ffi.Pointer a, ffi.Pointer b); /// BN_free frees the data referenced by |bn| and, if |bn| was originally /// allocated on the heap, frees |bn| also. -@ffi.Native)>( - symbol: 'webcrypto_BN_free', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native)>(symbol: 'webcrypto_BN_free') external void BN_free(ffi.Pointer bn); /// 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. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) ->(symbol: 'webcrypto_BN_lshift', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_BN_lshift') external int BN_lshift(ffi.Pointer r, ffi.Pointer a, int n); /// BN_new creates a new, allocated BIGNUM and initialises it. -@ffi.Native Function()>( - symbol: 'webcrypto_BN_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_BN_new') external ffi.Pointer BN_new(); /// BN_num_bytes returns the minimum number of bytes needed to represent the @@ -147,7 +140,6 @@ external ffi.Pointer BN_new(); /// will always fit in |int|. @ffi.Native)>( symbol: 'webcrypto_BN_num_bytes', - assetId: 'package:webcrypto/webcrypto.dart', ) external int BN_num_bytes(ffi.Pointer bn); @@ -155,7 +147,6 @@ external int BN_num_bytes(ffi.Pointer bn); /// allocation failure. @ffi.Native, BN_ULONG)>( symbol: 'webcrypto_BN_set_word', - assetId: 'package:webcrypto/webcrypto.dart', ) external int BN_set_word(ffi.Pointer bn, int value); @@ -167,7 +158,7 @@ external int BN_set_word(ffi.Pointer bn, int value); ffi.Pointer, ffi.Pointer, ) ->(symbol: 'webcrypto_BN_sub', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_BN_sub') external int BN_sub( ffi.Pointer r, ffi.Pointer a, @@ -175,19 +166,13 @@ external int BN_sub( ); /// BN_value_one returns a static BIGNUM with value 1. -@ffi.Native Function()>( - symbol: 'webcrypto_BN_value_one', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_BN_value_one') external ffi.Pointer BN_value_one(); /// 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. -@ffi.Native( - symbol: 'webcrypto_BORINGSSL_self_test', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native(symbol: 'webcrypto_BORINGSSL_self_test') external int BORINGSSL_self_test(); /// CBB_cleanup frees all resources owned by |cbb| and other |CBB| objects @@ -199,7 +184,6 @@ external int BORINGSSL_self_test(); /// |CBB_zero|. @ffi.Native)>( symbol: 'webcrypto_CBB_cleanup', - assetId: 'package:webcrypto/webcrypto.dart', ) external void CBB_cleanup(ffi.Pointer cbb); @@ -210,7 +194,6 @@ external void CBB_cleanup(ffi.Pointer cbb); /// CBB with any active children. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_CBB_data', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer CBB_data(ffi.Pointer cbb); @@ -219,10 +202,7 @@ external ffi.Pointer CBB_data(ffi.Pointer cbb); /// 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. -@ffi.Native)>( - symbol: 'webcrypto_CBB_flush', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native)>(symbol: 'webcrypto_CBB_flush') external int CBB_flush(ffi.Pointer cbb); /// CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as @@ -230,7 +210,6 @@ external int CBB_flush(ffi.Pointer cbb); /// zero on allocation failure. @ffi.Native, ffi.Size)>( symbol: 'webcrypto_CBB_init', - assetId: 'package:webcrypto/webcrypto.dart', ) external int CBB_init(ffi.Pointer cbb, int initial_capacity); @@ -239,20 +218,14 @@ external int CBB_init(ffi.Pointer cbb, int initial_capacity); /// /// To avoid unfinalized length prefixes, it is a fatal error to call this on a /// CBB with any active children. -@ffi.Native)>( - symbol: 'webcrypto_CBB_len', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native)>(symbol: 'webcrypto_CBB_len') external int CBB_len(ffi.Pointer cbb); /// 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|. -@ffi.Native)>( - symbol: 'webcrypto_CBB_zero', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native)>(symbol: 'webcrypto_CBB_zero') external void CBB_zero(ffi.Pointer cbb); /// CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. It @@ -262,10 +235,7 @@ external void CBB_zero(ffi.Pointer cbb); /// non-zero. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_CRYPTO_memcmp', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_CRYPTO_memcmp') external int CRYPTO_memcmp( ffi.Pointer a, ffi.Pointer b, @@ -287,7 +257,7 @@ external int CRYPTO_memcmp( ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer in1, + ffi.Pointer in$, ffi.Size inlen, ffi.Pointer out, ffi.Pointer outlen, @@ -295,10 +265,7 @@ external int CRYPTO_memcmp( > >, ) ->( - symbol: 'webcrypto_ECDH_compute_key', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_ECDH_compute_key') external int ECDH_compute_key( ffi.Pointer out, int outlen, @@ -307,7 +274,7 @@ external int ECDH_compute_key( ffi.Pointer< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer in1, + ffi.Pointer in$, ffi.Size inlen, ffi.Pointer out, ffi.Pointer outlen, @@ -320,7 +287,6 @@ external int ECDH_compute_key( /// ECDSA_SIG_free frees |sig| its member |BIGNUM|s. @ffi.Native)>( symbol: 'webcrypto_ECDSA_SIG_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void ECDSA_SIG_free(ffi.Pointer sig); @@ -332,10 +298,7 @@ external void ECDSA_SIG_free(ffi.Pointer sig); ffi.Pointer>, ffi.Pointer>, ) ->( - symbol: 'webcrypto_ECDSA_SIG_get0', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_ECDSA_SIG_get0') external void ECDSA_SIG_get0( ffi.Pointer sig, ffi.Pointer> out_r, @@ -346,7 +309,6 @@ external void ECDSA_SIG_get0( /// the result to |cbb|. It returns one on success and zero on error. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_ECDSA_SIG_marshal', - assetId: 'package:webcrypto/webcrypto.dart', ) external int ECDSA_SIG_marshal( ffi.Pointer cbb, @@ -356,7 +318,6 @@ external int ECDSA_SIG_marshal( /// ECDSA_SIG_new returns a fresh |ECDSA_SIG| structure or NULL on error. @ffi.Native Function()>( symbol: 'webcrypto_ECDSA_SIG_new', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer ECDSA_SIG_new(); @@ -364,7 +325,6 @@ external ffi.Pointer ECDSA_SIG_new(); /// advances |cbs|. It returns a newly-allocated |ECDSA_SIG| or NULL on error. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_ECDSA_SIG_parse', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer ECDSA_SIG_parse(ffi.Pointer cbs); @@ -376,7 +336,6 @@ external ffi.Pointer ECDSA_SIG_parse(ffi.Pointer cbs); /// either may ignore this function. @ffi.Native)>( symbol: 'webcrypto_EC_GROUP_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EC_GROUP_free(ffi.Pointer group); @@ -384,14 +343,12 @@ external void EC_GROUP_free(ffi.Pointer group); /// |group| that specifies the order of the group. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EC_GROUP_get0_order', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_GROUP_get0_order(ffi.Pointer group); /// EC_GROUP_get_curve_name returns a NID that identifies |group|. @ffi.Native)>( symbol: 'webcrypto_EC_GROUP_get_curve_name', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_GROUP_get_curve_name(ffi.Pointer group); @@ -399,7 +356,6 @@ external int EC_GROUP_get_curve_name(ffi.Pointer group); /// element of the field underlying |group|. @ffi.Native)>( symbol: 'webcrypto_EC_GROUP_get_degree', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_GROUP_get_degree(ffi.Pointer group); @@ -422,7 +378,6 @@ external int EC_GROUP_get_degree(ffi.Pointer group); /// more modern primitives. @ffi.Native Function(ffi.Int)>( symbol: 'webcrypto_EC_GROUP_new_by_curve_name', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_GROUP_new_by_curve_name(int nid); @@ -432,14 +387,12 @@ external ffi.Pointer EC_GROUP_new_by_curve_name(int nid); /// about the problem can be found on the error stack. @ffi.Native)>( symbol: 'webcrypto_EC_KEY_check_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_KEY_check_key(ffi.Pointer key); /// EC_KEY_free frees all the data owned by |key| and |key| itself. @ffi.Native)>( symbol: 'webcrypto_EC_KEY_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EC_KEY_free(ffi.Pointer key); @@ -448,21 +401,18 @@ external void EC_KEY_free(ffi.Pointer key); /// or zero otherwise. @ffi.Native)>( symbol: 'webcrypto_EC_KEY_generate_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_KEY_generate_key(ffi.Pointer key); /// EC_KEY_get0_group returns a pointer to the |EC_GROUP| object inside |key|. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EC_KEY_get0_group', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_KEY_get0_group(ffi.Pointer key); /// EC_KEY_get0_private_key returns a pointer to the private key inside |key|. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EC_KEY_get0_private_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_KEY_get0_private_key(ffi.Pointer key); @@ -470,7 +420,6 @@ external ffi.Pointer EC_KEY_get0_private_key(ffi.Pointer key); /// |key|. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EC_KEY_get0_public_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_KEY_get0_public_key(ffi.Pointer key); @@ -478,7 +427,6 @@ external ffi.Pointer EC_KEY_get0_public_key(ffi.Pointer key); /// bitwise-OR of |EC_PKEY_*| values. @ffi.Native)>( symbol: 'webcrypto_EC_KEY_get_enc_flags', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_KEY_get_enc_flags(ffi.Pointer key); @@ -486,7 +434,6 @@ external int EC_KEY_get_enc_flags(ffi.Pointer key); /// or NULL on error. @ffi.Native Function(ffi.Int)>( symbol: 'webcrypto_EC_KEY_new_by_curve_name', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_KEY_new_by_curve_name(int nid); @@ -494,7 +441,6 @@ external ffi.Pointer EC_KEY_new_by_curve_name(int nid); /// bitwise-OR of |EC_PKEY_*| values. @ffi.Native, ffi.UnsignedInt)>( symbol: 'webcrypto_EC_KEY_set_enc_flags', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EC_KEY_set_enc_flags(ffi.Pointer key, int flags); @@ -503,7 +449,6 @@ external void EC_KEY_set_enc_flags(ffi.Pointer key, int flags); /// configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|). @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EC_KEY_set_private_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_KEY_set_private_key( ffi.Pointer key, @@ -516,7 +461,6 @@ external int EC_KEY_set_private_key( /// |pub| must also belong to that group, and must not be the point at infinity. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EC_KEY_set_public_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EC_KEY_set_public_key( ffi.Pointer key, @@ -532,10 +476,7 @@ external int EC_KEY_set_public_key( ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EC_KEY_set_public_key_affine_coordinates', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EC_KEY_set_public_key_affine_coordinates') external int EC_KEY_set_public_key_affine_coordinates( ffi.Pointer key, ffi.Pointer x, @@ -545,7 +486,6 @@ external int EC_KEY_set_public_key_affine_coordinates( /// EC_POINT_free frees |point| and the data that it points to. @ffi.Native)>( symbol: 'webcrypto_EC_POINT_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EC_POINT_free(ffi.Pointer point); @@ -563,10 +503,7 @@ external void EC_POINT_free(ffi.Pointer point); ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EC_POINT_get_affine_coordinates_GFp', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EC_POINT_get_affine_coordinates_GFp') external int EC_POINT_get_affine_coordinates_GFp( ffi.Pointer group, ffi.Pointer point, @@ -579,7 +516,6 @@ external int EC_POINT_get_affine_coordinates_GFp( /// on error. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EC_POINT_new', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EC_POINT_new(ffi.Pointer group); @@ -595,10 +531,7 @@ external ffi.Pointer EC_POINT_new(ffi.Pointer group); ffi.Size, ffi.Pointer, ) ->( - symbol: 'webcrypto_EC_POINT_oct2point', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EC_POINT_oct2point') external int EC_POINT_oct2point( ffi.Pointer group, ffi.Pointer point, @@ -615,13 +548,10 @@ external int EC_POINT_oct2point( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Int32, + ffi.UnsignedInt, ffi.Pointer, ) ->( - symbol: 'webcrypto_EC_POINT_point2cbb', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EC_POINT_point2cbb') external int EC_POINT_point2cbb( ffi.Pointer out, ffi.Pointer group, @@ -631,10 +561,7 @@ external int EC_POINT_point2cbb( ); /// ERR_clear_error clears the error queue for the current thread. -@ffi.Native( - symbol: 'webcrypto_ERR_clear_error', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native(symbol: 'webcrypto_ERR_clear_error') external void ERR_clear_error(); /// ERR_error_string_n generates a human-readable string representing @@ -650,10 +577,7 @@ external void ERR_clear_error(); /// are ASCII text. @ffi.Native< ffi.Pointer Function(ffi.Uint32, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_ERR_error_string_n', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_ERR_error_string_n') external ffi.Pointer ERR_error_string_n( int packed_error, ffi.Pointer buf, @@ -663,25 +587,18 @@ external ffi.Pointer ERR_error_string_n( /// 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. -@ffi.Native( - symbol: 'webcrypto_ERR_get_error', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native(symbol: 'webcrypto_ERR_get_error') external int ERR_get_error(); /// The "peek" functions act like the |ERR_get_error| functions, above, but they /// do not remove the error from the queue. -@ffi.Native( - symbol: 'webcrypto_ERR_peek_error', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native(symbol: 'webcrypto_ERR_peek_error') external int ERR_peek_error(); /// EVP_AEAD_CTX_free calls |EVP_AEAD_CTX_cleanup| and |OPENSSL_free| on /// |ctx|. @ffi.Native)>( symbol: 'webcrypto_EVP_AEAD_CTX_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EVP_AEAD_CTX_free(ffi.Pointer ctx); @@ -694,10 +611,7 @@ external void EVP_AEAD_CTX_free(ffi.Pointer ctx); ffi.Size, ffi.Size, ) ->( - symbol: 'webcrypto_EVP_AEAD_CTX_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_AEAD_CTX_new') external ffi.Pointer EVP_AEAD_CTX_new( ffi.Pointer aead, ffi.Pointer key, @@ -737,10 +651,7 @@ external ffi.Pointer EVP_AEAD_CTX_new( ffi.Pointer, ffi.Size, ) ->( - symbol: 'webcrypto_EVP_AEAD_CTX_open', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_AEAD_CTX_open') external int EVP_AEAD_CTX_open( ffi.Pointer ctx, ffi.Pointer out, @@ -748,7 +659,7 @@ external int EVP_AEAD_CTX_open( int max_out_len, ffi.Pointer nonce, int nonce_len, - ffi.Pointer in1, + ffi.Pointer in$, int in_len, ffi.Pointer ad, int ad_len, @@ -787,10 +698,7 @@ external int EVP_AEAD_CTX_open( ffi.Pointer, ffi.Size, ) ->( - symbol: 'webcrypto_EVP_AEAD_CTX_seal', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_AEAD_CTX_seal') external int EVP_AEAD_CTX_seal( ffi.Pointer ctx, ffi.Pointer out, @@ -798,7 +706,7 @@ external int EVP_AEAD_CTX_seal( int max_out_len, ffi.Pointer nonce, int nonce_len, - ffi.Pointer in1, + ffi.Pointer in$, int in_len, ffi.Pointer ad, int ad_len, @@ -808,7 +716,6 @@ external int EVP_AEAD_CTX_seal( /// |aead|. @ffi.Native)>( symbol: 'webcrypto_EVP_AEAD_key_length', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_AEAD_key_length(ffi.Pointer aead); @@ -816,7 +723,6 @@ external int EVP_AEAD_key_length(ffi.Pointer aead); /// by the act of sealing data with |aead|. @ffi.Native)>( symbol: 'webcrypto_EVP_AEAD_max_overhead', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_AEAD_max_overhead(ffi.Pointer aead); @@ -825,7 +731,6 @@ external int EVP_AEAD_max_overhead(ffi.Pointer aead); /// |EVP_AEAD_CTX_init|. @ffi.Native)>( symbol: 'webcrypto_EVP_AEAD_max_tag_len', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_AEAD_max_tag_len(ffi.Pointer aead); @@ -833,7 +738,6 @@ external int EVP_AEAD_max_tag_len(ffi.Pointer aead); /// for |aead|. @ffi.Native)>( symbol: 'webcrypto_EVP_AEAD_nonce_length', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_AEAD_nonce_length(ffi.Pointer aead); @@ -841,7 +745,6 @@ external int EVP_AEAD_nonce_length(ffi.Pointer aead); /// |ctx| itself. @ffi.Native)>( symbol: 'webcrypto_EVP_CIPHER_CTX_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EVP_CIPHER_CTX_free(ffi.Pointer ctx); @@ -849,7 +752,6 @@ external void EVP_CIPHER_CTX_free(ffi.Pointer ctx); /// |EVP_CIPHER_CTX_init| and returns it, or NULL on allocation failure. @ffi.Native Function()>( symbol: 'webcrypto_EVP_CIPHER_CTX_new', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_CIPHER_CTX_new(); @@ -857,7 +759,6 @@ external ffi.Pointer EVP_CIPHER_CTX_new(); /// if |cipher| is a stream cipher. @ffi.Native)>( symbol: 'webcrypto_EVP_CIPHER_block_size', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_CIPHER_block_size(ffi.Pointer cipher); @@ -865,7 +766,6 @@ external int EVP_CIPHER_block_size(ffi.Pointer cipher); /// |cipher| doesn't take an IV. @ffi.Native)>( symbol: 'webcrypto_EVP_CIPHER_iv_length', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_CIPHER_iv_length(ffi.Pointer cipher); @@ -880,10 +780,7 @@ external int EVP_CIPHER_iv_length(ffi.Pointer cipher); ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EVP_CipherFinal_ex', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_CipherFinal_ex') external int EVP_CipherFinal_ex( ffi.Pointer ctx, ffi.Pointer out, @@ -906,10 +803,7 @@ external int EVP_CipherFinal_ex( ffi.Pointer, ffi.Int, ) ->( - symbol: 'webcrypto_EVP_CipherInit_ex', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_CipherInit_ex') external int EVP_CipherInit_ex( ffi.Pointer ctx, ffi.Pointer cipher, @@ -936,15 +830,12 @@ external int EVP_CipherInit_ex( ffi.Pointer, ffi.Int, ) ->( - symbol: 'webcrypto_EVP_CipherUpdate', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_CipherUpdate') external int EVP_CipherUpdate( ffi.Pointer ctx, ffi.Pointer out, ffi.Pointer out_len, - ffi.Pointer in1, + ffi.Pointer in$, int in_len, ); @@ -956,10 +847,7 @@ external int EVP_CipherUpdate( ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EVP_DigestFinal', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestFinal') external int EVP_DigestFinal( ffi.Pointer ctx, ffi.Pointer md_out, @@ -970,7 +858,6 @@ external int EVP_DigestFinal( /// initialised before use. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_DigestInit', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_DigestInit( ffi.Pointer ctx, @@ -995,10 +882,7 @@ external int EVP_DigestInit( ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EVP_DigestSignFinal', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestSignFinal') external int EVP_DigestSignFinal( ffi.Pointer ctx, ffi.Pointer out_sig, @@ -1027,10 +911,7 @@ external int EVP_DigestSignFinal( ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EVP_DigestSignInit', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestSignInit') external int EVP_DigestSignInit( ffi.Pointer ctx, ffi.Pointer> pctx, @@ -1047,10 +928,7 @@ external int EVP_DigestSignInit( /// single-shot operation. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_EVP_DigestSignUpdate', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestSignUpdate') external int EVP_DigestSignUpdate( ffi.Pointer ctx, ffi.Pointer data, @@ -1061,10 +939,7 @@ external int EVP_DigestSignUpdate( /// in |ctx|. It returns one. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_EVP_DigestUpdate', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestUpdate') external int EVP_DigestUpdate( ffi.Pointer ctx, ffi.Pointer data, @@ -1080,10 +955,7 @@ external int EVP_DigestUpdate( /// single-shot verification. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_EVP_DigestVerifyFinal', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestVerifyFinal') external int EVP_DigestVerifyFinal( ffi.Pointer ctx, ffi.Pointer sig, @@ -1112,10 +984,7 @@ external int EVP_DigestVerifyFinal( ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_EVP_DigestVerifyInit', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestVerifyInit') external int EVP_DigestVerifyInit( ffi.Pointer ctx, ffi.Pointer> pctx, @@ -1132,10 +1001,7 @@ external int EVP_DigestVerifyInit( /// single-shot verification. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_EVP_DigestVerifyUpdate', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_DigestVerifyUpdate') external int EVP_DigestVerifyUpdate( ffi.Pointer ctx, ffi.Pointer data, @@ -1145,7 +1011,6 @@ external int EVP_DigestVerifyUpdate( /// EVP_MD_CTX_free calls |EVP_MD_CTX_cleanup| and then frees |ctx| itself. @ffi.Native)>( symbol: 'webcrypto_EVP_MD_CTX_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EVP_MD_CTX_free(ffi.Pointer ctx); @@ -1154,7 +1019,6 @@ external void EVP_MD_CTX_free(ffi.Pointer ctx); /// release the resulting object. @ffi.Native Function()>( symbol: 'webcrypto_EVP_MD_CTX_new', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_MD_CTX_new(); @@ -1162,21 +1026,18 @@ external ffi.Pointer EVP_MD_CTX_new(); /// will crash if a digest hasn't been set on |ctx|. @ffi.Native)>( symbol: 'webcrypto_EVP_MD_CTX_size', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_MD_CTX_size(ffi.Pointer ctx); /// EVP_MD_size returns the digest size of |md|, in bytes. @ffi.Native)>( symbol: 'webcrypto_EVP_MD_size', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_MD_size(ffi.Pointer md); /// EVP_PKEY_CTX_free frees |ctx| and the data it owns. @ffi.Native)>( symbol: 'webcrypto_EVP_PKEY_CTX_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EVP_PKEY_CTX_free(ffi.Pointer ctx); @@ -1184,10 +1045,7 @@ external void EVP_PKEY_CTX_free(ffi.Pointer ctx); /// returns the context or NULL on error. @ffi.Native< ffi.Pointer Function(ffi.Pointer, ffi.Pointer) ->( - symbol: 'webcrypto_EVP_PKEY_CTX_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_PKEY_CTX_new') external ffi.Pointer EVP_PKEY_CTX_new( ffi.Pointer pkey, ffi.Pointer e, @@ -1200,10 +1058,7 @@ external ffi.Pointer EVP_PKEY_CTX_new( /// Returns one on success or zero on error. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->( - symbol: 'webcrypto_EVP_PKEY_CTX_set0_rsa_oaep_label', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_PKEY_CTX_set0_rsa_oaep_label') external int EVP_PKEY_CTX_set0_rsa_oaep_label( ffi.Pointer ctx, ffi.Pointer label, @@ -1218,7 +1073,6 @@ external int EVP_PKEY_CTX_set0_rsa_oaep_label( /// default and not call this function. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_CTX_set_rsa_mgf1_md', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_CTX_set_rsa_mgf1_md( ffi.Pointer ctx, @@ -1232,7 +1086,6 @@ external int EVP_PKEY_CTX_set_rsa_mgf1_md( /// TODO(davidben): Remove the default and require callers specify this. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_CTX_set_rsa_oaep_md', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_CTX_set_rsa_oaep_md( ffi.Pointer ctx, @@ -1244,7 +1097,6 @@ external int EVP_PKEY_CTX_set_rsa_oaep_md( /// default, the padding is |RSA_PKCS1_PADDING|. @ffi.Native, ffi.Int)>( symbol: 'webcrypto_EVP_PKEY_CTX_set_rsa_padding', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_CTX_set_rsa_padding( ffi.Pointer ctx, @@ -1264,7 +1116,6 @@ external int EVP_PKEY_CTX_set_rsa_padding( /// Returns one on success or zero on error. @ffi.Native, ffi.Int)>( symbol: 'webcrypto_EVP_PKEY_CTX_set_rsa_pss_saltlen', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_CTX_set_rsa_pss_saltlen( ffi.Pointer ctx, @@ -1289,15 +1140,12 @@ external int EVP_PKEY_CTX_set_rsa_pss_saltlen( ffi.Pointer, ffi.Size, ) ->( - symbol: 'webcrypto_EVP_PKEY_decrypt', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_PKEY_decrypt') external int EVP_PKEY_decrypt( ffi.Pointer ctx, ffi.Pointer out, ffi.Pointer out_len, - ffi.Pointer in1, + ffi.Pointer in$, int in_len, ); @@ -1307,7 +1155,6 @@ external int EVP_PKEY_decrypt( /// It returns one on success or zero on error. @ffi.Native)>( symbol: 'webcrypto_EVP_PKEY_decrypt_init', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_decrypt_init(ffi.Pointer ctx); @@ -1329,15 +1176,12 @@ external int EVP_PKEY_decrypt_init(ffi.Pointer ctx); ffi.Pointer, ffi.Size, ) ->( - symbol: 'webcrypto_EVP_PKEY_encrypt', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_EVP_PKEY_encrypt') external int EVP_PKEY_encrypt( ffi.Pointer ctx, ffi.Pointer out, ffi.Pointer out_len, - ffi.Pointer in1, + ffi.Pointer in$, int in_len, ); @@ -1347,7 +1191,6 @@ external int EVP_PKEY_encrypt( /// It returns one on success or zero on error. @ffi.Native)>( symbol: 'webcrypto_EVP_PKEY_encrypt_init', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_encrypt_init(ffi.Pointer ctx); @@ -1355,19 +1198,16 @@ external int EVP_PKEY_encrypt_init(ffi.Pointer ctx); /// reference count drops to zero. @ffi.Native)>( symbol: 'webcrypto_EVP_PKEY_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void EVP_PKEY_free(ffi.Pointer pkey); @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_get1_EC_KEY', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_PKEY_get1_EC_KEY(ffi.Pointer pkey); @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_get1_RSA', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_PKEY_get1_RSA(ffi.Pointer pkey); @@ -1379,21 +1219,16 @@ external ffi.Pointer EVP_PKEY_get1_RSA(ffi.Pointer pkey); /// |EVP_PKEY_get_ec_curve_nid|. @ffi.Native)>( symbol: 'webcrypto_EVP_PKEY_id', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_id(ffi.Pointer pkey); /// EVP_PKEY_new creates a new, empty public-key object and returns it or NULL /// on allocation failure. -@ffi.Native Function()>( - symbol: 'webcrypto_EVP_PKEY_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_EVP_PKEY_new') external ffi.Pointer EVP_PKEY_new(); @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_set1_EC_KEY', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_set1_EC_KEY( ffi.Pointer pkey, @@ -1428,7 +1263,6 @@ external int EVP_PKEY_set1_EC_KEY( /// callers are exposed to |EVP_PKEY_RSA_PSS| by default. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_PKEY_set1_RSA', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_set1_RSA( ffi.Pointer pkey, @@ -1454,7 +1288,6 @@ external int EVP_PKEY_set1_RSA( /// other values of |type| will result in an error. @ffi.Native, ffi.Int)>( symbol: 'webcrypto_EVP_PKEY_set_type', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_PKEY_set_type(ffi.Pointer pkey, int type); @@ -1467,7 +1300,6 @@ external int EVP_PKEY_set_type(ffi.Pointer pkey, int type); /// parameters, only use 12-byte nonces. @ffi.Native Function()>( symbol: 'webcrypto_EVP_aead_aes_128_gcm', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aead_aes_128_gcm(); @@ -1480,31 +1312,26 @@ external ffi.Pointer EVP_aead_aes_128_gcm(); /// parameters, only use 12-byte nonces. @ffi.Native Function()>( symbol: 'webcrypto_EVP_aead_aes_256_gcm', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aead_aes_256_gcm(); @ffi.Native Function()>( symbol: 'webcrypto_EVP_aes_128_cbc', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aes_128_cbc(); @ffi.Native Function()>( symbol: 'webcrypto_EVP_aes_128_ctr', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aes_128_ctr(); @ffi.Native Function()>( symbol: 'webcrypto_EVP_aes_256_cbc', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aes_256_cbc(); @ffi.Native Function()>( symbol: 'webcrypto_EVP_aes_256_ctr', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_aes_256_ctr(); @@ -1513,7 +1340,6 @@ external ffi.Pointer EVP_aes_256_ctr(); /// success and zero on error. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_marshal_private_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_marshal_private_key( ffi.Pointer cbb, @@ -1525,7 +1351,6 @@ external int EVP_marshal_private_key( /// success and zero on error. @ffi.Native, ffi.Pointer)>( symbol: 'webcrypto_EVP_marshal_public_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int EVP_marshal_public_key( ffi.Pointer cbb, @@ -1558,7 +1383,6 @@ external int EVP_marshal_public_key( /// ignored. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EVP_parse_private_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_parse_private_key(ffi.Pointer cbs); @@ -1583,32 +1407,19 @@ external ffi.Pointer EVP_parse_private_key(ffi.Pointer cbs); /// size or EC curve. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_EVP_parse_public_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer EVP_parse_public_key(ffi.Pointer cbs); -@ffi.Native Function()>( - symbol: 'webcrypto_EVP_sha1', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_EVP_sha1') external ffi.Pointer EVP_sha1(); -@ffi.Native Function()>( - symbol: 'webcrypto_EVP_sha256', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_EVP_sha256') external ffi.Pointer EVP_sha256(); -@ffi.Native Function()>( - symbol: 'webcrypto_EVP_sha384', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_EVP_sha384') external ffi.Pointer EVP_sha384(); -@ffi.Native Function()>( - symbol: 'webcrypto_EVP_sha512', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_EVP_sha512') external ffi.Pointer EVP_sha512(); /// HKDF computes HKDF (as specified by RFC 5869) of initial keying material @@ -1630,7 +1441,7 @@ external ffi.Pointer EVP_sha512(); ffi.Pointer, ffi.Size, ) ->(symbol: 'webcrypto_HKDF', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_HKDF') external int HKDF( ffi.Pointer out_key, int out_len, @@ -1646,17 +1457,13 @@ external int HKDF( /// HMAC_CTX_free calls |HMAC_CTX_cleanup| and then frees |ctx| itself. @ffi.Native)>( symbol: 'webcrypto_HMAC_CTX_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void HMAC_CTX_free(ffi.Pointer 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. -@ffi.Native Function()>( - symbol: 'webcrypto_HMAC_CTX_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_HMAC_CTX_new') external ffi.Pointer HMAC_CTX_new(); /// HMAC_Final completes the HMAC operation in |ctx| and writes the result to @@ -1670,7 +1477,7 @@ external ffi.Pointer HMAC_CTX_new(); ffi.Pointer, ffi.Pointer, ) ->(symbol: 'webcrypto_HMAC_Final', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_HMAC_Final') external int HMAC_Final( ffi.Pointer ctx, ffi.Pointer out, @@ -1694,7 +1501,7 @@ external int HMAC_Final( ffi.Pointer, ffi.Pointer, ) ->(symbol: 'webcrypto_HMAC_Init_ex', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_HMAC_Init_ex') external int HMAC_Init_ex( ffi.Pointer ctx, ffi.Pointer key, @@ -1707,7 +1514,7 @@ external int HMAC_Init_ex( /// operation in |ctx|. It returns one. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) ->(symbol: 'webcrypto_HMAC_Update', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_HMAC_Update') external int HMAC_Update( ffi.Pointer ctx, ffi.Pointer data, @@ -1718,7 +1525,6 @@ external int HMAC_Update( /// |ctx|. On entry, |ctx| must have been setup with |HMAC_Init_ex|. @ffi.Native)>( symbol: 'webcrypto_HMAC_size', - assetId: 'package:webcrypto/webcrypto.dart', ) external int HMAC_size(ffi.Pointer ctx); @@ -1727,7 +1533,6 @@ external int HMAC_size(ffi.Pointer ctx); /// It must only be used on on |ptr| values obtained from |OPENSSL_malloc| @ffi.Native)>( symbol: 'webcrypto_OPENSSL_free', - assetId: 'package:webcrypto/webcrypto.dart', ) external void OPENSSL_free(ffi.Pointer ptr); @@ -1737,7 +1542,6 @@ external void OPENSSL_free(ffi.Pointer ptr); /// push |ERR_R_MALLOC_FAILURE| onto the openssl error stack. @ffi.Native Function(ffi.Size)>( symbol: 'webcrypto_OPENSSL_malloc', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer OPENSSL_malloc(int size); @@ -1746,7 +1550,6 @@ external ffi.Pointer OPENSSL_malloc(int size); /// |OPENSSL_free|. @ffi.Native Function(ffi.Pointer, ffi.Size)>( symbol: 'webcrypto_OPENSSL_memdup', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer OPENSSL_memdup( ffi.Pointer data, @@ -1767,10 +1570,7 @@ external ffi.Pointer OPENSSL_memdup( ffi.Size, ffi.Pointer, ) ->( - symbol: 'webcrypto_PKCS5_PBKDF2_HMAC', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_PKCS5_PBKDF2_HMAC') external int PKCS5_PBKDF2_HMAC( ffi.Pointer password, int password_len, @@ -1786,7 +1586,6 @@ external int PKCS5_PBKDF2_HMAC( /// event that sufficient random data can not be obtained, |abort| is called. @ffi.Native, ffi.Size)>( symbol: 'webcrypto_RAND_bytes', - assetId: 'package:webcrypto/webcrypto.dart', ) external int RAND_bytes(ffi.Pointer buf, int len); @@ -1794,7 +1593,6 @@ external int RAND_bytes(ffi.Pointer buf, int len); /// |rsa| into it. It returns the fresh |RSA| object, or NULL on error. @ffi.Native Function(ffi.Pointer)>( symbol: 'webcrypto_RSAPublicKey_dup', - assetId: 'package:webcrypto/webcrypto.dart', ) external ffi.Pointer RSAPublicKey_dup(ffi.Pointer rsa); @@ -1803,16 +1601,12 @@ external ffi.Pointer RSAPublicKey_dup(ffi.Pointer rsa); /// returns zero then a more detailed error is available on the error queue. @ffi.Native)>( symbol: 'webcrypto_RSA_check_key', - assetId: 'package:webcrypto/webcrypto.dart', ) external int RSA_check_key(ffi.Pointer rsa); /// RSA_free decrements the reference count of |rsa| and frees it if the /// reference count drops to zero. -@ffi.Native)>( - symbol: 'webcrypto_RSA_free', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native)>(symbol: 'webcrypto_RSA_free') external void RSA_free(ffi.Pointer rsa); /// RSA_generate_key_ex generates a new RSA key where the modulus has size @@ -1830,10 +1624,7 @@ external void RSA_free(ffi.Pointer rsa); ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_RSA_generate_key_ex', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_RSA_generate_key_ex') external int RSA_generate_key_ex( ffi.Pointer rsa, int bits, @@ -1852,10 +1643,7 @@ external int RSA_generate_key_ex( ffi.Pointer>, ffi.Pointer>, ) ->( - symbol: 'webcrypto_RSA_get0_crt_params', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_RSA_get0_crt_params') external void RSA_get0_crt_params( ffi.Pointer rsa, ffi.Pointer> out_dmp1, @@ -1871,10 +1659,7 @@ external void RSA_get0_crt_params( ffi.Pointer>, ffi.Pointer>, ) ->( - symbol: 'webcrypto_RSA_get0_factors', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_RSA_get0_factors') external void RSA_get0_factors( ffi.Pointer rsa, ffi.Pointer> out_p, @@ -1891,7 +1676,7 @@ external void RSA_get0_factors( ffi.Pointer>, ffi.Pointer>, ) ->(symbol: 'webcrypto_RSA_get0_key', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_RSA_get0_key') external void RSA_get0_key( ffi.Pointer rsa, ffi.Pointer> out_n, @@ -1901,10 +1686,7 @@ external void RSA_get0_key( /// 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. -@ffi.Native Function()>( - symbol: 'webcrypto_RSA_new', - assetId: 'package:webcrypto/webcrypto.dart', -) +@ffi.Native Function()>(symbol: 'webcrypto_RSA_new') external ffi.Pointer RSA_new(); /// RSA_set0_crt_params sets |rsa|'s CRT parameters to |dmp1|, |dmq1|, and @@ -1922,10 +1704,7 @@ external ffi.Pointer RSA_new(); ffi.Pointer, ffi.Pointer, ) ->( - symbol: 'webcrypto_RSA_set0_crt_params', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_RSA_set0_crt_params') external int RSA_set0_crt_params( ffi.Pointer rsa, ffi.Pointer dmp1, @@ -1943,10 +1722,7 @@ external int RSA_set0_crt_params( /// cryptographic operation. Construct a new |RSA| object instead. @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer) ->( - symbol: 'webcrypto_RSA_set0_factors', - assetId: 'package:webcrypto/webcrypto.dart', -) +>(symbol: 'webcrypto_RSA_set0_factors') external int RSA_set0_factors( ffi.Pointer rsa, ffi.Pointer p, @@ -1969,7 +1745,7 @@ external int RSA_set0_factors( ffi.Pointer, ffi.Pointer, ) ->(symbol: 'webcrypto_RSA_set0_key', assetId: 'package:webcrypto/webcrypto.dart') +>(symbol: 'webcrypto_RSA_set0_key') external int RSA_set0_key( ffi.Pointer rsa, ffi.Pointer n, @@ -2028,52 +1804,10 @@ const int RSA_PKCS1_PADDING = 1; const int RSA_PKCS1_PSS_PADDING = 6; -/// md_data contains the hash-specific context. -final class UnnamedUnion2 extends ffi.Union { - @ffi.Array.multi([208]) - external ffi.Array md_data; - - @ffi.Uint64() - external int alignment; -} - 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 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; -} +final class bignum_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 @@ -2095,24 +1829,6 @@ final class bignum_st extends ffi.Struct { /// BN_GENCB argument and may call the function with other argument values. final class bn_gencb_st extends ffi.Opaque {} -/// CRYPTO ByteBuilder. -/// -/// |CBB| objects allow one to build length-prefixed serialisations. A |CBB| -/// object is associated with a buffer and new buffers are created with -/// |CBB_init|. Several |CBB| objects can point at the same buffer when a -/// length-prefix is pending, however only a single |CBB| can be 'current' at -/// any one time. For example, if one calls |CBB_add_u8_length_prefixed| then -/// the new |CBB| points at the same buffer as the original. But if the original -/// |CBB| is used then the length prefix is written out and the new |CBB| must -/// not be used again. -/// -/// If one needs to force a length prefix to be written out because a |CBB| is -/// going out of scope, use |CBB_flush|. If an operation on a |CBB| fails, it is -/// in an undefined state and must not be used except to call |CBB_cleanup|. -final class cbb_buffer_st extends ffi.Opaque {} - -final class cbb_child_st extends ffi.Opaque {} - final class cbb_st extends ffi.Opaque {} /// CRYPTO ByteString @@ -2121,6 +1837,14 @@ final class cbs_st extends ffi.Struct { @ffi.Size() external int len; + + static ffi.Pointer $allocate( + ffi.Allocator $allocator, { + required ffi.Pointer data, + required int len, + }) => $allocator() + ..ref.data = data + ..ref.len = len; } final class ec_group_st extends ffi.Opaque {} @@ -2133,156 +1857,52 @@ final class ec_point_st extends ffi.Opaque {} /// /// 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 r; - - external ffi.Pointer s; -} +final class ecdsa_sig_st extends ffi.Opaque {} 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 { - /// md_data contains the hash-specific context. - external UnnamedUnion2 unnamed; - - /// digest is the underlying digest function, or NULL if not set. - external ffi.Pointer digest; - - /// pctx is an opaque (at this layer) pointer to additional context that - /// EVP_PKEY functions may store in this object. - external ffi.Pointer pctx; - - /// pctx_ops, if not NULL, points to a vtable that contains functions to - /// manipulate |pctx|. - external ffi.Pointer pctx_ops; -} +final class env_md_ctx_st extends ffi.Opaque {} 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 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 opaque; - - @ffi.Uint64() - external int alignment; -} +final class evp_aead_ctx_st extends ffi.Opaque {} 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 cipher; - - /// application stuff - external ffi.Pointer app_data; - - /// cipher_data points to the |cipher| specific state. - external ffi.Pointer 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 oiv; - - /// iv contains the current IV value, which may have been updated. - @ffi.Array.multi([16]) - external ffi.Array 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 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 final1; - - /// Has this structure been rendered unusable by a failure. - @ffi.Int() - external int poisoned; -} +final class evp_cipher_ctx_st extends ffi.Opaque {} final class evp_cipher_st extends ffi.Opaque {} -/// Internal constants and structures (hidden). -final class evp_md_pctx_ops extends ffi.Opaque {} - final class evp_pkey_ctx_st extends ffi.Opaque {} final class evp_pkey_st extends ffi.Opaque {} /// Private functions -final class hmac_ctx_st extends ffi.Struct { - external ffi.Pointer md; - - external EVP_MD_CTX md_ctx; - - external EVP_MD_CTX i_ctx; - - external EVP_MD_CTX o_ctx; -} +final class hmac_ctx_st extends ffi.Opaque {} /// point_conversion_form_t enumerates forms, as defined in X9.62 (ECDSA), for /// the encoding of a elliptic curve point (x,y) -abstract class point_conversion_form_t { +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 int POINT_CONVERSION_COMPRESSED = 2; + 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 int POINT_CONVERSION_UNCOMPRESSED = 4; + 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 int POINT_CONVERSION_HYBRID = 6; + static const POINT_CONVERSION_HYBRID = 6; } final class rsa_st extends ffi.Opaque {} diff --git a/pubspec.yaml b/pubspec.yaml index fcc14f32a..91d26394e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,13 +22,13 @@ environment: dependencies: ffi: ^2.0.0 - hooks: ^1.0.0 + hooks: ^2.0.0 code_assets: ^1.0.0 native_toolchain_cmake: ^0.3.0 meta: ^1.3.0 dev_dependencies: - ffigen: ^11.0.0 + ffigen: ^21.0.0 test: ^1.30.0 yaml: ^3.0.0 flutter_lints: ^6.0.0 diff --git a/tool/bump-boringssl-revision.sh b/tool/bump-boringssl-revision.sh index 32de27be2..763bc6570 100755 --- a/tool/bump-boringssl-revision.sh +++ b/tool/bump-boringssl-revision.sh @@ -465,8 +465,8 @@ main() { dart pub get --no-example section "Updating FFI bindings" - log_info "Running update-bindings.sh..." - bash "$DIR/update-bindings.sh" + log_info "Running tool/ffigen.dart..." + dart run "$DIR/ffigen.dart" section "Running tests" log_info "Running test.sh..." diff --git a/tool/ffigen.dart b/tool/ffigen.dart new file mode 100644 index 000000000..9408a6764 --- /dev/null +++ b/tool/ffigen.dart @@ -0,0 +1,374 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import 'dart:io'; + +import 'package:ffigen/ffigen.dart'; + +void main() { + final packageRoot = Platform.script.resolve('../'); + + generateWebCryptoBindings(packageRoot); + generateBoringSslBindings(packageRoot); +} + +void generateWebCryptoBindings(Uri packageRoot) { + FfiGenerator( + output: Output( + dartFile: packageRoot.resolve( + 'lib/src/boringssl/bindings/generated_bindings.dart', + ), + style: const NativeExternalBindings( + assetId: 'package:webcrypto/webcrypto.dart', + ), + format: true, + commentType: const CommentType(CommentStyle.any, CommentLength.full), + preamble: ''' +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ignore_for_file: unused_element +// ignore_for_file: non_constant_identifier_names +''', + ), + headers: Headers(entryPoints: [packageRoot.resolve('src/webcrypto.h')]), + functions: Functions( + include: Declarations.includeSet({'webcrypto_get_CBB_size'}), + ), + structs: const Structs(dependencies: CompoundDependencies.opaque), + ).generate(); +} + +void generateBoringSslBindings(Uri packageRoot) { + FfiGenerator( + output: Output( + dartFile: packageRoot.resolve( + 'lib/src/third_party/boringssl/generated_bindings.dart', + ), + style: const NativeExternalBindings( + assetId: 'package:webcrypto/webcrypto.dart', + ), + format: true, + commentType: const CommentType(CommentStyle.any, CommentLength.full), + preamble: ''' +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ +// 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 +''', + ), + headers: Headers( + entryPoints: [ + packageRoot.resolve('third_party/boringssl/src/include/openssl/aead.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/aes.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/bn.h'), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/bytestring.h', + ), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/cipher.h', + ), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/crypto.h', + ), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/digest.h', + ), + packageRoot.resolve('third_party/boringssl/src/include/openssl/ec.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/ecdh.h'), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/ec_key.h', + ), + packageRoot.resolve( + 'third_party/boringssl/src/include/openssl/ecdsa.h', + ), + packageRoot.resolve('third_party/boringssl/src/include/openssl/err.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/evp.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/hkdf.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/hmac.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/mem.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/rand.h'), + packageRoot.resolve('third_party/boringssl/src/include/openssl/rsa.h'), + ], + compilerOptions: [ + '-Ithird_party/boringssl/src/include', + '-DBORINGSSL_PREFIX=webcrypto', + '-U__PRAGMA_REDEFINE_EXTNAME', + ], + ), + macros: Macros( + include: Declarations.includeSet({ + 'AES_BLOCK_SIZE', + 'EC_PKEY_NO_PUBKEY', + 'EVP_PKEY_EC', + 'EVP_PKEY_RSA', + 'HKDF_R_OUTPUT_TOO_LARGE', + 'NID_secp384r1', + 'NID_secp521r1', + 'NID_X9_62_prime256v1', + 'RSA_PKCS1_OAEP_PADDING', + 'RSA_PKCS1_PADDING', + 'RSA_PKCS1_PSS_PADDING', + }), + ), + enums: Enums( + include: Declarations.includeSet({'point_conversion_form_t'}), + style: (decl, suggestedStyle) => EnumStyle.intConstants, + ), + unnamedEnums: UnnamedEnums( + include: Declarations.includeSet({'ERR_LIB_HKDF'}), + ), + structs: Structs( + include: Declarations.includeSet({'cbs_st', 'cbb_st'}), + dependencies: CompoundDependencies.opaque, + ), + typedefs: Typedefs.includeSet({ + 'BIGNUM', + 'BN_CTX', + 'BN_GENCB', + 'BN_ULONG', + 'CBB', + 'CBS', + 'ECDSA_SIG', + 'EC_GROUP', + 'EC_KEY', + 'EC_POINT', + 'ENGINE', + 'EVP_AEAD', + 'EVP_AEAD_CTX', + 'EVP_CIPHER', + 'EVP_CIPHER_CTX', + 'EVP_MD', + 'EVP_MD_CTX', + 'EVP_PKEY', + 'EVP_PKEY_CTX', + 'HMAC_CTX', + 'RSA', + }), + functions: Functions( + include: Declarations.includeSet({ + // Source of truth for BoringSSL entry points bound from Dart. + 'webcrypto_BN_bin2bn', + 'webcrypto_BN_bn2bin_padded', + 'webcrypto_BN_free', + 'webcrypto_BN_new', + 'webcrypto_BN_num_bytes', + 'webcrypto_BN_set_word', + 'webcrypto_CBB_cleanup', + 'webcrypto_CBB_data', + 'webcrypto_CBB_flush', + 'webcrypto_CBB_init', + 'webcrypto_CBB_len', + 'webcrypto_CBB_zero', + 'webcrypto_CRYPTO_memcmp', + 'webcrypto_ECDH_compute_key', + 'webcrypto_ECDSA_SIG_free', + 'webcrypto_ECDSA_SIG_get0', + 'webcrypto_ECDSA_SIG_marshal', + 'webcrypto_ECDSA_SIG_new', + 'webcrypto_ECDSA_SIG_parse', + 'webcrypto_EC_GROUP_get0_order', + 'webcrypto_EC_GROUP_get_curve_name', + 'webcrypto_EC_GROUP_get_degree', + 'webcrypto_EC_KEY_check_key', + 'webcrypto_EC_KEY_free', + 'webcrypto_EC_KEY_generate_key', + 'webcrypto_EC_KEY_get0_group', + 'webcrypto_EC_KEY_get0_private_key', + 'webcrypto_EC_KEY_get0_public_key', + 'webcrypto_EC_KEY_get_enc_flags', + 'webcrypto_EC_KEY_new_by_curve_name', + 'webcrypto_EC_KEY_set_enc_flags', + 'webcrypto_EC_KEY_set_private_key', + 'webcrypto_EC_KEY_set_public_key', + 'webcrypto_EC_KEY_set_public_key_affine_coordinates', + 'webcrypto_EC_POINT_free', + 'webcrypto_EC_POINT_get_affine_coordinates_GFp', + 'webcrypto_EC_POINT_new', + 'webcrypto_EC_POINT_oct2point', + 'webcrypto_EC_POINT_point2cbb', + 'webcrypto_ERR_clear_error', + 'webcrypto_ERR_error_string_n', + 'webcrypto_ERR_get_error', + 'webcrypto_ERR_peek_error', + 'webcrypto_EVP_aead_aes_128_gcm', + 'webcrypto_EVP_aead_aes_256_gcm', + 'webcrypto_EVP_AEAD_CTX_free', + 'webcrypto_EVP_AEAD_CTX_new', + 'webcrypto_EVP_AEAD_CTX_open', + 'webcrypto_EVP_AEAD_CTX_seal', + 'webcrypto_EVP_AEAD_max_overhead', + 'webcrypto_EVP_aes_128_cbc', + 'webcrypto_EVP_aes_128_ctr', + 'webcrypto_EVP_aes_256_cbc', + 'webcrypto_EVP_aes_256_ctr', + 'webcrypto_EVP_CIPHER_CTX_free', + 'webcrypto_EVP_CIPHER_CTX_new', + 'webcrypto_EVP_CipherFinal_ex', + 'webcrypto_EVP_CipherInit_ex', + 'webcrypto_EVP_CIPHER_iv_length', + 'webcrypto_EVP_CipherUpdate', + 'webcrypto_EVP_DigestFinal', + 'webcrypto_EVP_DigestInit', + 'webcrypto_EVP_DigestSignFinal', + 'webcrypto_EVP_DigestSignInit', + 'webcrypto_EVP_DigestSignUpdate', + 'webcrypto_EVP_DigestUpdate', + 'webcrypto_EVP_DigestVerifyFinal', + 'webcrypto_EVP_DigestVerifyInit', + 'webcrypto_EVP_DigestVerifyUpdate', + 'webcrypto_EVP_marshal_private_key', + 'webcrypto_EVP_marshal_public_key', + 'webcrypto_EVP_MD_CTX_free', + 'webcrypto_EVP_MD_CTX_new', + 'webcrypto_EVP_MD_CTX_size', + 'webcrypto_EVP_parse_private_key', + 'webcrypto_EVP_parse_public_key', + 'webcrypto_EVP_PKEY_CTX_free', + 'webcrypto_EVP_PKEY_CTX_new', + 'webcrypto_EVP_PKEY_CTX_set0_rsa_oaep_label', + 'webcrypto_EVP_PKEY_CTX_set_rsa_mgf1_md', + 'webcrypto_EVP_PKEY_CTX_set_rsa_oaep_md', + 'webcrypto_EVP_PKEY_CTX_set_rsa_padding', + 'webcrypto_EVP_PKEY_CTX_set_rsa_pss_saltlen', + 'webcrypto_EVP_PKEY_decrypt', + 'webcrypto_EVP_PKEY_decrypt_init', + 'webcrypto_EVP_PKEY_encrypt', + 'webcrypto_EVP_PKEY_encrypt_init', + 'webcrypto_EVP_PKEY_free', + 'webcrypto_EVP_PKEY_get1_EC_KEY', + 'webcrypto_EVP_PKEY_get1_RSA', + 'webcrypto_EVP_PKEY_id', + 'webcrypto_EVP_PKEY_new', + 'webcrypto_EVP_PKEY_set1_EC_KEY', + 'webcrypto_EVP_PKEY_set1_RSA', + 'webcrypto_EVP_sha1', + 'webcrypto_EVP_sha256', + 'webcrypto_EVP_sha384', + 'webcrypto_EVP_sha512', + 'webcrypto_HKDF', + 'webcrypto_HMAC_CTX_free', + 'webcrypto_HMAC_CTX_new', + 'webcrypto_HMAC_Final', + 'webcrypto_HMAC_Init_ex', + 'webcrypto_HMAC_size', + 'webcrypto_HMAC_Update', + 'webcrypto_OPENSSL_malloc', + 'webcrypto_PKCS5_PBKDF2_HMAC', + 'webcrypto_RAND_bytes', + 'webcrypto_RSA_check_key', + 'webcrypto_RSA_free', + 'webcrypto_RSA_generate_key_ex', + 'webcrypto_RSA_get0_crt_params', + 'webcrypto_RSA_get0_factors', + 'webcrypto_RSA_get0_key', + 'webcrypto_RSA_new', + 'webcrypto_RSAPublicKey_dup', + 'webcrypto_RSA_set0_crt_params', + 'webcrypto_RSA_set0_factors', + 'webcrypto_RSA_set0_key', + // These are referenced, just need to be sorted right. + 'webcrypto_OPENSSL_free', + 'webcrypto_OPENSSL_memdup', + 'webcrypto_EVP_MD_size', + // Not used but maybe they should be: + 'webcrypto_EVP_AEAD_nonce_length', + 'webcrypto_EVP_AEAD_max_tag_len', + // Not used by nice to have, maybe, or maybe we remove / comment them out + 'webcrypto_EVP_AEAD_key_length', + 'webcrypto_BN_value_one', + 'webcrypto_BN_add', + 'webcrypto_BN_sub', + 'webcrypto_BN_cmp', + 'webcrypto_BN_lshift', + 'webcrypto_EVP_CIPHER_block_size', + 'webcrypto_EC_GROUP_new_by_curve_name', + 'webcrypto_EC_GROUP_free', + 'webcrypto_EVP_PKEY_set_type', + // Self testing only.. + 'webcrypto_BORINGSSL_self_test', + }), + rename: (decl) { + final name = decl.originalName; + if (name.startsWith('webcrypto_')) { + return name.substring('webcrypto_'.length); + } + return name; + }, + ), + ).generate(); +} diff --git a/tool/update-bindings.sh b/tool/update-bindings.sh deleted file mode 100755 index 9ff4da9ec..000000000 --- a/tool/update-bindings.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -cd "$DIR/.." - -dart pub get --no-example - -dart run ffigen --config=lib/src/boringssl/bindings/ffigen.yaml -dart run ffigen --config=lib/src/third_party/boringssl/ffigen.yaml