From c2a268929a7b264f048bb02433c1ab28e8eb06df Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Sat, 29 Aug 2026 18:05:27 +0200 Subject: [PATCH 1/4] [pubspec_parse] Add platforms field to Pubspec --- pkgs/pubspec_parse/CHANGELOG.md | 4 +++ pkgs/pubspec_parse/lib/src/pubspec.dart | 9 +++++++ pkgs/pubspec_parse/lib/src/pubspec.g.dart | 5 ++++ pkgs/pubspec_parse/pubspec.yaml | 2 +- pkgs/pubspec_parse/test/parse_test.dart | 32 +++++++++++++++++++++++ pkgs/pubspec_parse/test/tojson_test.dart | 6 +++++ 6 files changed, 57 insertions(+), 1 deletion(-) diff --git a/pkgs/pubspec_parse/CHANGELOG.md b/pkgs/pubspec_parse/CHANGELOG.md index e0116ecca0..8cc25f298d 100644 --- a/pkgs/pubspec_parse/CHANGELOG.md +++ b/pkgs/pubspec_parse/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.0-wip + +- Added `platforms` field to `Pubspec`. + ## 1.6.0 - Added `toJson` method to `Pubspec` to serialize the object back to a `Map`. diff --git a/pkgs/pubspec_parse/lib/src/pubspec.dart b/pkgs/pubspec_parse/lib/src/pubspec.dart index dd51fe505a..192fb75dcd 100644 --- a/pkgs/pubspec_parse/lib/src/pubspec.dart +++ b/pkgs/pubspec_parse/lib/src/pubspec.dart @@ -99,6 +99,14 @@ class Pubspec { /// Specifies how to resolve dependencies with the surrounding Pub Workspace. final String? resolution; + /// The platforms this package explicitly declares support for. + /// + /// Keys are platform names, such as `android`, `ios`, `linux`, `macos`, + /// `web` and `windows`. Values are currently always `null`. + /// + /// See https://dart.dev/tools/pub/pubspec#platforms. + final Map? platforms; + /// If [author] and [authors] are both provided, their values are combined /// with duplicates eliminated. Pubspec( @@ -121,6 +129,7 @@ class Pubspec { this.description, this.workspace, this.resolution, + this.platforms, Map? dependencies, Map? devDependencies, Map? dependencyOverrides, diff --git a/pkgs/pubspec_parse/lib/src/pubspec.g.dart b/pkgs/pubspec_parse/lib/src/pubspec.g.dart index cfbab518ef..b82f74d987 100644 --- a/pkgs/pubspec_parse/lib/src/pubspec.g.dart +++ b/pkgs/pubspec_parse/lib/src/pubspec.g.dart @@ -61,6 +61,10 @@ Pubspec _$PubspecFromJson(Map json) => $checkedCreate( (v) => (v as List?)?.map((e) => e as String).toList(), ), resolution: $checkedConvert('resolution', (v) => v as String?), + platforms: $checkedConvert( + 'platforms', + (v) => (v as Map?)?.map((k, e) => MapEntry(k as String, e)), + ), dependencies: $checkedConvert( 'dependencies', (v) => parseDeps(v as Map?), @@ -116,4 +120,5 @@ Map _$PubspecToJson(Pubspec instance) => { 'executables': _serializeExecutables(instance.executables), 'workspace': instance.workspace, 'resolution': instance.resolution, + 'platforms': instance.platforms, }; diff --git a/pkgs/pubspec_parse/pubspec.yaml b/pkgs/pubspec_parse/pubspec.yaml index cf7711d6ad..67b56a6633 100644 --- a/pkgs/pubspec_parse/pubspec.yaml +++ b/pkgs/pubspec_parse/pubspec.yaml @@ -1,5 +1,5 @@ name: pubspec_parse -version: 1.6.0 +version: 1.7.0-wip description: >- Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting. diff --git a/pkgs/pubspec_parse/test/parse_test.dart b/pkgs/pubspec_parse/test/parse_test.dart index f700b4efae..280d3562b3 100644 --- a/pkgs/pubspec_parse/test/parse_test.dart +++ b/pkgs/pubspec_parse/test/parse_test.dart @@ -34,6 +34,7 @@ void main() { expect(value.workspace, isNull); expect(value.resolution, isNull); expect(value.executables, isEmpty); + expect(value.platforms, isNull); }); test('all fields set', () async { @@ -58,6 +59,7 @@ void main() { ], 'workspace': ['pkg1', 'pkg2'], 'resolution': 'workspace', + 'platforms': {'android': null, 'web': null}, 'executables': { 'my_script': 'bin/my_script.dart', 'my_script2': 'bin/my_script2.dart', @@ -101,6 +103,7 @@ void main() { expect(value.workspace!.first, 'pkg1'); expect(value.workspace!.last, 'pkg2'); expect(value.resolution, 'workspace'); + expect(value.platforms, {'android': null, 'web': null}); }); test('environment values can be null', () async { @@ -261,6 +264,7 @@ line 3, column 16: Unsupported value for "publish_to". Must be an http or https }, lenient: true); expect(value.name, 'sample'); expect(value.executables, isEmpty); + expect(value.platforms, isNull); }); }); @@ -398,6 +402,34 @@ line 4, column 10: Unsupported value for "sdk". Could not parse version "silly". }); }); + group('platforms', () { + test('map with null values', () async { + final value = await parse({ + ...defaultPubspec, + 'platforms': {'android': null, 'ios': null, 'web': null}, + }); + expect(value.platforms, {'android': null, 'ios': null, 'web': null}); + }); + + test('not a map', () { + expectParseThrowsContaining( + {...defaultPubspec, 'platforms': 1}, + "Unsupported value for \"platforms\". type 'int' is not a subtype of type 'Map?'", + skipTryPub: true, + ); + }); + + test('invalid data - lenient', () async { + final value = await parse( + {...defaultPubspec, 'platforms': 1}, + skipTryPub: true, + lenient: true, + ); + expect(value.name, 'sample'); + expect(value.platforms, isNull); + }); + }); + group('funding', () { test('not a list', () { expectParseThrowsContaining( diff --git a/pkgs/pubspec_parse/test/tojson_test.dart b/pkgs/pubspec_parse/test/tojson_test.dart index 50c73aa978..d828d7879c 100644 --- a/pkgs/pubspec_parse/test/tojson_test.dart +++ b/pkgs/pubspec_parse/test/tojson_test.dart @@ -39,6 +39,7 @@ void main() { 'funding': null, 'topics': null, 'ignored_advisories': null, + 'platforms': null, }); }); @@ -65,6 +66,7 @@ void main() { ], 'workspace': ['pkg1', 'pkg2'], 'resolution': 'workspace', + 'platforms': {'android': null, 'web': null}, 'executables': { 'my_script': 'bin/my_script.dart', 'my_script2': 'bin/my_script2.dart', @@ -106,6 +108,7 @@ void main() { 'ignored_advisories': ['111', '222'], 'workspace': ['pkg1', 'pkg2'], 'resolution': 'workspace', + 'platforms': {'android': null, 'web': null}, 'executables': { 'my_script': 'bin/my_script.dart', 'my_script2': 'bin/my_script2.dart', @@ -139,6 +142,7 @@ void main() { expect(newValue.workspace, value.workspace); expect(newValue.resolution, value.resolution); expect(newValue.executables, value.executables); + expect(newValue.platforms, value.platforms); }); test('all fields set', () async { @@ -163,6 +167,7 @@ void main() { ], 'workspace': ['pkg1', 'pkg2'], 'resolution': 'workspace', + 'platforms': {'android': null, 'web': null}, 'executables': { 'my_script': 'bin/my_script.dart', 'my_script2': 'bin/my_script2.dart', @@ -200,6 +205,7 @@ void main() { expect(newValue.workspace, value.workspace); expect(newValue.resolution, value.resolution); expect(newValue.executables, value.executables); + expect(newValue.platforms, value.platforms); }); test('dependencies', () async { From ba830d096bdb582f9db2f674b71ce077b6f64e2e Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Sat, 29 Aug 2026 18:15:09 +0200 Subject: [PATCH 2/4] Remove stray expectation from unrelated test --- pkgs/pubspec_parse/test/parse_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/pubspec_parse/test/parse_test.dart b/pkgs/pubspec_parse/test/parse_test.dart index 280d3562b3..b0ba1abad9 100644 --- a/pkgs/pubspec_parse/test/parse_test.dart +++ b/pkgs/pubspec_parse/test/parse_test.dart @@ -264,7 +264,6 @@ line 3, column 16: Unsupported value for "publish_to". Must be an http or https }, lenient: true); expect(value.name, 'sample'); expect(value.executables, isEmpty); - expect(value.platforms, isNull); }); }); From b7a36ce1302cd48eaa1e7a877d9b4cdd9c7845df Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 19 Oct 2026 17:47:08 +0000 Subject: [PATCH 3/4] Revert unrelated pre-commit formatting from merge --- pkgs/api_summary/test/app_test.dart | 6 +- pkgs/api_summary/test/extensions_test.dart | 5 +- .../test/bench_command_test.dart | 6 +- pkgs/boring/lib/src/bindings/boringssl.g.dart | 3251 +++++++++++++---- pkgs/boring/test/boring_test.dart | 5 +- .../test/conformance/wycheproof_test.dart | 88 +- pkgs/boring/tool/ffigen.dart | 10 +- .../test/specs/code/expression_test.dart | 20 +- pkgs/coverage/test/chrome_test.dart | 45 +- .../test/test_with_coverage_test.dart | 5 +- pkgs/html/test/tokenizer_test.dart | 73 +- pkgs/json_rpc_2/lib/src/client.dart | 81 +- pkgs/json_rpc_2/lib/src/parameters.dart | 42 +- pkgs/json_rpc_2/lib/src/peer.dart | 84 +- pkgs/json_rpc_2/lib/src/server.dart | 121 +- pkgs/json_rpc_2/test/client/client_test.dart | 221 +- pkgs/json_rpc_2/test/client/utils.dart | 32 +- pkgs/json_rpc_2/test/server/server_test.dart | 276 +- pkgs/markdown/test/stats_test.dart | 6 +- pkgs/markdown/tool/stats_lib.dart | 5 +- .../lib/src/version_constraint.dart | 33 +- .../test/version_constraint_test.dart | 201 +- pkgs/string_scanner/lib/src/line_scanner.dart | 12 +- pkgs/string_scanner/lib/src/span_scanner.dart | 8 +- pkgs/unified_analytics/lib/src/analytics.dart | 5 +- pkgs/unified_analytics/lib/src/enums.dart | 3 +- .../test/unified_analytics_test.dart | 259 +- pkgs/yaml/lib/src/loader.dart | 92 +- pkgs/yaml/lib/src/parser.dart | 157 +- pkgs/yaml/lib/src/scanner.dart | 186 +- pkgs/yaml/lib/src/yaml_document.dart | 12 +- pkgs/yaml/lib/src/yaml_node.dart | 34 +- pkgs/yaml/test/error_listener_test.dart | 13 +- pkgs/yaml/test/yaml_test.dart | 1451 +++----- 34 files changed, 3971 insertions(+), 2877 deletions(-) diff --git a/pkgs/api_summary/test/app_test.dart b/pkgs/api_summary/test/app_test.dart index a31ec42cbd..817b4fa30d 100644 --- a/pkgs/api_summary/test/app_test.dart +++ b/pkgs/api_summary/test/app_test.dart @@ -7,7 +7,6 @@ library; import 'dart:convert'; import 'dart:io'; - import 'package:api_summary/api_summary.dart'; import 'package:path/path.dart' as p; import 'package:test/test.dart'; @@ -105,8 +104,9 @@ void main() { test('expectApiSummaryClean throws with diff on mismatch', () async { final samplePkgDir = await _createSandboxPackage(); - File(p.join(samplePkgDir, 'api.txt')) - .writeAsStringSync('environment:\n stale_line\n'); + File( + p.join(samplePkgDir, 'api.txt'), + ).writeAsStringSync('environment:\n stale_line\n'); await expectLater( expectApiSummaryClean(packagePath: samplePkgDir), diff --git a/pkgs/api_summary/test/extensions_test.dart b/pkgs/api_summary/test/extensions_test.dart index 5aafcb18a0..48ca869995 100644 --- a/pkgs/api_summary/test/extensions_test.dart +++ b/pkgs/api_summary/test/extensions_test.dart @@ -61,8 +61,9 @@ extension type ExtensionType(int i) {} } Future test_formalParameterElement_isDeprecated() async { - final f = (await analyzeLibrary('f({int? i, @deprecated int? j}) {}')) - .getTopLevelFunction('f')!; + final f = (await analyzeLibrary( + 'f({int? i, @deprecated int? j}) {}', + )).getTopLevelFunction('f')!; expect(f.formalParameters[0].isDeprecated, isFalse); expect(f.formalParameters[1].isDeprecated, isTrue); } diff --git a/pkgs/benchmark_harness/test/bench_command_test.dart b/pkgs/benchmark_harness/test/bench_command_test.dart index 9ee50fcbf6..0f224340ce 100644 --- a/pkgs/benchmark_harness/test/bench_command_test.dart +++ b/pkgs/benchmark_harness/test/bench_command_test.dart @@ -23,9 +23,9 @@ void main() { expect(output.exitCode, 0); // Sadly, the help output likes to include trailing spaces that don't // copy paste nicely or consistently into the README. - final trimmed = LineSplitter.split(output.stdout as String) - .map((e) => e.trimRight()) - .join('\n'); + final trimmed = LineSplitter.split( + output.stdout as String, + ).map((e) => e.trimRight()).join('\n'); final readmeFile = File('README.md').readAsStringSync(); diff --git a/pkgs/boring/lib/src/bindings/boringssl.g.dart b/pkgs/boring/lib/src/bindings/boringssl.g.dart index ba382d5f45..dd7d95be35 100644 --- a/pkgs/boring/lib/src/bindings/boringssl.g.dart +++ b/pkgs/boring/lib/src/bindings/boringssl.g.dart @@ -27,7 +27,9 @@ import '' as self; @ffi.Native)>( symbol: 'bssl_dart_ACCESS_DESCRIPTION_free', ) -external void ACCESS_DESCRIPTION_free(ffi.Pointer desc); +external void ACCESS_DESCRIPTION_free( + ffi.Pointer desc, +); /// ACCESS_DESCRIPTION_new returns a newly-allocated, empty `ACCESS_DESCRIPTION` /// object, or NULL on error. @@ -351,7 +353,9 @@ external int ASN1_BIT_STRING_check( @ffi.Native)>( symbol: 'bssl_dart_ASN1_BIT_STRING_free', ) -external void ASN1_BIT_STRING_free(ffi.Pointer str); +external void ASN1_BIT_STRING_free( + ffi.Pointer 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. @@ -359,7 +363,10 @@ external void ASN1_BIT_STRING_free(ffi.Pointer str); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_ASN1_BIT_STRING_get_bit', ) -external int ASN1_BIT_STRING_get_bit(ffi.Pointer str, int n); +external int ASN1_BIT_STRING_get_bit( + ffi.Pointer str, + int n, +); /// ASN1_BIT_STRING_new calls `ASN1_STRING_type_new` with `V_ASN1_BIT_STRING`. @meta.RecordUse() @@ -445,14 +452,18 @@ external int ASN1_BIT_STRING_set_bit( @ffi.Native)>( symbol: 'bssl_dart_ASN1_BIT_STRING_unused_bits', ) -external int ASN1_BIT_STRING_unused_bits(ffi.Pointer str); +external int ASN1_BIT_STRING_unused_bits( + ffi.Pointer str, +); /// The following functions call `ASN1_STRING_free`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_BMPSTRING_free', ) -external void ASN1_BMPSTRING_free(ffi.Pointer str); +external void ASN1_BMPSTRING_free( + ffi.Pointer str, +); /// The following functions call `ASN1_STRING_type_new` with the corresponding /// `V_ASN1_*` constant. @@ -467,7 +478,9 @@ external ffi.Pointer ASN1_BMPSTRING_new(); @ffi.Native)>( symbol: 'bssl_dart_ASN1_ENUMERATED_free', ) -external void ASN1_ENUMERATED_free(ffi.Pointer str); +external void ASN1_ENUMERATED_free( + ffi.Pointer str, +); /// ASN1_ENUMERATED_get returns the value of `a` as a `long`, or -1 if `a` is out /// of range or the wrong type. @@ -478,7 +491,9 @@ external void ASN1_ENUMERATED_free(ffi.Pointer str); @ffi.Native)>( symbol: 'bssl_dart_ASN1_ENUMERATED_get', ) -external int ASN1_ENUMERATED_get(ffi.Pointer a); +external int ASN1_ENUMERATED_get( + ffi.Pointer 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 @@ -520,7 +535,10 @@ external ffi.Pointer ASN1_ENUMERATED_new(); @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_ASN1_ENUMERATED_set', ) -external int ASN1_ENUMERATED_set(ffi.Pointer a, int v); +external int ASN1_ENUMERATED_set( + ffi.Pointer a, + int v, +); /// ASN1_ENUMERATED_set_int64 sets `a` to an ENUMERATED with value `v`. It /// returns one on success and zero on error. @@ -528,7 +546,10 @@ external int ASN1_ENUMERATED_set(ffi.Pointer a, int v); @ffi.Native, ffi.Int64)>( symbol: 'bssl_dart_ASN1_ENUMERATED_set_int64', ) -external int ASN1_ENUMERATED_set_int64(ffi.Pointer out, int v); +external int ASN1_ENUMERATED_set_int64( + ffi.Pointer out, + int v, +); /// ASN1_ENUMERATED_set_uint64 sets `a` to an ENUMERATED with value `v`. It /// returns one on success and zero on error. @@ -585,14 +606,18 @@ external ffi.Pointer ASN1_GENERALIZEDTIME_adj( @ffi.Native)>( symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_check', ) -external int ASN1_GENERALIZEDTIME_check(ffi.Pointer a); +external int ASN1_GENERALIZEDTIME_check( + ffi.Pointer a, +); /// ASN1_GENERALIZEDTIME_free calls `ASN1_STRING_free`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_GENERALIZEDTIME_free', ) -external void ASN1_GENERALIZEDTIME_free(ffi.Pointer str); +external void ASN1_GENERALIZEDTIME_free( + ffi.Pointer str, +); /// ASN1_GENERALIZEDTIME_new calls `ASN1_STRING_type_new` with /// `V_ASN1_GENERALIZEDTIME`. The resulting object contains empty contents and @@ -649,7 +674,9 @@ external int ASN1_GENERALIZEDTIME_set_string( @ffi.Native)>( symbol: 'bssl_dart_ASN1_GENERALSTRING_free', ) -external void ASN1_GENERALSTRING_free(ffi.Pointer str); +external void ASN1_GENERALSTRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -661,7 +688,9 @@ external ffi.Pointer ASN1_GENERALSTRING_new(); @ffi.Native)>( symbol: 'bssl_dart_ASN1_IA5STRING_free', ) -external void ASN1_IA5STRING_free(ffi.Pointer str); +external void ASN1_IA5STRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -695,7 +724,9 @@ external ffi.Pointer ASN1_INTEGER_dup( @ffi.Native)>( symbol: 'bssl_dart_ASN1_INTEGER_free', ) -external void ASN1_INTEGER_free(ffi.Pointer str); +external void ASN1_INTEGER_free( + ffi.Pointer str, +); /// ASN1_INTEGER_get returns the value of `a` as a `long`, or -1 if `a` is out of /// range or the wrong type. @@ -706,7 +737,9 @@ external void ASN1_INTEGER_free(ffi.Pointer str); @ffi.Native)>( symbol: 'bssl_dart_ASN1_INTEGER_get', ) -external int ASN1_INTEGER_get(ffi.Pointer a); +external int ASN1_INTEGER_get( + ffi.Pointer 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, @@ -748,7 +781,10 @@ external ffi.Pointer ASN1_INTEGER_new(); @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_ASN1_INTEGER_set', ) -external int ASN1_INTEGER_set(ffi.Pointer a, int v); +external int ASN1_INTEGER_set( + ffi.Pointer a, + int v, +); /// ASN1_INTEGER_set_int64 sets `a` to an INTEGER with value `v`. It returns one /// on success and zero on error. @@ -756,7 +792,10 @@ external int ASN1_INTEGER_set(ffi.Pointer a, int v); @ffi.Native, ffi.Int64)>( symbol: 'bssl_dart_ASN1_INTEGER_set_int64', ) -external int ASN1_INTEGER_set_int64(ffi.Pointer out, int v); +external int ASN1_INTEGER_set_int64( + ffi.Pointer out, + int v, +); /// ASN1_INTEGER_set_uint64 sets `a` to an INTEGER with value `v`. It returns one /// on success and zero on error. @@ -764,7 +803,10 @@ external int ASN1_INTEGER_set_int64(ffi.Pointer out, int v); @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_ASN1_INTEGER_set_uint64', ) -external int ASN1_INTEGER_set_uint64(ffi.Pointer out, int v); +external int ASN1_INTEGER_set_uint64( + ffi.Pointer 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 @@ -783,7 +825,9 @@ external ffi.Pointer ASN1_INTEGER_to_BN( @ffi.Native)>( symbol: 'bssl_dart_ASN1_NULL_free', ) -external void ASN1_NULL_free(ffi.Pointer null$); +external void ASN1_NULL_free( + ffi.Pointer null$, +); /// ASN1_NULL_new returns an opaque, non-NULL pointer. It is safe to call /// `ASN1_NULL_free` on the result, but not necessary. @@ -828,7 +872,9 @@ external ffi.Pointer ASN1_OBJECT_create( @ffi.Native)>( symbol: 'bssl_dart_ASN1_OBJECT_free', ) -external void ASN1_OBJECT_free(ffi.Pointer a); +external void ASN1_OBJECT_free( + ffi.Pointer a, +); /// ASN1_OCTET_STRING_cmp calls `ASN1_STRING_cmp`. @meta.RecordUse() @@ -856,7 +902,9 @@ external ffi.Pointer ASN1_OCTET_STRING_dup( @ffi.Native)>( symbol: 'bssl_dart_ASN1_OCTET_STRING_free', ) -external void ASN1_OCTET_STRING_free(ffi.Pointer str); +external void ASN1_OCTET_STRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -883,7 +931,9 @@ external int ASN1_OCTET_STRING_set( @ffi.Native)>( symbol: 'bssl_dart_ASN1_PRINTABLESTRING_free', ) -external void ASN1_PRINTABLESTRING_free(ffi.Pointer str); +external void ASN1_PRINTABLESTRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -975,14 +1025,18 @@ external ffi.Pointer ASN1_STRING_data( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_ASN1_STRING_dup', ) -external ffi.Pointer ASN1_STRING_dup(ffi.Pointer str); +external ffi.Pointer ASN1_STRING_dup( + ffi.Pointer str, +); /// ASN1_STRING_free releases memory associated with `str`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_STRING_free', ) -external void ASN1_STRING_free(ffi.Pointer str); +external void ASN1_STRING_free( + ffi.Pointer 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 @@ -1015,7 +1069,9 @@ external int ASN1_STRING_get_default_mask(); @ffi.Native)>( symbol: 'bssl_dart_ASN1_STRING_length', ) -external int ASN1_STRING_length(ffi.Pointer str); +external int ASN1_STRING_length( + ffi.Pointer 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 @@ -1159,14 +1215,18 @@ external ffi.Pointer ASN1_STRING_set_by_NID( @ffi.Native( symbol: 'bssl_dart_ASN1_STRING_set_default_mask', ) -external void ASN1_STRING_set_default_mask(int mask); +external void ASN1_STRING_set_default_mask( + int mask, +); /// ASN1_STRING_set_default_mask_asc returns one. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_STRING_set_default_mask_asc', ) -external int ASN1_STRING_set_default_mask_asc(ffi.Pointer p); +external int ASN1_STRING_set_default_mask_asc( + ffi.Pointer 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 @@ -1190,7 +1250,9 @@ external int ASN1_STRING_to_UTF8( @ffi.Native)>( symbol: 'bssl_dart_ASN1_STRING_type', ) -external int ASN1_STRING_type(ffi.Pointer str); +external int ASN1_STRING_type( + ffi.Pointer str, +); /// ASN1_STRING_type_new returns a newly-allocated empty `ASN1_STRING` object of /// type `type`, or NULL on error. @@ -1198,13 +1260,17 @@ external int ASN1_STRING_type(ffi.Pointer str); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_ASN1_STRING_type_new', ) -external ffi.Pointer ASN1_STRING_type_new(int type); +external ffi.Pointer ASN1_STRING_type_new( + int type, +); @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_T61STRING_free', ) -external void ASN1_T61STRING_free(ffi.Pointer str); +external void ASN1_T61STRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -1243,7 +1309,9 @@ external ffi.Pointer ASN1_TIME_adj( @ffi.Native)>( symbol: 'bssl_dart_ASN1_TIME_check', ) -external int ASN1_TIME_check(ffi.Pointer t); +external int ASN1_TIME_check( + ffi.Pointer 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 @@ -1276,7 +1344,9 @@ external int ASN1_TIME_diff( @ffi.Native)>( symbol: 'bssl_dart_ASN1_TIME_free', ) -external void ASN1_TIME_free(ffi.Pointer str); +external void ASN1_TIME_free( + ffi.Pointer 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 @@ -1293,7 +1363,10 @@ external ffi.Pointer ASN1_TIME_new(); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_ASN1_TIME_print', ) -external int ASN1_TIME_print(ffi.Pointer out, ffi.Pointer a); +external int ASN1_TIME_print( + ffi.Pointer out, + ffi.Pointer a, +); /// ASN1_TIME_set is exactly the same as `ASN1_TIME_set_posix` but with a /// time_t as input for compatibility. @@ -1407,14 +1480,19 @@ external int ASN1_TIME_to_time_t( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_ASN1_TYPE_cmp', ) -external int ASN1_TYPE_cmp(ffi.Pointer a, ffi.Pointer b); +external int ASN1_TYPE_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// ASN1_TYPE_free releases memory associated with `a`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_TYPE_free', ) -external void ASN1_TYPE_free(ffi.Pointer a); +external void ASN1_TYPE_free( + ffi.Pointer 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. @@ -1422,7 +1500,9 @@ external void ASN1_TYPE_free(ffi.Pointer a); @ffi.Native)>( symbol: 'bssl_dart_ASN1_TYPE_get', ) -external int ASN1_TYPE_get(ffi.Pointer a); +external int ASN1_TYPE_get( + ffi.Pointer 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 @@ -1471,7 +1551,9 @@ external int ASN1_TYPE_set1( @ffi.Native)>( symbol: 'bssl_dart_ASN1_UNIVERSALSTRING_free', ) -external void ASN1_UNIVERSALSTRING_free(ffi.Pointer str); +external void ASN1_UNIVERSALSTRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -1507,14 +1589,18 @@ external ffi.Pointer ASN1_UTCTIME_adj( @ffi.Native)>( symbol: 'bssl_dart_ASN1_UTCTIME_check', ) -external int ASN1_UTCTIME_check(ffi.Pointer a); +external int ASN1_UTCTIME_check( + ffi.Pointer a, +); /// ASN1_UTCTIME_free calls `ASN1_STRING_free`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ASN1_UTCTIME_free', ) -external void ASN1_UTCTIME_free(ffi.Pointer str); +external void ASN1_UTCTIME_free( + ffi.Pointer 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 @@ -1568,7 +1654,9 @@ external int ASN1_UTCTIME_set_string( @ffi.Native)>( symbol: 'bssl_dart_ASN1_UTF8STRING_free', ) -external void ASN1_UTF8STRING_free(ffi.Pointer str); +external void ASN1_UTF8STRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -1580,7 +1668,9 @@ external ffi.Pointer ASN1_UTF8STRING_new(); @ffi.Native)>( symbol: 'bssl_dart_ASN1_VISIBLESTRING_free', ) -external void ASN1_VISIBLESTRING_free(ffi.Pointer str); +external void ASN1_VISIBLESTRING_free( + ffi.Pointer str, +); @meta.RecordUse() @ffi.Native Function()>( @@ -1847,7 +1937,9 @@ external int ASN1_item_i2d_fp( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_ASN1_item_new', ) -external ffi.Pointer ASN1_item_new(ffi.Pointer it); +external ffi.Pointer ASN1_item_new( + ffi.Pointer 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. @@ -2063,7 +2155,11 @@ external int ASN1_mbstring_ncopy( @ffi.Native( symbol: 'bssl_dart_ASN1_object_size', ) -external int ASN1_object_size(int constructed, int length, int tag); +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. @@ -2073,7 +2169,9 @@ external int ASN1_object_size(int constructed, int length, int tag); @ffi.Native>)>( symbol: 'bssl_dart_ASN1_put_eoc', ) -external int ASN1_put_eoc(ffi.Pointer> outp); +external int ASN1_put_eoc( + ffi.Pointer> 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 @@ -2109,7 +2207,9 @@ external void ASN1_put_object( @ffi.Native( symbol: 'bssl_dart_ASN1_tag2bit', ) -external int ASN1_tag2bit(int tag); +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_*`. @@ -2117,7 +2217,9 @@ external int ASN1_tag2bit(int tag); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_ASN1_tag2str', ) -external ffi.Pointer ASN1_tag2str(int tag); +external ffi.Pointer ASN1_tag2str( + int tag, +); /// AUTHORITY_INFO_ACCESS_free releases memory associated with `aia`. @meta.RecordUse() @@ -2141,7 +2243,9 @@ external ffi.Pointer AUTHORITY_INFO_ACCESS_new(); @ffi.Native)>( symbol: 'bssl_dart_AUTHORITY_KEYID_free', ) -external void AUTHORITY_KEYID_free(ffi.Pointer akid); +external void AUTHORITY_KEYID_free( + ffi.Pointer akid, +); /// AUTHORITY_KEYID_new returns a newly-allocated, empty `AUTHORITY_KEYID` /// object, or NULL on error. @@ -2156,7 +2260,9 @@ external ffi.Pointer AUTHORITY_KEYID_new(); @ffi.Native)>( symbol: 'bssl_dart_BASIC_CONSTRAINTS_free', ) -external void BASIC_CONSTRAINTS_free(ffi.Pointer bcons); +external void BASIC_CONSTRAINTS_free( + ffi.Pointer bcons, +); /// BASIC_CONSTRAINTS_new returns a newly-allocated, empty `BASIC_CONSTRAINTS` /// object, or NULL on error. @@ -2199,7 +2305,10 @@ external int BIO_callback_ctrl( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_clear_flags', ) -external void BIO_clear_flags(ffi.Pointer bio, int flags); +external void BIO_clear_flags( + ffi.Pointer 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`. @@ -2207,7 +2316,9 @@ external void BIO_clear_flags(ffi.Pointer bio, int flags); @ffi.Native)>( symbol: 'bssl_dart_BIO_clear_retry_flags', ) -external void BIO_clear_retry_flags(ffi.Pointer bio); +external void BIO_clear_retry_flags( + ffi.Pointer bio, +); /// BIO_copy_next_retry sets the retry flags and `retry_reason` of `bio` from /// the next BIO in the chain. @@ -2215,7 +2326,9 @@ external void BIO_clear_retry_flags(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_copy_next_retry', ) -external void BIO_copy_next_retry(ffi.Pointer bio); +external void BIO_copy_next_retry( + ffi.Pointer bio, +); /// BIO_ctrl sends the control request `cmd` to `bio`. The `cmd` argument should /// be one of the `BIO_C_*` values. @@ -2236,7 +2349,9 @@ external int BIO_ctrl( @ffi.Native)>( symbol: 'bssl_dart_BIO_ctrl_get_read_request', ) -external int BIO_ctrl_get_read_request(ffi.Pointer bio); +external int BIO_ctrl_get_read_request( + ffi.Pointer 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 @@ -2245,7 +2360,9 @@ external int BIO_ctrl_get_read_request(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_ctrl_get_write_guarantee', ) -external int BIO_ctrl_get_write_guarantee(ffi.Pointer bio); +external int BIO_ctrl_get_write_guarantee( + ffi.Pointer bio, +); /// BIO_ctrl_pending calls `BIO_pending` and exists only for compatibility with /// OpenSSL. @@ -2253,7 +2370,9 @@ external int BIO_ctrl_get_write_guarantee(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_ctrl_pending', ) -external int BIO_ctrl_pending(ffi.Pointer bio); +external int BIO_ctrl_pending( + ffi.Pointer bio, +); /// BIO_do_connect connects `bio` if it has not been connected yet. It returns /// one on success and <= 0 otherwise. @@ -2261,14 +2380,18 @@ external int BIO_ctrl_pending(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_do_connect', ) -external int BIO_do_connect(ffi.Pointer bio); +external int BIO_do_connect( + ffi.Pointer 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)>(symbol: 'bssl_dart_BIO_eof') -external int BIO_eof(ffi.Pointer bio); +external int BIO_eof( + ffi.Pointer bio, +); /// BIO_find_type walks a chain of BIOs and returns the first that matches /// `type`, which is one of the `BIO_TYPE_*` values. @@ -2282,14 +2405,19 @@ external int BIO_eof(ffi.Pointer bio); @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_BIO_find_type', ) -external ffi.Pointer BIO_find_type(ffi.Pointer bio, int type); +external ffi.Pointer BIO_find_type( + ffi.Pointer 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)>(symbol: 'bssl_dart_BIO_flush') -external int BIO_flush(ffi.Pointer bio); +external int BIO_flush( + ffi.Pointer 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 @@ -2307,7 +2435,9 @@ external int BIO_flush(ffi.Pointer bio); /// counts it owns. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BIO_free') -external int BIO_free(ffi.Pointer bio); +external int BIO_free( + ffi.Pointer 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. @@ -2315,7 +2445,9 @@ external int BIO_free(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_free_all', ) -external void BIO_free_all(ffi.Pointer bio); +external void BIO_free_all( + ffi.Pointer bio, +); /// BIO_get_data returns custom data on `bio` set by `BIO_get_data`. /// @@ -2326,13 +2458,18 @@ external void BIO_free_all(ffi.Pointer bio); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BIO_get_data', ) -external ffi.Pointer BIO_get_data(ffi.Pointer bio); +external ffi.Pointer BIO_get_data( + ffi.Pointer bio, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_BIO_get_ex_data', ) -external ffi.Pointer BIO_get_ex_data(ffi.Pointer bio, int idx); +external ffi.Pointer BIO_get_ex_data( + ffi.Pointer bio, + int idx, +); /// ex_data functions. /// @@ -2365,7 +2502,10 @@ external int BIO_get_ex_new_index( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BIO_get_fd', ) -external int BIO_get_fd(ffi.Pointer bio, ffi.Pointer out_fd); +external int BIO_get_fd( + ffi.Pointer bio, + ffi.Pointer out_fd, +); /// BIO_get_fp sets `*out_file` to the current `FILE` for `bio`. It returns one /// on success and zero otherwise. @@ -2383,7 +2523,9 @@ external int BIO_get_fp( @ffi.Native)>( symbol: 'bssl_dart_BIO_get_init', ) -external int BIO_get_init(ffi.Pointer bio); +external int BIO_get_init( + ffi.Pointer bio, +); /// BIO_get_mem_data sets `*contents` to point to the current contents of `bio` /// and returns the length of the data. @@ -2423,7 +2565,9 @@ external int BIO_get_new_index(); @ffi.Native)>( symbol: 'bssl_dart_BIO_get_retry_flags', ) -external int BIO_get_retry_flags(ffi.Pointer bio); +external int BIO_get_retry_flags( + ffi.Pointer 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. @@ -2431,14 +2575,18 @@ external int BIO_get_retry_flags(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_get_retry_reason', ) -external int BIO_get_retry_reason(ffi.Pointer bio); +external int BIO_get_retry_reason( + ffi.Pointer bio, +); /// BIO_get_shutdown returns the method-specific "shutdown" bit. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BIO_get_shutdown', ) -external int BIO_get_shutdown(ffi.Pointer bio); +external int BIO_get_shutdown( + ffi.Pointer 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 @@ -2482,7 +2630,11 @@ external int BIO_hexdump( @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.UnsignedInt, ffi.UnsignedInt) >(symbol: 'bssl_dart_BIO_indent') -external int BIO_indent(ffi.Pointer bio, int indent, int max_indent); +external int BIO_indent( + ffi.Pointer bio, + int indent, + int max_indent, +); /// BIO_int_ctrl acts like `BIO_ctrl` but passes the address of a copy of `iarg` /// as `parg`. @@ -2490,7 +2642,12 @@ external int BIO_indent(ffi.Pointer bio, int indent, int max_indent); @ffi.Native, ffi.Int, ffi.Long, ffi.Int)>( symbol: 'bssl_dart_BIO_int_ctrl', ) -external int BIO_int_ctrl(ffi.Pointer bp, int cmd, int larg, int iarg); +external int BIO_int_ctrl( + ffi.Pointer 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 @@ -2514,7 +2671,9 @@ external int BIO_mem_contents( @ffi.Native)>( symbol: 'bssl_dart_BIO_meth_free', ) -external void BIO_meth_free(ffi.Pointer method); +external void BIO_meth_free( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2530,7 +2689,9 @@ external ffi.Pointer< ffi.Long Function(ffi.Pointer, ffi.Int, ffi.Pointer) > > -BIO_meth_get_callback_ctrl(ffi.Pointer method); +BIO_meth_get_callback_ctrl( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2539,7 +2700,9 @@ BIO_meth_get_callback_ctrl(ffi.Pointer method); ) >(symbol: 'bssl_dart_BIO_meth_get_create') external ffi.Pointer)>> -BIO_meth_get_create(ffi.Pointer method); +BIO_meth_get_create( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2565,7 +2728,9 @@ external ffi.Pointer< ) > > -BIO_meth_get_ctrl(ffi.Pointer method); +BIO_meth_get_ctrl( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2574,7 +2739,9 @@ BIO_meth_get_ctrl(ffi.Pointer method); ) >(symbol: 'bssl_dart_BIO_meth_get_destroy') external ffi.Pointer)>> -BIO_meth_get_destroy(ffi.Pointer method); +BIO_meth_get_destroy( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2590,7 +2757,9 @@ external ffi.Pointer< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) > > -BIO_meth_get_gets(ffi.Pointer method); +BIO_meth_get_gets( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2604,7 +2773,9 @@ BIO_meth_get_gets(ffi.Pointer method); external ffi.Pointer< ffi.NativeFunction, ffi.Pointer)> > -BIO_meth_get_puts(ffi.Pointer method); +BIO_meth_get_puts( + ffi.Pointer method, +); @meta.RecordUse() @ffi.Native< @@ -2620,7 +2791,9 @@ external ffi.Pointer< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) > > -BIO_meth_get_read(ffi.Pointer method); +BIO_meth_get_read( + ffi.Pointer method, +); /// The following functions return function pointers, possibly NULL, which are /// compatible with the corresponding `BIO_meth_set_*` function. `method` must be @@ -2659,7 +2832,9 @@ external ffi.Pointer< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) > > -BIO_meth_get_write(ffi.Pointer method); +BIO_meth_get_write( + ffi.Pointer 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 @@ -2940,7 +3115,9 @@ external int BIO_meth_set_write_ex( @ffi.Native)>( symbol: 'bssl_dart_BIO_method_type', ) -external int BIO_method_type(ffi.Pointer bio); +external int BIO_method_type( + ffi.Pointer 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. @@ -2948,7 +3125,9 @@ external int BIO_method_type(ffi.Pointer bio); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BIO_new', ) -external ffi.Pointer BIO_new(ffi.Pointer method); +external ffi.Pointer BIO_new( + ffi.Pointer 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 @@ -2990,7 +3169,10 @@ external ffi.Pointer BIO_new_connect( @ffi.Native Function(ffi.Int, ffi.Int)>( symbol: 'bssl_dart_BIO_new_fd', ) -external ffi.Pointer BIO_new_fd(int fd, int close_flag); +external ffi.Pointer 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, @@ -3027,7 +3209,10 @@ external ffi.Pointer BIO_new_file( @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_BIO_new_fp', ) -external ffi.Pointer BIO_new_fp(ffi.Pointer file, int flags); +external ffi.Pointer BIO_new_fp( + ffi.Pointer 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 @@ -3040,7 +3225,10 @@ external ffi.Pointer BIO_new_fp(ffi.Pointer file, int flags); @ffi.Native Function(ffi.Pointer, ossl_ssize_t)>( symbol: 'bssl_dart_BIO_new_mem_buf', ) -external ffi.Pointer BIO_new_mem_buf(ffi.Pointer buf, int len); +external ffi.Pointer BIO_new_mem_buf( + ffi.Pointer 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 @@ -3049,7 +3237,10 @@ external ffi.Pointer BIO_new_mem_buf(ffi.Pointer buf, int len); @ffi.Native Function(ffi.Int, ffi.Int)>( symbol: 'bssl_dart_BIO_new_socket', ) -external ffi.Pointer BIO_new_socket(int fd, int close_flag); +external ffi.Pointer 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. @@ -3057,7 +3248,9 @@ external ffi.Pointer BIO_new_socket(int fd, int close_flag); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BIO_next', ) -external ffi.Pointer BIO_next(ffi.Pointer bio); +external ffi.Pointer BIO_next( + ffi.Pointer bio, +); /// BIO_number_read returns the number of bytes that have been read from /// `bio`. @@ -3065,7 +3258,9 @@ external ffi.Pointer BIO_next(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_number_read', ) -external int BIO_number_read(ffi.Pointer bio); +external int BIO_number_read( + ffi.Pointer bio, +); /// BIO_number_written returns the number of bytes that have been written to /// `bio`. @@ -3073,14 +3268,18 @@ external int BIO_number_read(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_number_written', ) -external int BIO_number_written(ffi.Pointer bio); +external int BIO_number_written( + ffi.Pointer bio, +); /// BIO_pending returns the number of bytes pending to be read. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BIO_pending', ) -external int BIO_pending(ffi.Pointer bio); +external int BIO_pending( + ffi.Pointer 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. @@ -3090,7 +3289,9 @@ external int BIO_pending(ffi.Pointer bio); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BIO_pop', ) -external ffi.Pointer BIO_pop(ffi.Pointer bio); +external ffi.Pointer BIO_pop( + ffi.Pointer 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. @@ -3098,7 +3299,10 @@ external ffi.Pointer BIO_pop(ffi.Pointer bio); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BIO_printf', ) -external int BIO_printf(ffi.Pointer bio, ffi.Pointer format); +external int BIO_printf( + ffi.Pointer bio, + ffi.Pointer 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 @@ -3133,7 +3337,10 @@ external ffi.Pointer BIO_push( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BIO_puts', ) -external int BIO_puts(ffi.Pointer bio, ffi.Pointer buf); +external int BIO_puts( + ffi.Pointer bio, + ffi.Pointer 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 @@ -3199,7 +3406,9 @@ external int BIO_read_filename( /// in this library. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BIO_reset') -external int BIO_reset(ffi.Pointer bio); +external int BIO_reset( + ffi.Pointer 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 @@ -3255,7 +3464,10 @@ external ffi.Pointer BIO_s_socket(); @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_BIO_seek', ) -external int BIO_seek(ffi.Pointer bio, int offset); +external int BIO_seek( + ffi.Pointer 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 @@ -3265,7 +3477,10 @@ external int BIO_seek(ffi.Pointer bio, int offset); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_close', ) -external int BIO_set_close(ffi.Pointer bio, int close_flag); +external int BIO_set_close( + ffi.Pointer 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 @@ -3313,7 +3528,10 @@ external int BIO_set_conn_port( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BIO_set_data', ) -external void BIO_set_data(ffi.Pointer bio, ffi.Pointer ptr); +external void BIO_set_data( + ffi.Pointer bio, + ffi.Pointer ptr, +); @meta.RecordUse() @ffi.Native, ffi.Int, ffi.Pointer)>( @@ -3335,7 +3553,11 @@ external int BIO_set_ex_data( @ffi.Native, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_BIO_set_fd', ) -external int BIO_set_fd(ffi.Pointer bio, int fd, int close_flag); +external int BIO_set_fd( + ffi.Pointer 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`. @@ -3343,7 +3565,10 @@ external int BIO_set_fd(ffi.Pointer bio, int fd, int close_flag); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_flags', ) -external void BIO_set_flags(ffi.Pointer bio, int flags); +external void BIO_set_flags( + ffi.Pointer 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 @@ -3380,7 +3605,10 @@ external int BIO_set_fp( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_init', ) -external void BIO_set_init(ffi.Pointer bio, int init); +external void BIO_set_init( + ffi.Pointer 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 @@ -3409,7 +3637,10 @@ external int BIO_set_mem_buf( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_mem_eof_return', ) -external int BIO_set_mem_eof_return(ffi.Pointer bio, int eof_value); +external int BIO_set_mem_eof_return( + ffi.Pointer 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 @@ -3421,7 +3652,10 @@ external int BIO_set_mem_eof_return(ffi.Pointer bio, int eof_value); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_nbio', ) -external int BIO_set_nbio(ffi.Pointer bio, int on); +external int BIO_set_nbio( + ffi.Pointer bio, + int on, +); /// BIO_set_retry_read sets the `BIO_FLAGS_READ` and `BIO_FLAGS_SHOULD_RETRY` /// flags on `bio`. @@ -3429,7 +3663,9 @@ external int BIO_set_nbio(ffi.Pointer bio, int on); @ffi.Native)>( symbol: 'bssl_dart_BIO_set_retry_read', ) -external void BIO_set_retry_read(ffi.Pointer bio); +external void BIO_set_retry_read( + ffi.Pointer 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. @@ -3437,13 +3673,18 @@ external void BIO_set_retry_read(ffi.Pointer bio); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_retry_reason', ) -external void BIO_set_retry_reason(ffi.Pointer bio, int reason); +external void BIO_set_retry_reason( + ffi.Pointer bio, + int reason, +); @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BIO_set_retry_special', ) -external void BIO_set_retry_special(ffi.Pointer bio); +external void BIO_set_retry_special( + ffi.Pointer bio, +); /// BIO_set_retry_write sets the `BIO_FLAGS_WRITE` and `BIO_FLAGS_SHOULD_RETRY` /// flags on `bio`. @@ -3451,21 +3692,29 @@ external void BIO_set_retry_special(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_set_retry_write', ) -external void BIO_set_retry_write(ffi.Pointer bio); +external void BIO_set_retry_write( + ffi.Pointer bio, +); /// BIO_set_shutdown sets a method-specific "shutdown" bit on `bio`. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_shutdown', ) -external void BIO_set_shutdown(ffi.Pointer bio, int shutdown); +external void BIO_set_shutdown( + ffi.Pointer bio, + int shutdown, +); /// BIO_set_write_buffer_size returns zero. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_set_write_buffer_size', ) -external int BIO_set_write_buffer_size(ffi.Pointer bio, int buffer_size); +external int BIO_set_write_buffer_size( + ffi.Pointer 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 @@ -3475,7 +3724,9 @@ external int BIO_set_write_buffer_size(ffi.Pointer bio, int buffer_size); @ffi.Native)>( symbol: 'bssl_dart_BIO_should_io_special', ) -external int BIO_should_io_special(ffi.Pointer bio); +external int BIO_should_io_special( + ffi.Pointer 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 @@ -3484,7 +3735,9 @@ external int BIO_should_io_special(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_should_read', ) -external int BIO_should_read(ffi.Pointer bio); +external int BIO_should_read( + ffi.Pointer 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, @@ -3493,7 +3746,9 @@ external int BIO_should_read(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_should_retry', ) -external int BIO_should_retry(ffi.Pointer bio); +external int BIO_should_retry( + ffi.Pointer 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 @@ -3502,7 +3757,9 @@ external int BIO_should_retry(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_should_write', ) -external int BIO_should_write(ffi.Pointer bio); +external int BIO_should_write( + ffi.Pointer 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 @@ -3511,7 +3768,9 @@ external int BIO_should_write(ffi.Pointer bio); @ffi.Native)>( symbol: 'bssl_dart_BIO_shutdown_wr', ) -external int BIO_shutdown_wr(ffi.Pointer bio); +external int BIO_shutdown_wr( + ffi.Pointer bio, +); /// BIO_snprintf has the same behavior as snprintf(3). @meta.RecordUse() @@ -3531,19 +3790,26 @@ external int BIO_snprintf( /// cannot report 64-bit offsets. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BIO_tell') -external int BIO_tell(ffi.Pointer bio); +external int BIO_tell( + ffi.Pointer bio, +); /// BIO_test_flags returns `bio->flags` AND `flags`. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BIO_test_flags', ) -external int BIO_test_flags(ffi.Pointer bio, int flags); +external int BIO_test_flags( + ffi.Pointer bio, + int flags, +); /// BIO_up_ref increments the reference count of `bio` and returns one. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BIO_up_ref') -external int BIO_up_ref(ffi.Pointer bio); +external int BIO_up_ref( + ffi.Pointer bio, +); /// BIO_vfree performs the same actions as `BIO_free`, but has a void return /// value. This is provided for API-compat. @@ -3551,7 +3817,9 @@ external int BIO_up_ref(ffi.Pointer bio); /// TODO(fork): remove. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BIO_vfree') -external void BIO_vfree(ffi.Pointer bio); +external void BIO_vfree( + ffi.Pointer bio, +); /// BIO_vsnprintf has the same behavior as vsnprintf(3). @meta.RecordUse() @@ -3575,7 +3843,9 @@ external int BIO_vsnprintf( @ffi.Native)>( symbol: 'bssl_dart_BIO_wpending', ) -external int BIO_wpending(ffi.Pointer bio); +external int BIO_wpending( + ffi.Pointer 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 @@ -3643,7 +3913,9 @@ external int BIO_write_filename( @ffi.Native)>( symbol: 'bssl_dart_BN_CTX_end', ) -external void BN_CTX_end(ffi.Pointer ctx); +external void BN_CTX_end( + ffi.Pointer ctx, +); /// BN_CTX_free frees all BIGNUMs contained in `ctx` and then frees `ctx` /// itself. @@ -3651,7 +3923,9 @@ external void BN_CTX_end(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_BN_CTX_free', ) -external void BN_CTX_free(ffi.Pointer ctx); +external void BN_CTX_free( + ffi.Pointer 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 @@ -3660,7 +3934,9 @@ external void BN_CTX_free(ffi.Pointer ctx); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_CTX_get', ) -external ffi.Pointer BN_CTX_get(ffi.Pointer ctx); +external ffi.Pointer BN_CTX_get( + ffi.Pointer ctx, +); /// BN_CTX_new returns a new, empty BN_CTX or NULL on allocation failure. @meta.RecordUse() @@ -3673,7 +3949,9 @@ external ffi.Pointer BN_CTX_new(); @ffi.Native)>( symbol: 'bssl_dart_BN_CTX_start', ) -external void BN_CTX_start(ffi.Pointer ctx); +external void BN_CTX_start( + ffi.Pointer ctx, +); /// BN_GENCB_call calls `callback`, if not NULL, and returns the return value of /// the callback, or 1 if `callback` is NULL. @@ -3681,21 +3959,29 @@ external void BN_CTX_start(ffi.Pointer ctx); @ffi.Native, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_BN_GENCB_call', ) -external int BN_GENCB_call(ffi.Pointer callback, int event, int n); +external int BN_GENCB_call( + ffi.Pointer callback, + int event, + int n, +); /// BN_GENCB_free releases memory associated with `callback`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_GENCB_free', ) -external void BN_GENCB_free(ffi.Pointer callback); +external void BN_GENCB_free( + ffi.Pointer callback, +); /// BN_GENCB_get_arg returns `callback->arg`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_GENCB_get_arg', ) -external ffi.Pointer BN_GENCB_get_arg(ffi.Pointer callback); +external ffi.Pointer BN_GENCB_get_arg( + ffi.Pointer 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 @@ -3748,7 +4034,9 @@ external ffi.Pointer BN_MONT_CTX_copy( @ffi.Native)>( symbol: 'bssl_dart_BN_MONT_CTX_free', ) -external void BN_MONT_CTX_free(ffi.Pointer mont); +external void BN_MONT_CTX_free( + ffi.Pointer mont, +); /// BN_MONT_CTX_new returns a fresh `BN_MONT_CTX` or NULL on allocation failure. /// Use `BN_MONT_CTX_new_for_modulus` instead. @@ -3803,7 +4091,10 @@ external int BN_MONT_CTX_set( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_abs_is_word', ) -external int BN_abs_is_word(ffi.Pointer bn, int w); +external int BN_abs_is_word( + ffi.Pointer 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. @@ -3826,7 +4117,10 @@ external int BN_add( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_add_word', ) -external int BN_add_word(ffi.Pointer a, int w); +external int BN_add_word( + ffi.Pointer 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 @@ -3867,9 +4161,12 @@ external ffi.Pointer BN_bin2bn( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_bn2bin', ) -external int BN_bn2bin(ffi.Pointer in$, ffi.Pointer out); - -/// BN_bn2bin_padded serialises the absolute value of `in` to `out` as a +external int BN_bn2bin( + ffi.Pointer in$, + ffi.Pointer 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. @@ -3919,7 +4216,9 @@ external int BN_bn2cbb_padded( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_bn2dec', ) -external ffi.Pointer BN_bn2dec(ffi.Pointer a); +external ffi.Pointer BN_bn2dec( + ffi.Pointer 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 @@ -3928,7 +4227,9 @@ external ffi.Pointer BN_bn2dec(ffi.Pointer a); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_bn2hex', ) -external ffi.Pointer BN_bn2hex(ffi.Pointer bn); +external ffi.Pointer BN_bn2hex( + ffi.Pointer 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 @@ -3968,14 +4269,19 @@ external int BN_bn2lebinpad( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_bn2mpi', ) -external int BN_bn2mpi(ffi.Pointer in$, ffi.Pointer out); +external int BN_bn2mpi( + ffi.Pointer in$, + ffi.Pointer out, +); /// BN_clear sets `bn` to zero and erases the old data. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_clear', ) -external void BN_clear(ffi.Pointer bn); +external void BN_clear( + ffi.Pointer 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 @@ -3984,7 +4290,10 @@ external void BN_clear(ffi.Pointer bn); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BN_clear_bit', ) -external int BN_clear_bit(ffi.Pointer a, int n); +external int BN_clear_bit( + ffi.Pointer 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. @@ -3992,7 +4301,9 @@ external int BN_clear_bit(ffi.Pointer a, int n); @ffi.Native)>( symbol: 'bssl_dart_BN_clear_free', ) -external void BN_clear_free(ffi.Pointer bn); +external void BN_clear_free( + ffi.Pointer 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. @@ -4000,7 +4311,10 @@ external void BN_clear_free(ffi.Pointer bn); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_cmp', ) -external int BN_cmp(ffi.Pointer a, ffi.Pointer b); +external int BN_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// BN_cmp_word is like `BN_cmp` except it takes its second argument as a /// `BN_ULONG` instead of a `BIGNUM`. @@ -4008,7 +4322,10 @@ external int BN_cmp(ffi.Pointer a, ffi.Pointer b); @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_cmp_word', ) -external int BN_cmp_word(ffi.Pointer a, int b); +external int BN_cmp_word( + ffi.Pointer a, + int b, +); /// BN_copy sets `dest` equal to `src` and returns `dest` or NULL on allocation /// failure. @@ -4028,7 +4345,9 @@ external ffi.Pointer BN_copy( @ffi.Native)>( symbol: 'bssl_dart_BN_count_low_zero_bits', ) -external int BN_count_low_zero_bits(ffi.Pointer bn); +external int BN_count_low_zero_bits( + ffi.Pointer 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, @@ -4083,7 +4402,10 @@ external int BN_div( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_div_word', ) -external int BN_div_word(ffi.Pointer numerator, int divisor); +external int BN_div_word( + ffi.Pointer 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. @@ -4091,7 +4413,9 @@ external int BN_div_word(ffi.Pointer numerator, int divisor); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_dup', ) -external ffi.Pointer BN_dup(ffi.Pointer src); +external ffi.Pointer BN_dup( + ffi.Pointer 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 @@ -4130,7 +4454,10 @@ external int BN_enhanced_miller_rabin_primality_test( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_equal_consttime', ) -external int BN_equal_consttime(ffi.Pointer a, ffi.Pointer b); +external int BN_equal_consttime( + ffi.Pointer a, + ffi.Pointer 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 @@ -4155,7 +4482,9 @@ external int BN_exp( /// allocated on the heap, frees `bn` also. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BN_free') -external void BN_free(ffi.Pointer bn); +external void BN_free( + ffi.Pointer 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 @@ -4235,7 +4564,9 @@ external int BN_generate_prime_ex( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_1536', ) -external ffi.Pointer BN_get_rfc3526_prime_1536(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_1536( + ffi.Pointer 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 @@ -4245,7 +4576,9 @@ external ffi.Pointer BN_get_rfc3526_prime_1536(ffi.Pointer ret); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_2048', ) -external ffi.Pointer BN_get_rfc3526_prime_2048(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_2048( + ffi.Pointer 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 @@ -4255,7 +4588,9 @@ external ffi.Pointer BN_get_rfc3526_prime_2048(ffi.Pointer ret); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_3072', ) -external ffi.Pointer BN_get_rfc3526_prime_3072(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_3072( + ffi.Pointer 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 @@ -4265,7 +4600,9 @@ external ffi.Pointer BN_get_rfc3526_prime_3072(ffi.Pointer ret); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_4096', ) -external ffi.Pointer BN_get_rfc3526_prime_4096(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_4096( + ffi.Pointer 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 @@ -4275,7 +4612,9 @@ external ffi.Pointer BN_get_rfc3526_prime_4096(ffi.Pointer ret); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_6144', ) -external ffi.Pointer BN_get_rfc3526_prime_6144(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_6144( + ffi.Pointer 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 @@ -4285,7 +4624,9 @@ external ffi.Pointer BN_get_rfc3526_prime_6144(ffi.Pointer ret); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BN_get_rfc3526_prime_8192', ) -external ffi.Pointer BN_get_rfc3526_prime_8192(ffi.Pointer ret); +external ffi.Pointer BN_get_rfc3526_prime_8192( + ffi.Pointer 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 @@ -4294,7 +4635,10 @@ external ffi.Pointer BN_get_rfc3526_prime_8192(ffi.Pointer ret); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_get_u64', ) -external int BN_get_u64(ffi.Pointer bn, ffi.Pointer out); +external int BN_get_u64( + ffi.Pointer bn, + ffi.Pointer 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 @@ -4303,7 +4647,9 @@ external int BN_get_u64(ffi.Pointer bn, ffi.Pointer out); @ffi.Native)>( symbol: 'bssl_dart_BN_get_word', ) -external int BN_get_word(ffi.Pointer bn); +external int BN_get_word( + ffi.Pointer 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. @@ -4323,7 +4669,9 @@ external int BN_hex2bn( /// BN_init initialises a stack allocated `BIGNUM`. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BN_init') -external void BN_init(ffi.Pointer bn); +external void BN_init( + ffi.Pointer bn, +); /// BN_is_bit_set returns one if the `n`th least-significant bit in `a` exists /// and is set. Otherwise, it returns zero. @@ -4331,35 +4679,46 @@ external void BN_init(ffi.Pointer bn); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BN_is_bit_set', ) -external int BN_is_bit_set(ffi.Pointer a, int n); +external int BN_is_bit_set( + ffi.Pointer a, + int n, +); /// BN_is_negative returns one if `bn` is negative and zero otherwise. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_is_negative', ) -external int BN_is_negative(ffi.Pointer bn); +external int BN_is_negative( + ffi.Pointer bn, +); /// BN_is_odd returns one if `bn` is odd and zero otherwise. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_is_odd', ) -external int BN_is_odd(ffi.Pointer bn); +external int BN_is_odd( + ffi.Pointer bn, +); /// BN_is_one returns one if `bn` equals one and zero otherwise. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_is_one', ) -external int BN_is_one(ffi.Pointer bn); +external int BN_is_one( + ffi.Pointer bn, +); /// BN_is_pow2 returns 1 if `a` is a power of two, and 0 otherwise. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_is_pow2', ) -external int BN_is_pow2(ffi.Pointer a); +external int BN_is_pow2( + ffi.Pointer a, +); /// BN_is_prime_ex acts the same as `BN_is_prime_fasttest_ex` with /// `do_trial_division` set to zero. @@ -4417,14 +4776,19 @@ external int BN_is_prime_fasttest_ex( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_is_word', ) -external int BN_is_word(ffi.Pointer bn, int w); +external int BN_is_word( + ffi.Pointer bn, + int w, +); /// BN_is_zero returns one if `bn` is zero and zero otherwise. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_BN_is_zero', ) -external int BN_is_zero(ffi.Pointer bn); +external int BN_is_zero( + ffi.Pointer bn, +); /// BN_le2bn calls `BN_lebin2bn`. @meta.RecordUse() @@ -4465,7 +4829,11 @@ external ffi.Pointer BN_lebin2bn( @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) >(symbol: 'bssl_dart_BN_lshift') -external int BN_lshift(ffi.Pointer r, ffi.Pointer a, int n); +external int BN_lshift( + ffi.Pointer r, + ffi.Pointer 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. @@ -4473,7 +4841,10 @@ external int BN_lshift(ffi.Pointer r, ffi.Pointer a, int n); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_lshift1', ) -external int BN_lshift1(ffi.Pointer r, ffi.Pointer a); +external int BN_lshift1( + ffi.Pointer r, + ffi.Pointer 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. @@ -4481,7 +4852,10 @@ external int BN_lshift1(ffi.Pointer r, ffi.Pointer a); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_marshal_asn1', ) -external int BN_marshal_asn1(ffi.Pointer cbb, ffi.Pointer bn); +external int BN_marshal_asn1( + ffi.Pointer cbb, + ffi.Pointer 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. @@ -4494,7 +4868,10 @@ external int BN_marshal_asn1(ffi.Pointer cbb, ffi.Pointer bn); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BN_mask_bits', ) -external int BN_mask_bits(ffi.Pointer a, int n); +external int BN_mask_bits( + ffi.Pointer a, + int n, +); /// BN_mod_add sets `r` = `a` + `b` mod `m`. It returns one on success and zero /// on error. @@ -4850,7 +5227,11 @@ external int BN_mod_mul_montgomery( @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) >(symbol: 'bssl_dart_BN_mod_pow2') -external int BN_mod_pow2(ffi.Pointer r, ffi.Pointer a, int e); +external int BN_mod_pow2( + ffi.Pointer r, + ffi.Pointer a, + int e, +); /// BN_mod_sqr sets `r` = `a`^2 mod `m`. It returns one on success and zero /// on error. @@ -4941,7 +5322,10 @@ external int BN_mod_sub_quick( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_mod_word', ) -external int BN_mod_word(ffi.Pointer a, int w); +external int BN_mod_word( + ffi.Pointer 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`. @@ -4987,7 +5371,10 @@ external int BN_mul( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_mul_word', ) -external int BN_mul_word(ffi.Pointer bn, int w); +external int BN_mul_word( + ffi.Pointer bn, + int w, +); /// BN_new creates a new, allocated BIGNUM and initialises it. @meta.RecordUse() @@ -5019,7 +5406,11 @@ external int BN_nnmod( @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Size) >(symbol: 'bssl_dart_BN_nnmod_pow2') -external int BN_nnmod_pow2(ffi.Pointer r, ffi.Pointer a, int e); +external int BN_nnmod_pow2( + ffi.Pointer r, + ffi.Pointer a, + int e, +); /// BN_num_bits returns the minimum number of bits needed to represent the /// absolute value of `bn`. @@ -5027,13 +5418,17 @@ external int BN_nnmod_pow2(ffi.Pointer r, ffi.Pointer a, int e); @ffi.Native)>( symbol: 'bssl_dart_BN_num_bits', ) -external int BN_num_bits(ffi.Pointer bn); +external int BN_num_bits( + ffi.Pointer bn, +); @meta.RecordUse() @ffi.Native( symbol: 'bssl_dart_BN_num_bits_word', ) -external int BN_num_bits_word(int l); +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`. @@ -5045,13 +5440,17 @@ external int BN_num_bits_word(int l); @ffi.Native)>( symbol: 'bssl_dart_BN_num_bytes', ) -external int BN_num_bytes(ffi.Pointer bn); +external int BN_num_bytes( + ffi.Pointer bn, +); /// BN_one sets `bn` to one. It returns one on success or zero on allocation /// failure. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BN_one') -external int BN_one(ffi.Pointer bn); +external int BN_one( + ffi.Pointer 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. @@ -5104,14 +5503,20 @@ external int BN_primality_test( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_print', ) -external int BN_print(ffi.Pointer bio, ffi.Pointer a); +external int BN_print( + ffi.Pointer bio, + ffi.Pointer a, +); /// BN_print_fp acts like `BIO_print`, but wraps `fp` in a `BIO` first. @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_print_fp', ) -external int BN_print_fp(ffi.Pointer fp, ffi.Pointer a); +external int BN_print_fp( + ffi.Pointer fp, + ffi.Pointer a, +); /// BN_pseudo_rand is an alias for `BN_rand`. @meta.RecordUse() @@ -5151,7 +5556,12 @@ external int BN_pseudo_rand_range( @ffi.Native, ffi.Int, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_BN_rand', ) -external int BN_rand(ffi.Pointer rnd, int bits, int top, int bottom); +external int BN_rand( + ffi.Pointer 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`. @@ -5159,7 +5569,10 @@ external int BN_rand(ffi.Pointer rnd, int bits, int top, int bottom); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_rand_range', ) -external int BN_rand_range(ffi.Pointer rnd, ffi.Pointer range); +external int BN_rand_range( + ffi.Pointer rnd, + ffi.Pointer range, +); /// BN_rand_range_ex sets `rnd` to a random value in /// [min_inclusive..max_exclusive). It returns one on success and zero @@ -5180,7 +5593,11 @@ external int BN_rand_range_ex( @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int) >(symbol: 'bssl_dart_BN_rshift') -external int BN_rshift(ffi.Pointer r, ffi.Pointer a, int n); +external int BN_rshift( + ffi.Pointer r, + ffi.Pointer 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. @@ -5188,7 +5605,10 @@ external int BN_rshift(ffi.Pointer r, ffi.Pointer a, int n); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_rshift1', ) -external int BN_rshift1(ffi.Pointer r, ffi.Pointer a); +external int BN_rshift1( + ffi.Pointer r, + ffi.Pointer a, +); /// BN_secure_new calls `BN_new`. @meta.RecordUse() @@ -5202,14 +5622,20 @@ external ffi.Pointer BN_secure_new(); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BN_set_bit', ) -external int BN_set_bit(ffi.Pointer a, int n); +external int BN_set_bit( + ffi.Pointer a, + int n, +); /// BN_set_negative sets the sign of `bn`. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_BN_set_negative', ) -external void BN_set_negative(ffi.Pointer bn, int sign); +external void BN_set_negative( + ffi.Pointer bn, + int sign, +); /// BN_set_u64 sets `bn` to `value`. It returns one on success or zero on /// allocation failure. @@ -5217,7 +5643,10 @@ external void BN_set_negative(ffi.Pointer bn, int sign); @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_BN_set_u64', ) -external int BN_set_u64(ffi.Pointer bn, int value); +external int BN_set_u64( + ffi.Pointer bn, + int value, +); /// BN_set_word sets `bn` to `value`. It returns one on success or zero on /// allocation failure. @@ -5225,7 +5654,10 @@ external int BN_set_u64(ffi.Pointer bn, int value); @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_set_word', ) -external int BN_set_word(ffi.Pointer bn, int value); +external int BN_set_word( + ffi.Pointer 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 @@ -5284,7 +5716,10 @@ external int BN_sub( @ffi.Native, BN_ULONG)>( symbol: 'bssl_dart_BN_sub_word', ) -external int BN_sub_word(ffi.Pointer a, int w); +external int BN_sub_word( + ffi.Pointer 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 @@ -5361,7 +5796,10 @@ external int BN_uadd( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_BN_ucmp', ) -external int BN_ucmp(ffi.Pointer a, ffi.Pointer b); +external int BN_ucmp( + ffi.Pointer a, + ffi.Pointer 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 @@ -5388,7 +5826,9 @@ external ffi.Pointer BN_value_one(); /// BN_zero sets `bn` to zero. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_BN_zero') -external void BN_zero(ffi.Pointer bn); +external void BN_zero( + ffi.Pointer 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 @@ -5422,7 +5862,9 @@ external int BUF_MEM_append( @ffi.Native)>( symbol: 'bssl_dart_BUF_MEM_free', ) -external void BUF_MEM_free(ffi.Pointer buf); +external void BUF_MEM_free( + ffi.Pointer 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 @@ -5431,7 +5873,10 @@ external void BUF_MEM_free(ffi.Pointer buf); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_BUF_MEM_grow', ) -external int BUF_MEM_grow(ffi.Pointer buf, int len); +external int BUF_MEM_grow( + ffi.Pointer buf, + int len, +); /// BUF_MEM_grow_clean calls `BUF_MEM_grow`. BoringSSL always zeros memory /// allocated memory on free. @@ -5439,7 +5884,10 @@ external int BUF_MEM_grow(ffi.Pointer buf, int len); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_BUF_MEM_grow_clean', ) -external int BUF_MEM_grow_clean(ffi.Pointer buf, int len); +external int BUF_MEM_grow_clean( + ffi.Pointer buf, + int len, +); /// BUF_MEM_new creates a new BUF_MEM which has no allocated data buffer. @meta.RecordUse() @@ -5452,21 +5900,29 @@ external ffi.Pointer BUF_MEM_new(); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_BUF_MEM_reserve', ) -external int BUF_MEM_reserve(ffi.Pointer buf, int cap); +external int BUF_MEM_reserve( + ffi.Pointer buf, + int cap, +); /// BUF_memdup calls `OPENSSL_memdup`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer, ffi.Size)>( symbol: 'bssl_dart_BUF_memdup', ) -external ffi.Pointer BUF_memdup(ffi.Pointer data, int size); +external ffi.Pointer BUF_memdup( + ffi.Pointer data, + int size, +); /// BUF_strdup calls `OPENSSL_strdup`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_BUF_strdup', ) -external ffi.Pointer BUF_strdup(ffi.Pointer str); +external ffi.Pointer BUF_strdup( + ffi.Pointer str, +); /// BUF_strlcat calls `OPENSSL_strlcat`. @meta.RecordUse() @@ -5495,14 +5951,20 @@ external int BUF_strlcpy( @ffi.Native Function(ffi.Pointer, ffi.Size)>( symbol: 'bssl_dart_BUF_strndup', ) -external ffi.Pointer BUF_strndup(ffi.Pointer str, int size); +external ffi.Pointer BUF_strndup( + ffi.Pointer str, + int size, +); /// BUF_strnlen calls `OPENSSL_strnlen`. @meta.RecordUse() @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_BUF_strnlen', ) -external int BUF_strnlen(ffi.Pointer str, int max_len); +external int BUF_strnlen( + ffi.Pointer 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 @@ -5523,7 +5985,10 @@ external int CBB_add_asn1( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_CBB_add_asn1_bool', ) -external int CBB_add_asn1_bool(ffi.Pointer cbb, int value); +external int CBB_add_asn1_bool( + ffi.Pointer 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 @@ -5551,7 +6016,10 @@ external int CBB_add_asn1_element( @ffi.Native, ffi.Int64)>( symbol: 'bssl_dart_CBB_add_asn1_int64', ) -external int CBB_add_asn1_int64(ffi.Pointer cbb, int value); +external int CBB_add_asn1_int64( + ffi.Pointer 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 @@ -5589,7 +6057,10 @@ external int CBB_add_asn1_octet_string( @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_CBB_add_asn1_oid_component', ) -external int CBB_add_asn1_oid_component(ffi.Pointer cbb, int value); +external int CBB_add_asn1_oid_component( + ffi.Pointer 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 @@ -5652,7 +6123,10 @@ external int CBB_add_asn1_relative_oid_from_text( @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_CBB_add_asn1_uint64', ) -external int CBB_add_asn1_uint64(ffi.Pointer cbb, int value); +external int CBB_add_asn1_uint64( + ffi.Pointer 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 @@ -5683,7 +6157,10 @@ external int CBB_add_bytes( @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_latin1', ) -external int CBB_add_latin1(ffi.Pointer cbb, int u); +external int CBB_add_latin1( + ffi.Pointer 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 @@ -5709,7 +6186,10 @@ external int CBB_add_space( @ffi.Native, ffi.Uint16)>( symbol: 'bssl_dart_CBB_add_u16', ) -external int CBB_add_u16(ffi.Pointer cbb, int value); +external int CBB_add_u16( + ffi.Pointer 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, @@ -5729,7 +6209,10 @@ external int CBB_add_u16_length_prefixed( @ffi.Native, ffi.Uint16)>( symbol: 'bssl_dart_CBB_add_u16le', ) -external int CBB_add_u16le(ffi.Pointer cbb, int value); +external int CBB_add_u16le( + ffi.Pointer 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. @@ -5737,7 +6220,10 @@ external int CBB_add_u16le(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_u24', ) -external int CBB_add_u24(ffi.Pointer cbb, int value); +external int CBB_add_u24( + ffi.Pointer 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, @@ -5757,7 +6243,10 @@ external int CBB_add_u24_length_prefixed( @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_u32', ) -external int CBB_add_u32(ffi.Pointer cbb, int value); +external int CBB_add_u32( + ffi.Pointer 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. @@ -5765,7 +6254,10 @@ external int CBB_add_u32(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_u32le', ) -external int CBB_add_u32le(ffi.Pointer cbb, int value); +external int CBB_add_u32le( + ffi.Pointer 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. @@ -5773,7 +6265,10 @@ external int CBB_add_u32le(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_CBB_add_u48', ) -external int CBB_add_u48(ffi.Pointer cbb, int value); +external int CBB_add_u48( + ffi.Pointer 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. @@ -5781,7 +6276,10 @@ external int CBB_add_u48(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_CBB_add_u64', ) -external int CBB_add_u64(ffi.Pointer cbb, int value); +external int CBB_add_u64( + ffi.Pointer 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. @@ -5789,7 +6287,10 @@ external int CBB_add_u64(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint64)>( symbol: 'bssl_dart_CBB_add_u64le', ) -external int CBB_add_u64le(ffi.Pointer cbb, int value); +external int CBB_add_u64le( + ffi.Pointer cbb, + int value, +); /// CBB_add_u8 appends an 8-bit number from `value` to `cbb`. It returns one on /// success and zero otherwise. @@ -5797,7 +6298,10 @@ external int CBB_add_u64le(ffi.Pointer cbb, int value); @ffi.Native, ffi.Uint8)>( symbol: 'bssl_dart_CBB_add_u8', ) -external int CBB_add_u8(ffi.Pointer cbb, int value); +external int CBB_add_u8( + ffi.Pointer 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 @@ -5815,13 +6319,19 @@ external int CBB_add_u8_length_prefixed( @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_ucs2_be', ) -external int CBB_add_ucs2_be(ffi.Pointer cbb, int u); +external int CBB_add_ucs2_be( + ffi.Pointer cbb, + int u, +); @meta.RecordUse() @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_utf32_be', ) -external int CBB_add_utf32_be(ffi.Pointer cbb, int u); +external int CBB_add_utf32_be( + ffi.Pointer 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 @@ -5831,7 +6341,10 @@ external int CBB_add_utf32_be(ffi.Pointer cbb, int u); @ffi.Native, ffi.Uint32)>( symbol: 'bssl_dart_CBB_add_utf8', ) -external int CBB_add_utf8(ffi.Pointer cbb, int u); +external int CBB_add_utf8( + ffi.Pointer cbb, + int u, +); /// CBB_add_zeros append `len` bytes with value zero to `cbb`. It returns one on /// success and zero otherwise. @@ -5839,7 +6352,10 @@ external int CBB_add_utf8(ffi.Pointer cbb, int u); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_CBB_add_zeros', ) -external int CBB_add_zeros(ffi.Pointer cbb, int len); +external int CBB_add_zeros( + ffi.Pointer 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 @@ -5852,7 +6368,9 @@ external int CBB_add_zeros(ffi.Pointer cbb, int len); @ffi.Native)>( symbol: 'bssl_dart_CBB_cleanup', ) -external void CBB_cleanup(ffi.Pointer cbb); +external void CBB_cleanup( + ffi.Pointer 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`. @@ -5863,7 +6381,9 @@ external void CBB_cleanup(ffi.Pointer cbb); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_CBB_data', ) -external ffi.Pointer CBB_data(ffi.Pointer cbb); +external ffi.Pointer CBB_data( + ffi.Pointer 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. @@ -5871,7 +6391,10 @@ external ffi.Pointer CBB_data(ffi.Pointer cbb); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_CBB_did_write', ) -external int CBB_did_write(ffi.Pointer cbb, int len); +external int CBB_did_write( + ffi.Pointer 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`. @@ -5879,7 +6402,10 @@ external int CBB_did_write(ffi.Pointer cbb, int len); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_CBB_discard', ) -external void CBB_discard(ffi.Pointer cbb, int len); +external void CBB_discard( + ffi.Pointer 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. @@ -5887,7 +6413,9 @@ external void CBB_discard(ffi.Pointer cbb, int len); @ffi.Native)>( symbol: 'bssl_dart_CBB_discard_child', ) -external void CBB_discard_child(ffi.Pointer cbb); +external void CBB_discard_child( + ffi.Pointer 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 @@ -5918,7 +6446,9 @@ external int CBB_finish( /// function returns one on success or zero on error. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_CBB_flush') -external int CBB_flush(ffi.Pointer cbb); +external int CBB_flush( + ffi.Pointer 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 @@ -5931,13 +6461,17 @@ external int CBB_flush(ffi.Pointer cbb); @ffi.Native)>( symbol: 'bssl_dart_CBB_flush_asn1_set_of', ) -external int CBB_flush_asn1_set_of(ffi.Pointer cbb); +external int CBB_flush_asn1_set_of( + ffi.Pointer cbb, +); /// CBB_get_utf8_len returns the number of bytes needed to represent `u` in /// UTF-8. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_CBB_get_utf8_len') -external int CBB_get_utf8_len(int u); +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 @@ -5946,7 +6480,10 @@ external int CBB_get_utf8_len(int u); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_CBB_init', ) -external int CBB_init(ffi.Pointer cbb, int initial_capacity); +external int CBB_init( + ffi.Pointer 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 @@ -5969,7 +6506,9 @@ external int CBB_init_fixed( /// CBB with any active children. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_CBB_len') -external int CBB_len(ffi.Pointer cbb); +external int CBB_len( + ffi.Pointer 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 @@ -5996,7 +6535,9 @@ external int CBB_reserve( /// uniform cleanup of a `CBB`. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_CBB_zero') -external void CBB_zero(ffi.Pointer cbb); +external void CBB_zero( + ffi.Pointer 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. @@ -6005,7 +6546,10 @@ external void CBB_zero(ffi.Pointer cbb); @ffi.Native, ffi.UnsignedInt)>( symbol: 'bssl_dart_CBS_asn1_bitstring_has_bit', ) -external int CBS_asn1_bitstring_has_bit(ffi.Pointer cbs, int bit); +external int CBS_asn1_bitstring_has_bit( + ffi.Pointer 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 @@ -6019,7 +6563,9 @@ external int CBS_asn1_bitstring_has_bit(ffi.Pointer cbs, int bit); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_CBS_asn1_oid_to_text', ) -external ffi.Pointer CBS_asn1_oid_to_text(ffi.Pointer cbs); +external ffi.Pointer CBS_asn1_oid_to_text( + ffi.Pointer 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 @@ -6042,7 +6588,9 @@ external ffi.Pointer CBS_asn1_relative_oid_to_text( @ffi.Native)>( symbol: 'bssl_dart_CBS_contains_zero_byte', ) -external int CBS_contains_zero_byte(ffi.Pointer cbs); +external int CBS_contains_zero_byte( + ffi.Pointer 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. @@ -6146,7 +6694,10 @@ external int CBS_get_asn1( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_asn1_bool', ) -external int CBS_get_asn1_bool(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_asn1_bool( + ffi.Pointer cbs, + ffi.Pointer out, +); /// CBS_get_asn1_element acts like `CBS_get_asn1` but `out` will include the /// ASN.1 header bytes too. @@ -6238,7 +6789,11 @@ external int CBS_get_asn1_uint64_with_tag( @ffi.Native, ffi.Pointer, ffi.Size)>( symbol: 'bssl_dart_CBS_get_bytes', ) -external int CBS_get_bytes(ffi.Pointer cbs, ffi.Pointer out, int len); +external int CBS_get_bytes( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6246,13 +6801,19 @@ external int CBS_get_bytes(ffi.Pointer cbs, ffi.Pointer out, int len); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_last_u8', ) -external int CBS_get_last_u8(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_last_u8( + ffi.Pointer cbs, + ffi.Pointer out, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_latin1', ) -external int CBS_get_latin1(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_latin1( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6345,7 +6906,10 @@ external int CBS_get_optional_asn1_uint64( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u16', ) -external int CBS_get_u16(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u16( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6365,7 +6929,10 @@ external int CBS_get_u16_length_prefixed( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u16le', ) -external int CBS_get_u16le(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u16le( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6373,7 +6940,10 @@ external int CBS_get_u16le(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u24', ) -external int CBS_get_u24(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u24( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6393,7 +6963,10 @@ external int CBS_get_u24_length_prefixed( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u32', ) -external int CBS_get_u32(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u32( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6401,7 +6974,10 @@ external int CBS_get_u32(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u32le', ) -external int CBS_get_u32le(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u32le( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6409,7 +6985,10 @@ external int CBS_get_u32le(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u48', ) -external int CBS_get_u48(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u48( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6417,7 +6996,10 @@ external int CBS_get_u48(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u64', ) -external int CBS_get_u64(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u64( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6439,7 +7021,10 @@ external int CBS_get_u64_decimal( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u64le', ) -external int CBS_get_u64le(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u64le( + ffi.Pointer cbs, + ffi.Pointer 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. @@ -6447,7 +7032,10 @@ external int CBS_get_u64le(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_u8', ) -external int CBS_get_u8(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_u8( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6465,7 +7053,10 @@ external int CBS_get_u8_length_prefixed( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_ucs2_be', ) -external int CBS_get_ucs2_be(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_ucs2_be( + ffi.Pointer cbs, + ffi.Pointer 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 @@ -6524,7 +7115,10 @@ external int CBS_get_utf32_be( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_CBS_get_utf8', ) -external int CBS_get_utf8(ffi.Pointer cbs, ffi.Pointer out); +external int CBS_get_utf8( + ffi.Pointer cbs, + ffi.Pointer out, +); /// CBS_is_unsigned_asn1_integer returns one if `cbs` is a valid non-negative /// ASN.1 INTEGER body and zero otherwise. @@ -6532,7 +7126,9 @@ external int CBS_get_utf8(ffi.Pointer cbs, ffi.Pointer out); @ffi.Native)>( symbol: 'bssl_dart_CBS_is_unsigned_asn1_integer', ) -external int CBS_is_unsigned_asn1_integer(ffi.Pointer cbs); +external int CBS_is_unsigned_asn1_integer( + ffi.Pointer cbs, +); /// CBS_is_valid_asn1_bitstring returns one if `cbs` is a valid ASN.1 BIT STRING /// body and zero otherwise. @@ -6540,7 +7136,9 @@ external int CBS_is_unsigned_asn1_integer(ffi.Pointer cbs); @ffi.Native)>( symbol: 'bssl_dart_CBS_is_valid_asn1_bitstring', ) -external int CBS_is_valid_asn1_bitstring(ffi.Pointer cbs); +external int CBS_is_valid_asn1_bitstring( + ffi.Pointer 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, @@ -6562,7 +7160,9 @@ external int CBS_is_valid_asn1_integer( @ffi.Native)>( symbol: 'bssl_dart_CBS_is_valid_asn1_oid', ) -external int CBS_is_valid_asn1_oid(ffi.Pointer cbs); +external int CBS_is_valid_asn1_oid( + ffi.Pointer 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 @@ -6574,7 +7174,9 @@ external int CBS_is_valid_asn1_oid(ffi.Pointer cbs); @ffi.Native)>( symbol: 'bssl_dart_CBS_is_valid_asn1_relative_oid', ) -external int CBS_is_valid_asn1_relative_oid(ffi.Pointer cbs); +external int CBS_is_valid_asn1_relative_oid( + ffi.Pointer 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 @@ -6631,7 +7233,9 @@ external int CBS_parse_utc_time( @ffi.Native)>( symbol: 'bssl_dart_CBS_peek_any_asn1_tag', ) -external int CBS_peek_any_asn1_tag(ffi.Pointer cbs); +external int CBS_peek_any_asn1_tag( + ffi.Pointer 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 @@ -6641,7 +7245,10 @@ external int CBS_peek_any_asn1_tag(ffi.Pointer cbs); @ffi.Native, CBS_ASN1_TAG)>( symbol: 'bssl_dart_CBS_peek_asn1_tag', ) -external int CBS_peek_asn1_tag(ffi.Pointer cbs, int tag_value); +external int CBS_peek_asn1_tag( + ffi.Pointer cbs, + int tag_value, +); /// CBS_skip advances `cbs` by `len` bytes. It returns one on success and zero /// otherwise. @@ -6649,7 +7256,10 @@ external int CBS_peek_asn1_tag(ffi.Pointer cbs, int tag_value); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_CBS_skip', ) -external int CBS_skip(ffi.Pointer cbs, int len); +external int CBS_skip( + ffi.Pointer 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 @@ -6727,14 +7337,18 @@ external int CONF_modules_load_file( /// CONF_modules_unload does nothing. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_CONF_modules_unload') -external void CONF_modules_unload(int all); +external void CONF_modules_unload( + int all, +); /// CPACE_CTX_free frees `ctx` and all the resources that it has allocated. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_CPACE_CTX_free', ) -external void CPACE_CTX_free(ffi.Pointer ctx); +external void CPACE_CTX_free( + ffi.Pointer 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 @@ -6832,7 +7446,9 @@ external int CPACE_process_msg( @ffi.Native)>( symbol: 'bssl_dart_CRL_DIST_POINTS_free', ) -external void CRL_DIST_POINTS_free(ffi.Pointer crldp); +external void CRL_DIST_POINTS_free( + ffi.Pointer crldp, +); /// CRL_DIST_POINTS_new returns a newly-allocated, empty `CRL_DIST_POINTS` /// object, or NULL on error. @@ -6859,7 +7475,9 @@ external ffi.Pointer CRYPTO_BUFFER_POOL_dup_ref( @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_free', ) -external void CRYPTO_BUFFER_POOL_free(ffi.Pointer pool); +external void CRYPTO_BUFFER_POOL_free( + ffi.Pointer pool, +); /// CRYPTO_BUFFER_POOL_new returns a freshly allocated `CRYPTO_BUFFER_POOL` or /// NULL on error. @@ -6876,7 +7494,9 @@ external ffi.Pointer CRYPTO_BUFFER_POOL_new(); @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_BUFFER_POOL_up_ref', ) -external int CRYPTO_BUFFER_POOL_up_ref(ffi.Pointer pool); +external int CRYPTO_BUFFER_POOL_up_ref( + ffi.Pointer 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. @@ -6924,7 +7544,9 @@ external ffi.Pointer CRYPTO_BUFFER_dup_ref( @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_BUFFER_free', ) -external void CRYPTO_BUFFER_free(ffi.Pointer buf); +external void CRYPTO_BUFFER_free( + ffi.Pointer buf, +); /// CRYPTO_BUFFER_init_CBS initialises `out` to point at the data from `buf`. @meta.RecordUse() @@ -6942,7 +7564,9 @@ external void CRYPTO_BUFFER_init_CBS( @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_BUFFER_len', ) -external int CRYPTO_BUFFER_len(ffi.Pointer buf); +external int CRYPTO_BUFFER_len( + ffi.Pointer 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 @@ -7003,14 +7627,18 @@ external ffi.Pointer CRYPTO_BUFFER_new_from_static_data_unsafe( @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_BUFFER_up_ref', ) -external int CRYPTO_BUFFER_up_ref(ffi.Pointer buf); +external int CRYPTO_BUFFER_up_ref( + ffi.Pointer buf, +); /// CRYPTO_THREADID_current does nothing. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_CRYPTO_THREADID_current', ) -external void CRYPTO_THREADID_current(ffi.Pointer id); +external void CRYPTO_THREADID_current( + ffi.Pointer id, +); /// CRYPTO_THREADID_set_callback returns one. @meta.RecordUse() @@ -7163,7 +7791,9 @@ CRYPTO_get_dynlock_lock_callback(); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_CRYPTO_get_lock_name', ) -external ffi.Pointer CRYPTO_get_lock_name(int lock_num); +external ffi.Pointer CRYPTO_get_lock_name( + int lock_num, +); /// CRYPTO_get_locking_callback returns NULL. @meta.RecordUse() @@ -7275,7 +7905,10 @@ external ffi.Pointer CRYPTO_realloc( @ffi.Native( symbol: 'bssl_dart_CRYPTO_secure_malloc_init', ) -external int CRYPTO_secure_malloc_init(int size, int min_size); +external int CRYPTO_secure_malloc_init( + int size, + int min_size, +); /// CRYPTO_secure_malloc_initialized returns zero. @meta.RecordUse() @@ -7451,7 +8084,9 @@ external void CRYPTO_set_locking_callback( @ffi.Native)>( symbol: 'bssl_dart_DH_bits', ) -external int DH_bits(ffi.Pointer dh); +external int DH_bits( + ffi.Pointer 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 @@ -7462,7 +8097,10 @@ external int DH_bits(ffi.Pointer dh); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_DH_check', ) -external int DH_check(ffi.Pointer dh, ffi.Pointer out_flags); +external int DH_check( + ffi.Pointer dh, + ffi.Pointer 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 @@ -7574,7 +8212,9 @@ external int DH_compute_key_padded( /// count drops to zero. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_DH_free') -external void DH_free(ffi.Pointer dh); +external void DH_free( + ffi.Pointer 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 @@ -7584,7 +8224,9 @@ external void DH_free(ffi.Pointer dh); @ffi.Native)>( symbol: 'bssl_dart_DH_generate_key', ) -external int DH_generate_key(ffi.Pointer dh); +external int DH_generate_key( + ffi.Pointer 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 @@ -7610,7 +8252,9 @@ external int DH_generate_parameters_ex( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_get0_g', ) -external ffi.Pointer DH_get0_g(ffi.Pointer dh); +external ffi.Pointer DH_get0_g( + ffi.Pointer 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 @@ -7634,7 +8278,9 @@ external void DH_get0_key( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_get0_p', ) -external ffi.Pointer DH_get0_p(ffi.Pointer dh); +external ffi.Pointer DH_get0_p( + ffi.Pointer dh, +); /// DH_get0_pqg sets `*out_p`, `*out_q`, and `*out_g`, if non-NULL, to `dh`'s p, /// q, and g parameters, respectively. @@ -7659,21 +8305,27 @@ external void DH_get0_pqg( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_get0_priv_key', ) -external ffi.Pointer DH_get0_priv_key(ffi.Pointer dh); +external ffi.Pointer DH_get0_priv_key( + ffi.Pointer dh, +); /// DH_get0_pub_key returns `dh`'s public key. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_get0_pub_key', ) -external ffi.Pointer DH_get0_pub_key(ffi.Pointer dh); +external ffi.Pointer DH_get0_pub_key( + ffi.Pointer dh, +); /// DH_get0_q returns the size of `dh`'s subgroup, or NULL if it is unset. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_get0_q', ) -external ffi.Pointer DH_get0_q(ffi.Pointer dh); +external ffi.Pointer DH_get0_q( + ffi.Pointer dh, +); /// DH_get_rfc7919_2048 returns the group `ffdhe2048` from /// https://tools.ietf.org/html/rfc7919#appendix-A.1. It returns NULL if out @@ -7689,7 +8341,10 @@ external ffi.Pointer DH_get_rfc7919_2048(); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_DH_marshal_parameters', ) -external int DH_marshal_parameters(ffi.Pointer cbb, ffi.Pointer dh); +external int DH_marshal_parameters( + ffi.Pointer cbb, + ffi.Pointer dh, +); /// DH_new returns a new, empty DH object or NULL on error. @meta.RecordUse() @@ -7703,7 +8358,9 @@ external ffi.Pointer DH_new(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DH_parse_parameters', ) -external ffi.Pointer DH_parse_parameters(ffi.Pointer cbs); +external ffi.Pointer DH_parse_parameters( + ffi.Pointer 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 @@ -7745,18 +8402,25 @@ external int DH_set0_pqg( @ffi.Native, ffi.UnsignedInt)>( symbol: 'bssl_dart_DH_set_length', ) -external int DH_set_length(ffi.Pointer dh, int priv_length); +external int DH_set_length( + ffi.Pointer dh, + int priv_length, +); /// DH_size returns the number of bytes in the DH group's prime. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_DH_size') -external int DH_size(ffi.Pointer dh); +external int DH_size( + ffi.Pointer 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)>(symbol: 'bssl_dart_DH_up_ref') -external int DH_up_ref(ffi.Pointer dh); +external int DH_up_ref( + ffi.Pointer dh, +); /// DHparams_dup allocates a fresh `DH` and copies the parameters from `dh` into /// it. It returns the new `DH` or NULL on error. @@ -7764,14 +8428,18 @@ external int DH_up_ref(ffi.Pointer dh); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DHparams_dup', ) -external ffi.Pointer DHparams_dup(ffi.Pointer dh); +external ffi.Pointer DHparams_dup( + ffi.Pointer dh, +); /// DIRECTORYSTRING_free calls `ASN1_STRING_free`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_DIRECTORYSTRING_free', ) -external void DIRECTORYSTRING_free(ffi.Pointer str); +external void DIRECTORYSTRING_free( + ffi.Pointer 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 @@ -7787,7 +8455,9 @@ external ffi.Pointer DIRECTORYSTRING_new(); @ffi.Native)>( symbol: 'bssl_dart_DISPLAYTEXT_free', ) -external void DISPLAYTEXT_free(ffi.Pointer str); +external void DISPLAYTEXT_free( + ffi.Pointer 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 @@ -7803,7 +8473,9 @@ external ffi.Pointer DISPLAYTEXT_new(); @ffi.Native)>( symbol: 'bssl_dart_DIST_POINT_NAME_free', ) -external void DIST_POINT_NAME_free(ffi.Pointer name); +external void DIST_POINT_NAME_free( + ffi.Pointer name, +); /// DIST_POINT_NAME_new returns a newly-allocated, empty `DIST_POINT_NAME` /// object, or NULL on error. @@ -7818,7 +8490,9 @@ external ffi.Pointer DIST_POINT_NAME_new(); @ffi.Native)>( symbol: 'bssl_dart_DIST_POINT_free', ) -external void DIST_POINT_free(ffi.Pointer dp); +external void DIST_POINT_free( + ffi.Pointer dp, +); /// DIST_POINT_new returns a newly-allocated, empty `DIST_POINT` object, or NULL /// on error. @@ -7833,7 +8507,9 @@ external ffi.Pointer DIST_POINT_new(); @ffi.Native)>( symbol: 'bssl_dart_DSA_SIG_free', ) -external void DSA_SIG_free(ffi.Pointer sig); +external void DSA_SIG_free( + ffi.Pointer sig, +); /// DSA_SIG_get0 sets `*out_r` and `*out_s`, if non-NULL, to the two components /// of `sig`. @@ -7857,7 +8533,10 @@ external void DSA_SIG_get0( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_DSA_SIG_marshal', ) -external int DSA_SIG_marshal(ffi.Pointer cbb, ffi.Pointer sig); +external int DSA_SIG_marshal( + ffi.Pointer cbb, + ffi.Pointer 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. @@ -7871,7 +8550,9 @@ external ffi.Pointer DSA_SIG_new(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_SIG_parse', ) -external ffi.Pointer DSA_SIG_parse(ffi.Pointer cbs); +external ffi.Pointer DSA_SIG_parse( + ffi.Pointer 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. @@ -7895,7 +8576,9 @@ external int DSA_SIG_set0( @ffi.Native)>( symbol: 'bssl_dart_DSA_bits', ) -external int DSA_bits(ffi.Pointer dsa); +external int DSA_bits( + ffi.Pointer 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 @@ -7996,7 +8679,9 @@ external int DSA_do_verify( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_dup_DH', ) -external ffi.Pointer DSA_dup_DH(ffi.Pointer dsa); +external ffi.Pointer DSA_dup_DH( + ffi.Pointer 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 @@ -8005,13 +8690,17 @@ external ffi.Pointer DSA_dup_DH(ffi.Pointer dsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_dup_ref', ) -external ffi.Pointer DSA_dup_ref(ffi.Pointer dsa); +external ffi.Pointer DSA_dup_ref( + ffi.Pointer dsa, +); /// DSA_free decrements the reference count of `dsa` and frees it if the /// reference count drops to zero. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_DSA_free') -external void DSA_free(ffi.Pointer dsa); +external void DSA_free( + ffi.Pointer 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 @@ -8020,7 +8709,9 @@ external void DSA_free(ffi.Pointer dsa); @ffi.Native)>( symbol: 'bssl_dart_DSA_generate_key', ) -external int DSA_generate_key(ffi.Pointer dsa); +external int DSA_generate_key( + ffi.Pointer dsa, +); /// DSA_generate_parameters_ex generates a set of DSA parameters by following /// the procedure given in FIPS 186-4, appendix A. @@ -8066,7 +8757,9 @@ external int DSA_generate_parameters_ex( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_get0_g', ) -external ffi.Pointer DSA_get0_g(ffi.Pointer dsa); +external ffi.Pointer DSA_get0_g( + ffi.Pointer 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 @@ -8090,7 +8783,9 @@ external void DSA_get0_key( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_get0_p', ) -external ffi.Pointer DSA_get0_p(ffi.Pointer dsa); +external ffi.Pointer DSA_get0_p( + ffi.Pointer dsa, +); /// DSA_get0_pqg sets `*out_p`, `*out_q`, and `*out_g`, if non-NULL, to `dsa`'s /// p, q, and g parameters, respectively. @@ -8116,27 +8811,36 @@ external void DSA_get0_pqg( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_get0_priv_key', ) -external ffi.Pointer DSA_get0_priv_key(ffi.Pointer dsa); +external ffi.Pointer DSA_get0_priv_key( + ffi.Pointer dsa, +); /// DSA_get0_pub_key returns `dsa`'s public key. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_get0_pub_key', ) -external ffi.Pointer DSA_get0_pub_key(ffi.Pointer dsa); +external ffi.Pointer DSA_get0_pub_key( + ffi.Pointer dsa, +); /// DSA_get0_q returns the size of `dsa`'s subgroup. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_get0_q', ) -external ffi.Pointer DSA_get0_q(ffi.Pointer dsa); +external ffi.Pointer DSA_get0_q( + ffi.Pointer dsa, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_DSA_get_ex_data', ) -external ffi.Pointer DSA_get_ex_data(ffi.Pointer dsa, int idx); +external ffi.Pointer DSA_get_ex_data( + ffi.Pointer dsa, + int idx, +); /// ex_data functions. /// @@ -8166,7 +8870,10 @@ external int DSA_get_ex_new_index( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_DSA_marshal_parameters', ) -external int DSA_marshal_parameters(ffi.Pointer cbb, ffi.Pointer dsa); +external int DSA_marshal_parameters( + ffi.Pointer cbb, + ffi.Pointer 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 @@ -8187,7 +8894,10 @@ external int DSA_marshal_private_key( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_DSA_marshal_public_key', ) -external int DSA_marshal_public_key(ffi.Pointer cbb, ffi.Pointer dsa); +external int DSA_marshal_public_key( + ffi.Pointer cbb, + ffi.Pointer dsa, +); /// DSA_new returns a new, empty DSA object or NULL on error. @meta.RecordUse() @@ -8201,7 +8911,9 @@ external ffi.Pointer DSA_new(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_parse_parameters', ) -external ffi.Pointer DSA_parse_parameters(ffi.Pointer cbs); +external ffi.Pointer DSA_parse_parameters( + ffi.Pointer 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. @@ -8209,7 +8921,9 @@ external ffi.Pointer DSA_parse_parameters(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_parse_private_key', ) -external ffi.Pointer DSA_parse_private_key(ffi.Pointer cbs); +external ffi.Pointer DSA_parse_private_key( + ffi.Pointer 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. @@ -8217,7 +8931,9 @@ external ffi.Pointer DSA_parse_private_key(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSA_parse_public_key', ) -external ffi.Pointer DSA_parse_public_key(ffi.Pointer cbs); +external ffi.Pointer DSA_parse_public_key( + ffi.Pointer 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 @@ -8296,13 +9012,17 @@ external int DSA_sign( /// generated by `dsa`. Parameters must already have been setup in `dsa`. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_DSA_size') -external int DSA_size(ffi.Pointer dsa); +external int DSA_size( + ffi.Pointer 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)>(symbol: 'bssl_dart_DSA_up_ref') -external int DSA_up_ref(ffi.Pointer dsa); +external int DSA_up_ref( + ffi.Pointer 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 @@ -8342,7 +9062,9 @@ external int DSA_verify( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_DSAparams_dup', ) -external ffi.Pointer DSAparams_dup(ffi.Pointer dsa); +external ffi.Pointer DSAparams_dup( + ffi.Pointer 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 @@ -8420,7 +9142,9 @@ external int ECDH_compute_key_fips( @ffi.Native)>( symbol: 'bssl_dart_ECDSA_SIG_free', ) -external void ECDSA_SIG_free(ffi.Pointer sig); +external void ECDSA_SIG_free( + ffi.Pointer 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. @@ -8454,14 +9178,18 @@ external void ECDSA_SIG_get0( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_ECDSA_SIG_get0_r', ) -external ffi.Pointer ECDSA_SIG_get0_r(ffi.Pointer sig); +external ffi.Pointer ECDSA_SIG_get0_r( + ffi.Pointer sig, +); /// ECDSA_SIG_get0_s returns the s component of `sig`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_ECDSA_SIG_get0_s', ) -external ffi.Pointer ECDSA_SIG_get0_s(ffi.Pointer sig); +external ffi.Pointer ECDSA_SIG_get0_s( + ffi.Pointer 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. @@ -8479,7 +9207,9 @@ external int ECDSA_SIG_marshal( /// zero on overflow. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_ECDSA_SIG_max_len') -external int ECDSA_SIG_max_len(int order_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() @@ -8494,7 +9224,9 @@ external ffi.Pointer ECDSA_SIG_new(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_ECDSA_SIG_parse', ) -external ffi.Pointer ECDSA_SIG_parse(ffi.Pointer cbs); +external ffi.Pointer ECDSA_SIG_parse( + ffi.Pointer 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. @@ -8663,7 +9395,9 @@ ECDSA_sign_with_nonce_and_leak_private_key_for_testing( @ffi.Native)>( symbol: 'bssl_dart_ECDSA_size', ) -external int ECDSA_size(ffi.Pointer key); +external int ECDSA_size( + ffi.Pointer 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. @@ -8671,7 +9405,9 @@ external int ECDSA_size(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_ECDSA_size_p1363', ) -external int ECDSA_size_p1363(ffi.Pointer key); +external int ECDSA_size_p1363( + ffi.Pointer 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 @@ -8753,7 +9489,9 @@ external int EC_GROUP_cmp( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_GROUP_dup', ) -external ffi.Pointer EC_GROUP_dup(ffi.Pointer group); +external ffi.Pointer EC_GROUP_dup( + ffi.Pointer 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. @@ -8765,7 +9503,9 @@ external ffi.Pointer EC_GROUP_dup(ffi.Pointer group); @ffi.Native)>( symbol: 'bssl_dart_EC_GROUP_free', ) -external void EC_GROUP_free(ffi.Pointer group); +external void EC_GROUP_free( + ffi.Pointer group, +); /// EC_GROUP_get0_generator returns a pointer to the internal `EC_POINT` object /// in `group` that specifies the generator for the group. @@ -8783,14 +9523,18 @@ external ffi.Pointer EC_GROUP_get0_generator( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_GROUP_get0_order', ) -external ffi.Pointer EC_GROUP_get0_order(ffi.Pointer group); +external ffi.Pointer EC_GROUP_get0_order( + ffi.Pointer group, +); /// EC_GROUP_get_asn1_flag returns `OPENSSL_EC_NAMED_CURVE`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EC_GROUP_get_asn1_flag', ) -external int EC_GROUP_get_asn1_flag(ffi.Pointer group); +external int EC_GROUP_get_asn1_flag( + ffi.Pointer 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. @@ -8836,7 +9580,9 @@ external int EC_GROUP_get_curve_GFp( @ffi.Native)>( symbol: 'bssl_dart_EC_GROUP_get_curve_name', ) -external int EC_GROUP_get_curve_name(ffi.Pointer group); +external int EC_GROUP_get_curve_name( + ffi.Pointer group, +); /// EC_GROUP_get_degree returns the number of bits needed to represent an /// element of the field underlying `group`. @@ -8844,7 +9590,9 @@ external int EC_GROUP_get_curve_name(ffi.Pointer group); @ffi.Native)>( symbol: 'bssl_dart_EC_GROUP_get_degree', ) -external int EC_GROUP_get_degree(ffi.Pointer group); +external int EC_GROUP_get_degree( + ffi.Pointer 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 @@ -8868,7 +9616,9 @@ external int EC_GROUP_get_order( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_GROUP_method_of', ) -external ffi.Pointer EC_GROUP_method_of(ffi.Pointer group); +external ffi.Pointer EC_GROUP_method_of( + ffi.Pointer 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 @@ -8891,7 +9641,9 @@ external ffi.Pointer EC_GROUP_method_of(ffi.Pointer group); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_EC_GROUP_new_by_curve_name', ) -external ffi.Pointer EC_GROUP_new_by_curve_name(int nid); +external ffi.Pointer 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 @@ -8936,14 +9688,19 @@ external ffi.Pointer EC_GROUP_new_curve_GFp( @ffi.Native)>( symbol: 'bssl_dart_EC_GROUP_order_bits', ) -external int EC_GROUP_order_bits(ffi.Pointer group); +external int EC_GROUP_order_bits( + ffi.Pointer group, +); /// EC_GROUP_set_asn1_flag does nothing. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_EC_GROUP_set_asn1_flag', ) -external void EC_GROUP_set_asn1_flag(ffi.Pointer group, int flag); +external void EC_GROUP_set_asn1_flag( + ffi.Pointer 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` @@ -8983,7 +9740,9 @@ external void EC_GROUP_set_point_conversion_form( @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_check_fips', ) -external int EC_KEY_check_fips(ffi.Pointer key); +external int EC_KEY_check_fips( + ffi.Pointer 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 @@ -8993,7 +9752,9 @@ external int EC_KEY_check_fips(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_check_key', ) -external int EC_KEY_check_key(ffi.Pointer key); +external int EC_KEY_check_key( + ffi.Pointer 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` @@ -9024,7 +9785,9 @@ external ffi.Pointer EC_KEY_derive_from_secret( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_dup', ) -external ffi.Pointer EC_KEY_dup(ffi.Pointer src); +external ffi.Pointer EC_KEY_dup( + ffi.Pointer 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 @@ -9033,14 +9796,18 @@ external ffi.Pointer EC_KEY_dup(ffi.Pointer src); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_dup_ref', ) -external ffi.Pointer EC_KEY_dup_ref(ffi.Pointer key); +external ffi.Pointer EC_KEY_dup_ref( + ffi.Pointer key, +); /// EC_KEY_free frees all the data owned by `key` and `key` itself. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_free', ) -external void EC_KEY_free(ffi.Pointer key); +external void EC_KEY_free( + ffi.Pointer 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 @@ -9049,7 +9816,9 @@ external void EC_KEY_free(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_generate_key', ) -external int EC_KEY_generate_key(ffi.Pointer key); +external int EC_KEY_generate_key( + ffi.Pointer key, +); /// EC_KEY_generate_key_fips behaves like `EC_KEY_generate_key` but performs /// additional checks for FIPS compliance. This function is applicable when @@ -9059,21 +9828,27 @@ external int EC_KEY_generate_key(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_generate_key_fips', ) -external int EC_KEY_generate_key_fips(ffi.Pointer key); +external int EC_KEY_generate_key_fips( + ffi.Pointer key, +); /// EC_KEY_get0_group returns a pointer to the `EC_GROUP` object inside `key`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_get0_group', ) -external ffi.Pointer EC_KEY_get0_group(ffi.Pointer key); +external ffi.Pointer EC_KEY_get0_group( + ffi.Pointer key, +); /// EC_KEY_get0_private_key returns a pointer to the private key inside `key`. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_get0_private_key', ) -external ffi.Pointer EC_KEY_get0_private_key(ffi.Pointer key); +external ffi.Pointer EC_KEY_get0_private_key( + ffi.Pointer key, +); /// EC_KEY_get0_public_key returns a pointer to the public key point inside /// `key`. @@ -9081,7 +9856,9 @@ external ffi.Pointer EC_KEY_get0_private_key(ffi.Pointer key); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_get0_public_key', ) -external ffi.Pointer EC_KEY_get0_public_key(ffi.Pointer key); +external ffi.Pointer EC_KEY_get0_public_key( + ffi.Pointer key, +); /// EC_KEY_get_conv_form returns the conversion form that will be used by /// `key`. @@ -9089,7 +9866,9 @@ external ffi.Pointer EC_KEY_get0_public_key(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_get_conv_form', ) -external int EC_KEY_get_conv_form(ffi.Pointer key); +external int EC_KEY_get_conv_form( + ffi.Pointer key, +); /// EC_KEY_get_enc_flags returns the encoding flags for `key`, which is a /// bitwise-OR of `EC_PKEY_*` values. @@ -9097,7 +9876,9 @@ external int EC_KEY_get_conv_form(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_get_enc_flags', ) -external int EC_KEY_get_enc_flags(ffi.Pointer key); +external int EC_KEY_get_enc_flags( + ffi.Pointer key, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer, ffi.Int)>( @@ -9135,7 +9916,9 @@ external int EC_KEY_get_ex_new_index( @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_is_opaque', ) -external int EC_KEY_is_opaque(ffi.Pointer key); +external int EC_KEY_is_opaque( + ffi.Pointer key, +); /// EC_KEY_key2buf behaves like `EC_POINT_point2buf`, except it encodes the /// public key in `key`. `ctx` is ignored and may be NULL. @@ -9192,7 +9975,9 @@ external ffi.Pointer EC_KEY_new(); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_EC_KEY_new_by_curve_name', ) -external ffi.Pointer EC_KEY_new_by_curve_name(int nid); +external ffi.Pointer EC_KEY_new_by_curve_name( + int nid, +); /// EC_KEY_new_method acts the same as `EC_KEY_new`, but takes an explicit /// `ENGINE`. @@ -9200,7 +9985,9 @@ external ffi.Pointer EC_KEY_new_by_curve_name(int nid); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_new_method', ) -external ffi.Pointer EC_KEY_new_method(ffi.Pointer engine); +external ffi.Pointer EC_KEY_new_method( + ffi.Pointer 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 @@ -9250,7 +10037,9 @@ external int EC_KEY_oct2priv( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_parse_curve_name', ) -external ffi.Pointer EC_KEY_parse_curve_name(ffi.Pointer cbs); +external ffi.Pointer EC_KEY_parse_curve_name( + ffi.Pointer 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 @@ -9267,7 +10056,9 @@ external ffi.Pointer EC_KEY_parse_curve_name(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_KEY_parse_parameters', ) -external ffi.Pointer EC_KEY_parse_parameters(ffi.Pointer cbs); +external ffi.Pointer EC_KEY_parse_parameters( + ffi.Pointer 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 @@ -9316,14 +10107,20 @@ external int EC_KEY_priv2oct( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_EC_KEY_set_asn1_flag', ) -external void EC_KEY_set_asn1_flag(ffi.Pointer key, int flag); +external void EC_KEY_set_asn1_flag( + ffi.Pointer key, + int flag, +); /// EC_KEY_set_conv_form sets the conversion form to be used by `key`. @meta.RecordUse() @ffi.Native, ffi.UnsignedInt)>( symbol: 'bssl_dart_EC_KEY_set_conv_form', ) -external void EC_KEY_set_conv_form(ffi.Pointer key, int cform); +external void EC_KEY_set_conv_form( + ffi.Pointer key, + int cform, +); /// EC_KEY_set_enc_flags sets the encoding flags for `key`, which is a /// bitwise-OR of `EC_PKEY_*` values. @@ -9331,7 +10128,10 @@ external void EC_KEY_set_conv_form(ffi.Pointer key, int cform); @ffi.Native, ffi.UnsignedInt)>( symbol: 'bssl_dart_EC_KEY_set_enc_flags', ) -external void EC_KEY_set_enc_flags(ffi.Pointer key, int flags); +external void EC_KEY_set_enc_flags( + ffi.Pointer key, + int flags, +); @meta.RecordUse() @ffi.Native< @@ -9403,14 +10203,18 @@ external int EC_KEY_set_public_key_affine_coordinates( @ffi.Native)>( symbol: 'bssl_dart_EC_KEY_up_ref', ) -external int EC_KEY_up_ref(ffi.Pointer key); +external int EC_KEY_up_ref( + ffi.Pointer key, +); /// EC_METHOD_get_field_type returns NID_X9_62_prime_field. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EC_METHOD_get_field_type', ) -external int EC_METHOD_get_field_type(ffi.Pointer meth); +external int EC_METHOD_get_field_type( + ffi.Pointer 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. @@ -9437,7 +10241,9 @@ external int EC_POINT_add( @ffi.Native)>( symbol: 'bssl_dart_EC_POINT_clear_free', ) -external void EC_POINT_clear_free(ffi.Pointer point); +external void EC_POINT_clear_free( + ffi.Pointer 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. @@ -9502,7 +10308,9 @@ external ffi.Pointer EC_POINT_dup( @ffi.Native)>( symbol: 'bssl_dart_EC_POINT_free', ) -external void EC_POINT_free(ffi.Pointer point); +external void EC_POINT_free( + ffi.Pointer point, +); /// EC_POINT_get_affine_coordinates is an alias of /// `EC_POINT_get_affine_coordinates_GFp`. @@ -9620,7 +10428,9 @@ external int EC_POINT_mul( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EC_POINT_new', ) -external ffi.Pointer EC_POINT_new(ffi.Pointer group); +external ffi.Pointer EC_POINT_new( + ffi.Pointer 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` @@ -9797,7 +10607,9 @@ external int EC_POINT_set_to_infinity( @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_EC_curve_nid2nist', ) -external ffi.Pointer EC_curve_nid2nist(int nid); +external ffi.Pointer 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, @@ -9806,7 +10618,9 @@ external ffi.Pointer EC_curve_nid2nist(int nid); @ffi.Native)>( symbol: 'bssl_dart_EC_curve_nist2nid', ) -external int EC_curve_nist2nid(ffi.Pointer name); +external int EC_curve_nist2nid( + ffi.Pointer 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_ @@ -10147,7 +10961,9 @@ external int ED25519_verify_prehashed( @ffi.Native)>( symbol: 'bssl_dart_EDIPARTYNAME_free', ) -external void EDIPARTYNAME_free(ffi.Pointer name); +external void EDIPARTYNAME_free( + ffi.Pointer 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 @@ -10169,7 +10985,9 @@ external void ENGINE_cleanup(); @ffi.Native)>( symbol: 'bssl_dart_ENGINE_free', ) -external int ENGINE_free(ffi.Pointer engine); +external int ENGINE_free( + ffi.Pointer engine, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( @@ -10242,7 +11060,9 @@ external int ENGINE_set_RSA_method( @ffi.Native( symbol: 'bssl_dart_ERR_add_error_data', ) -external void ERR_add_error_data(int count); +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. @@ -10250,7 +11070,9 @@ external void ERR_add_error_data(int count); @ffi.Native)>( symbol: 'bssl_dart_ERR_add_error_dataf', ) -external void ERR_add_error_dataf(ffi.Pointer format); +external void ERR_add_error_dataf( + ffi.Pointer format, +); /// ERR_clear_error clears the error queue for the current thread. @meta.RecordUse() @@ -10313,7 +11135,9 @@ external void ERR_free_strings(); @ffi.Native Function(ffi.Uint32)>( symbol: 'bssl_dart_ERR_func_error_string', ) -external ffi.Pointer ERR_func_error_string(int packed_error); +external ffi.Pointer 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 @@ -10369,7 +11193,9 @@ external int ERR_get_next_error_library(); @ffi.Native Function(ffi.Uint32)>( symbol: 'bssl_dart_ERR_lib_error_string', ) -external ffi.Pointer ERR_lib_error_string(int packed_error); +external ffi.Pointer 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 @@ -10378,7 +11204,9 @@ external ffi.Pointer ERR_lib_error_string(int packed_error); @ffi.Native Function(ffi.Uint32)>( symbol: 'bssl_dart_ERR_lib_symbol_name', ) -external ffi.Pointer ERR_lib_symbol_name(int packed_error); +external ffi.Pointer ERR_lib_symbol_name( + int packed_error, +); /// ERR_load_BIO_strings does nothing. @meta.RecordUse() @@ -10476,7 +11304,9 @@ external int ERR_pop_to_mark(); @ffi.Native)>( symbol: 'bssl_dart_ERR_print_errors', ) -external void ERR_print_errors(ffi.Pointer bio); +external void ERR_print_errors( + ffi.Pointer 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 @@ -10505,7 +11335,9 @@ external void ERR_print_errors_cb( @ffi.Native)>( symbol: 'bssl_dart_ERR_print_errors_fp', ) -external void ERR_print_errors_fp(ffi.Pointer file); +external void ERR_print_errors_fp( + ffi.Pointer file, +); /// ERR_put_error adds an error to the error queue, dropping the least recent /// error if necessary for space reasons. @@ -10533,7 +11365,9 @@ external void ERR_put_error( @ffi.Native Function(ffi.Uint32)>( symbol: 'bssl_dart_ERR_reason_error_string', ) -external ffi.Pointer ERR_reason_error_string(int packed_error); +external ffi.Pointer 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` @@ -10545,14 +11379,18 @@ external ffi.Pointer ERR_reason_error_string(int packed_error); @ffi.Native Function(ffi.Uint32)>( symbol: 'bssl_dart_ERR_reason_symbol_name', ) -external ffi.Pointer ERR_reason_symbol_name(int packed_error); +external ffi.Pointer ERR_reason_symbol_name( + int packed_error, +); /// ERR_remove_state calls `ERR_clear_error`. @meta.RecordUse() @ffi.Native( symbol: 'bssl_dart_ERR_remove_state', ) -external void ERR_remove_state(int pid); +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 @@ -10564,7 +11402,9 @@ external void ERR_remove_state(int pid); @ffi.Native)>( symbol: 'bssl_dart_ERR_remove_thread_state', ) -external void ERR_remove_thread_state(ffi.Pointer tid); +external void ERR_remove_thread_state( + ffi.Pointer 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 @@ -10579,7 +11419,10 @@ external void ERR_remove_thread_state(ffi.Pointer tid); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_ERR_set_error_data', ) -external void ERR_set_error_data(ffi.Pointer data, int flags); +external void ERR_set_error_data( + ffi.Pointer 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. @@ -10593,7 +11436,9 @@ external int ERR_set_mark(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_AEAD_CTX_aead', ) -external ffi.Pointer EVP_AEAD_CTX_aead(ffi.Pointer ctx); +external ffi.Pointer EVP_AEAD_CTX_aead( + ffi.Pointer 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 @@ -10602,7 +11447,9 @@ external ffi.Pointer EVP_AEAD_CTX_aead(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_CTX_cleanup', ) -external void EVP_AEAD_CTX_cleanup(ffi.Pointer ctx); +external void EVP_AEAD_CTX_cleanup( + ffi.Pointer ctx, +); /// EVP_AEAD_CTX_free calls `EVP_AEAD_CTX_cleanup` and `OPENSSL_free` on /// `ctx`. @@ -10610,7 +11457,9 @@ external void EVP_AEAD_CTX_cleanup(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_CTX_free', ) -external void EVP_AEAD_CTX_free(ffi.Pointer ctx); +external void EVP_AEAD_CTX_free( + ffi.Pointer 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 @@ -11110,7 +11959,9 @@ external int EVP_AEAD_CTX_tag_len( @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_CTX_zero', ) -external void EVP_AEAD_CTX_zero(ffi.Pointer ctx); +external void EVP_AEAD_CTX_zero( + ffi.Pointer ctx, +); /// EVP_AEAD_key_length returns the length, in bytes, of the keys used by /// `aead`. @@ -11118,7 +11969,9 @@ external void EVP_AEAD_CTX_zero(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_key_length', ) -external int EVP_AEAD_key_length(ffi.Pointer aead); +external int EVP_AEAD_key_length( + ffi.Pointer aead, +); /// EVP_AEAD_max_overhead returns the maximum number of additional bytes added /// by the act of sealing data with `aead`. @@ -11126,7 +11979,9 @@ external int EVP_AEAD_key_length(ffi.Pointer aead); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_max_overhead', ) -external int EVP_AEAD_max_overhead(ffi.Pointer aead); +external int EVP_AEAD_max_overhead( + ffi.Pointer 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 @@ -11135,7 +11990,9 @@ external int EVP_AEAD_max_overhead(ffi.Pointer aead); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_max_tag_len', ) -external int EVP_AEAD_max_tag_len(ffi.Pointer aead); +external int EVP_AEAD_max_tag_len( + ffi.Pointer aead, +); /// EVP_AEAD_nonce_length returns the length, in bytes, of the per-message nonce /// for `aead`. @@ -11143,7 +12000,9 @@ external int EVP_AEAD_max_tag_len(ffi.Pointer aead); @ffi.Native)>( symbol: 'bssl_dart_EVP_AEAD_nonce_length', ) -external int EVP_AEAD_nonce_length(ffi.Pointer aead); +external int EVP_AEAD_nonce_length( + ffi.Pointer 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 @@ -11194,7 +12053,9 @@ external int EVP_BytesToKey( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_block_size', ) -external int EVP_CIPHER_CTX_block_size(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_block_size( + ffi.Pointer ctx, +); /// EVP_CIPHER_CTX_cipher returns the `EVP_CIPHER` underlying `ctx`, or NULL if /// none has been set. @@ -11212,7 +12073,9 @@ external ffi.Pointer EVP_CIPHER_CTX_cipher( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_cleanup', ) -external int EVP_CIPHER_CTX_cleanup(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_cleanup( + ffi.Pointer 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 @@ -11251,7 +12114,9 @@ external int EVP_CIPHER_CTX_ctrl( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_encrypting', ) -external int EVP_CIPHER_CTX_encrypting(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_encrypting( + ffi.Pointer 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. @@ -11259,7 +12124,9 @@ external int EVP_CIPHER_CTX_encrypting(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_flags', ) -external int EVP_CIPHER_CTX_flags(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_flags( + ffi.Pointer ctx, +); /// EVP_CIPHER_CTX_free calls `EVP_CIPHER_CTX_cleanup` on `ctx` and then frees /// `ctx` itself. @@ -11267,7 +12134,9 @@ external int EVP_CIPHER_CTX_flags(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_free', ) -external void EVP_CIPHER_CTX_free(ffi.Pointer ctx); +external void EVP_CIPHER_CTX_free( + ffi.Pointer ctx, +); /// EVP_CIPHER_CTX_get_app_data returns the opaque, application data pointer for /// `ctx`, or NULL if none has been set. @@ -11290,7 +12159,9 @@ external ffi.Pointer EVP_CIPHER_CTX_get_app_data( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_init', ) -external void EVP_CIPHER_CTX_init(ffi.Pointer ctx); +external void EVP_CIPHER_CTX_init( + ffi.Pointer 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. @@ -11298,7 +12169,9 @@ external void EVP_CIPHER_CTX_init(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_iv_length', ) -external int EVP_CIPHER_CTX_iv_length(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_iv_length( + ffi.Pointer 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. @@ -11306,7 +12179,9 @@ external int EVP_CIPHER_CTX_iv_length(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_key_length', ) -external int EVP_CIPHER_CTX_key_length(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_key_length( + ffi.Pointer 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 @@ -11316,7 +12191,9 @@ external int EVP_CIPHER_CTX_key_length(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_max_final', ) -external int EVP_CIPHER_CTX_max_final(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_max_final( + ffi.Pointer 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 @@ -11337,7 +12214,9 @@ external int EVP_CIPHER_CTX_max_next_update( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_mode', ) -external int EVP_CIPHER_CTX_mode(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_mode( + ffi.Pointer 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 @@ -11355,7 +12234,9 @@ external ffi.Pointer EVP_CIPHER_CTX_new(); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_nid', ) -external int EVP_CIPHER_CTX_nid(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_nid( + ffi.Pointer ctx, +); /// EVP_CIPHER_CTX_reset calls `EVP_CIPHER_CTX_cleanup` followed by /// `EVP_CIPHER_CTX_init` and returns one. @@ -11363,7 +12244,9 @@ external int EVP_CIPHER_CTX_nid(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_CTX_reset', ) -external int EVP_CIPHER_CTX_reset(ffi.Pointer ctx); +external int EVP_CIPHER_CTX_reset( + ffi.Pointer ctx, +); /// EVP_CIPHER_CTX_set_app_data sets the opaque, application data pointer for /// `ctx` to `data`. @@ -11421,7 +12304,9 @@ external int EVP_CIPHER_CTX_set_padding( @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_block_size', ) -external int EVP_CIPHER_block_size(ffi.Pointer cipher); +external int EVP_CIPHER_block_size( + ffi.Pointer cipher, +); /// EVP_CIPHER_flags returns a value which is the OR of zero or more /// `EVP_CIPH_*` flags. @@ -11429,7 +12314,9 @@ external int EVP_CIPHER_block_size(ffi.Pointer cipher); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_flags', ) -external int EVP_CIPHER_flags(ffi.Pointer cipher); +external int EVP_CIPHER_flags( + ffi.Pointer cipher, +); /// EVP_CIPHER_iv_length returns the IV size, in bytes, of `cipher`, or zero if /// `cipher` doesn't take an IV. @@ -11437,7 +12324,9 @@ external int EVP_CIPHER_flags(ffi.Pointer cipher); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_iv_length', ) -external int EVP_CIPHER_iv_length(ffi.Pointer cipher); +external int EVP_CIPHER_iv_length( + ffi.Pointer 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 @@ -11447,14 +12336,18 @@ external int EVP_CIPHER_iv_length(ffi.Pointer cipher); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_key_length', ) -external int EVP_CIPHER_key_length(ffi.Pointer cipher); +external int EVP_CIPHER_key_length( + ffi.Pointer cipher, +); /// EVP_CIPHER_mode returns one of the cipher mode values enumerated below. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_mode', ) -external int EVP_CIPHER_mode(ffi.Pointer cipher); +external int EVP_CIPHER_mode( + ffi.Pointer cipher, +); /// EVP_CIPHER_nid returns a NID identifying `cipher`. (For example, /// `NID_aes_128_gcm`.) @@ -11462,7 +12355,9 @@ external int EVP_CIPHER_mode(ffi.Pointer cipher); @ffi.Native)>( symbol: 'bssl_dart_EVP_CIPHER_nid', ) -external int EVP_CIPHER_nid(ffi.Pointer cipher); +external int EVP_CIPHER_nid( + ffi.Pointer cipher, +); /// EVP_Cipher historically exposed an internal implementation detail of `ctx` /// and should not be used. Use `EVP_CipherUpdate` and `EVP_CipherFinal_ex` @@ -11775,7 +12670,9 @@ external int EVP_DecodeFinal( @ffi.Native)>( symbol: 'bssl_dart_EVP_DecodeInit', ) -external void EVP_DecodeInit(ffi.Pointer ctx); +external void EVP_DecodeInit( + ffi.Pointer 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 @@ -11810,7 +12707,10 @@ external int EVP_DecodeUpdate( @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_EVP_DecodedLength', ) -external int EVP_DecodedLength(ffi.Pointer out_len, int len); +external int EVP_DecodedLength( + ffi.Pointer out_len, + int len, +); /// EVP_DecryptFinal calls `EVP_DecryptFinal_ex`. @meta.RecordUse() @@ -12299,7 +13199,9 @@ external int EVP_DigestVerifyUpdate( @ffi.Native)>( symbol: 'bssl_dart_EVP_ENCODE_CTX_free', ) -external void EVP_ENCODE_CTX_free(ffi.Pointer ctx); +external void EVP_ENCODE_CTX_free( + ffi.Pointer 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 @@ -12349,7 +13251,9 @@ external void EVP_EncodeFinal( @ffi.Native)>( symbol: 'bssl_dart_EVP_EncodeInit', ) -external void EVP_EncodeInit(ffi.Pointer ctx); +external void EVP_EncodeInit( + ffi.Pointer 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. @@ -12381,7 +13285,10 @@ external void EVP_EncodeUpdate( @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_EVP_EncodedLength', ) -external int EVP_EncodedLength(ffi.Pointer out_len, int len); +external int EVP_EncodedLength( + ffi.Pointer out_len, + int len, +); /// EVP_EncryptFinal calls `EVP_EncryptFinal_ex`. @meta.RecordUse() @@ -12556,7 +13463,9 @@ external int EVP_EncryptUpdate_ex( @ffi.Native)>( symbol: 'bssl_dart_EVP_KEM_ciphertext_len', ) -external int EVP_KEM_ciphertext_len(ffi.Pointer kem); +external int EVP_KEM_ciphertext_len( + ffi.Pointer kem, +); /// EVP_KEM_decap uses `kem` to decapsulate a `ciphertext` of length /// `ciphertext_len`, using `key` as a decapsulation key. It outputs a shared @@ -12655,7 +13564,9 @@ external int EVP_KEM_encap_external_entropy_for_testing( @ffi.Native)>( symbol: 'bssl_dart_EVP_KEM_entropy_len_for_testing', ) -external int EVP_KEM_entropy_len_for_testing(ffi.Pointer kem); +external int EVP_KEM_entropy_len_for_testing( + ffi.Pointer kem, +); /// EVP_KEM_secret_len returns the fixed length, in bytes, of the shared /// secret produced and consumed by `kem`. @@ -12663,7 +13574,9 @@ external int EVP_KEM_entropy_len_for_testing(ffi.Pointer kem); @ffi.Native)>( symbol: 'bssl_dart_EVP_KEM_secret_len', ) -external int EVP_KEM_secret_len(ffi.Pointer kem); +external int EVP_KEM_secret_len( + ffi.Pointer 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`. @@ -12671,7 +13584,9 @@ external int EVP_KEM_secret_len(ffi.Pointer kem); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_block_size', ) -external int EVP_MD_CTX_block_size(ffi.Pointer ctx); +external int EVP_MD_CTX_block_size( + ffi.Pointer 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 @@ -12682,7 +13597,9 @@ external int EVP_MD_CTX_block_size(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_cleanse', ) -external void EVP_MD_CTX_cleanse(ffi.Pointer ctx); +external void EVP_MD_CTX_cleanse( + ffi.Pointer 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. @@ -12690,7 +13607,9 @@ external void EVP_MD_CTX_cleanse(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_cleanup', ) -external int EVP_MD_CTX_cleanup(ffi.Pointer ctx); +external int EVP_MD_CTX_cleanup( + ffi.Pointer ctx, +); /// EVP_MD_CTX_copy calls `EVP_MD_CTX_init`, followed by `EVP_MD_CTX_copy_ex`. /// @@ -12737,14 +13656,18 @@ external ffi.Pointer EVP_MD_CTX_create(); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_destroy', ) -external void EVP_MD_CTX_destroy(ffi.Pointer ctx); +external void EVP_MD_CTX_destroy( + ffi.Pointer ctx, +); /// EVP_MD_CTX_free calls `EVP_MD_CTX_cleanup` and then frees `ctx` itself. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_free', ) -external void EVP_MD_CTX_free(ffi.Pointer ctx); +external void EVP_MD_CTX_free( + ffi.Pointer ctx, +); /// EVP_MD_CTX_get0_md returns the underlying digest function, or NULL if one has /// not been set. @@ -12752,7 +13675,9 @@ external void EVP_MD_CTX_free(ffi.Pointer ctx); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_MD_CTX_get0_md', ) -external ffi.Pointer EVP_MD_CTX_get0_md(ffi.Pointer ctx); +external ffi.Pointer EVP_MD_CTX_get0_md( + ffi.Pointer 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. @@ -12764,7 +13689,9 @@ external ffi.Pointer EVP_MD_CTX_get0_md(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_init', ) -external void EVP_MD_CTX_init(ffi.Pointer ctx); +external void EVP_MD_CTX_init( + ffi.Pointer 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 @@ -12773,7 +13700,9 @@ external void EVP_MD_CTX_init(ffi.Pointer ctx); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_MD_CTX_md', ) -external ffi.Pointer EVP_MD_CTX_md(ffi.Pointer ctx); +external ffi.Pointer EVP_MD_CTX_md( + ffi.Pointer 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. @@ -12812,14 +13741,19 @@ external ffi.Pointer EVP_MD_CTX_pkey_ctx( @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_reset', ) -external int EVP_MD_CTX_reset(ffi.Pointer ctx); +external int EVP_MD_CTX_reset( + ffi.Pointer ctx, +); /// EVP_MD_CTX_set_flags does nothing. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_EVP_MD_CTX_set_flags', ) -external void EVP_MD_CTX_set_flags(ffi.Pointer ctx, int flags); +external void EVP_MD_CTX_set_flags( + ffi.Pointer 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`. @@ -12827,7 +13761,9 @@ external void EVP_MD_CTX_set_flags(ffi.Pointer ctx, int flags); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_size', ) -external int EVP_MD_CTX_size(ffi.Pointer ctx); +external int EVP_MD_CTX_size( + ffi.Pointer 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 @@ -12836,14 +13772,18 @@ external int EVP_MD_CTX_size(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_CTX_type', ) -external int EVP_MD_CTX_type(ffi.Pointer ctx); +external int EVP_MD_CTX_type( + ffi.Pointer ctx, +); /// EVP_MD_block_size returns the native block-size of `md`, in bytes. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_block_size', ) -external int EVP_MD_block_size(ffi.Pointer md); +external int EVP_MD_block_size( + ffi.Pointer 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 @@ -12868,49 +13808,63 @@ external ffi.Pointer EVP_MD_fetch( @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_flags', ) -external int EVP_MD_flags(ffi.Pointer md); +external int EVP_MD_flags( + ffi.Pointer md, +); /// EVP_MD_free does nothing. `EVP_MD`s in BoringSSL are static. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_free', ) -external void EVP_MD_free(ffi.Pointer md); +external void EVP_MD_free( + ffi.Pointer md, +); /// EVP_MD_meth_get_flags calls `EVP_MD_flags`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_meth_get_flags', ) -external int EVP_MD_meth_get_flags(ffi.Pointer md); +external int EVP_MD_meth_get_flags( + ffi.Pointer md, +); /// EVP_MD_nid calls `EVP_MD_type`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_nid', ) -external int EVP_MD_nid(ffi.Pointer md); +external int EVP_MD_nid( + ffi.Pointer md, +); /// EVP_MD_size returns the digest size of `md`, in bytes. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_size', ) -external int EVP_MD_size(ffi.Pointer md); +external int EVP_MD_size( + ffi.Pointer md, +); /// EVP_MD_type returns a NID identifying `md`. (For example, `NID_sha256`.) @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_type', ) -external int EVP_MD_type(ffi.Pointer md); +external int EVP_MD_type( + ffi.Pointer md, +); /// EVP_MD_up_ref returns one. `EVP_MD`s in BoringSSL are static. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_EVP_MD_up_ref', ) -external int EVP_MD_up_ref(ffi.Pointer md); +external int EVP_MD_up_ref( + ffi.Pointer 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 @@ -12997,7 +13951,9 @@ external ffi.Pointer EVP_PKEY_CTX_dup( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_CTX_free', ) -external void EVP_PKEY_CTX_free(ffi.Pointer ctx); +external void EVP_PKEY_CTX_free( + ffi.Pointer ctx, +); /// EVP_PKEY_CTX_get0_pkey returns the `EVP_PKEY` associated with `ctx`. @meta.RecordUse() @@ -13162,7 +14118,10 @@ external int EVP_PKEY_CTX_set1_signature_context_string( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_EVP_PKEY_CTX_set_dh_pad', ) -external int EVP_PKEY_CTX_set_dh_pad(ffi.Pointer ctx, int pad); +external int EVP_PKEY_CTX_set_dh_pad( + ffi.Pointer ctx, + int pad, +); /// EVP_PKEY_CTX_set_dsa_paramgen_bits returns zero. @meta.RecordUse() @@ -13392,7 +14351,9 @@ external int EVP_PKEY_assign_RSA( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_base_id', ) -external int EVP_PKEY_base_id(ffi.Pointer pkey); +external int EVP_PKEY_base_id( + ffi.Pointer 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 @@ -13401,7 +14362,9 @@ external int EVP_PKEY_base_id(ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_bits', ) -external int EVP_PKEY_bits(ffi.Pointer pkey); +external int EVP_PKEY_bits( + ffi.Pointer pkey, +); /// EVP_PKEY_cmp calls `EVP_PKEY_eq`. It returns one if public keys are equal and /// zero otherwise. @@ -13411,7 +14374,10 @@ external int EVP_PKEY_bits(ffi.Pointer pkey); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_cmp', ) -external int EVP_PKEY_cmp(ffi.Pointer a, ffi.Pointer b); +external int EVP_PKEY_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// EVP_PKEY_cmp_parameters calls `EVP_PKEY_parameters_eq`. It returns one if /// parameters are equal and zero otherwise. @@ -13444,7 +14410,9 @@ external int EVP_PKEY_copy_parameters( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_copy_public', ) -external ffi.Pointer EVP_PKEY_copy_public(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_copy_public( + ffi.Pointer pkey, +); /// EVP_PKEY_decapsulate implements private key decapsulation using `ctx`. /// `ciphertext` and `ciphertext_len` specify the ciphertext to be decapsulated. @@ -13527,7 +14495,9 @@ external int EVP_PKEY_decrypt( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_decrypt_init', ) -external int EVP_PKEY_decrypt_init(ffi.Pointer ctx); +external int EVP_PKEY_decrypt_init( + ffi.Pointer 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 @@ -13562,7 +14532,9 @@ external int EVP_PKEY_derive( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_derive_init', ) -external int EVP_PKEY_derive_init(ffi.Pointer ctx); +external int EVP_PKEY_derive_init( + ffi.Pointer 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 @@ -13588,7 +14560,9 @@ external int EVP_PKEY_derive_set_peer( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_dup_ref', ) -external ffi.Pointer EVP_PKEY_dup_ref(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_dup_ref( + ffi.Pointer pkey, +); /// EVP_PKEY_encapsulate implements public key encapsulation using `ctx`. It /// either performs the operation or returns the maximum output sizes, depending @@ -13677,7 +14651,9 @@ external int EVP_PKEY_encrypt( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_encrypt_init', ) -external int EVP_PKEY_encrypt_init(ffi.Pointer ctx); +external int EVP_PKEY_encrypt_init( + ffi.Pointer ctx, +); /// EVP_PKEY_eq compares `a` and `b` and returns one if their public keys are /// equal and zero otherwise. @@ -13685,7 +14661,10 @@ external int EVP_PKEY_encrypt_init(ffi.Pointer ctx); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_eq', ) -external int EVP_PKEY_eq(ffi.Pointer a, ffi.Pointer b); +external int EVP_PKEY_eq( + ffi.Pointer a, + ffi.Pointer b, +); /// EVP_PKEY_free decrements the reference count of `pkey` and frees it if the /// reference count drops to zero. @@ -13693,7 +14672,9 @@ external int EVP_PKEY_eq(ffi.Pointer a, ffi.Pointer b); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_free', ) -external void EVP_PKEY_free(ffi.Pointer pkey); +external void EVP_PKEY_free( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native< @@ -13907,55 +14888,73 @@ external ffi.Pointer EVP_PKEY_generate_from_alg( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get0', ) -external ffi.Pointer EVP_PKEY_get0(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get0( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get0_DH', ) -external ffi.Pointer EVP_PKEY_get0_DH(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get0_DH( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get0_DSA', ) -external ffi.Pointer EVP_PKEY_get0_DSA(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get0_DSA( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get0_EC_KEY', ) -external ffi.Pointer EVP_PKEY_get0_EC_KEY(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get0_EC_KEY( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get0_RSA', ) -external ffi.Pointer EVP_PKEY_get0_RSA(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get0_RSA( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get1_DH', ) -external ffi.Pointer EVP_PKEY_get1_DH(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get1_DH( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get1_DSA', ) -external ffi.Pointer EVP_PKEY_get1_DSA(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get1_DSA( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get1_EC_KEY', ) -external ffi.Pointer EVP_PKEY_get1_EC_KEY(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get1_EC_KEY( + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_get1_RSA', ) -external ffi.Pointer EVP_PKEY_get1_RSA(ffi.Pointer pkey); +external ffi.Pointer EVP_PKEY_get1_RSA( + ffi.Pointer 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 @@ -13981,7 +14980,9 @@ external int EVP_PKEY_get1_tls_encodedpoint( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_get_ec_curve_nid', ) -external int EVP_PKEY_get_ec_curve_nid(ffi.Pointer pkey); +external int EVP_PKEY_get_ec_curve_nid( + ffi.Pointer 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. @@ -13989,7 +14990,9 @@ external int EVP_PKEY_get_ec_curve_nid(ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_get_ec_point_conv_form', ) -external int EVP_PKEY_get_ec_point_conv_form(ffi.Pointer pkey); +external int EVP_PKEY_get_ec_point_conv_form( + ffi.Pointer 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. @@ -14060,7 +15063,9 @@ external int EVP_PKEY_get_raw_public_key( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_has_private', ) -external int EVP_PKEY_has_private(ffi.Pointer pkey); +external int EVP_PKEY_has_private( + ffi.Pointer pkey, +); /// EVP_PKEY_has_public returns one if `pkey` has a public key, or zero /// otherwise. @@ -14068,7 +15073,9 @@ external int EVP_PKEY_has_private(ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_has_public', ) -external int EVP_PKEY_has_public(ffi.Pointer pkey); +external int EVP_PKEY_has_public( + ffi.Pointer 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, @@ -14080,7 +15087,9 @@ external int EVP_PKEY_has_public(ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_id', ) -external int EVP_PKEY_id(ffi.Pointer pkey); +external int EVP_PKEY_id( + ffi.Pointer 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 @@ -14089,7 +15098,9 @@ external int EVP_PKEY_id(ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_is_opaque', ) -external int EVP_PKEY_is_opaque(ffi.Pointer pkey); +external int EVP_PKEY_is_opaque( + ffi.Pointer 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 @@ -14115,7 +15126,9 @@ external int EVP_PKEY_keygen( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_keygen_init', ) -external int EVP_PKEY_keygen_init(ffi.Pointer ctx); +external int EVP_PKEY_keygen_init( + ffi.Pointer ctx, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( @@ -14196,7 +15209,9 @@ external int EVP_PKEY_marshal_rsa_public_key( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_missing_parameters', ) -external int EVP_PKEY_missing_parameters(ffi.Pointer pkey); +external int EVP_PKEY_missing_parameters( + ffi.Pointer pkey, +); /// EVP_PKEY_new creates a new, empty public-key object and returns it or NULL /// on allocation failure. @@ -14285,7 +15300,9 @@ external int EVP_PKEY_paramgen( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_paramgen_init', ) -external int EVP_PKEY_paramgen_init(ffi.Pointer ctx); +external int EVP_PKEY_paramgen_init( + ffi.Pointer ctx, +); /// EVP_PKEY_print_params prints a textual representation of the parameters in /// `pkey` to `out`. Returns one on success or zero otherwise. @@ -14345,7 +15362,10 @@ external int EVP_PKEY_print_public( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_EVP_PKEY_set1_DH', ) -external int EVP_PKEY_set1_DH(ffi.Pointer pkey, ffi.Pointer key); +external int EVP_PKEY_set1_DH( + ffi.Pointer pkey, + ffi.Pointer key, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( @@ -14438,7 +15458,10 @@ external int EVP_PKEY_set1_tls_encodedpoint( @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_EVP_PKEY_set_type', ) -external int EVP_PKEY_set_type(ffi.Pointer pkey, int type); +external int EVP_PKEY_set_type( + ffi.Pointer 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`. @@ -14482,7 +15505,9 @@ external int EVP_PKEY_sign( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_sign_init', ) -external int EVP_PKEY_sign_init(ffi.Pointer ctx); +external int EVP_PKEY_sign_init( + ffi.Pointer 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 @@ -14492,12 +15517,16 @@ external int EVP_PKEY_sign_init(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_size', ) -external int EVP_PKEY_size(ffi.Pointer pkey); +external int EVP_PKEY_size( + ffi.Pointer pkey, +); /// EVP_PKEY_type returns `nid`. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_EVP_PKEY_type') -external int EVP_PKEY_type(int nid); +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 @@ -14506,7 +15535,9 @@ external int EVP_PKEY_type(int nid); @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_up_ref', ) -external int EVP_PKEY_up_ref(ffi.Pointer pkey); +external int EVP_PKEY_up_ref( + ffi.Pointer pkey, +); /// EVP_PKEY_verify verifies that `sig_len` bytes from `sig` are a valid /// signature for `digest`. This function will fail for signature @@ -14544,7 +15575,9 @@ external int EVP_PKEY_verify( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_verify_init', ) -external int EVP_PKEY_verify_init(ffi.Pointer ctx); +external int EVP_PKEY_verify_init( + ffi.Pointer 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, @@ -14590,7 +15623,9 @@ external int EVP_PKEY_verify_recover( @ffi.Native)>( symbol: 'bssl_dart_EVP_PKEY_verify_recover_init', ) -external int EVP_PKEY_verify_recover_init(ffi.Pointer ctx); +external int EVP_PKEY_verify_recover_init( + ffi.Pointer ctx, +); /// EVP_Q_digest behaves like `EVP_Digest` but specifies the digest by a string /// `name`. `libctx` and `propq` are ignored. @@ -14626,7 +15661,9 @@ external int EVP_Q_digest( @ffi.Native Function(ffi.UnsignedInt)>( symbol: 'bssl_dart_EVP_RSA_gen', ) -external ffi.Pointer EVP_RSA_gen(int bits); +external ffi.Pointer 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, @@ -14785,7 +15822,9 @@ external int EVP_add_cipher_alias( @ffi.Native)>( symbol: 'bssl_dart_EVP_add_digest', ) -external int EVP_add_digest(ffi.Pointer digest); +external int EVP_add_digest( + ffi.Pointer digest, +); /// The following functions implement legacy TLS CBC cipher suites. /// @@ -15235,7 +16274,9 @@ external ffi.Pointer EVP_get_cipherbyname( @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_EVP_get_cipherbynid', ) -external ffi.Pointer EVP_get_cipherbynid(int nid); +external ffi.Pointer 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. @@ -15243,7 +16284,9 @@ external ffi.Pointer EVP_get_cipherbynid(int nid); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_get_digestbyname', ) -external ffi.Pointer EVP_get_digestbyname(ffi.Pointer name); +external ffi.Pointer EVP_get_digestbyname( + ffi.Pointer name, +); /// EVP_get_digestbynid returns an `EVP_MD` for the given NID, or NULL if no /// such digest is known. @@ -15251,7 +16294,9 @@ external ffi.Pointer EVP_get_digestbyname(ffi.Pointer name); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_EVP_get_digestbynid', ) -external ffi.Pointer EVP_get_digestbynid(int nid); +external ffi.Pointer 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. @@ -15259,7 +16304,9 @@ external ffi.Pointer EVP_get_digestbynid(int nid); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_get_digestbyobj', ) -external ffi.Pointer EVP_get_digestbyobj(ffi.Pointer obj); +external ffi.Pointer EVP_get_digestbyobj( + ffi.Pointer obj, +); /// EVP_has_aes_hardware returns one if we enable hardware support for fast and /// constant-time AES-GCM. @@ -15371,7 +16418,9 @@ external ffi.Pointer EVP_md5_sha1(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_parse_digest_algorithm', ) -external ffi.Pointer EVP_parse_digest_algorithm(ffi.Pointer cbs); +external ffi.Pointer EVP_parse_digest_algorithm( + ffi.Pointer 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 @@ -15380,7 +16429,9 @@ external ffi.Pointer EVP_parse_digest_algorithm(ffi.Pointer cbs); @ffi.Native)>( symbol: 'bssl_dart_EVP_parse_digest_algorithm_nid', ) -external int EVP_parse_digest_algorithm_nid(ffi.Pointer cbs); +external int EVP_parse_digest_algorithm_nid( + ffi.Pointer 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` @@ -15410,7 +16461,9 @@ external int EVP_parse_digest_algorithm_nid(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_parse_private_key', ) -external ffi.Pointer EVP_parse_private_key(ffi.Pointer cbs); +external ffi.Pointer EVP_parse_private_key( + ffi.Pointer cbs, +); /// EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure /// (RFC 5280) from `cbs` and advances `cbs`. It returns a newly-allocated @@ -15435,7 +16488,9 @@ external ffi.Pointer EVP_parse_private_key(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_EVP_parse_public_key', ) -external ffi.Pointer EVP_parse_public_key(ffi.Pointer cbs); +external ffi.Pointer EVP_parse_public_key( + ffi.Pointer 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 @@ -15689,7 +16744,9 @@ external ffi.Pointer EVP_sha512_256(); @ffi.Native)>( symbol: 'bssl_dart_EXTENDED_KEY_USAGE_free', ) -external void EXTENDED_KEY_USAGE_free(ffi.Pointer eku); +external void EXTENDED_KEY_USAGE_free( + ffi.Pointer eku, +); /// EXTENDED_KEY_USAGE_new returns a newly-allocated, empty `EXTENDED_KEY_USAGE` /// object, or NULL on error. @@ -15709,7 +16766,9 @@ external int FIPS_mode(); /// `BORINGSSL_FIPS` and zero otherwise. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_FIPS_mode_set') -external int FIPS_mode_set(int on); +external int FIPS_mode_set( + int on, +); /// FIPS_module_name returns the name of the FIPS module. @meta.RecordUse() @@ -15724,7 +16783,9 @@ external ffi.Pointer FIPS_module_name(); @ffi.Native)>( symbol: 'bssl_dart_FIPS_query_algorithm_status', ) -external int FIPS_query_algorithm_status(ffi.Pointer algorithm); +external int FIPS_query_algorithm_status( + ffi.Pointer 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 @@ -15733,7 +16794,9 @@ external int FIPS_query_algorithm_status(ffi.Pointer algorithm); @ffi.Native( symbol: 'bssl_dart_FIPS_read_counter', ) -external int FIPS_read_counter(int 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 @@ -15749,7 +16812,9 @@ external int FIPS_version(); @ffi.Native)>( symbol: 'bssl_dart_GENERAL_NAMES_free', ) -external void GENERAL_NAMES_free(ffi.Pointer gens); +external void GENERAL_NAMES_free( + ffi.Pointer gens, +); /// GENERAL_NAMES_new returns a new, empty `GENERAL_NAMES`, or NULL on error. @meta.RecordUse() @@ -15774,7 +16839,9 @@ external ffi.Pointer GENERAL_NAME_dup( @ffi.Native)>( symbol: 'bssl_dart_GENERAL_NAME_free', ) -external void GENERAL_NAME_free(ffi.Pointer gen); +external void GENERAL_NAME_free( + ffi.Pointer 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 @@ -15890,7 +16957,9 @@ external void GENERAL_NAME_set0_value( @ffi.Native)>( symbol: 'bssl_dart_GENERAL_SUBTREE_free', ) -external void GENERAL_SUBTREE_free(ffi.Pointer subtree); +external void GENERAL_SUBTREE_free( + ffi.Pointer subtree, +); /// GENERAL_SUBTREE_new returns a newly-allocated, empty `GENERAL_SUBTREE` /// object, or NULL on error. @@ -16021,14 +17090,18 @@ external ffi.Pointer HMAC( @ffi.Native)>( symbol: 'bssl_dart_HMAC_CTX_cleanse', ) -external void HMAC_CTX_cleanse(ffi.Pointer ctx); +external void HMAC_CTX_cleanse( + ffi.Pointer ctx, +); /// HMAC_CTX_cleanup frees data owned by `ctx`. It does not free `ctx` itself. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_HMAC_CTX_cleanup', ) -external void HMAC_CTX_cleanup(ffi.Pointer ctx); +external void HMAC_CTX_cleanup( + ffi.Pointer 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 @@ -16059,14 +17132,18 @@ external int HMAC_CTX_copy_ex( @ffi.Native)>( symbol: 'bssl_dart_HMAC_CTX_free', ) -external void HMAC_CTX_free(ffi.Pointer ctx); +external void HMAC_CTX_free( + ffi.Pointer ctx, +); /// HMAC_CTX_get_md returns `ctx`'s hash function. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_HMAC_CTX_get_md', ) -external ffi.Pointer HMAC_CTX_get_md(ffi.Pointer ctx); +external ffi.Pointer HMAC_CTX_get_md( + ffi.Pointer 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 @@ -16075,7 +17152,9 @@ external ffi.Pointer HMAC_CTX_get_md(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_HMAC_CTX_init', ) -external void HMAC_CTX_init(ffi.Pointer ctx); +external void HMAC_CTX_init( + 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 @@ -16089,7 +17168,9 @@ external ffi.Pointer HMAC_CTX_new(); @ffi.Native)>( symbol: 'bssl_dart_HMAC_CTX_reset', ) -external void HMAC_CTX_reset(ffi.Pointer ctx); +external void HMAC_CTX_reset( + ffi.Pointer 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 @@ -16172,14 +17253,18 @@ external int HMAC_Update( @ffi.Native)>( symbol: 'bssl_dart_HMAC_size', ) -external int HMAC_size(ffi.Pointer ctx); +external int HMAC_size( + ffi.Pointer ctx, +); /// ISSUING_DIST_POINT_free releases memory associated with `idp`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_ISSUING_DIST_POINT_free', ) -external void ISSUING_DIST_POINT_free(ffi.Pointer idp); +external void ISSUING_DIST_POINT_free( + ffi.Pointer idp, +); /// ISSUING_DIST_POINT_new returns a newly-allocated, empty `ISSUING_DIST_POINT` /// object, or NULL on error. @@ -16195,7 +17280,9 @@ external ffi.Pointer ISSUING_DIST_POINT_new(); @ffi.Native)>( symbol: 'bssl_dart_METHOD_ref', ) -external void METHOD_ref(ffi.Pointer method); +external void METHOD_ref( + ffi.Pointer 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 @@ -16204,7 +17291,9 @@ external void METHOD_ref(ffi.Pointer method); @ffi.Native)>( symbol: 'bssl_dart_METHOD_unref', ) -external void METHOD_unref(ffi.Pointer method); +external void METHOD_unref( + ffi.Pointer 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. @@ -16222,7 +17311,9 @@ external int NAME_CONSTRAINTS_check( @ffi.Native)>( symbol: 'bssl_dart_NAME_CONSTRAINTS_free', ) -external void NAME_CONSTRAINTS_free(ffi.Pointer ncons); +external void NAME_CONSTRAINTS_free( + ffi.Pointer ncons, +); /// NAME_CONSTRAINTS_new returns a newly-allocated, empty `NAME_CONSTRAINTS` /// object, or NULL on error. @@ -16237,7 +17328,9 @@ external ffi.Pointer NAME_CONSTRAINTS_new(); @ffi.Native)>( symbol: 'bssl_dart_NCONF_free', ) -external void NCONF_free(ffi.Pointer conf); +external void NCONF_free( + ffi.Pointer 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 @@ -16307,14 +17400,18 @@ external int NCONF_load_bio( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_NCONF_new', ) -external ffi.Pointer NCONF_new(ffi.Pointer method); +external ffi.Pointer NCONF_new( + ffi.Pointer method, +); /// NETSCAPE_SPKAC_free releases memory associated with `spkac`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_NETSCAPE_SPKAC_free', ) -external void NETSCAPE_SPKAC_free(ffi.Pointer spkac); +external void NETSCAPE_SPKAC_free( + ffi.Pointer spkac, +); /// NETSCAPE_SPKAC_new returns a newly-allocated, empty `NETSCAPE_SPKAC` object, /// or NULL on error. @@ -16355,7 +17452,9 @@ external ffi.Pointer NETSCAPE_SPKI_b64_encode( @ffi.Native)>( symbol: 'bssl_dart_NETSCAPE_SPKI_free', ) -external void NETSCAPE_SPKI_free(ffi.Pointer spki); +external void NETSCAPE_SPKI_free( + ffi.Pointer 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 @@ -16422,7 +17521,9 @@ external int NETSCAPE_SPKI_verify( @ffi.Native)>( symbol: 'bssl_dart_NOTICEREF_free', ) -external void NOTICEREF_free(ffi.Pointer ref); +external void NOTICEREF_free( + ffi.Pointer ref, +); /// NOTICEREF_new returns a newly-allocated, empty `NOTICEREF` object, or NULL /// on error. @@ -16436,7 +17537,9 @@ external ffi.Pointer NOTICEREF_new(); /// `NID_undef` if no such object is known. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_OBJ_cbs2nid') -external int OBJ_cbs2nid(ffi.Pointer cbs); +external int OBJ_cbs2nid( + ffi.Pointer cbs, +); /// OBJ_cleanup does nothing. @meta.RecordUse() @@ -16449,7 +17552,10 @@ external void OBJ_cleanup(); @ffi.Native< ffi.Int Function(ffi.Pointer, ffi.Pointer) >(symbol: 'bssl_dart_OBJ_cmp') -external int OBJ_cmp(ffi.Pointer a, ffi.Pointer b); +external int OBJ_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// OBJ_create adds a known object and returns the NID of the new object, or /// NID_undef on error. @@ -16480,7 +17586,9 @@ external int OBJ_create( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OBJ_dup', ) -external ffi.Pointer OBJ_dup(ffi.Pointer obj); +external ffi.Pointer OBJ_dup( + ffi.Pointer 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` @@ -16520,7 +17628,9 @@ external int OBJ_find_sigid_by_algs( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OBJ_get0_data', ) -external ffi.Pointer OBJ_get0_data(ffi.Pointer obj); +external ffi.Pointer OBJ_get0_data( + ffi.Pointer obj, +); /// OBJ_get_undef returns the object for `NID_undef`. Prefer this function over /// `OBJ_nid2obj` to avoid pulling in the full OID table. @@ -16538,7 +17648,9 @@ external ffi.Pointer OBJ_get_undef(); @ffi.Native)>( symbol: 'bssl_dart_OBJ_length', ) -external int OBJ_length(ffi.Pointer obj); +external int OBJ_length( + ffi.Pointer obj, +); /// OBJ_ln2nid returns the nid corresponding to `long_name`, or `NID_undef` if /// no such long name is known. @@ -16546,7 +17658,9 @@ external int OBJ_length(ffi.Pointer obj); @ffi.Native)>( symbol: 'bssl_dart_OBJ_ln2nid', ) -external int OBJ_ln2nid(ffi.Pointer long_name); +external int OBJ_ln2nid( + ffi.Pointer long_name, +); /// OBJ_nid2cbb writes `nid` as an ASN.1 OBJECT IDENTIFIER to `out`. It returns /// one on success or zero otherwise. @@ -16554,14 +17668,19 @@ external int OBJ_ln2nid(ffi.Pointer long_name); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_OBJ_nid2cbb', ) -external int OBJ_nid2cbb(ffi.Pointer out, int nid); +external int OBJ_nid2cbb( + ffi.Pointer out, + int nid, +); /// OBJ_nid2ln returns the long name for `nid`, or NULL if `nid` is unknown. @meta.RecordUse() @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_OBJ_nid2ln', ) -external ffi.Pointer OBJ_nid2ln(int nid); +external ffi.Pointer OBJ_nid2ln( + int nid, +); /// OBJ_nid2obj returns the `ASN1_OBJECT` corresponding to `nid`, or NULL if /// `nid` is unknown. @@ -16582,14 +17701,18 @@ external ffi.Pointer OBJ_nid2ln(int nid); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_OBJ_nid2obj', ) -external ffi.Pointer OBJ_nid2obj(int nid); +external ffi.Pointer OBJ_nid2obj( + int nid, +); /// OBJ_nid2sn returns the short name for `nid`, or NULL if `nid` is unknown. @meta.RecordUse() @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_OBJ_nid2sn', ) -external ffi.Pointer OBJ_nid2sn(int nid); +external ffi.Pointer OBJ_nid2sn( + int nid, +); /// OBJ_obj2nid returns the nid corresponding to `obj`, or `NID_undef` if no /// such object is known. @@ -16597,7 +17720,9 @@ external ffi.Pointer OBJ_nid2sn(int nid); @ffi.Native)>( symbol: 'bssl_dart_OBJ_obj2nid', ) -external int OBJ_obj2nid(ffi.Pointer obj); +external int OBJ_obj2nid( + ffi.Pointer obj, +); /// OBJ_obj2txt converts `obj` to a textual representation. If /// `always_return_oid` is zero then `obj` will be matched against known objects @@ -16629,7 +17754,9 @@ external int OBJ_obj2txt( @ffi.Native)>( symbol: 'bssl_dart_OBJ_sn2nid', ) -external int OBJ_sn2nid(ffi.Pointer short_name); +external int OBJ_sn2nid( + ffi.Pointer 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 @@ -16638,7 +17765,9 @@ external int OBJ_sn2nid(ffi.Pointer short_name); @ffi.Native)>( symbol: 'bssl_dart_OBJ_txt2nid', ) -external int OBJ_txt2nid(ffi.Pointer s); +external int OBJ_txt2nid( + ffi.Pointer 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 @@ -16680,7 +17809,10 @@ external int OPENSSL_asprintf( @ffi.Native Function(ffi.Size, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_calloc', ) -external ffi.Pointer OPENSSL_calloc(int num, int size); +external ffi.Pointer OPENSSL_calloc( + int num, + int size, +); /// OPENSSL_cleanse zeros out `len` bytes of memory at `ptr`. This is similar to /// `memset_s` from C11. @@ -16688,7 +17820,10 @@ external ffi.Pointer OPENSSL_calloc(int num, int size); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_cleanse', ) -external void OPENSSL_cleanse(ffi.Pointer ptr, int len); +external void OPENSSL_cleanse( + ffi.Pointer ptr, + int len, +); /// OPENSSL_cleanup does nothing. @meta.RecordUse() @@ -16701,14 +17836,19 @@ external void OPENSSL_cleanup(); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_clear_free', ) -external void OPENSSL_clear_free(ffi.Pointer ptr, int len); +external void OPENSSL_clear_free( + ffi.Pointer ptr, + int len, +); /// OPENSSL_config does nothing. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_config', ) -external void OPENSSL_config(ffi.Pointer config_name); +external void OPENSSL_config( + ffi.Pointer 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. @@ -16717,7 +17857,9 @@ external void OPENSSL_config(ffi.Pointer config_name); @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_free', ) -external void OPENSSL_free(ffi.Pointer ptr); +external void OPENSSL_free( + ffi.Pointer ptr, +); /// OPENSSL_fromxdigit returns one if `c` is a hexadecimal digit as recognized /// by OPENSSL_isxdigit, and sets `out` to the corresponding value. Otherwise @@ -16726,14 +17868,20 @@ external void OPENSSL_free(ffi.Pointer ptr); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_OPENSSL_fromxdigit', ) -external int OPENSSL_fromxdigit(ffi.Pointer out, int c); +external int OPENSSL_fromxdigit( + ffi.Pointer out, + int c, +); /// OPENSSL_hash32 implements the 32 bit, FNV-1a hash. @meta.RecordUse() @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_hash32', ) -external int OPENSSL_hash32(ffi.Pointer ptr, int len); +external int OPENSSL_hash32( + ffi.Pointer ptr, + int len, +); /// OPENSSL_init_crypto returns one. @meta.RecordUse() @@ -16749,32 +17897,42 @@ external int OPENSSL_init_crypto( /// only recognizes what `OPENSSL_isalpha` and `OPENSSL_isdigit` recognize. @meta.RecordUse() @ffi.Native(symbol: 'bssl_dart_OPENSSL_isalnum') -external int OPENSSL_isalnum(int c); +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(symbol: 'bssl_dart_OPENSSL_isalpha') -external int OPENSSL_isalpha(int c); +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(symbol: 'bssl_dart_OPENSSL_isdigit') -external int OPENSSL_isdigit(int c); +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(symbol: 'bssl_dart_OPENSSL_isspace') -external int OPENSSL_isspace(int c); +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(symbol: 'bssl_dart_OPENSSL_isxdigit') -external int OPENSSL_isxdigit(int c); +external int OPENSSL_isxdigit( + int c, +); /// OPENSSL_load_builtin_modules does nothing. @meta.RecordUse() @@ -16791,7 +17949,9 @@ external void OPENSSL_load_builtin_modules(); @ffi.Native Function(ffi.Size)>( symbol: 'bssl_dart_OPENSSL_malloc', ) -external ffi.Pointer OPENSSL_malloc(int size); +external ffi.Pointer OPENSSL_malloc( + int size, +); /// OPENSSL_malloc_init returns one. @meta.RecordUse() @@ -16833,14 +17993,19 @@ external ffi.Pointer OPENSSL_realloc( @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_secure_clear_free', ) -external void OPENSSL_secure_clear_free(ffi.Pointer ptr, int len); +external void OPENSSL_secure_clear_free( + ffi.Pointer ptr, + int len, +); /// OPENSSL_secure_malloc calls `OPENSSL_malloc`. @meta.RecordUse() @ffi.Native Function(ffi.Size)>( symbol: 'bssl_dart_OPENSSL_secure_malloc', ) -external ffi.Pointer OPENSSL_secure_malloc(int size); +external ffi.Pointer OPENSSL_secure_malloc( + int size, +); @meta.RecordUse() @ffi.Native< @@ -16925,7 +18090,9 @@ external int OPENSSL_sk_find( @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_sk_free', ) -external void OPENSSL_sk_free(ffi.Pointer sk); +external void OPENSSL_sk_free( + ffi.Pointer sk, +); @meta.RecordUse() @ffi.Native< @@ -16941,13 +18108,17 @@ external int OPENSSL_sk_insert( @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_sk_is_sorted', ) -external int OPENSSL_sk_is_sorted(ffi.Pointer sk); +external int OPENSSL_sk_is_sorted( + ffi.Pointer sk, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OPENSSL_sk_last', ) -external ffi.Pointer OPENSSL_sk_last(ffi.Pointer sk); +external ffi.Pointer OPENSSL_sk_last( + ffi.Pointer sk, +); /// The following are raw stack functions. They implement the corresponding typed /// `sk_SAMPLE_*` functions generated by `DEFINE_STACK_OF`. Callers shouldn't be @@ -16956,7 +18127,9 @@ external ffi.Pointer OPENSSL_sk_last(ffi.Pointer sk); @ffi.Native Function(OPENSSL_sk_cmp_func)>( symbol: 'bssl_dart_OPENSSL_sk_new', ) -external ffi.Pointer OPENSSL_sk_new(OPENSSL_sk_cmp_func comp); +external ffi.Pointer OPENSSL_sk_new( + OPENSSL_sk_cmp_func comp, +); @meta.RecordUse() @ffi.Native Function()>( @@ -16968,13 +18141,17 @@ external ffi.Pointer OPENSSL_sk_new_null(); @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_sk_num', ) -external int OPENSSL_sk_num(ffi.Pointer sk); +external int OPENSSL_sk_num( + ffi.Pointer sk, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OPENSSL_sk_pop', ) -external ffi.Pointer OPENSSL_sk_pop(ffi.Pointer sk); +external ffi.Pointer OPENSSL_sk_pop( + ffi.Pointer sk, +); @meta.RecordUse() @ffi.Native< @@ -17026,7 +18203,9 @@ external OPENSSL_sk_cmp_func OPENSSL_sk_set_cmp_func( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OPENSSL_sk_shift', ) -external ffi.Pointer OPENSSL_sk_shift(ffi.Pointer sk); +external ffi.Pointer OPENSSL_sk_shift( + ffi.Pointer sk, +); @meta.RecordUse() @ffi.Native< @@ -17066,7 +18245,9 @@ external ffi.Pointer OPENSSL_sk_value( @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_sk_zero', ) -external void OPENSSL_sk_zero(ffi.Pointer sk); +external void OPENSSL_sk_zero( + ffi.Pointer sk, +); /// OPENSSL_strcasecmp is a locale-independent, ASCII-only version of /// strcasecmp(3). @@ -17084,14 +18265,18 @@ external int OPENSSL_strcasecmp( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_OPENSSL_strdup', ) -external ffi.Pointer OPENSSL_strdup(ffi.Pointer s); +external ffi.Pointer OPENSSL_strdup( + ffi.Pointer s, +); /// OPENSSL_strhash calls `OPENSSL_hash32` on the NUL-terminated string `s`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_OPENSSL_strhash', ) -external int OPENSSL_strhash(ffi.Pointer s); +external int OPENSSL_strhash( + ffi.Pointer s, +); /// OPENSSL_strlcat acts like strlcat(3). @meta.RecordUse() @@ -17144,13 +18329,18 @@ external ffi.Pointer OPENSSL_strndup( @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_OPENSSL_strnlen', ) -external int OPENSSL_strnlen(ffi.Pointer s, int len); +external int OPENSSL_strnlen( + ffi.Pointer 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(symbol: 'bssl_dart_OPENSSL_tolower') -external int OPENSSL_tolower(int c); +external int OPENSSL_tolower( + int c, +); /// OPENSSL_vasprintf has the same behavior as vasprintf(3), except that /// memory allocated in a returned string must be freed with `OPENSSL_free`. @@ -17174,14 +18364,18 @@ external int OPENSSL_vasprintf( @ffi.Native Function(ffi.Size)>( symbol: 'bssl_dart_OPENSSL_zalloc', ) -external ffi.Pointer OPENSSL_zalloc(int size); +external ffi.Pointer OPENSSL_zalloc( + int size, +); /// OTHERNAME_free releases memory associated with `name`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_OTHERNAME_free', ) -external void OTHERNAME_free(ffi.Pointer name); +external void OTHERNAME_free( + ffi.Pointer name, +); /// OTHERNAME_new returns a new, empty `OTHERNAME`, or NULL on error. @meta.RecordUse() @@ -17212,7 +18406,9 @@ external void OpenSSL_add_all_digests(); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_OpenSSL_version', ) -external ffi.Pointer OpenSSL_version(int which); +external ffi.Pointer OpenSSL_version( + int which, +); /// OpenSSL_version_num is a compatibility function that returns /// OPENSSL_VERSION_NUMBER from base.h. @@ -18181,7 +19377,10 @@ external int PEM_write( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_DHparams', ) -external int PEM_write_DHparams(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_DHparams( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native< @@ -18209,13 +19408,19 @@ external int PEM_write_DSAPrivateKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_DSA_PUBKEY', ) -external int PEM_write_DSA_PUBKEY(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_DSA_PUBKEY( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_DSAparams', ) -external int PEM_write_DSAparams(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_DSAparams( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native< @@ -18243,19 +19448,28 @@ external int PEM_write_ECPrivateKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_EC_PUBKEY', ) -external int PEM_write_EC_PUBKEY(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_EC_PUBKEY( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_PKCS7', ) -external int PEM_write_PKCS7(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_PKCS7( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_PKCS8', ) -external int PEM_write_PKCS8(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_PKCS8( + ffi.Pointer fp, + ffi.Pointer in$, +); /// PEM_write_PKCS8PrivateKey behaves like `PEM_write_bio_PKCS8PrivateKey` but /// writes to `fp`. @@ -18318,7 +19532,10 @@ external int PEM_write_PKCS8_PRIV_KEY_INFO( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_PUBKEY', ) -external int PEM_write_PUBKEY(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_PUBKEY( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native< @@ -18368,13 +19585,19 @@ external int PEM_write_RSAPrivateKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_RSAPublicKey', ) -external int PEM_write_RSAPublicKey(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_RSAPublicKey( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_RSA_PUBKEY', ) -external int PEM_write_RSA_PUBKEY(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_RSA_PUBKEY( + ffi.Pointer fp, + ffi.Pointer in$, +); /// The following functions behave like the corresponding `PEM_write_bio_*` /// functions, but write to `fp`. @@ -18382,13 +19605,19 @@ external int PEM_write_RSA_PUBKEY(ffi.Pointer fp, ffi.Pointer in$); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_X509', ) -external int PEM_write_X509(ffi.Pointer fp, ffi.Pointer x); +external int PEM_write_X509( + ffi.Pointer fp, + ffi.Pointer x, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_X509_AUX', ) -external int PEM_write_X509_AUX(ffi.Pointer fp, ffi.Pointer in$); +external int PEM_write_X509_AUX( + ffi.Pointer fp, + ffi.Pointer in$, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( @@ -18445,7 +19674,10 @@ external int PEM_write_bio( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_bio_DHparams', ) -external int PEM_write_bio_DHparams(ffi.Pointer bio, ffi.Pointer in$); +external int PEM_write_bio_DHparams( + ffi.Pointer bio, + ffi.Pointer in$, +); /// PEM_write_bio_DSAPrivateKey writes `in` as a PEM block of type "DSA PRIVATE /// KEY", as described in `PEM_write_bio_SAMPLE`. @@ -18534,7 +19766,10 @@ external int PEM_write_bio_EC_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_bio_PKCS7', ) -external int PEM_write_bio_PKCS7(ffi.Pointer bio, ffi.Pointer in$); +external int PEM_write_bio_PKCS7( + ffi.Pointer bio, + ffi.Pointer 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 @@ -18702,7 +19937,10 @@ external int PEM_write_bio_RSA_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_PEM_write_bio_X509', ) -external int PEM_write_bio_X509(ffi.Pointer bio, ffi.Pointer in$); +external int PEM_write_bio_X509( + ffi.Pointer bio, + ffi.Pointer in$, +); /// PEM_write_bio_X509_AUX writes a PEM block of type "TRUSTED CERTIFICATE", as /// described in `PEM_write_bio_SAMPLE`. @@ -18845,7 +20083,9 @@ external int PKCS7_bundle_raw_certificates( @ffi.Native)>( symbol: 'bssl_dart_PKCS7_free', ) -external void PKCS7_free(ffi.Pointer p7); +external void PKCS7_free( + ffi.Pointer 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. @@ -18972,49 +20212,63 @@ external ffi.Pointer PKCS7_sign( @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_data', ) -external int PKCS7_type_is_data(ffi.Pointer p7); +external int PKCS7_type_is_data( + ffi.Pointer p7, +); /// PKCS7_type_is_digest returns zero. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_digest', ) -external int PKCS7_type_is_digest(ffi.Pointer p7); +external int PKCS7_type_is_digest( + ffi.Pointer p7, +); /// PKCS7_type_is_encrypted returns zero. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_encrypted', ) -external int PKCS7_type_is_encrypted(ffi.Pointer p7); +external int PKCS7_type_is_encrypted( + ffi.Pointer p7, +); /// PKCS7_type_is_enveloped returns zero. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_enveloped', ) -external int PKCS7_type_is_enveloped(ffi.Pointer p7); +external int PKCS7_type_is_enveloped( + ffi.Pointer p7, +); /// PKCS7_type_is_signed returns one. (We only support signed data ContentInfos.) @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_signed', ) -external int PKCS7_type_is_signed(ffi.Pointer p7); +external int PKCS7_type_is_signed( + ffi.Pointer p7, +); /// PKCS7_type_is_signedAndEnveloped returns zero. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS7_type_is_signedAndEnveloped', ) -external int PKCS7_type_is_signedAndEnveloped(ffi.Pointer p7); +external int PKCS7_type_is_signedAndEnveloped( + ffi.Pointer p7, +); /// PKCS8_PRIV_KEY_INFO_free releases memory associated with `key`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_PKCS8_PRIV_KEY_INFO_free', ) -external void PKCS8_PRIV_KEY_INFO_free(ffi.Pointer key); +external void PKCS8_PRIV_KEY_INFO_free( + ffi.Pointer key, +); /// PKCS8_PRIV_KEY_INFO_new returns a newly-allocated, empty /// `PKCS8_PRIV_KEY_INFO` object, or NULL on error. @@ -19029,7 +20283,9 @@ external ffi.Pointer PKCS8_PRIV_KEY_INFO_new(); @ffi.Native)>( symbol: 'bssl_dart_POLICYINFO_free', ) -external void POLICYINFO_free(ffi.Pointer info); +external void POLICYINFO_free( + ffi.Pointer info, +); /// POLICYINFO_new returns a newly-allocated, empty `POLICYINFO` object, or NULL /// on error. @@ -19044,7 +20300,9 @@ external ffi.Pointer POLICYINFO_new(); @ffi.Native)>( symbol: 'bssl_dart_POLICYQUALINFO_free', ) -external void POLICYQUALINFO_free(ffi.Pointer info); +external void POLICYQUALINFO_free( + ffi.Pointer info, +); /// POLICYQUALINFO_new returns a newly-allocated, empty `POLICYQUALINFO` object, /// or NULL on error. @@ -19059,7 +20317,9 @@ external ffi.Pointer POLICYQUALINFO_new(); @ffi.Native)>( symbol: 'bssl_dart_POLICY_CONSTRAINTS_free', ) -external void POLICY_CONSTRAINTS_free(ffi.Pointer pcons); +external void POLICY_CONSTRAINTS_free( + ffi.Pointer pcons, +); /// POLICY_CONSTRAINTS_new returns a newly-allocated, empty `POLICY_CONSTRAINTS` /// object, or NULL on error. @@ -19074,7 +20334,9 @@ external ffi.Pointer POLICY_CONSTRAINTS_new(); @ffi.Native)>( symbol: 'bssl_dart_POLICY_MAPPING_free', ) -external void POLICY_MAPPING_free(ffi.Pointer mapping); +external void POLICY_MAPPING_free( + ffi.Pointer mapping, +); /// POLICY_MAPPING_new returns a newly-allocated, empty `POLICY_MAPPING` object, /// or NULL on error. @@ -19103,7 +20365,11 @@ external ffi.Pointer RAND_SSLeay(); @ffi.Native, ffi.Int, ffi.Double)>( symbol: 'bssl_dart_RAND_add', ) -external void RAND_add(ffi.Pointer buf, int num, double entropy); +external void RAND_add( + ffi.Pointer 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. @@ -19111,7 +20377,10 @@ external void RAND_add(ffi.Pointer buf, int num, double entropy); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_RAND_bytes', ) -external int RAND_bytes(ffi.Pointer buf, int len); +external int RAND_bytes( + ffi.Pointer buf, + int len, +); /// RAND_cleanup does nothing. @meta.RecordUse() @@ -19131,7 +20400,9 @@ external void RAND_disable_fork_unsafe_buffering(); @ffi.Native)>( symbol: 'bssl_dart_RAND_egd', ) -external int RAND_egd(ffi.Pointer arg0); +external int RAND_egd( + ffi.Pointer 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 @@ -19156,7 +20427,9 @@ external int RAND_egd(ffi.Pointer arg0); @ffi.Native( symbol: 'bssl_dart_RAND_enable_fork_unsafe_buffering', ) -external void RAND_enable_fork_unsafe_buffering(int fd); +external void RAND_enable_fork_unsafe_buffering( + int fd, +); /// RAND_file_name returns NULL. @meta.RecordUse() @@ -19196,7 +20469,10 @@ external void RAND_get_system_entropy_for_custom_prng( @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_RAND_load_file', ) -external int RAND_load_file(ffi.Pointer path, int num); +external int RAND_load_file( + ffi.Pointer path, + int num, +); /// RAND_poll returns one. @meta.RecordUse() @@ -19208,7 +20484,10 @@ external int RAND_poll(); @ffi.Native, ffi.Size)>( symbol: 'bssl_dart_RAND_pseudo_bytes', ) -external int RAND_pseudo_bytes(ffi.Pointer buf, int len); +external int RAND_pseudo_bytes( + ffi.Pointer buf, + int len, +); /// RAND_seed reads a single byte of random data to ensure that any file /// descriptors etc are opened. @@ -19216,14 +20495,19 @@ external int RAND_pseudo_bytes(ffi.Pointer buf, int len); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_RAND_seed', ) -external void RAND_seed(ffi.Pointer buf, int num); +external void RAND_seed( + ffi.Pointer buf, + int num, +); /// RAND_set_rand_method returns one. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_RAND_set_rand_method', ) -external int RAND_set_rand_method(ffi.Pointer arg0); +external int RAND_set_rand_method( + ffi.Pointer arg0, +); /// RAND_status returns one. @meta.RecordUse() @@ -19236,7 +20520,9 @@ external int RAND_status(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSAPrivateKey_dup', ) -external ffi.Pointer RSAPrivateKey_dup(ffi.Pointer rsa); +external ffi.Pointer RSAPrivateKey_dup( + ffi.Pointer 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. @@ -19244,14 +20530,18 @@ external ffi.Pointer RSAPrivateKey_dup(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSAPublicKey_dup', ) -external ffi.Pointer RSAPublicKey_dup(ffi.Pointer rsa); +external ffi.Pointer RSAPublicKey_dup( + ffi.Pointer rsa, +); /// RSA_PSS_PARAMS_free releases memory associated with `params`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_RSA_PSS_PARAMS_free', ) -external void RSA_PSS_PARAMS_free(ffi.Pointer params); +external void RSA_PSS_PARAMS_free( + ffi.Pointer params, +); /// RSA_PSS_PARAMS_new returns a new, empty `RSA_PSS_PARAMS`, or NULL on error. @meta.RecordUse() @@ -19289,21 +20579,28 @@ external int RSA_add_pkcs1_prefix( @ffi.Native)>( symbol: 'bssl_dart_RSA_bits', ) -external int RSA_bits(ffi.Pointer rsa); +external int RSA_bits( + ffi.Pointer rsa, +); /// RSA_blinding_off does nothing. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_RSA_blinding_off', ) -external void RSA_blinding_off(ffi.Pointer rsa); +external void RSA_blinding_off( + ffi.Pointer rsa, +); /// RSA_blinding_on returns one. @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_RSA_blinding_on', ) -external int RSA_blinding_on(ffi.Pointer rsa, ffi.Pointer ctx); +external int RSA_blinding_on( + ffi.Pointer rsa, + ffi.Pointer 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 @@ -19312,7 +20609,9 @@ external int RSA_blinding_on(ffi.Pointer rsa, ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_RSA_check_fips', ) -external int RSA_check_fips(ffi.Pointer key); +external int RSA_check_fips( + ffi.Pointer 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 @@ -19321,7 +20620,9 @@ external int RSA_check_fips(ffi.Pointer key); @ffi.Native)>( symbol: 'bssl_dart_RSA_check_key', ) -external int RSA_check_key(ffi.Pointer rsa); +external int RSA_check_key( + ffi.Pointer 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 @@ -19375,7 +20676,9 @@ external int RSA_decrypt( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_dup_ref', ) -external ffi.Pointer RSA_dup_ref(ffi.Pointer rsa); +external ffi.Pointer RSA_dup_ref( + ffi.Pointer 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 @@ -19415,13 +20718,17 @@ external int RSA_encrypt( /// constants. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_RSA_flags') -external int RSA_flags(ffi.Pointer rsa); +external int RSA_flags( + ffi.Pointer rsa, +); /// RSA_free decrements the reference count of `rsa` and frees it if the /// reference count drops to zero. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_RSA_free') -external void RSA_free(ffi.Pointer rsa); +external void RSA_free( + ffi.Pointer 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 @@ -19486,7 +20793,9 @@ external void RSA_get0_crt_params( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_d', ) -external ffi.Pointer RSA_get0_d(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_d( + ffi.Pointer 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. @@ -19494,7 +20803,9 @@ external ffi.Pointer RSA_get0_d(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_dmp1', ) -external ffi.Pointer RSA_get0_dmp1(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_dmp1( + ffi.Pointer 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. @@ -19502,14 +20813,18 @@ external ffi.Pointer RSA_get0_dmp1(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_dmq1', ) -external ffi.Pointer RSA_get0_dmq1(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_dmq1( + ffi.Pointer rsa, +); /// RSA_get0_e returns `rsa`'s public exponent. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_e', ) -external ffi.Pointer RSA_get0_e(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_e( + ffi.Pointer 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. @@ -19533,7 +20848,9 @@ external void RSA_get0_factors( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_iqmp', ) -external ffi.Pointer RSA_get0_iqmp(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_iqmp( + ffi.Pointer 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 @@ -19559,7 +20876,9 @@ external void RSA_get0_key( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_n', ) -external ffi.Pointer RSA_get0_n(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_n( + ffi.Pointer 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. @@ -19567,7 +20886,9 @@ external ffi.Pointer RSA_get0_n(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_p', ) -external ffi.Pointer RSA_get0_p(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_p( + ffi.Pointer 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 @@ -19581,7 +20902,9 @@ external ffi.Pointer RSA_get0_p(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_pss_params', ) -external ffi.Pointer RSA_get0_pss_params(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_pss_params( + ffi.Pointer 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. @@ -19589,13 +20912,18 @@ external ffi.Pointer RSA_get0_pss_params(ffi.Pointer rsa); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_get0_q', ) -external ffi.Pointer RSA_get0_q(ffi.Pointer rsa); +external ffi.Pointer RSA_get0_q( + ffi.Pointer rsa, +); @meta.RecordUse() @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_RSA_get_ex_data', ) -external ffi.Pointer RSA_get_ex_data(ffi.Pointer rsa, int idx); +external ffi.Pointer RSA_get_ex_data( + ffi.Pointer rsa, + int idx, +); /// ex_data functions. /// @@ -19624,7 +20952,9 @@ external int RSA_get_ex_new_index( @ffi.Native)>( symbol: 'bssl_dart_RSA_is_opaque', ) -external int RSA_is_opaque(ffi.Pointer rsa); +external int RSA_is_opaque( + ffi.Pointer 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 @@ -19645,7 +20975,10 @@ external int RSA_marshal_private_key( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_RSA_marshal_public_key', ) -external int RSA_marshal_public_key(ffi.Pointer cbb, ffi.Pointer rsa); +external int RSA_marshal_public_key( + ffi.Pointer cbb, + ffi.Pointer 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. @@ -19658,7 +20991,9 @@ external ffi.Pointer RSA_new(); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_new_method', ) -external ffi.Pointer RSA_new_method(ffi.Pointer engine); +external ffi.Pointer RSA_new_method( + ffi.Pointer 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. @@ -19863,7 +21198,9 @@ external int RSA_padding_add_PKCS1_PSS_mgf1( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_parse_private_key', ) -external ffi.Pointer RSA_parse_private_key(ffi.Pointer cbs); +external ffi.Pointer RSA_parse_private_key( + ffi.Pointer 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 @@ -19872,7 +21209,9 @@ external ffi.Pointer RSA_parse_private_key(ffi.Pointer cbs); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_RSA_parse_public_key', ) -external ffi.Pointer RSA_parse_public_key(ffi.Pointer cbs); +external ffi.Pointer RSA_parse_public_key( + ffi.Pointer cbs, +); /// RSA_print prints a textual representation of `rsa` to `bio`. It returns one /// on success or zero otherwise. @@ -19880,7 +21219,11 @@ external ffi.Pointer RSA_parse_public_key(ffi.Pointer cbs); @ffi.Native, ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_RSA_print', ) -external int RSA_print(ffi.Pointer bio, ffi.Pointer rsa, int indent); +external int RSA_print( + ffi.Pointer bio, + ffi.Pointer 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 @@ -20265,20 +21608,27 @@ external int RSA_sign_raw( @ffi.Native)>( symbol: 'bssl_dart_RSA_size', ) -external int RSA_size(ffi.Pointer rsa); +external int RSA_size( + ffi.Pointer rsa, +); /// RSA_test_flags returns the subset of flags in `flags` which are set in `rsa`. @meta.RecordUse() @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_RSA_test_flags', ) -external int RSA_test_flags(ffi.Pointer rsa, int flags); +external int RSA_test_flags( + ffi.Pointer 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)>(symbol: 'bssl_dart_RSA_up_ref') -external int RSA_up_ref(ffi.Pointer rsa); +external int RSA_up_ref( + ffi.Pointer 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`. @@ -20452,14 +21802,19 @@ external ffi.Pointer SHA1( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_SHA1_Final', ) -external int SHA1_Final(ffi.Pointer out, ffi.Pointer sha); +external int SHA1_Final( + ffi.Pointer out, + ffi.Pointer sha, +); /// SHA1_Init initialises `sha` and returns one. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_SHA1_Init', ) -external int SHA1_Init(ffi.Pointer sha); +external int SHA1_Init( + ffi.Pointer 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 @@ -20518,7 +21873,9 @@ external int SHA224_Final( @ffi.Native)>( symbol: 'bssl_dart_SHA224_Init', ) -external int SHA224_Init(ffi.Pointer sha); +external int SHA224_Init( + ffi.Pointer sha, +); /// SHA224_Update adds `len` bytes from `data` to `sha` and returns 1. @meta.RecordUse() @@ -20565,7 +21922,9 @@ external int SHA256_Final( @ffi.Native)>( symbol: 'bssl_dart_SHA256_Init', ) -external int SHA256_Init(ffi.Pointer sha); +external int SHA256_Init( + ffi.Pointer 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 @@ -20638,7 +21997,9 @@ external int SHA384_Final( @ffi.Native)>( symbol: 'bssl_dart_SHA384_Init', ) -external int SHA384_Init(ffi.Pointer sha); +external int SHA384_Init( + ffi.Pointer sha, +); /// SHA384_Update adds `len` bytes from `data` to `sha` and returns 1. @meta.RecordUse() @@ -20702,7 +22063,9 @@ external int SHA512_256_Final( @ffi.Native)>( symbol: 'bssl_dart_SHA512_256_Init', ) -external int SHA512_256_Init(ffi.Pointer sha); +external int SHA512_256_Init( + ffi.Pointer sha, +); /// SHA512_256_Update adds `len` bytes from `data` to `sha` and returns 1. @meta.RecordUse() @@ -20732,7 +22095,9 @@ external int SHA512_Final( @ffi.Native)>( symbol: 'bssl_dart_SHA512_Init', ) -external int SHA512_Init(ffi.Pointer sha); +external int SHA512_Init( + ffi.Pointer 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 @@ -20762,7 +22127,9 @@ external int SHA512_Update( @ffi.Native)>( symbol: 'bssl_dart_SPAKE2_CTX_free', ) -external void SPAKE2_CTX_free(ffi.Pointer ctx); +external void SPAKE2_CTX_free( + ffi.Pointer 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 @@ -20871,14 +22238,18 @@ external int SSLeay(); @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_SSLeay_version', ) -external ffi.Pointer SSLeay_version(int which); +external ffi.Pointer SSLeay_version( + int which, +); /// USERNOTICE_free releases memory associated with `notice`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_USERNOTICE_free', ) -external void USERNOTICE_free(ffi.Pointer notice); +external void USERNOTICE_free( + ffi.Pointer notice, +); /// USERNOTICE_new returns a newly-allocated, empty `USERNOTICE` object, or NULL /// on error. @@ -20992,7 +22363,9 @@ external int X509V3_EXT_REQ_add_nconf( @ffi.Native)>( symbol: 'bssl_dart_X509V3_EXT_add', ) -external int X509V3_EXT_add(ffi.Pointer ext); +external int X509V3_EXT_add( + ffi.Pointer 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 @@ -21004,7 +22377,10 @@ external int X509V3_EXT_add(ffi.Pointer ext); @ffi.Native( symbol: 'bssl_dart_X509V3_EXT_add_alias', ) -external int X509V3_EXT_add_alias(int nid_to, int nid_from); +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. @@ -21060,7 +22436,9 @@ external int X509V3_EXT_add_nconf_sk( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509V3_EXT_d2i', ) -external ffi.Pointer X509V3_EXT_d2i(ffi.Pointer ext); +external ffi.Pointer X509V3_EXT_d2i( + ffi.Pointer 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 @@ -21075,7 +22453,10 @@ external ffi.Pointer X509V3_EXT_d2i(ffi.Pointer ext); @ffi.Native)>( symbol: 'bssl_dart_X509V3_EXT_free', ) -external int X509V3_EXT_free(int nid, ffi.Pointer ext_data); +external int X509V3_EXT_free( + int nid, + ffi.Pointer ext_data, +); /// X509V3_EXT_get returns the `X509V3_EXT_METHOD` corresponding to `ext`'s /// extension type, or NULL if none was registered. @@ -21093,7 +22474,9 @@ external ffi.Pointer X509V3_EXT_get( @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_X509V3_EXT_get_nid', ) -external ffi.Pointer X509V3_EXT_get_nid(int nid); +external ffi.Pointer 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` @@ -21246,7 +22629,9 @@ external int X509V3_add_standard_extensions(); @ffi.Native)>( symbol: 'bssl_dart_X509V3_conf_free', ) -external void X509V3_conf_free(ffi.Pointer val); +external void X509V3_conf_free( + ffi.Pointer val, +); /// X509V3_extensions_print prints `title`, followed by a human-readable /// representation of `exts` to `out`. It returns one on success and zero on @@ -21385,14 +22770,18 @@ external int X509_ALGOR_copy( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_ALGOR_dup', ) -external ffi.Pointer X509_ALGOR_dup(ffi.Pointer alg); +external ffi.Pointer X509_ALGOR_dup( + ffi.Pointer alg, +); /// X509_ALGOR_free releases memory associated with `alg`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_ALGOR_free', ) -external void X509_ALGOR_free(ffi.Pointer alg); +external void X509_ALGOR_free( + ffi.Pointer 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 @@ -21492,7 +22881,9 @@ external int X509_ALGOR_set_md( @ffi.Native)>( symbol: 'bssl_dart_X509_ATTRIBUTE_count', ) -external int X509_ATTRIBUTE_count(ffi.Pointer attr); +external int X509_ATTRIBUTE_count( + ffi.Pointer 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 @@ -21597,7 +22988,9 @@ external ffi.Pointer X509_ATTRIBUTE_dup( @ffi.Native)>( symbol: 'bssl_dart_X509_ATTRIBUTE_free', ) -external void X509_ATTRIBUTE_free(ffi.Pointer attr); +external void X509_ATTRIBUTE_free( + ffi.Pointer 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 @@ -21771,7 +23164,10 @@ external int X509_CRL_add_ext( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_cmp', ) -external int X509_CRL_cmp(ffi.Pointer a, ffi.Pointer b); +external int X509_CRL_cmp( + ffi.Pointer a, + ffi.Pointer 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 @@ -21813,7 +23209,9 @@ external int X509_CRL_digest( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_dup', ) -external ffi.Pointer X509_CRL_dup(ffi.Pointer crl); +external ffi.Pointer X509_CRL_dup( + ffi.Pointer crl, +); /// X509_CRL_free decrements `crl`'s reference count and, if zero, releases /// memory associated with `crl`. @@ -21821,7 +23219,9 @@ external ffi.Pointer X509_CRL_dup(ffi.Pointer crl); @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_free', ) -external void X509_CRL_free(ffi.Pointer crl); +external void X509_CRL_free( + ffi.Pointer crl, +); /// X509_CRL_get0_by_cert behaves like `X509_CRL_get0_by_serial`, except it looks /// for the entry that matches `x509`. @@ -21987,7 +23387,9 @@ external int X509_CRL_get_ext_by_critical( @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_get_ext_count', ) -external int X509_CRL_get_ext_count(ffi.Pointer x); +external int X509_CRL_get_ext_count( + ffi.Pointer x, +); /// X509_CRL_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the /// extension in `crl`'s extension list. @@ -22016,7 +23418,9 @@ external ffi.Pointer X509_CRL_get_ext_d2i( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_get_issuer', ) -external ffi.Pointer X509_CRL_get_issuer(ffi.Pointer crl); +external ffi.Pointer X509_CRL_get_issuer( + ffi.Pointer crl, +); /// X509_CRL_get_lastUpdate returns a mutable pointer to `crl`'s thisUpdate time. /// The OpenSSL API refers to this field as lastUpdate. @@ -22048,7 +23452,9 @@ external ffi.Pointer X509_CRL_get_nextUpdate( @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_get_signature_nid', ) -external int X509_CRL_get_signature_nid(ffi.Pointer crl); +external int X509_CRL_get_signature_nid( + ffi.Pointer crl, +); /// X509_CRL_get_version returns the numerical value of `crl`'s version, which /// will be one of the `X509_CRL_VERSION_*` constants. @@ -22056,7 +23462,9 @@ external int X509_CRL_get_signature_nid(ffi.Pointer crl); @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_get_version', ) -external int X509_CRL_get_version(ffi.Pointer crl); +external int X509_CRL_get_version( + ffi.Pointer 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 @@ -22072,7 +23480,10 @@ external int X509_CRL_get_version(ffi.Pointer crl); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_match', ) -external int X509_CRL_match(ffi.Pointer a, ffi.Pointer b); +external int X509_CRL_match( + ffi.Pointer a, + ffi.Pointer 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. @@ -22086,14 +23497,20 @@ external ffi.Pointer X509_CRL_new(); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_print', ) -external int X509_CRL_print(ffi.Pointer bp, ffi.Pointer x); +external int X509_CRL_print( + ffi.Pointer bp, + ffi.Pointer x, +); /// X509_CRL_print_fp behaves like `X509_CRL_print` but writes to `fp`. @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_CRL_print_fp', ) -external int X509_CRL_print_fp(ffi.Pointer fp, ffi.Pointer x); +external int X509_CRL_print_fp( + ffi.Pointer fp, + ffi.Pointer 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 @@ -22170,7 +23587,10 @@ external int X509_CRL_set_issuer_name( @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_X509_CRL_set_version', ) -external int X509_CRL_set_version(ffi.Pointer crl, int version); +external int X509_CRL_set_version( + ffi.Pointer 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 @@ -22214,14 +23634,18 @@ external int X509_CRL_sign_ctx( @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_sort', ) -external int X509_CRL_sort(ffi.Pointer crl); +external int X509_CRL_sort( + ffi.Pointer crl, +); /// X509_CRL_up_ref adds one to the reference count of `crl` and returns one. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_CRL_up_ref', ) -external int X509_CRL_up_ref(ffi.Pointer crl); +external int X509_CRL_up_ref( + ffi.Pointer crl, +); /// X509_CRL_verify checks that `crl` has a valid signature by `pkey`. It returns /// one if the signature is valid and zero otherwise. @@ -22292,7 +23716,9 @@ external ffi.Pointer X509_EXTENSION_dup( @ffi.Native)>( symbol: 'bssl_dart_X509_EXTENSION_free', ) -external void X509_EXTENSION_free(ffi.Pointer ex); +external void X509_EXTENSION_free( + ffi.Pointer ex, +); /// X509_EXTENSION_get_critical returns one if `ex` is critical and zero /// otherwise. @@ -22300,7 +23726,9 @@ external void X509_EXTENSION_free(ffi.Pointer ex); @ffi.Native)>( symbol: 'bssl_dart_X509_EXTENSION_get_critical', ) -external int X509_EXTENSION_get_critical(ffi.Pointer ex); +external int X509_EXTENSION_get_critical( + ffi.Pointer 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 @@ -22370,7 +23798,9 @@ external int X509_EXTENSION_set_object( @ffi.Native)>( symbol: 'bssl_dart_X509_INFO_free', ) -external void X509_INFO_free(ffi.Pointer info); +external void X509_INFO_free( + ffi.Pointer 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. @@ -22458,7 +23888,9 @@ external ffi.Pointer X509_LOOKUP_file(); @ffi.Native)>( symbol: 'bssl_dart_X509_LOOKUP_free', ) -external void X509_LOOKUP_free(ffi.Pointer ctx); +external void X509_LOOKUP_free( + ffi.Pointer ctx, +); /// X509_LOOKUP_hash_dir creates `X509_LOOKUP`s that may be used with /// `X509_LOOKUP_add_dir`. @@ -22566,7 +23998,9 @@ external ffi.Pointer X509_NAME_ENTRY_dup( @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_ENTRY_free', ) -external void X509_NAME_ENTRY_free(ffi.Pointer entry); +external void X509_NAME_ENTRY_free( + ffi.Pointer 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 @@ -22612,7 +24046,9 @@ external ffi.Pointer X509_NAME_ENTRY_new(); @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_ENTRY_set', ) -external int X509_NAME_ENTRY_set(ffi.Pointer entry); +external int X509_NAME_ENTRY_set( + ffi.Pointer 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 @@ -22766,7 +24202,10 @@ external int X509_NAME_add_entry_by_txt( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_NAME_cmp', ) -external int X509_NAME_cmp(ffi.Pointer a, ffi.Pointer b); +external int X509_NAME_cmp( + ffi.Pointer a, + ffi.Pointer 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 @@ -22809,21 +24248,27 @@ external int X509_NAME_digest( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_NAME_dup', ) -external ffi.Pointer X509_NAME_dup(ffi.Pointer name); +external ffi.Pointer X509_NAME_dup( + ffi.Pointer name, +); /// X509_NAME_entry_count returns the number of entries in `name`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_entry_count', ) -external int X509_NAME_entry_count(ffi.Pointer name); +external int X509_NAME_entry_count( + ffi.Pointer name, +); /// X509_NAME_free releases memory associated with `name`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_free', ) -external void X509_NAME_free(ffi.Pointer name); +external void X509_NAME_free( + ffi.Pointer 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 @@ -22949,7 +24394,9 @@ external int X509_NAME_get_text_by_OBJ( @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_hash', ) -external int X509_NAME_hash(ffi.Pointer name); +external int X509_NAME_hash( + ffi.Pointer 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 @@ -22962,7 +24409,9 @@ external int X509_NAME_hash(ffi.Pointer name); @ffi.Native)>( symbol: 'bssl_dart_X509_NAME_hash_old', ) -external int X509_NAME_hash_old(ffi.Pointer name); +external int X509_NAME_hash_old( + ffi.Pointer name, +); /// X509_NAME_new returns a new, empty `X509_NAME`, or NULL on error. @meta.RecordUse() @@ -23075,7 +24524,9 @@ external int X509_NAME_set( @ffi.Native)>( symbol: 'bssl_dart_X509_OBJECT_free', ) -external void X509_OBJECT_free(ffi.Pointer obj); +external void X509_OBJECT_free( + ffi.Pointer obj, +); /// X509_OBJECT_free_contents sets `obj` to the empty object, freeing any values /// that were previously there. @@ -23086,7 +24537,9 @@ external void X509_OBJECT_free(ffi.Pointer obj); @ffi.Native)>( symbol: 'bssl_dart_X509_OBJECT_free_contents', ) -external void X509_OBJECT_free_contents(ffi.Pointer obj); +external void X509_OBJECT_free_contents( + ffi.Pointer obj, +); /// X509_OBJECT_get0_X509 returns `obj` as a certificate, or NULL if `obj` is not /// a certificate. @@ -23094,7 +24547,9 @@ external void X509_OBJECT_free_contents(ffi.Pointer obj); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_OBJECT_get0_X509', ) -external ffi.Pointer X509_OBJECT_get0_X509(ffi.Pointer obj); +external ffi.Pointer X509_OBJECT_get0_X509( + ffi.Pointer obj, +); /// X509_OBJECT_get_type returns the type of `obj`, which will be one of the /// `X509_LU_*` constants. @@ -23102,7 +24557,9 @@ external ffi.Pointer X509_OBJECT_get0_X509(ffi.Pointer obj); @ffi.Native)>( symbol: 'bssl_dart_X509_OBJECT_get_type', ) -external int X509_OBJECT_get_type(ffi.Pointer obj); +external int X509_OBJECT_get_type( + ffi.Pointer obj, +); /// X509_OBJECT_new returns a newly-allocated, empty `X509_OBJECT` or NULL on /// error. @@ -23117,7 +24574,9 @@ external ffi.Pointer X509_OBJECT_new(); @ffi.Native)>( symbol: 'bssl_dart_X509_PUBKEY_free', ) -external void X509_PUBKEY_free(ffi.Pointer key); +external void X509_PUBKEY_free( + ffi.Pointer 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 @@ -23127,7 +24586,9 @@ external void X509_PUBKEY_free(ffi.Pointer key); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_PUBKEY_get', ) -external ffi.Pointer X509_PUBKEY_get(ffi.Pointer key); +external ffi.Pointer X509_PUBKEY_get( + ffi.Pointer 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 @@ -23136,7 +24597,9 @@ external ffi.Pointer X509_PUBKEY_get(ffi.Pointer key); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_PUBKEY_get0', ) -external ffi.Pointer X509_PUBKEY_get0(ffi.Pointer key); +external ffi.Pointer X509_PUBKEY_get0( + ffi.Pointer 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` @@ -23239,7 +24702,9 @@ external int X509_PUBKEY_set0_param( @ffi.Native Function(ffi.Int)>( symbol: 'bssl_dart_X509_PURPOSE_get0', ) -external ffi.Pointer X509_PURPOSE_get0(int id); +external ffi.Pointer 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. @@ -23255,7 +24720,9 @@ external ffi.Pointer X509_PURPOSE_get0(int id); @ffi.Native)>( symbol: 'bssl_dart_X509_PURPOSE_get_by_sname', ) -external int X509_PURPOSE_get_by_sname(ffi.Pointer sname); +external int X509_PURPOSE_get_by_sname( + ffi.Pointer sname, +); /// X509_PURPOSE_get_id returns `purpose`'s ID. This will be one of the /// `X509_PURPOSE_*` constants. @@ -23263,7 +24730,9 @@ external int X509_PURPOSE_get_by_sname(ffi.Pointer sname); @ffi.Native)>( symbol: 'bssl_dart_X509_PURPOSE_get_id', ) -external int X509_PURPOSE_get_id(ffi.Pointer purpose); +external int X509_PURPOSE_get_id( + ffi.Pointer 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. @@ -23422,7 +24891,9 @@ external int X509_REQ_digest( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_REQ_dup', ) -external ffi.Pointer X509_REQ_dup(ffi.Pointer req); +external ffi.Pointer X509_REQ_dup( + ffi.Pointer 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 @@ -23432,14 +24903,18 @@ external ffi.Pointer X509_REQ_dup(ffi.Pointer req); @ffi.Native( symbol: 'bssl_dart_X509_REQ_extension_nid', ) -external int X509_REQ_extension_nid(int nid); +external int X509_REQ_extension_nid( + int nid, +); /// X509_REQ_free releases memory associated with `req`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_REQ_free', ) -external void X509_REQ_free(ffi.Pointer req); +external void X509_REQ_free( + ffi.Pointer 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 @@ -23448,7 +24923,9 @@ external void X509_REQ_free(ffi.Pointer req); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_REQ_get0_pubkey', ) -external ffi.Pointer X509_REQ_get0_pubkey(ffi.Pointer req); +external ffi.Pointer X509_REQ_get0_pubkey( + ffi.Pointer 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 @@ -23529,7 +25006,9 @@ external int X509_REQ_get_attr_by_OBJ( @ffi.Native)>( symbol: 'bssl_dart_X509_REQ_get_attr_count', ) -external int X509_REQ_get_attr_count(ffi.Pointer req); +external int X509_REQ_get_attr_count( + ffi.Pointer req, +); /// X509_REQ_get_extensions decodes the most preferred list of requested /// extensions in `req` and returns a newly-allocated `STACK_OF(X509_EXTENSION)` @@ -23557,7 +25036,9 @@ external ffi.Pointer X509_REQ_get_extensions( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_REQ_get_pubkey', ) -external ffi.Pointer X509_REQ_get_pubkey(ffi.Pointer req); +external ffi.Pointer X509_REQ_get_pubkey( + ffi.Pointer 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 @@ -23566,7 +25047,9 @@ external ffi.Pointer X509_REQ_get_pubkey(ffi.Pointer req); @ffi.Native)>( symbol: 'bssl_dart_X509_REQ_get_signature_nid', ) -external int X509_REQ_get_signature_nid(ffi.Pointer req); +external int X509_REQ_get_signature_nid( + ffi.Pointer req, +); /// X509_REQ_get_subject_name returns `req`'s subject name. Note this function is /// not const-correct for legacy reasons. @@ -23586,7 +25069,9 @@ external ffi.Pointer X509_REQ_get_subject_name( @ffi.Native)>( symbol: 'bssl_dart_X509_REQ_get_version', ) -external int X509_REQ_get_version(ffi.Pointer req); +external int X509_REQ_get_version( + ffi.Pointer 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. @@ -23600,7 +25085,10 @@ external ffi.Pointer X509_REQ_new(); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_REQ_print', ) -external int X509_REQ_print(ffi.Pointer bp, ffi.Pointer req); +external int X509_REQ_print( + ffi.Pointer bp, + ffi.Pointer 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 @@ -23627,7 +25115,10 @@ external int X509_REQ_print_ex( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_REQ_print_fp', ) -external int X509_REQ_print_fp(ffi.Pointer fp, ffi.Pointer req); +external int X509_REQ_print_fp( + ffi.Pointer fp, + ffi.Pointer req, +); /// X509_REQ_set1_signature_algo sets `req`'s signature algorithm to `algo` and /// returns one on success or zero on error. @@ -23691,7 +25182,10 @@ external int X509_REQ_set_subject_name( @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_X509_REQ_set_version', ) -external int X509_REQ_set_version(ffi.Pointer req, int version); +external int X509_REQ_set_version( + ffi.Pointer 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 @@ -23813,7 +25307,9 @@ external ffi.Pointer X509_REVOKED_dup( @ffi.Native)>( symbol: 'bssl_dart_X509_REVOKED_free', ) -external void X509_REVOKED_free(ffi.Pointer rev); +external void X509_REVOKED_free( + ffi.Pointer 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 @@ -23899,7 +25395,9 @@ external int X509_REVOKED_get_ext_by_critical( @ffi.Native)>( symbol: 'bssl_dart_X509_REVOKED_get_ext_count', ) -external int X509_REVOKED_get_ext_count(ffi.Pointer x); +external int X509_REVOKED_get_ext_count( + ffi.Pointer x, +); /// X509_REVOKED_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the /// extension in `revoked`'s extension list. @@ -23957,7 +25455,9 @@ external int X509_REVOKED_set_serialNumber( @ffi.Native)>( symbol: 'bssl_dart_X509_SIG_free', ) -external void X509_SIG_free(ffi.Pointer key); +external void X509_SIG_free( + ffi.Pointer 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 @@ -24007,14 +25507,18 @@ external ffi.Pointer X509_SIG_new(); @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_CTX_cleanup', ) -external void X509_STORE_CTX_cleanup(ffi.Pointer ctx); +external void X509_STORE_CTX_cleanup( + ffi.Pointer ctx, +); /// X509_STORE_CTX_free releases memory associated with `ctx`. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_CTX_free', ) -external void X509_STORE_CTX_free(ffi.Pointer ctx); +external void X509_STORE_CTX_free( + ffi.Pointer ctx, +); /// X509_STORE_CTX_get0_cert returns the leaf certificate that `ctx` is /// verifying. @@ -24216,7 +25720,9 @@ external ffi.Pointer X509_STORE_CTX_get_current_cert( @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_CTX_get_error', ) -external int X509_STORE_CTX_get_error(ffi.Pointer ctx); +external int X509_STORE_CTX_get_error( + ffi.Pointer 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 @@ -24226,7 +25732,9 @@ external int X509_STORE_CTX_get_error(ffi.Pointer ctx); @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_CTX_get_error_depth', ) -external int X509_STORE_CTX_get_error_depth(ffi.Pointer ctx); +external int X509_STORE_CTX_get_error_depth( + ffi.Pointer ctx, +); @meta.RecordUse() @ffi.Native< @@ -24640,7 +26148,9 @@ external ffi.Pointer X509_STORE_dup_ref( @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_free', ) -external void X509_STORE_free(ffi.Pointer store); +external void X509_STORE_free( + ffi.Pointer 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 @@ -24759,7 +26269,9 @@ external int X509_STORE_set1_param( @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_set_default_paths', ) -external int X509_STORE_set_default_paths(ffi.Pointer store); +external int X509_STORE_set_default_paths( + ffi.Pointer store, +); /// X509_STORE_set_depth configures `store` to, by default, limit certificate /// chains to `depth` intermediate certificates. This count excludes both the @@ -24768,7 +26280,10 @@ external int X509_STORE_set_default_paths(ffi.Pointer store); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_X509_STORE_set_depth', ) -external int X509_STORE_set_depth(ffi.Pointer store, int depth); +external int X509_STORE_set_depth( + ffi.Pointer 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. @@ -24780,7 +26295,10 @@ external int X509_STORE_set_depth(ffi.Pointer store, int depth); @ffi.Native, ffi.UnsignedLong)>( symbol: 'bssl_dart_X509_STORE_set_flags', ) -external int X509_STORE_set_flags(ffi.Pointer store, int flags); +external int X509_STORE_set_flags( + ffi.Pointer store, + int flags, +); /// X509_STORE_set_purpose configures the purpose check for `store`. See /// `X509_VERIFY_PARAM_set_purpose` for details. @@ -24788,7 +26306,10 @@ external int X509_STORE_set_flags(ffi.Pointer store, int flags); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_X509_STORE_set_purpose', ) -external int X509_STORE_set_purpose(ffi.Pointer store, int purpose); +external int X509_STORE_set_purpose( + ffi.Pointer store, + int purpose, +); /// X509_STORE_set_trust configures the trust check for `store`. See /// `X509_VERIFY_PARAM_set_trust` for details. @@ -24796,7 +26317,10 @@ external int X509_STORE_set_purpose(ffi.Pointer store, int purpose); @ffi.Native, ffi.Int)>( symbol: 'bssl_dart_X509_STORE_set_trust', ) -external int X509_STORE_set_trust(ffi.Pointer store, int trust); +external int X509_STORE_set_trust( + ffi.Pointer 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` @@ -24817,7 +26341,9 @@ external void X509_STORE_set_verify_cb( @ffi.Native)>( symbol: 'bssl_dart_X509_STORE_up_ref', ) -external int X509_STORE_up_ref(ffi.Pointer store); +external int X509_STORE_up_ref( + ffi.Pointer 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 @@ -24872,7 +26398,9 @@ external int X509_VERIFY_PARAM_clear_flags( @ffi.Native)>( symbol: 'bssl_dart_X509_VERIFY_PARAM_free', ) -external void X509_VERIFY_PARAM_free(ffi.Pointer param); +external void X509_VERIFY_PARAM_free( + ffi.Pointer param, +); /// X509_VERIFY_PARAM_get_depth returns the maximum depth configured in `param`. /// See `X509_VERIFY_PARAM_set_depth`. @@ -24880,14 +26408,18 @@ external void X509_VERIFY_PARAM_free(ffi.Pointer param); @ffi.Native)>( symbol: 'bssl_dart_X509_VERIFY_PARAM_get_depth', ) -external int X509_VERIFY_PARAM_get_depth(ffi.Pointer param); +external int X509_VERIFY_PARAM_get_depth( + ffi.Pointer param, +); /// X509_VERIFY_PARAM_get_flags returns `param`'s verification flags. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_VERIFY_PARAM_get_flags', ) -external int X509_VERIFY_PARAM_get_flags(ffi.Pointer param); +external int X509_VERIFY_PARAM_get_flags( + ffi.Pointer 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`. @@ -25280,7 +26812,9 @@ external ffi.Pointer X509_chain_up_ref( @ffi.Native)>( symbol: 'bssl_dart_X509_check_ca', ) -external int X509_check_ca(ffi.Pointer x509); +external int X509_check_ca( + ffi.Pointer 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 @@ -25439,7 +26973,11 @@ external int X509_check_private_key( @ffi.Native, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_X509_check_purpose', ) -external int X509_check_purpose(ffi.Pointer x509, int purpose, int ca); +external int X509_check_purpose( + ffi.Pointer 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 @@ -25451,7 +26989,11 @@ external int X509_check_purpose(ffi.Pointer x509, int purpose, int ca); @ffi.Native, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_X509_check_trust', ) -external int X509_check_trust(ffi.Pointer x509, int id, int flags); +external int X509_check_trust( + ffi.Pointer 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`. @@ -25468,7 +27010,10 @@ external int X509_check_trust(ffi.Pointer x509, int id, int flags); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_cmp', ) -external int X509_cmp(ffi.Pointer a, ffi.Pointer b); +external int X509_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// X509_cmp_current_time behaves like `X509_cmp_time` but compares `s` against /// the current time. @@ -25476,7 +27021,9 @@ external int X509_cmp(ffi.Pointer a, ffi.Pointer b); @ffi.Native)>( symbol: 'bssl_dart_X509_cmp_current_time', ) -external int X509_cmp_current_time(ffi.Pointer s); +external int X509_cmp_current_time( + ffi.Pointer 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 @@ -25488,7 +27035,10 @@ external int X509_cmp_current_time(ffi.Pointer s); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_cmp_time', ) -external int X509_cmp_time(ffi.Pointer s, ffi.Pointer t); +external int X509_cmp_time( + ffi.Pointer s, + ffi.Pointer 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, @@ -25502,7 +27052,10 @@ external int X509_cmp_time(ffi.Pointer s, ffi.Pointer t); @ffi.Native, ffi.Int64)>( symbol: 'bssl_dart_X509_cmp_time_posix', ) -external int X509_cmp_time_posix(ffi.Pointer s, int t); +external int X509_cmp_time_posix( + ffi.Pointer 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`. @@ -25517,7 +27070,10 @@ external int X509_cmp_time_posix(ffi.Pointer s, int t); @ffi.Native, ffi.Int64)>( symbol: 'bssl_dart_X509_cmp_time_posix_nonstandard', ) -external int X509_cmp_time_posix_nonstandard(ffi.Pointer s, int t); +external int X509_cmp_time_posix_nonstandard( + ffi.Pointer 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 @@ -25560,7 +27116,9 @@ external int X509_digest( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_dup', ) -external ffi.Pointer X509_dup(ffi.Pointer x509); +external ffi.Pointer X509_dup( + ffi.Pointer 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. @@ -25572,7 +27130,9 @@ external ffi.Pointer X509_dup(ffi.Pointer x509); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_dup_ref', ) -external ffi.Pointer X509_dup_ref(ffi.Pointer x509); +external ffi.Pointer X509_dup_ref( + ffi.Pointer 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 @@ -25581,7 +27141,9 @@ external ffi.Pointer X509_dup_ref(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_email_free', ) -external void X509_email_free(ffi.Pointer sk); +external void X509_email_free( + ffi.Pointer 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 @@ -25615,7 +27177,9 @@ external ffi.Pointer X509_find_by_subject( /// associated with `x509`. @meta.RecordUse() @ffi.Native)>(symbol: 'bssl_dart_X509_free') -external void X509_free(ffi.Pointer x509); +external void X509_free( + ffi.Pointer x509, +); /// X509_get0_authority_issuer returns the authorityCertIssuer of `x509`'s /// authority key identifier, if the extension and field are present. (See @@ -25683,14 +27247,18 @@ external ffi.Pointer X509_get0_extensions( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get0_notAfter', ) -external ffi.Pointer X509_get0_notAfter(ffi.Pointer x509); +external ffi.Pointer X509_get0_notAfter( + ffi.Pointer x509, +); /// X509_get0_notBefore returns `x509`'s notBefore time. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get0_notBefore', ) -external ffi.Pointer X509_get0_notBefore(ffi.Pointer x509); +external ffi.Pointer X509_get0_notBefore( + ffi.Pointer 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 @@ -25699,7 +27267,9 @@ external ffi.Pointer X509_get0_notBefore(ffi.Pointer x509); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get0_pubkey', ) -external ffi.Pointer X509_get0_pubkey(ffi.Pointer x509); +external ffi.Pointer X509_get0_pubkey( + ffi.Pointer x509, +); /// X509_get0_pubkey_bitstr returns the BIT STRING portion of `x509`'s public /// key. Note this does not contain the AlgorithmIdentifier portion. @@ -25770,7 +27340,9 @@ external ffi.Pointer X509_get0_subject_key_id( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get0_tbs_sigalg', ) -external ffi.Pointer X509_get0_tbs_sigalg(ffi.Pointer x509); +external ffi.Pointer X509_get0_tbs_sigalg( + ffi.Pointer 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 @@ -25830,7 +27402,9 @@ external ffi.Pointer X509_get1_ocsp( @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_X509_PUBKEY', ) -external ffi.Pointer X509_get_X509_PUBKEY(ffi.Pointer x509); +external ffi.Pointer X509_get_X509_PUBKEY( + ffi.Pointer x509, +); /// The following functions return filesystem paths used to determine the above /// "default" paths, when the corresponding environment variables are not set. @@ -25883,7 +27457,10 @@ external ffi.Pointer X509_get_default_private_dir(); @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_X509_get_ex_data', ) -external ffi.Pointer X509_get_ex_data(ffi.Pointer r, int idx); +external ffi.Pointer X509_get_ex_data( + ffi.Pointer r, + int idx, +); /// ex_data functions. /// @@ -25913,7 +27490,10 @@ external int X509_get_ex_new_index( @ffi.Native Function(ffi.Pointer, ffi.Int)>( symbol: 'bssl_dart_X509_get_ext', ) -external ffi.Pointer X509_get_ext(ffi.Pointer x, int loc); +external ffi.Pointer X509_get_ext( + ffi.Pointer x, + int loc, +); /// X509_get_ext_by_NID behaves like `X509v3_get_ext_by_NID` but searches for /// extensions in `x`. @@ -25921,7 +27501,11 @@ external ffi.Pointer X509_get_ext(ffi.Pointer x, int loc); @ffi.Native, ffi.Int, ffi.Int)>( symbol: 'bssl_dart_X509_get_ext_by_NID', ) -external int X509_get_ext_by_NID(ffi.Pointer x, int nid, int lastpos); +external int X509_get_ext_by_NID( + ffi.Pointer x, + int nid, + int lastpos, +); /// X509_get_ext_by_OBJ behaves like `X509v3_get_ext_by_OBJ` but searches for /// extensions in `x`. @@ -25952,7 +27536,9 @@ external int X509_get_ext_by_critical( @ffi.Native)>( symbol: 'bssl_dart_X509_get_ext_count', ) -external int X509_get_ext_count(ffi.Pointer x); +external int X509_get_ext_count( + ffi.Pointer x, +); /// X509_get_ext_d2i behaves like `X509V3_get_d2i` but looks for the extension in /// `x509`'s extension list. @@ -25989,7 +27575,9 @@ external ffi.Pointer X509_get_ext_d2i( @ffi.Native)>( symbol: 'bssl_dart_X509_get_extended_key_usage', ) -external int X509_get_extended_key_usage(ffi.Pointer x509); +external int X509_get_extended_key_usage( + ffi.Pointer 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 @@ -25998,14 +27586,18 @@ external int X509_get_extended_key_usage(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_get_extension_flags', ) -external int X509_get_extension_flags(ffi.Pointer x509); +external int X509_get_extension_flags( + ffi.Pointer x509, +); /// X509_get_issuer_name returns `x509`'s issuer. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_issuer_name', ) -external ffi.Pointer X509_get_issuer_name(ffi.Pointer x509); +external ffi.Pointer X509_get_issuer_name( + ffi.Pointer 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 @@ -26024,7 +27616,9 @@ external ffi.Pointer X509_get_issuer_name(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_get_key_usage', ) -external int X509_get_key_usage(ffi.Pointer x509); +external int X509_get_key_usage( + ffi.Pointer x509, +); /// X509_get_notAfter returns `x509`'s notAfter time. Note this function is not /// const-correct for legacy reasons. Use `X509_get0_notAfter` or @@ -26033,7 +27627,9 @@ external int X509_get_key_usage(ffi.Pointer x509); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_notAfter', ) -external ffi.Pointer X509_get_notAfter(ffi.Pointer x509); +external ffi.Pointer X509_get_notAfter( + ffi.Pointer x509, +); /// X509_get_notBefore returns `x509`'s notBefore time. Note this function is not /// const-correct for legacy reasons. Use `X509_get0_notBefore` or @@ -26042,7 +27638,9 @@ external ffi.Pointer X509_get_notAfter(ffi.Pointer x509); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_notBefore', ) -external ffi.Pointer X509_get_notBefore(ffi.Pointer x509); +external ffi.Pointer X509_get_notBefore( + ffi.Pointer 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 @@ -26055,7 +27653,9 @@ external ffi.Pointer X509_get_notBefore(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_get_pathlen', ) -external int X509_get_pathlen(ffi.Pointer x509); +external int X509_get_pathlen( + ffi.Pointer 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 @@ -26065,7 +27665,9 @@ external int X509_get_pathlen(ffi.Pointer x509); @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_pubkey', ) -external ffi.Pointer X509_get_pubkey(ffi.Pointer x509); +external ffi.Pointer X509_get_pubkey( + ffi.Pointer x509, +); /// X509_get_serialNumber returns a mutable pointer to `x509`'s serial number. /// Prefer `X509_get0_serialNumber`. @@ -26084,14 +27686,18 @@ external ffi.Pointer X509_get_serialNumber( @ffi.Native)>( symbol: 'bssl_dart_X509_get_signature_nid', ) -external int X509_get_signature_nid(ffi.Pointer x509); +external int X509_get_signature_nid( + ffi.Pointer x509, +); /// X509_get_subject_name returns `x509`'s subject. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_get_subject_name', ) -external ffi.Pointer X509_get_subject_name(ffi.Pointer x509); +external ffi.Pointer X509_get_subject_name( + ffi.Pointer x509, +); /// X509_get_version returns the numerical value of `x509`'s version, which will /// be one of the `X509_VERSION_*` constants. @@ -26099,21 +27705,27 @@ external ffi.Pointer X509_get_subject_name(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_get_version', ) -external int X509_get_version(ffi.Pointer x509); +external int X509_get_version( + ffi.Pointer x509, +); /// X509_getm_notAfter returns a mutable pointer to `x509`'s notAfter time. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_getm_notAfter', ) -external ffi.Pointer X509_getm_notAfter(ffi.Pointer x); +external ffi.Pointer X509_getm_notAfter( + ffi.Pointer x, +); /// X509_getm_notBefore returns a mutable pointer to `x509`'s notBefore time. @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_X509_getm_notBefore', ) -external ffi.Pointer X509_getm_notBefore(ffi.Pointer x509); +external ffi.Pointer X509_getm_notBefore( + ffi.Pointer x509, +); /// X509_gmtime_adj behaves like `X509_time_adj_ex` but adds `offset_sec` to the /// current time. @@ -26132,7 +27744,10 @@ external ffi.Pointer X509_gmtime_adj( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_issuer_name_cmp', ) -external int X509_issuer_name_cmp(ffi.Pointer a, ffi.Pointer b); +external int X509_issuer_name_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// X509_issuer_name_hash returns the hash of `x509`'s issuer name with /// `X509_NAME_hash`. @@ -26145,7 +27760,9 @@ external int X509_issuer_name_cmp(ffi.Pointer a, ffi.Pointer b); @ffi.Native)>( symbol: 'bssl_dart_X509_issuer_name_hash', ) -external int X509_issuer_name_hash(ffi.Pointer x509); +external int X509_issuer_name_hash( + ffi.Pointer x509, +); /// X509_issuer_name_hash_old returns the hash of `x509`'s issuer name with /// `X509_NAME_hash_old`. @@ -26157,7 +27774,9 @@ external int X509_issuer_name_hash(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_issuer_name_hash_old', ) -external int X509_issuer_name_hash_old(ffi.Pointer x509); +external int X509_issuer_name_hash_old( + ffi.Pointer 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 @@ -26284,7 +27903,10 @@ external ffi.Pointer X509_parse_with_algorithms( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_print', ) -external int X509_print(ffi.Pointer bp, ffi.Pointer x); +external int X509_print( + ffi.Pointer bp, + ffi.Pointer 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 @@ -26328,7 +27950,10 @@ external int X509_print_ex_fp( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_print_fp', ) -external int X509_print_fp(ffi.Pointer fp, ffi.Pointer x); +external int X509_print_fp( + ffi.Pointer fp, + ffi.Pointer x, +); /// X509_pubkey_digest hashes the contents of the BIT STRING in `x509`'s /// subjectPublicKeyInfo field with `md` and writes the result to `out`. @@ -26362,7 +27987,9 @@ external int X509_pubkey_digest( @ffi.Native)>( symbol: 'bssl_dart_X509_reject_clear', ) -external void X509_reject_clear(ffi.Pointer x509); +external void X509_reject_clear( + ffi.Pointer x509, +); /// X509_set1_notAfter sets `x509`'s notAfter time to `tm`. it returns one on /// success and zero on error. @@ -26502,7 +28129,10 @@ external int X509_set_subject_name( @ffi.Native, ffi.Long)>( symbol: 'bssl_dart_X509_set_version', ) -external int X509_set_version(ffi.Pointer x509, int version); +external int X509_set_version( + ffi.Pointer 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 @@ -26535,7 +28165,10 @@ external int X509_sign( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_sign_ctx', ) -external int X509_sign_ctx(ffi.Pointer x509, ffi.Pointer ctx); +external int X509_sign_ctx( + ffi.Pointer x509, + ffi.Pointer 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. @@ -26571,7 +28204,10 @@ external int X509_signature_print( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_subject_name_cmp', ) -external int X509_subject_name_cmp(ffi.Pointer a, ffi.Pointer b); +external int X509_subject_name_cmp( + ffi.Pointer a, + ffi.Pointer b, +); /// X509_subject_name_hash returns the hash of `x509`'s subject name with /// `X509_NAME_hash`. @@ -26584,7 +28220,9 @@ external int X509_subject_name_cmp(ffi.Pointer a, ffi.Pointer b); @ffi.Native)>( symbol: 'bssl_dart_X509_subject_name_hash', ) -external int X509_subject_name_hash(ffi.Pointer x509); +external int X509_subject_name_hash( + ffi.Pointer x509, +); /// X509_subject_name_hash_old returns the hash of `x509`'s usjbect name with /// `X509_NAME_hash_old`. @@ -26596,7 +28234,9 @@ external int X509_subject_name_hash(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_subject_name_hash_old', ) -external int X509_subject_name_hash_old(ffi.Pointer x509); +external int X509_subject_name_hash_old( + ffi.Pointer x509, +); /// X509_supported_extension returns one if `ex` is a critical X.509 certificate /// extension, supported by `X509_verify_cert`, and zero otherwise. @@ -26609,7 +28249,9 @@ external int X509_subject_name_hash_old(ffi.Pointer x509); @ffi.Native)>( symbol: 'bssl_dart_X509_supported_extension', ) -external int X509_supported_extension(ffi.Pointer ex); +external int X509_supported_extension( + ffi.Pointer ex, +); /// X509_time_adj calls `X509_time_adj_ex` with `offset_day` equal to zero. @meta.RecordUse() @@ -26650,14 +28292,18 @@ external ffi.Pointer X509_time_adj_ex( @ffi.Native)>( symbol: 'bssl_dart_X509_trust_clear', ) -external void X509_trust_clear(ffi.Pointer x509); +external void X509_trust_clear( + ffi.Pointer x509, +); /// X509_up_ref adds one to the reference count of `x509` and returns one. @meta.RecordUse() @ffi.Native)>( symbol: 'bssl_dart_X509_up_ref', ) -external int X509_up_ref(ffi.Pointer x509); +external int X509_up_ref( + ffi.Pointer 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 @@ -26667,7 +28313,10 @@ external int X509_up_ref(ffi.Pointer x509); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_X509_verify', ) -external int X509_verify(ffi.Pointer x509, ffi.Pointer pkey); +external int X509_verify( + ffi.Pointer x509, + ffi.Pointer pkey, +); /// X509_verify_cert performs certificate verification with `ctx`, which must /// have been initialized with `X509_STORE_CTX_init`. It returns one on success @@ -26682,7 +28331,9 @@ external int X509_verify(ffi.Pointer x509, ffi.Pointer pkey); @ffi.Native)>( symbol: 'bssl_dart_X509_verify_cert', ) -external int X509_verify_cert(ffi.Pointer ctx); +external int X509_verify_cert( + ffi.Pointer 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 @@ -26691,7 +28342,9 @@ external int X509_verify_cert(ffi.Pointer ctx); @ffi.Native Function(ffi.Long)>( symbol: 'bssl_dart_X509_verify_cert_error_string', ) -external ffi.Pointer X509_verify_cert_error_string(int err); +external ffi.Pointer 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 @@ -26800,7 +28453,9 @@ external int X509v3_get_ext_by_critical( @ffi.Native)>( symbol: 'bssl_dart_X509v3_get_ext_count', ) -external int X509v3_get_ext_count(ffi.Pointer x); +external int X509v3_get_ext_count( + ffi.Pointer 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` @@ -28442,7 +30097,10 @@ external int i2a_ASN1_ENUMERATED( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2a_ASN1_INTEGER', ) -external int i2a_ASN1_INTEGER(ffi.Pointer bp, ffi.Pointer a); +external int i2a_ASN1_INTEGER( + ffi.Pointer bp, + ffi.Pointer 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 @@ -28451,7 +30109,10 @@ external int i2a_ASN1_INTEGER(ffi.Pointer bp, ffi.Pointer a); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2a_ASN1_OBJECT', ) -external int i2a_ASN1_OBJECT(ffi.Pointer bp, ffi.Pointer a); +external int i2a_ASN1_OBJECT( + ffi.Pointer bp, + ffi.Pointer 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 @@ -28873,7 +30534,10 @@ external int i2d_DHparams( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_DHparams_bio', ) -external int i2d_DHparams_bio(ffi.Pointer bp, ffi.Pointer dh); +external int i2d_DHparams_bio( + ffi.Pointer bp, + ffi.Pointer dh, +); /// i2d_DIRECTORYSTRING marshals `in` as a DER-encoded X.509 DirectoryString (RFC /// 5280), as described in `i2d_SAMPLE`. @@ -28920,13 +30584,19 @@ external int i2d_DSAPrivateKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_DSAPrivateKey_bio', ) -external int i2d_DSAPrivateKey_bio(ffi.Pointer bp, ffi.Pointer dsa); +external int i2d_DSAPrivateKey_bio( + ffi.Pointer bp, + ffi.Pointer dsa, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_DSAPrivateKey_fp', ) -external int i2d_DSAPrivateKey_fp(ffi.Pointer fp, ffi.Pointer dsa); +external int i2d_DSAPrivateKey_fp( + ffi.Pointer fp, + ffi.Pointer dsa, +); /// i2d_DSAPublicKey marshals `in` as a DER-encoded DSA public key, as described /// in `i2d_SAMPLE`. @@ -28958,13 +30628,19 @@ external int i2d_DSA_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_DSA_PUBKEY_bio', ) -external int i2d_DSA_PUBKEY_bio(ffi.Pointer bp, ffi.Pointer dsa); +external int i2d_DSA_PUBKEY_bio( + ffi.Pointer bp, + ffi.Pointer dsa, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_DSA_PUBKEY_fp', ) -external int i2d_DSA_PUBKEY_fp(ffi.Pointer fp, ffi.Pointer dsa); +external int i2d_DSA_PUBKEY_fp( + ffi.Pointer fp, + ffi.Pointer dsa, +); /// i2d_DSA_SIG marshals `in` to a DER-encoded DSA-Sig-Value structure, as /// described in `i2d_SAMPLE`. @@ -29079,13 +30755,19 @@ external int i2d_EC_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_EC_PUBKEY_bio', ) -external int i2d_EC_PUBKEY_bio(ffi.Pointer bp, ffi.Pointer eckey); +external int i2d_EC_PUBKEY_bio( + ffi.Pointer bp, + ffi.Pointer eckey, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_EC_PUBKEY_fp', ) -external int i2d_EC_PUBKEY_fp(ffi.Pointer fp, ffi.Pointer eckey); +external int i2d_EC_PUBKEY_fp( + ffi.Pointer fp, + ffi.Pointer eckey, +); /// i2d_EXTENDED_KEY_USAGE marshals `eku` as a DER-encoded ExtKeyUsageSyntax (RFC /// 5280), as described in `i2d_SAMPLE`. @@ -29188,7 +30870,10 @@ external int i2d_PKCS7( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_PKCS7_bio', ) -external int i2d_PKCS7_bio(ffi.Pointer bio, ffi.Pointer p7); +external int i2d_PKCS7_bio( + ffi.Pointer bio, + ffi.Pointer p7, +); /// i2d_PKCS8PrivateKeyInfo_bio encodes `key` as a PKCS#8 PrivateKeyInfo /// structure (see `EVP_marshal_private_key`) and writes the result to `bp`. It @@ -29365,13 +31050,19 @@ external int i2d_PKCS8_PRIV_KEY_INFO_fp( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_PKCS8_bio', ) -external int i2d_PKCS8_bio(ffi.Pointer bp, ffi.Pointer p8); +external int i2d_PKCS8_bio( + ffi.Pointer bp, + ffi.Pointer p8, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_PKCS8_fp', ) -external int i2d_PKCS8_fp(ffi.Pointer fp, ffi.Pointer p8); +external int i2d_PKCS8_fp( + ffi.Pointer fp, + ffi.Pointer p8, +); /// i2d_PUBKEY marshals `pkey` as a DER-encoded SubjectPublicKeyInfo, as /// described in `i2d_SAMPLE`. @@ -29390,13 +31081,19 @@ external int i2d_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_PUBKEY_bio', ) -external int i2d_PUBKEY_bio(ffi.Pointer bp, ffi.Pointer pkey); +external int i2d_PUBKEY_bio( + ffi.Pointer bp, + ffi.Pointer pkey, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_PUBKEY_fp', ) -external int i2d_PUBKEY_fp(ffi.Pointer fp, ffi.Pointer pkey); +external int i2d_PUBKEY_fp( + ffi.Pointer fp, + ffi.Pointer pkey, +); /// i2d_PrivateKey marshals a private key from `key` to type-specific format, as /// described in `i2d_SAMPLE`. @@ -29465,13 +31162,19 @@ external int i2d_RSAPrivateKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSAPrivateKey_bio', ) -external int i2d_RSAPrivateKey_bio(ffi.Pointer bp, ffi.Pointer rsa); +external int i2d_RSAPrivateKey_bio( + ffi.Pointer bp, + ffi.Pointer rsa, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSAPrivateKey_fp', ) -external int i2d_RSAPrivateKey_fp(ffi.Pointer fp, ffi.Pointer rsa); +external int i2d_RSAPrivateKey_fp( + ffi.Pointer fp, + ffi.Pointer rsa, +); /// i2d_RSAPublicKey marshals `in` to a DER-encoded RSAPublicKey structure (RFC /// 8017), as described in `i2d_SAMPLE`. @@ -29490,13 +31193,19 @@ external int i2d_RSAPublicKey( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSAPublicKey_bio', ) -external int i2d_RSAPublicKey_bio(ffi.Pointer bp, ffi.Pointer rsa); +external int i2d_RSAPublicKey_bio( + ffi.Pointer bp, + ffi.Pointer rsa, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSAPublicKey_fp', ) -external int i2d_RSAPublicKey_fp(ffi.Pointer fp, ffi.Pointer rsa); +external int i2d_RSAPublicKey_fp( + ffi.Pointer fp, + ffi.Pointer rsa, +); /// i2d_RSA_PSS_PARAMS marshals `in` as a DER-encoded RSASSA-PSS-params (RFC /// 4055), as described in `i2d_SAMPLE`. @@ -29529,13 +31238,19 @@ external int i2d_RSA_PUBKEY( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSA_PUBKEY_bio', ) -external int i2d_RSA_PUBKEY_bio(ffi.Pointer bp, ffi.Pointer rsa); +external int i2d_RSA_PUBKEY_bio( + ffi.Pointer bp, + ffi.Pointer rsa, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_RSA_PUBKEY_fp', ) -external int i2d_RSA_PUBKEY_fp(ffi.Pointer fp, ffi.Pointer rsa); +external int i2d_RSA_PUBKEY_fp( + ffi.Pointer fp, + ffi.Pointer rsa, +); /// i2d_X509 marshals `x509` as a DER-encoded X.509 Certificate (RFC 5280), as /// described in `i2d_SAMPLE`. @@ -29604,13 +31319,19 @@ external int i2d_X509_CRL( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_CRL_bio', ) -external int i2d_X509_CRL_bio(ffi.Pointer bp, ffi.Pointer crl); +external int i2d_X509_CRL_bio( + ffi.Pointer bp, + ffi.Pointer crl, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_CRL_fp', ) -external int i2d_X509_CRL_fp(ffi.Pointer fp, ffi.Pointer crl); +external int i2d_X509_CRL_fp( + ffi.Pointer fp, + ffi.Pointer crl, +); /// i2d_X509_CRL_tbs serializes the TBSCertList portion of `crl`, as described in /// `i2d_SAMPLE`. @@ -29699,13 +31420,19 @@ external int i2d_X509_REQ( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_REQ_bio', ) -external int i2d_X509_REQ_bio(ffi.Pointer bp, ffi.Pointer req); +external int i2d_X509_REQ_bio( + ffi.Pointer bp, + ffi.Pointer req, +); @meta.RecordUse() @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_REQ_fp', ) -external int i2d_X509_REQ_fp(ffi.Pointer fp, ffi.Pointer req); +external int i2d_X509_REQ_fp( + ffi.Pointer fp, + ffi.Pointer req, +); /// i2d_X509_REVOKED marshals `alg` as a DER-encoded X.509 CRL entry, as /// described in `i2d_SAMPLE`. @@ -29740,7 +31467,10 @@ external int i2d_X509_SIG( @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_bio', ) -external int i2d_X509_bio(ffi.Pointer bp, ffi.Pointer x509); +external int i2d_X509_bio( + ffi.Pointer bp, + ffi.Pointer x509, +); /// The following functions behave like the corresponding `i2d_*_bio` functions, /// but write to `fp` instead. @@ -29748,7 +31478,10 @@ external int i2d_X509_bio(ffi.Pointer bp, ffi.Pointer x509); @ffi.Native, ffi.Pointer)>( symbol: 'bssl_dart_i2d_X509_fp', ) -external int i2d_X509_fp(ffi.Pointer fp, ffi.Pointer x509); +external int i2d_X509_fp( + ffi.Pointer fp, + ffi.Pointer x509, +); /// i2d_X509_tbs serializes the TBSCertificate portion of `x509`, as described in /// `i2d_SAMPLE`. @@ -29998,7 +31731,9 @@ external ffi.Pointer s2i_ASN1_OCTET_STRING( @ffi.Native)>( symbol: 'bssl_dart_sk_free', ) -external void sk_free(ffi.Pointer sk); +external void sk_free( + ffi.Pointer sk, +); /// The following functions call the corresponding `OPENSSL_sk_*` function. @Deprecated('Deprecated') @@ -30013,14 +31748,18 @@ external ffi.Pointer sk_new_null(); @ffi.Native)>( symbol: 'bssl_dart_sk_num', ) -external int sk_num(ffi.Pointer sk); +external int sk_num( + ffi.Pointer sk, +); @Deprecated('Deprecated') @meta.RecordUse() @ffi.Native Function(ffi.Pointer)>( symbol: 'bssl_dart_sk_pop', ) -external ffi.Pointer sk_pop(ffi.Pointer sk); +external ffi.Pointer sk_pop( + ffi.Pointer 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 @@ -30060,14 +31799,20 @@ external void sk_pop_free_ex( @ffi.Native< ffi.Size Function(ffi.Pointer, ffi.Pointer) >(symbol: 'bssl_dart_sk_push') -external int sk_push(ffi.Pointer sk, ffi.Pointer p); +external int sk_push( + ffi.Pointer sk, + ffi.Pointer p, +); @Deprecated('Deprecated') @meta.RecordUse() @ffi.Native< ffi.Pointer Function(ffi.Pointer, ffi.Size) >(symbol: 'bssl_dart_sk_value') -external ffi.Pointer sk_value(ffi.Pointer sk, int i); +external ffi.Pointer sk_value( + ffi.Pointer sk, + int i, +); const addresses = _SymbolAddresses(); diff --git a/pkgs/boring/test/boring_test.dart b/pkgs/boring/test/boring_test.dart index 3938b40c9e..524fe840ca 100644 --- a/pkgs/boring/test/boring_test.dart +++ b/pkgs/boring/test/boring_test.dart @@ -115,7 +115,10 @@ void main() { expect(EC_PKEY_NO_PUBKEY, isNonZero); expect(HKDF_R_OUTPUT_TOO_LARGE, isNonZero); expect(ERR_LIB_HKDF, isNonZero); - expect(point_conversion_form_t.POINT_CONVERSION_UNCOMPRESSED, equals(4)); + expect( + point_conversion_form_t.POINT_CONVERSION_UNCOMPRESSED, + equals(4), + ); final packed = (ERR_LIB_HKDF << 24) | HKDF_R_OUTPUT_TOO_LARGE; expect(ERR_GET_LIB(packed), equals(ERR_LIB_HKDF)); expect(ERR_GET_REASON(packed), equals(HKDF_R_OUTPUT_TOO_LARGE)); diff --git a/pkgs/boring/test/conformance/wycheproof_test.dart b/pkgs/boring/test/conformance/wycheproof_test.dart index adbd6779d9..d031bd6971 100644 --- a/pkgs/boring/test/conformance/wycheproof_test.dart +++ b/pkgs/boring/test/conformance/wycheproof_test.dart @@ -457,50 +457,50 @@ bool _verify( }); /// AES-CBC decryption with PKCS #7 padding. -Uint8List? _aesCbcDecrypt(List key, List iv, List ciphertext) => - ssl.BoringArena.using((arena) { - final cipher = switch (key.length) { - 16 => ssl.EVP_aes_128_cbc(), - 24 => ssl.EVP_aes_192_cbc(), - 32 => ssl.EVP_aes_256_cbc(), - _ => null, - }; - // EVP_DecryptInit_ex reads a full IV, however long the buffer is. - if (cipher == null || iv.length != ssl.EVP_CIPHER_iv_length(cipher)) { - return null; - } - final ctx = arena.register( - ssl.EVP_CIPHER_CTX_new(), - ssl.EVP_CIPHER_CTX_free, - ); - if (ssl.EVP_DecryptInit_ex( - ctx, - cipher, - ffi.nullptr, - arena.copyBytes(key), - arena.copyBytes(iv), - ) != - 1) { - return null; - } - final out = arena( - ciphertext.length + ssl.EVP_CIPHER_block_size(cipher), - ); - final outLen = arena(); - if (ssl.EVP_DecryptUpdate( - ctx, - out, - outLen, - arena.copyBytes(ciphertext), - ciphertext.length, - ) != - 1) { - return null; - } - final updated = outLen.value; - if (ssl.EVP_DecryptFinal_ex(ctx, out + updated, outLen) != 1) return null; - return Uint8List.fromList(out.asTypedList(updated + outLen.value)); - }); +Uint8List? _aesCbcDecrypt( + List key, + List iv, + List ciphertext, +) => ssl.BoringArena.using((arena) { + final cipher = switch (key.length) { + 16 => ssl.EVP_aes_128_cbc(), + 24 => ssl.EVP_aes_192_cbc(), + 32 => ssl.EVP_aes_256_cbc(), + _ => null, + }; + // EVP_DecryptInit_ex reads a full IV, however long the buffer is. + if (cipher == null || iv.length != ssl.EVP_CIPHER_iv_length(cipher)) { + return null; + } + final ctx = arena.register(ssl.EVP_CIPHER_CTX_new(), ssl.EVP_CIPHER_CTX_free); + if (ssl.EVP_DecryptInit_ex( + ctx, + cipher, + ffi.nullptr, + arena.copyBytes(key), + arena.copyBytes(iv), + ) != + 1) { + return null; + } + final out = arena( + ciphertext.length + ssl.EVP_CIPHER_block_size(cipher), + ); + final outLen = arena(); + if (ssl.EVP_DecryptUpdate( + ctx, + out, + outLen, + arena.copyBytes(ciphertext), + ciphertext.length, + ) != + 1) { + return null; + } + final updated = outLen.value; + if (ssl.EVP_DecryptFinal_ex(ctx, out + updated, outLen) != 1) return null; + return Uint8List.fromList(out.asTypedList(updated + outLen.value)); +}); /// AES key unwrap (RFC 3394). Uint8List? _aesKeyUnwrap(List key, List wrapped) => diff --git a/pkgs/boring/tool/ffigen.dart b/pkgs/boring/tool/ffigen.dart index f84e53edf6..9f69f34e16 100644 --- a/pkgs/boring/tool/ffigen.dart +++ b/pkgs/boring/tool/ffigen.dart @@ -78,7 +78,9 @@ Future main() async { ''', ), input: Input( - entryPoints: [packageRoot.resolve('src/wrapper.h')], + entryPoints: [ + packageRoot.resolve('src/wrapper.h'), + ], compilerOptions: const [ '-Ithird_party/boringssl/src/include', '-DBORINGSSL_PREFIX=bssl_dart', @@ -168,9 +170,9 @@ Future _recordAddressUses(File bindings) async { ' @meta.RecordUse()\n ', ); final getterCount = RegExp(r'\bget \w+ =>').allMatches(getters).length; - final annotationCount = RegExp('@meta.RecordUse') - .allMatches(annotated) - .length; + final annotationCount = RegExp( + '@meta.RecordUse', + ).allMatches(annotated).length; if (getterCount == 0 || getterCount != annotationCount) { throw StateError( 'Annotated $annotationCount of $getterCount address getters.', diff --git a/pkgs/code_builder/test/specs/code/expression_test.dart b/pkgs/code_builder/test/specs/code/expression_test.dart index e3470a24a1..3b0e9de780 100644 --- a/pkgs/code_builder/test/specs/code/expression_test.dart +++ b/pkgs/code_builder/test/specs/code/expression_test.dart @@ -49,8 +49,9 @@ void main() { Uri.https('google.com'), onError: (value) { if (value is Uri) { - return refer('Uri') - .newInstanceNamed('parse', [literalString(value.toString())]); + return refer( + 'Uri', + ).newInstanceNamed('parse', [literalString(value.toString())]); } throw UnsupportedError('Not supported: $value'); }, @@ -597,11 +598,9 @@ void main() { test('should emit an if null index operator set', () { expect( - refer('bar') - .index(literalTrue) - .ifNullThen(literalFalse) - .assignVar('foo') - .statement, + refer( + 'bar', + ).index(literalTrue).ifNullThen(literalFalse).assignVar('foo').statement, equalsDart('var foo = bar[true] ?? false;'), ); }); @@ -1083,10 +1082,9 @@ void main() { test('should emit a parenthesized expression', () { expect( refer('foo').ifNullThen( - refer('FormatException') - .newInstance([literalString('missing foo')]) - .thrown - .parenthesized, + refer( + 'FormatException', + ).newInstance([literalString('missing foo')]).thrown.parenthesized, ), equalsDart('foo ?? (throw FormatException(\'missing foo\'))'), ); diff --git a/pkgs/coverage/test/chrome_test.dart b/pkgs/coverage/test/chrome_test.dart index 4881562c7c..eb8599597d 100644 --- a/pkgs/coverage/test/chrome_test.dart +++ b/pkgs/coverage/test/chrome_test.dart @@ -33,9 +33,13 @@ Future sourceUriProvider(String sourceUrl, String scriptId) async => void main() { test('reports correctly', () async { - final preciseCoverage = json.decode( - await File('test/test_files/chrome_precise_report.txt').readAsString(), - ) as List; + final preciseCoverage = + json.decode( + await File( + 'test/test_files/chrome_precise_report.txt', + ).readAsString(), + ) + as List; final report = await parseChromeCoverage( preciseCoverage.cast(), @@ -78,9 +82,13 @@ void main() { }); test('HitMap.parseFiles parses Chrome coverage reports', () async { - final preciseCoverage = json.decode( - await File('test/test_files/chrome_precise_report.txt').readAsString(), - ) as List; + final preciseCoverage = + json.decode( + await File( + 'test/test_files/chrome_precise_report.txt', + ).readAsString(), + ) + as List; final report = await parseChromeCoverage( preciseCoverage.cast(), @@ -142,9 +150,13 @@ void main() { }); test('HitMap.parseFiles skips non-map entries in a coverage list', () async { - final preciseCoverage = json.decode( - await File('test/test_files/chrome_precise_report.txt').readAsString(), - ) as List; + final preciseCoverage = + json.decode( + await File( + 'test/test_files/chrome_precise_report.txt', + ).readAsString(), + ) + as List; final report = await parseChromeCoverage( preciseCoverage.cast(), sourceProvider, @@ -169,9 +181,13 @@ void main() { }); test('HitMap.parseFiles rejects a raw V8 list', () async { - final preciseCoverage = json.decode( - await File('test/test_files/chrome_precise_report.txt').readAsString(), - ) as List; + final preciseCoverage = + json.decode( + await File( + 'test/test_files/chrome_precise_report.txt', + ).readAsString(), + ) + as List; final tempDir = Directory.systemTemp.createTempSync('hitmap_v8_reject_'); final tempFile = File('${tempDir.path}/raw_v8.json'); tempFile.writeAsStringSync(jsonEncode(preciseCoverage)); @@ -241,8 +257,9 @@ void main() { }, { 'name': 'other_pkg', - 'rootUri': Uri.directory('${tempDir.path}/other_pkg') - .toString(), + 'rootUri': Uri.directory( + '${tempDir.path}/other_pkg', + ).toString(), 'packageUri': otherPkgLib.uri.toString(), }, ], diff --git a/pkgs/coverage/test/test_with_coverage_test.dart b/pkgs/coverage/test/test_with_coverage_test.dart index 6ddb86695e..29ef5017a0 100644 --- a/pkgs/coverage/test/test_with_coverage_test.dart +++ b/pkgs/coverage/test/test_with_coverage_test.dart @@ -50,8 +50,9 @@ void main() { ]).create(); } - var pubspecContent = File(p.join(_testPkgDirPath, 'pubspec.yaml')) - .readAsStringSync(); + var pubspecContent = File( + p.join(_testPkgDirPath, 'pubspec.yaml'), + ).readAsStringSync(); expect( pubspecContent.replaceAll('\r\n', '\n'), diff --git a/pkgs/html/test/tokenizer_test.dart b/pkgs/html/test/tokenizer_test.dart index e2a091a45b..32c9407115 100644 --- a/pkgs/html/test/tokenizer_test.dart +++ b/pkgs/html/test/tokenizer_test.dart @@ -47,22 +47,17 @@ class TokenizerTestParser { final bool _generateSpans; List>? outputTokens; - TokenizerTestParser( - String? initialState, [ - String? lastStartTag, - bool generateSpans = false, - ]) : _state = initialState, - _lastStartTag = lastStartTag, - _generateSpans = generateSpans; + TokenizerTestParser(String? initialState, + [String? lastStartTag, bool generateSpans = false]) + : _state = initialState, + _lastStartTag = lastStartTag, + _generateSpans = generateSpans; List? parse(String str) { // Note: we need to pass bytes to the tokenizer if we want it to handle BOM. final bytes = utf8.encode(str); - final tokenizer = HtmlTokenizer( - bytes, - encoding: 'utf-8', - generateSpans: _generateSpans, - ); + final tokenizer = + HtmlTokenizer(bytes, encoding: 'utf-8', generateSpans: _generateSpans); outputTokens = []; tokenizer.state = switch (_state) { @@ -73,10 +68,10 @@ class TokenizerTestParser { 'scriptDataState' => tokenizer.scriptDataState, 'cdataSectionState' => tokenizer.cdataSectionState, _ => throw ArgumentError.value( - _state, - '_state', - 'Unsupported initial state', - ), + _state, + '_state', + 'Unsupported initial state', + ), }; if (_lastStartTag != null) { @@ -114,22 +109,13 @@ class TokenizerTestParser { } void processDoctype(DoctypeToken token) { - addOutputToken(token, [ - 'DOCTYPE', - token.name, - token.publicId, - token.systemId, - token.correct, - ]); + addOutputToken(token, + ['DOCTYPE', token.name, token.publicId, token.systemId, token.correct]); } void processStartTag(StartTagToken token) { - addOutputToken(token, [ - 'StartTag', - token.name, - token.data, - token.selfClosing, - ]); + addOutputToken( + token, ['StartTag', token.name, token.data, token.selfClosing]); } void processEndTag(EndTagToken token) { @@ -199,13 +185,9 @@ List normalizeTokens(List tokens) { /// /// If the ignoreErrorOrder flag is set to true we don't test the relative /// positions of parse errors and non parse errors. -void expectTokensMatch( - List expectedTokens, - List receivedTokens, - bool ignoreErrorOrder, [ - bool ignoreErrors = false, - String? message, -]) { +void expectTokensMatch(List expectedTokens, + List receivedTokens, bool ignoreErrorOrder, + [bool ignoreErrors = false, String? message]) { // If the 'selfClosing' attribute is not included in the expected test tokens, // remove it from the received token. var removeSelfClosing = false; @@ -234,12 +216,10 @@ void expectTokensMatch( expect(receivedNonErrors, equals(expectedNonErrors), reason: message); if (!ignoreErrors) { - final expectedParseErrors = expectedTokens.where( - (t) => t == 'ParseError', - ); - final receivedParseErrors = receivedTokens.where( - (t) => t == 'ParseError', - ); + final expectedParseErrors = + expectedTokens.where((t) => t == 'ParseError'); + final receivedParseErrors = + receivedTokens.where((t) => t == 'ParseError'); expect(receivedParseErrors, equals(expectedParseErrors), reason: message); } } @@ -257,10 +237,9 @@ void runTokenizerTest(Map testInfo) { testInfo['lastStartTag'] = null; } final parser = TokenizerTestParser( - testInfo['initialState'] as String?, - testInfo['lastStartTag'] as String?, - testInfo['generateSpans'] as bool? ?? false, - ); + testInfo['initialState'] as String?, + testInfo['lastStartTag'] as String?, + testInfo['generateSpans'] as bool? ?? false); var tokens = parser.parse(testInfo['input'] as String)!; tokens = concatenateCharacterTokens(tokens); final received = normalizeTokens(tokens); @@ -272,7 +251,7 @@ void runTokenizerTest(Map testInfo) { '\nExpected:', expected, '\nreceived:', - tokens, + tokens ].map((s) => '$s').join('\n'); final ignoreErrorOrder = testInfo['ignoreErrorOrder'] as bool? ?? false; diff --git a/pkgs/json_rpc_2/lib/src/client.dart b/pkgs/json_rpc_2/lib/src/client.dart index 36c0283acb..48cf2eadca 100644 --- a/pkgs/json_rpc_2/lib/src/client.dart +++ b/pkgs/json_rpc_2/lib/src/client.dart @@ -68,15 +68,12 @@ class Client { /// responses which are not conformant with the JSON-RPC 2.0 specification. /// In particular, responses missing the `jsonrpc` parameter will be /// accepted. - Client( - StreamChannel channel, { - Object Function()? idGenerator, - bool strictProtocolChecks = true, - }) : this.withoutJson( - jsonDocument.bind(channel).transformStream(ignoreFormatExceptions), - idGenerator: idGenerator, - strictProtocolChecks: strictProtocolChecks, - ); + Client(StreamChannel channel, + {Object Function()? idGenerator, bool strictProtocolChecks = true}) + : this.withoutJson( + jsonDocument.bind(channel).transformStream(ignoreFormatExceptions), + idGenerator: idGenerator, + strictProtocolChecks: strictProtocolChecks); /// Creates a [Client] that communicates using decoded messages over /// [_channel]. @@ -95,25 +92,18 @@ class Client { /// responses which are not conformant with the JSON-RPC 2.0 specification. /// In particular, responses missing the `jsonrpc` parameter will be /// accepted. - Client.withoutJson( - this._channel, { - Object Function()? idGenerator, - this.strictProtocolChecks = true, - }) : _idGenerator = idGenerator ?? _createIncrementingIdGenerator() { - done - .whenComplete(() { - for (var request in _pendingRequests.values) { - request.completer.completeError( - StateError( - 'The client closed with pending request "${request.method}".', - ), - ); - } - _pendingRequests.clear(); - }) - .catchError((_) { - // Avoid an unhandled error. - }); + Client.withoutJson(this._channel, + {Object Function()? idGenerator, this.strictProtocolChecks = true}) + : _idGenerator = idGenerator ?? _createIncrementingIdGenerator() { + done.whenComplete(() { + for (var request in _pendingRequests.values) { + request.completer.completeError(StateError( + 'The client closed with pending request "${request.method}".')); + } + _pendingRequests.clear(); + }).catchError((_) { + // Avoid an unhandled error. + }); } /// Starts listening to the underlying stream. @@ -123,17 +113,14 @@ class Client { /// /// [listen] may only be called once. Future listen() { - _channel.stream.listen( - _handleResponse, - onError: (Object error, StackTrace stackTrace) { - _done.completeError(error, stackTrace); - _channel.sink.close(); - }, - onDone: () { - if (!_done.isCompleted) _done.complete(); - close(); - }, - ); + _channel.stream.listen(_handleResponse, + onError: (Object error, StackTrace stackTrace) { + _done.completeError(error, stackTrace); + _channel.sink.close(); + }, onDone: () { + if (!_done.isCompleted) _done.complete(); + close(); + }); return done; } @@ -191,10 +178,8 @@ class Client { void _send(String method, Object? parameters, [Object? id]) { if (parameters is Iterable) parameters = parameters.toList(); if (parameters is! Map && parameters is! List && parameters != null) { - throw ArgumentError( - 'Only maps and lists may be used as JSON-RPC ' - 'parameters, was "$parameters".', - ); + throw ArgumentError('Only maps and lists may be used as JSON-RPC ' + 'parameters, was "$parameters".'); } if (isClosed) throw StateError('The client is closed.'); @@ -254,13 +239,9 @@ class Client { request.completer.complete(response['result']); } else { request.completer.completeError( - RpcException( - response['error']['code'], - response['error']['message'], - data: response['error']['data'], - ), - request.chain, - ); + RpcException(response['error']['code'], response['error']['message'], + data: response['error']['data']), + request.chain); } } diff --git a/pkgs/json_rpc_2/lib/src/parameters.dart b/pkgs/json_rpc_2/lib/src/parameters.dart index c6064ecd52..b574b03ce2 100644 --- a/pkgs/json_rpc_2/lib/src/parameters.dart +++ b/pkgs/json_rpc_2/lib/src/parameters.dart @@ -72,10 +72,8 @@ class Parameters { return _MissingParameter(method, this, key); } } else { - throw ArgumentError( - 'Parameters[] only takes an int or a string, was ' - '"$key".', - ); + throw ArgumentError('Parameters[] only takes an int or a string, was ' + '"$key".'); } } @@ -94,19 +92,15 @@ class Parameters { /// Asserts that [value] is a positional argument list. void _assertPositional() { if (value is List) return; - throw RpcException.invalidParams( - 'Parameters for method "$method" ' - 'must be passed by position.', - ); + throw RpcException.invalidParams('Parameters for method "$method" ' + 'must be passed by position.'); } /// Asserts that [value] is a named argument map. void _assertNamed() { if (value is Map) return; - throw RpcException.invalidParams( - 'Parameters for method "$method" ' - 'must be passed by name.', - ); + throw RpcException.invalidParams('Parameters for method "$method" ' + 'must be passed by name.'); } } @@ -175,7 +169,7 @@ class Parameter extends Parameters { bool get exists => true; Parameter._(super.method, super.value, this._parent, this._key) - : super(id: _parent.id, isNotification: _parent.isNotification); + : super(id: _parent.id, isNotification: _parent.isNotification); /// Returns [value], or [defaultValue] if this parameter wasn't passed. dynamic valueOr(Object? defaultValue) => value; @@ -288,10 +282,8 @@ class Parameter extends Parameters { /// article. dynamic _getTyped(String type, bool Function(dynamic) test) { if (test(value)) return value; - throw RpcException.invalidParams( - 'Parameter $_path for method ' - '"$method" must be $type, but was ${jsonEncode(value)}.', - ); + throw RpcException.invalidParams('Parameter $_path for method ' + '"$method" must be $type, but was ${jsonEncode(value)}.'); } dynamic _getParsed(String description, void Function(String) parse) { @@ -309,11 +301,9 @@ class Parameter extends Parameters { message = '\n$message'; } - throw RpcException.invalidParams( - 'Parameter $_path for method ' - '"$method" must be a valid $description, but was ' - '${jsonEncode(string)}.$message', - ); + throw RpcException.invalidParams('Parameter $_path for method ' + '"$method" must be a valid $description, but was ' + '${jsonEncode(string)}.$message'); } } @@ -334,17 +324,15 @@ class Parameter extends Parameters { class _MissingParameter extends Parameter { @override dynamic get value { - throw RpcException.invalidParams( - 'Request for method "$method" is ' - 'missing required parameter $_path.', - ); + throw RpcException.invalidParams('Request for method "$method" is ' + 'missing required parameter $_path.'); } @override bool get exists => false; _MissingParameter(String method, Parameters parent, Object key) - : super._(method, null, parent, key); + : super._(method, null, parent, key); @override dynamic valueOr(Object? defaultValue) => defaultValue; diff --git a/pkgs/json_rpc_2/lib/src/peer.dart b/pkgs/json_rpc_2/lib/src/peer.dart index 24412646ec..45c76d69ff 100644 --- a/pkgs/json_rpc_2/lib/src/peer.dart +++ b/pkgs/json_rpc_2/lib/src/peer.dart @@ -69,11 +69,10 @@ class Peer implements Client, Server { bool strictProtocolChecks = true, Object Function()? idGenerator, }) : this.withoutJson( - jsonDocument.bind(channel).transform(respondToFormatExceptions), - onUnhandledError: onUnhandledError, - strictProtocolChecks: strictProtocolChecks, - idGenerator: idGenerator, - ); + jsonDocument.bind(channel).transform(respondToFormatExceptions), + onUnhandledError: onUnhandledError, + strictProtocolChecks: strictProtocolChecks, + idGenerator: idGenerator); /// Creates a [Peer] that communicates using decoded messages over [_channel]. /// @@ -94,22 +93,21 @@ class Peer implements Client, Server { /// If [idGenerator] is passed, it will be called to generate an ID for each /// request. Defaults to an auto-incrementing `int`. The value returned must /// be either an `int` or `String`. - Peer.withoutJson( - this._channel, { - ErrorCallback? onUnhandledError, - bool strictProtocolChecks = true, - Object Function()? idGenerator, - }) { + Peer.withoutJson(this._channel, + {ErrorCallback? onUnhandledError, + bool strictProtocolChecks = true, + Object Function()? idGenerator}) { _server = Server.withoutJson( - StreamChannel(_serverIncomingForwarder.stream, _channel.sink), - onUnhandledError: onUnhandledError, - strictProtocolChecks: strictProtocolChecks, - ); + StreamChannel(_serverIncomingForwarder.stream, _channel.sink), + onUnhandledError: onUnhandledError, + strictProtocolChecks: strictProtocolChecks); _client = Client.withoutJson( - StreamChannel(_clientIncomingForwarder.stream, _channel.sink), - idGenerator: idGenerator, - strictProtocolChecks: strictProtocolChecks, - ); + StreamChannel( + _clientIncomingForwarder.stream, + _channel.sink, + ), + idGenerator: idGenerator, + strictProtocolChecks: strictProtocolChecks); } // Client methods. @@ -141,35 +139,31 @@ class Peer implements Client, Server { Future listen() { _client.listen(); _server.listen(); - _channel.stream.listen( - (message) { - if (message is Map) { - if (message.containsKey('result') || message.containsKey('error')) { - _clientIncomingForwarder.add(message); - } else { - _serverIncomingForwarder.add(message); - } - } else if (message is List && - message.isNotEmpty && - message.first is Map) { - if (message.first.containsKey('result') || - message.first.containsKey('error')) { - _clientIncomingForwarder.add(message); - } else { - _serverIncomingForwarder.add(message); - } + _channel.stream.listen((message) { + if (message is Map) { + if (message.containsKey('result') || message.containsKey('error')) { + _clientIncomingForwarder.add(message); + } else { + _serverIncomingForwarder.add(message); + } + } else if (message is List && + message.isNotEmpty && + message.first is Map) { + if (message.first.containsKey('result') || + message.first.containsKey('error')) { + _clientIncomingForwarder.add(message); } else { - // Non-Map and -List messages are ill-formed, so we pass them to the - // server since it knows how to send error responses. _serverIncomingForwarder.add(message); } - }, - onError: (Object error, StackTrace stackTrace) { - _serverIncomingForwarder.addError(error, stackTrace); - _clientIncomingForwarder.addError(error, stackTrace); - }, - onDone: close, - ); + } else { + // Non-Map and -List messages are ill-formed, so we pass them to the + // server since it knows how to send error responses. + _serverIncomingForwarder.add(message); + } + }, onError: (Object error, StackTrace stackTrace) { + _serverIncomingForwarder.addError(error, stackTrace); + _clientIncomingForwarder.addError(error, stackTrace); + }, onDone: close); return done; } diff --git a/pkgs/json_rpc_2/lib/src/server.dart b/pkgs/json_rpc_2/lib/src/server.dart index 055cb06182..70cc21e379 100644 --- a/pkgs/json_rpc_2/lib/src/server.dart +++ b/pkgs/json_rpc_2/lib/src/server.dart @@ -80,15 +80,12 @@ class Server { /// If [strictProtocolChecks] is false, this [Server] will accept some /// requests which are not conformant with the JSON-RPC 2.0 specification. In /// particular, requests missing the `jsonrpc` parameter will be accepted. - Server( - StreamChannel channel, { - ErrorCallback? onUnhandledError, - bool strictProtocolChecks = true, - }) : this.withoutJson( - jsonDocument.bind(channel).transform(respondToFormatExceptions), - onUnhandledError: onUnhandledError, - strictProtocolChecks: strictProtocolChecks, - ); + Server(StreamChannel channel, + {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true}) + : this.withoutJson( + jsonDocument.bind(channel).transform(respondToFormatExceptions), + onUnhandledError: onUnhandledError, + strictProtocolChecks: strictProtocolChecks); /// Creates a [Server] that communicates using decoded messages over /// [_channel]. @@ -105,11 +102,8 @@ class Server { /// If [strictProtocolChecks] is false, this [Server] will accept some /// requests which are not conformant with the JSON-RPC 2.0 specification. In /// particular, requests missing the `jsonrpc` parameter will be accepted. - Server.withoutJson( - this._channel, { - this.onUnhandledError, - this.strictProtocolChecks = true, - }); + Server.withoutJson(this._channel, + {this.onUnhandledError, this.strictProtocolChecks = true}); /// Starts listening to the underlying stream. /// @@ -118,16 +112,13 @@ class Server { /// /// [listen] may only be called once. Future listen() { - _channel.stream.listen( - _handleRequest, - onError: (Object error, StackTrace stackTrace) { - _done.completeError(error, stackTrace); - _channel.sink.close(); - }, - onDone: () { - if (!_done.isCompleted) _done.complete(); - }, - ); + _channel.stream.listen(_handleRequest, + onError: (Object error, StackTrace stackTrace) { + _done.completeError(error, stackTrace); + _channel.sink.close(); + }, onDone: () { + if (!_done.isCompleted) _done.complete(); + }); return done; } @@ -183,10 +174,9 @@ class Server { dynamic response; if (request is List) { if (request.isEmpty) { - response = RpcException( - error_code.INVALID_REQUEST, - 'A batch must contain at least one request.', - ).serialize(request); + response = RpcException(error_code.INVALID_REQUEST, + 'A batch must contain at least one request.') + .serialize(request); } else { var results = await Future.wait(request.map(_handleSingleRequest)); var nonNull = results.where((result) => result != null); @@ -214,21 +204,13 @@ class Server { Object? result; if (method is ZeroArgumentFunction) { if (request.containsKey('params')) { - throw RpcException.invalidParams( - 'No parameters are allowed for ' - 'method "$name".', - ); + throw RpcException.invalidParams('No parameters are allowed for ' + 'method "$name".'); } result = await method(); } else { - result = await method( - Parameters( - name, - request['params'], - id: request['id'], - isNotification: !request.containsKey('id'), - ), - ); + result = await method(Parameters(name, request['params'], + id: request['id'], isNotification: !request.containsKey('id'))); } // A request without an id is a notification, which should not be sent a @@ -250,11 +232,11 @@ class Server { return null; } final chain = Chain.forTrace(stackTrace); - return RpcException( - error_code.SERVER_ERROR, - getErrorMessage(error), - data: {'full': '$error', 'stack': '$chain'}, - ).serialize(request); + return RpcException(error_code.SERVER_ERROR, getErrorMessage(error), + data: { + 'full': '$error', + 'stack': '$chain', + }).serialize(request); } } @@ -262,64 +244,57 @@ class Server { void _validateRequest(Object? request) { if (request is! Map) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request must be ' - 'an Array or an Object.', - ); + error_code.INVALID_REQUEST, + 'Request must be ' + 'an Array or an Object.'); } if (strictProtocolChecks && !request.containsKey('jsonrpc')) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request must ' - 'contain a "jsonrpc" key.', - ); + error_code.INVALID_REQUEST, + 'Request must ' + 'contain a "jsonrpc" key.'); } if ((strictProtocolChecks || request.containsKey('jsonrpc')) && request['jsonrpc'] != '2.0') { throw RpcException( - error_code.INVALID_REQUEST, - 'Invalid JSON-RPC ' - 'version ${jsonEncode(request['jsonrpc'])}, expected "2.0".', - ); + error_code.INVALID_REQUEST, + 'Invalid JSON-RPC ' + 'version ${jsonEncode(request['jsonrpc'])}, expected "2.0".'); } if (!request.containsKey('method')) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request must ' - 'contain a "method" key.', - ); + error_code.INVALID_REQUEST, + 'Request must ' + 'contain a "method" key.'); } var method = request['method']; if (request['method'] is! String) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request method must ' - 'be a string, but was ${jsonEncode(method)}.', - ); + error_code.INVALID_REQUEST, + 'Request method must ' + 'be a string, but was ${jsonEncode(method)}.'); } if (request.containsKey('params')) { var params = request['params']; if (params is! List && params is! Map) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request params must ' - 'be an Array or an Object, but was ${jsonEncode(params)}.', - ); + error_code.INVALID_REQUEST, + 'Request params must ' + 'be an Array or an Object, but was ${jsonEncode(params)}.'); } } var id = request['id']; if (id != null && id is! String && id is! num) { throw RpcException( - error_code.INVALID_REQUEST, - 'Request id must be a ' - 'string, number, or null, but was ${jsonEncode(id)}.', - ); + error_code.INVALID_REQUEST, + 'Request id must be a ' + 'string, number, or null, but was ${jsonEncode(id)}.'); } } diff --git a/pkgs/json_rpc_2/test/client/client_test.dart b/pkgs/json_rpc_2/test/client/client_test.dart index 432bbaa0b4..3c4bdc8a38 100644 --- a/pkgs/json_rpc_2/test/client/client_test.dart +++ b/pkgs/json_rpc_2/test/client/client_test.dart @@ -17,33 +17,29 @@ void main() { test('sends a message and returns the response', () { controller.expectRequest((request) { expect( - request, - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'foo'), - containsPair('params', {'param': 'value'}), - ]), - ); + request, + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'foo'), + containsPair('params', {'param': 'value'}) + ])); return {'jsonrpc': '2.0', 'result': 'bar', 'id': request['id']}; }); - expect( - controller.client.sendRequest('foo', {'param': 'value'}), - completion(equals('bar')), - ); + expect(controller.client.sendRequest('foo', {'param': 'value'}), + completion(equals('bar'))); }); test('sends a notification and expects no response', () { controller.expectRequest((request) { expect( - request, - equals({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {'param': 'value'}, - }), - ); + request, + equals({ + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': {'param': 'value'} + })); }); controller.client.sendNotification('foo', {'param': 'value'}); @@ -52,13 +48,12 @@ void main() { test('sends a notification with positional parameters', () { controller.expectRequest((request) { expect( - request, - equals({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': ['value1', 'value2'], - }), - ); + request, + equals({ + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': ['value1', 'value2'] + })); }); controller.client.sendNotification('foo', ['value1', 'value2']); @@ -78,37 +73,31 @@ void main() { expect(request, hasLength(3)); expect(request[0], equals({'jsonrpc': '2.0', 'method': 'foo'})); expect( - request[1], - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'bar'), - containsPair('params', {'param': 'value'}), - ]), - ); + request[1], + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'bar'), + containsPair('params', {'param': 'value'}) + ])); expect( - request[2], - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'baz'), - ]), - ); + request[2], + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'baz') + ])); return [ {'jsonrpc': '2.0', 'result': 'baz response', 'id': request[2]['id']}, - {'jsonrpc': '2.0', 'result': 'bar response', 'id': request[1]['id']}, + {'jsonrpc': '2.0', 'result': 'bar response', 'id': request[1]['id']} ]; }); controller.client.withBatch(() { controller.client.sendNotification('foo'); - expect( - controller.client.sendRequest('bar', {'param': 'value'}), - completion(equals('bar response')), - ); - expect( - controller.client.sendRequest('baz'), - completion(equals('baz response')), - ); + expect(controller.client.sendRequest('bar', {'param': 'value'}), + completion(equals('bar response'))); + expect(controller.client.sendRequest('baz'), + completion(equals('baz response'))); }); }); @@ -118,77 +107,64 @@ void main() { expect(request, hasLength(3)); expect(request[0], equals({'jsonrpc': '2.0', 'method': 'foo'})); expect( - request[1], - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'bar'), - containsPair('params', {'param': 'value'}), - ]), - ); + request[1], + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'bar'), + containsPair('params', {'param': 'value'}) + ])); expect( - request[2], - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'baz'), - ]), - ); + request[2], + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'baz') + ])); return [ {'jsonrpc': '2.0', 'result': 'baz response', 'id': request[2]['id']}, - {'jsonrpc': '2.0', 'result': 'bar response', 'id': request[1]['id']}, + {'jsonrpc': '2.0', 'result': 'bar response', 'id': request[1]['id']} ]; }); controller.client.withBatch(() { - return Future.value() - .then((_) { - controller.client.sendNotification('foo'); - }) - .then((_) { - expect( - controller.client.sendRequest('bar', {'param': 'value'}), - completion(equals('bar response')), - ); - }) - .then((_) { - expect( - controller.client.sendRequest('baz'), - completion(equals('baz response')), - ); - }); + return Future.value().then((_) { + controller.client.sendNotification('foo'); + }).then((_) { + expect(controller.client.sendRequest('bar', {'param': 'value'}), + completion(equals('bar response'))); + }).then((_) { + expect(controller.client.sendRequest('baz'), + completion(equals('baz response'))); + }); }); }); test('reports an error from the server', () { controller.expectRequest((request) { expect( - request, - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'foo'), - ]), - ); + request, + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'foo') + ])); return { 'jsonrpc': '2.0', 'error': { 'code': error_code.SERVER_ERROR, 'message': 'you are bad at requests', - 'data': 'some junk', + 'data': 'some junk' }, - 'id': request['id'], + 'id': request['id'] }; }); expect( - controller.client.sendRequest('foo', {'param': 'value'}), - throwsA( - isA() + controller.client.sendRequest('foo', {'param': 'value'}), + throwsA(isA() .having((e) => e.code, 'code', error_code.SERVER_ERROR) .having((e) => e.message, 'message', 'you are bad at requests') - .having((e) => e.data, 'data', 'some junk'), - ), - ); + .having((e) => e.data, 'data', 'some junk'))); }); test('requests throw StateErrors if the client is closed', () { @@ -205,29 +181,25 @@ void main() { controller.sendResponse({ 'jsonrpc': 'wrong version', 'result': 'wrong', - 'id': request['id'], + 'id': request['id'] }); controller.sendResponse({'jsonrpc': '2.0', 'result': 'wrong'}); controller.sendResponse({'jsonrpc': '2.0', 'id': request['id']}); - controller.sendResponse({ - 'jsonrpc': '2.0', - 'error': 'not a map', - 'id': request['id'], - }); + controller.sendResponse( + {'jsonrpc': '2.0', 'error': 'not a map', 'id': request['id']}); controller.sendResponse({ 'jsonrpc': '2.0', 'error': {'code': 'not an int', 'message': 'dang yo'}, - 'id': request['id'], + 'id': request['id'] }); controller.sendResponse({ 'jsonrpc': '2.0', 'error': {'code': 123, 'message': 0xDEADBEEF}, - 'id': request['id'], + 'id': request['id'] }); return pumpEventQueue().then( - (_) => {'jsonrpc': '2.0', 'result': 'right', 'id': request['id']}, - ); + (_) => {'jsonrpc': '2.0', 'result': 'right', 'id': request['id']}); }); expect(controller.client.sendRequest('foo'), completion(equals('right'))); @@ -250,12 +222,11 @@ void main() { controller.sendResponse({ 'jsonrpc': 'wrong version', 'result': 'wrong', - 'id': request['id'], + 'id': request['id'] }); return pumpEventQueue().then( - (_) => {'jsonrpc': '2.0', 'result': 'right', 'id': request['id']}, - ); + (_) => {'jsonrpc': '2.0', 'result': 'right', 'id': request['id']}); }); expect(controller.client.sendRequest('foo'), completion(equals('right'))); @@ -267,22 +238,19 @@ void main() { controller = ClientController(idGenerator: () => 'ID-${id++}'); controller.expectRequest((request) { expect( - request, - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'foo'), - containsPair('params', {'param': 'value'}), - containsPair('id', 'ID-0'), - ]), - ); + request, + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'foo'), + containsPair('params', {'param': 'value'}), + containsPair('id', 'ID-0'), + ])); return {'jsonrpc': '2.0', 'result': 'bar', 'id': request['id']}; }); - expect( - controller.client.sendRequest('foo', {'param': 'value'}), - completion(equals('bar')), - ); + expect(controller.client.sendRequest('foo', {'param': 'value'}), + completion(equals('bar'))); }); test('String ids are not parsed as ints', () { @@ -290,21 +258,18 @@ void main() { controller = ClientController(idGenerator: () => '${id++}'); controller.expectRequest((request) { expect( - request, - allOf([ - containsPair('jsonrpc', '2.0'), - containsPair('method', 'foo'), - containsPair('params', {'param': 'value'}), - containsPair('id', '0'), - ]), - ); + request, + allOf([ + containsPair('jsonrpc', '2.0'), + containsPair('method', 'foo'), + containsPair('params', {'param': 'value'}), + containsPair('id', '0'), + ])); return {'jsonrpc': '2.0', 'result': 'bar', 'id': request['id']}; }); - expect( - controller.client.sendRequest('foo', {'param': 'value'}), - completion(equals('bar')), - ); + expect(controller.client.sendRequest('foo', {'param': 'value'}), + completion(equals('bar'))); }); } diff --git a/pkgs/json_rpc_2/test/client/utils.dart b/pkgs/json_rpc_2/test/client/utils.dart index 87b4be34c8..af7fdfd444 100644 --- a/pkgs/json_rpc_2/test/client/utils.dart +++ b/pkgs/json_rpc_2/test/client/utils.dart @@ -20,15 +20,12 @@ class ClientController { /// The client. late final json_rpc.Client client; - ClientController({ - Object Function()? idGenerator, - bool strictProtocolChecks = true, - }) { + ClientController( + {Object Function()? idGenerator, bool strictProtocolChecks = true}) { client = json_rpc.Client( - StreamChannel(_responseController.stream, _requestController.sink), - idGenerator: idGenerator, - strictProtocolChecks: strictProtocolChecks, - ); + StreamChannel(_responseController.stream, _requestController.sink), + idGenerator: idGenerator, + strictProtocolChecks: strictProtocolChecks); client.listen(); } @@ -40,17 +37,14 @@ class ClientController { /// as the response. void expectRequest(FutureOr Function(dynamic) callback) { expect( - _requestController.stream.first - .then((request) { - return callback(jsonDecode(request)); - }) - .then((response) { - if (response == null) return; - if (response is! String) response = jsonEncode(response); - _responseController.add(response); - }), - completes, - ); + _requestController.stream.first.then((request) { + return callback(jsonDecode(request)); + }).then((response) { + if (response == null) return; + if (response is! String) response = jsonEncode(response); + _responseController.add(response); + }), + completes); } /// Sends [response], a decoded response, to [client]. diff --git a/pkgs/json_rpc_2/test/server/server_test.dart b/pkgs/json_rpc_2/test/server/server_test.dart index 8d893d776f..cd0a99b2ee 100644 --- a/pkgs/json_rpc_2/test/server/server_test.dart +++ b/pkgs/json_rpc_2/test/server/server_test.dart @@ -22,69 +22,55 @@ void main() { }); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {'param': 'value'}, - 'id': 1234, - }), - completion( - equals({ + controller.handleRequest({ + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': {'param': 'value'}, + 'id': 1234 + }), + completion(equals({ 'jsonrpc': '2.0', 'result': { - 'params': {'param': 'value'}, + 'params': {'param': 'value'} }, - 'id': 1234, - }), - ), - ); + 'id': 1234 + }))); }); test('passes the ID of the request being answered', () { controller.server.registerMethod( - 'foo', - (json_rpc.Parameters params) => { - 'id': params.id, - 'nested': params['param'].id, - }, - ); + 'foo', + (json_rpc.Parameters params) => + {'id': params.id, 'nested': params['param'].id}); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {'param': 'value'}, - 'id': 1234, - }), - completion( - equals({ + controller.handleRequest({ 'jsonrpc': '2.0', - 'result': {'id': 1234, 'nested': 1234}, - 'id': 1234, + 'method': 'foo', + 'params': {'param': 'value'}, + 'id': 1234 }), - ), - ); + completion(equals({ + 'jsonrpc': '2.0', + 'result': {'id': 1234, 'nested': 1234}, + 'id': 1234 + }))); }); test('a null ID is not a notification', () { controller.server.registerMethod( - 'foo', - (json_rpc.Parameters params) => { - 'id': params.id, - 'notification': params.isNotification, - }, - ); + 'foo', + (json_rpc.Parameters params) => + {'id': params.id, 'notification': params.isNotification}); expect( - controller.handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': null}), - completion( - equals({ + controller + .handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': null}), + completion(equals({ 'jsonrpc': '2.0', 'result': {'id': null, 'notification': false}, - 'id': null, - }), - ), - ); + 'id': null + }))); }); test('a request with no ID is a notification', () async { @@ -95,13 +81,11 @@ void main() { handled.complete(); }); - unawaited( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {'param': 'value'}, - }), - ); + unawaited(controller.handleRequest({ + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': {'param': 'value'} + })); await handled.future; expect(received!.id, isNull); @@ -113,71 +97,64 @@ void main() { controller.server.registerMethod('foo', () => 'foo'); expect( - controller.handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), - completion(equals({'jsonrpc': '2.0', 'result': 'foo', 'id': 1234})), - ); + controller + .handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), + completion(equals({'jsonrpc': '2.0', 'result': 'foo', 'id': 1234}))); }); test('Allows a `null` result', () { controller.server.registerMethod('foo', () => null); expect( - controller.handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), - completion(equals({'jsonrpc': '2.0', 'result': null, 'id': 1234})), - ); + controller + .handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), + completion(equals({'jsonrpc': '2.0', 'result': null, 'id': 1234}))); }); test('a method that takes no parameters rejects parameters', () { controller.server.registerMethod('foo', () => 'foo'); expectErrorResponse( - controller, - { - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {}, - 'id': 1234, - }, - error_code.INVALID_PARAMS, - 'No parameters are allowed for method "foo".', - ); + controller, + { + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': {}, + 'id': 1234 + }, + error_code.INVALID_PARAMS, + 'No parameters are allowed for method "foo".'); }); test('an unexpected error in a method is captured', () { - controller.server.registerMethod( - 'foo', - () => throw const FormatException('bad format'), - ); + controller.server + .registerMethod('foo', () => throw const FormatException('bad format')); expect( - controller.handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), - completion({ - 'jsonrpc': '2.0', - 'id': 1234, - 'error': { - 'code': error_code.SERVER_ERROR, - 'message': 'bad format', - 'data': { - 'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}, - 'full': 'FormatException: bad format', - 'stack': isA(), - }, - }, - }), - ); + controller + .handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), + completion({ + 'jsonrpc': '2.0', + 'id': 1234, + 'error': { + 'code': error_code.SERVER_ERROR, + 'message': 'bad format', + 'data': { + 'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}, + 'full': 'FormatException: bad format', + 'stack': isA() + } + } + })); }); test('doesn\'t return a result for a notification', () { controller.server.registerMethod('foo', (args) => 'result'); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {}, - }), - doesNotComplete, - ); + controller.handleRequest( + {'jsonrpc': '2.0', 'method': 'foo', 'params': {}}), + doesNotComplete); }); test('includes the error data in the response', () { @@ -186,17 +163,16 @@ void main() { }); expectErrorResponse( - controller, - { - 'jsonrpc': '2.0', - 'method': 'foo', - 'params': {}, - 'id': 1234, - }, - 5, - 'Error message.', - data: 'data value', - ); + controller, + { + 'jsonrpc': '2.0', + 'method': 'foo', + 'params': {}, + 'id': 1234 + }, + 5, + 'Error message.', + data: 'data value'); }); test('a JSON parse error is rejected', () { @@ -208,10 +184,10 @@ void main() { 'message': startsWith('Invalid JSON: '), // TODO(nweiz): Always expect the source when sdk#25655 is fixed. 'data': { - 'request': anyOf([isNull, 'invalid json {']), - }, + 'request': anyOf([isNull, 'invalid json {']) + } }, - 'id': null, + 'id': null }); }); }); @@ -224,77 +200,61 @@ void main() { ..registerFallback((params) => {'fallback': params.value}); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'baz', - 'params': {'param': 'value'}, - 'id': 1234, - }), - completion( - equals({ + controller.handleRequest({ + 'jsonrpc': '2.0', + 'method': 'baz', + 'params': {'param': 'value'}, + 'id': 1234 + }), + completion(equals({ 'jsonrpc': '2.0', 'result': { - 'fallback': {'param': 'value'}, + 'fallback': {'param': 'value'} }, - 'id': 1234, - }), - ), - ); + 'id': 1234 + }))); }); test('calls the first matching fallback', () { controller.server - ..registerFallback( - (params) => throw json_rpc.RpcException.methodNotFound(params.method), - ) + ..registerFallback((params) => + throw json_rpc.RpcException.methodNotFound(params.method)) ..registerFallback((params) => 'fallback 2') ..registerFallback((params) => 'fallback 3'); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'fallback 2', - 'id': 1234, - }), - completion( - equals({'jsonrpc': '2.0', 'result': 'fallback 2', 'id': 1234}), - ), - ); + controller.handleRequest( + {'jsonrpc': '2.0', 'method': 'fallback 2', 'id': 1234}), + completion( + equals({'jsonrpc': '2.0', 'result': 'fallback 2', 'id': 1234}))); }); test('an unexpected error in a fallback is captured', () { - controller.server.registerFallback( - (_) => throw const FormatException('bad format'), - ); + controller.server + .registerFallback((_) => throw const FormatException('bad format')); expect( - controller.handleRequest({ - 'jsonrpc': '2.0', - 'method': 'foo', - 'id': 1234, - }), - completion({ - 'jsonrpc': '2.0', - 'id': 1234, - 'error': { - 'code': error_code.SERVER_ERROR, - 'message': 'bad format', - 'data': { - 'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}, - 'full': 'FormatException: bad format', - 'stack': isA(), - }, - }, - }), - ); + controller + .handleRequest({'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}), + completion({ + 'jsonrpc': '2.0', + 'id': 1234, + 'error': { + 'code': error_code.SERVER_ERROR, + 'message': 'bad format', + 'data': { + 'request': {'jsonrpc': '2.0', 'method': 'foo', 'id': 1234}, + 'full': 'FormatException: bad format', + 'stack': isA() + } + } + })); }); }); test('disallows multiple methods with the same name', () { controller.server.registerMethod('foo', () => null); - expect( - () => controller.server.registerMethod('foo', () => null), - throwsArgumentError, - ); + expect(() => controller.server.registerMethod('foo', () => null), + throwsArgumentError); }); } diff --git a/pkgs/markdown/test/stats_test.dart b/pkgs/markdown/test/stats_test.dart index 84c6089595..7584e2b30b 100644 --- a/pkgs/markdown/test/stats_test.dart +++ b/pkgs/markdown/test/stats_test.dart @@ -76,9 +76,9 @@ ignored for (final prefix in ['common_mark', 'gfm']) { test('$prefix unit files and stats are in sync with spec tests', () { final sections = loadCommonMarkSections(prefix); - final statsJson = jsonDecode( - getStatsFile(prefix).readAsStringSync(), - ) as Map; + final statsJson = + jsonDecode(getStatsFile(prefix).readAsStringSync()) + as Map; final specExamplesByHeader = {}; final statsLevelByHeader = {}; diff --git a/pkgs/markdown/tool/stats_lib.dart b/pkgs/markdown/tool/stats_lib.dart index f5f9e6a64a..b4542517a6 100644 --- a/pkgs/markdown/tool/stats_lib.dart +++ b/pkgs/markdown/tool/stats_lib.dart @@ -23,8 +23,9 @@ import '../test/util.dart'; // Locate the "tool" directory. Use `Isolate.resolvePackageUriSync` so that this // works with the test package, which loads this suite into an isolate. final String toolDir = p.fromUri( - Isolate.resolvePackageUriSync(Uri.parse('package:markdown/'))! - .resolve('../tool'), + Isolate.resolvePackageUriSync( + Uri.parse('package:markdown/'), + )!.resolve('../tool'), ); File getStatsFile(String prefix) => diff --git a/pkgs/pub_semver/lib/src/version_constraint.dart b/pkgs/pub_semver/lib/src/version_constraint.dart index c676c4452a..5a583c4d2f 100644 --- a/pkgs/pub_semver/lib/src/version_constraint.dart +++ b/pkgs/pub_semver/lib/src/version_constraint.dart @@ -82,10 +82,8 @@ abstract class VersionConstraint { var version = matchVersion(); if (version == null) { - throw FormatException( - 'Expected version number after "$op" in ' - '"$originalText", got "$text".', - ); + throw FormatException('Expected version number after "$op" in ' + '"$originalText", got "$text".'); } return switch (op) { @@ -106,17 +104,13 @@ abstract class VersionConstraint { var version = matchVersion(); if (version == null) { - throw FormatException( - 'Expected version number after ' - '"$compatibleWithChar" in "$originalText", got "$text".', - ); + throw FormatException('Expected version number after ' + '"$compatibleWithChar" in "$originalText", got "$text".'); } if (text.isNotEmpty) { - throw FormatException( - 'Cannot include other constraints with ' - '"$compatibleWithChar" constraint in "$originalText".', - ); + throw FormatException('Cannot include other constraints with ' + '"$compatibleWithChar" constraint in "$originalText".'); } return VersionConstraint.compatibleWith(version); @@ -137,10 +131,8 @@ abstract class VersionConstraint { var newRange = matchVersion() ?? matchComparison(); if (newRange == null) { - throw FormatException( - 'Could not parse version "$originalText". ' - 'Unknown text at "$text".', - ); + throw FormatException('Could not parse version "$originalText". ' + 'Unknown text at "$text".'); } if (newRange.min != null) { @@ -175,11 +167,7 @@ abstract class VersionConstraint { } return VersionRange( - min: min, - includeMin: includeMin, - max: max, - includeMax: includeMax, - ); + min: min, includeMin: includeMin, max: max, includeMax: includeMax); } /// Creates a version constraint which allows all versions that are @@ -198,8 +186,7 @@ abstract class VersionConstraint { /// constraints is empty, then it returns a VersionConstraint that allows /// all versions. factory VersionConstraint.intersection( - Iterable constraints, - ) { + Iterable constraints) { VersionConstraint constraint = VersionRange(); for (var other in constraints) { constraint = constraint.intersect(other); diff --git a/pkgs/pub_semver/test/version_constraint_test.dart b/pkgs/pub_semver/test/version_constraint_test.dart index 7b38343ea9..b29fade408 100644 --- a/pkgs/pub_semver/test/version_constraint_test.dart +++ b/pkgs/pub_semver/test/version_constraint_test.dart @@ -11,26 +11,18 @@ void main() { test('any', () { expect(VersionConstraint.any.isAny, isTrue); expect( - VersionConstraint.any, - allows( - Version.parse('0.0.0-blah'), - Version.parse('1.2.3'), - Version.parse('12345.678.90'), - ), - ); + VersionConstraint.any, + allows(Version.parse('0.0.0-blah'), Version.parse('1.2.3'), + Version.parse('12345.678.90'))); }); test('empty', () { expect(VersionConstraint.empty.isEmpty, isTrue); expect(VersionConstraint.empty.isAny, isFalse); expect( - VersionConstraint.empty, - doesNotAllow( - Version.parse('0.0.0-blah'), - Version.parse('1.2.3'), - Version.parse('12345.678.90'), - ), - ); + VersionConstraint.empty, + doesNotAllow(Version.parse('0.0.0-blah'), Version.parse('1.2.3'), + Version.parse('12345.678.90'))); }); group('parse()', () { @@ -45,127 +37,83 @@ void main() { var constraint = VersionConstraint.parse('any'); expect( - constraint, - allows( - Version.parse('0.0.0'), - Version.parse('1.2.3'), - Version.parse('12345.678.90'), - ), - ); + constraint, + allows(Version.parse('0.0.0'), Version.parse('1.2.3'), + Version.parse('12345.678.90'))); }); test('parses a ">" minimum version', () { var constraint = VersionConstraint.parse('>1.2.3'); + expect(constraint, + allows(Version.parse('1.2.3+foo'), Version.parse('1.2.4'))); expect( - constraint, - allows(Version.parse('1.2.3+foo'), Version.parse('1.2.4')), - ); - expect( - constraint, - doesNotAllow( - Version.parse('1.2.1'), - Version.parse('1.2.3-build'), - Version.parse('1.2.3'), - ), - ); + constraint, + doesNotAllow(Version.parse('1.2.1'), Version.parse('1.2.3-build'), + Version.parse('1.2.3'))); }); test('parses a ">=" minimum version', () { var constraint = VersionConstraint.parse('>=1.2.3'); expect( - constraint, - allows( - Version.parse('1.2.3'), - Version.parse('1.2.3+foo'), - Version.parse('1.2.4'), - ), - ); - expect( - constraint, - doesNotAllow(Version.parse('1.2.1'), Version.parse('1.2.3-build')), - ); + constraint, + allows(Version.parse('1.2.3'), Version.parse('1.2.3+foo'), + Version.parse('1.2.4'))); + expect(constraint, + doesNotAllow(Version.parse('1.2.1'), Version.parse('1.2.3-build'))); }); test('parses a "<" maximum version', () { var constraint = VersionConstraint.parse('<1.2.3'); + expect(constraint, + allows(Version.parse('1.2.1'), Version.parse('1.2.2+foo'))); expect( - constraint, - allows(Version.parse('1.2.1'), Version.parse('1.2.2+foo')), - ); - expect( - constraint, - doesNotAllow( - Version.parse('1.2.3'), - Version.parse('1.2.3+foo'), - Version.parse('1.2.4'), - ), - ); + constraint, + doesNotAllow(Version.parse('1.2.3'), Version.parse('1.2.3+foo'), + Version.parse('1.2.4'))); }); test('parses a "<=" maximum version', () { var constraint = VersionConstraint.parse('<=1.2.3'); expect( - constraint, - allows( - Version.parse('1.2.1'), - Version.parse('1.2.3-build'), - Version.parse('1.2.3'), - ), - ); - expect( - constraint, - doesNotAllow(Version.parse('1.2.3+foo'), Version.parse('1.2.4')), - ); + constraint, + allows(Version.parse('1.2.1'), Version.parse('1.2.3-build'), + Version.parse('1.2.3'))); + expect(constraint, + doesNotAllow(Version.parse('1.2.3+foo'), Version.parse('1.2.4'))); }); test('parses a series of space-separated constraints', () { var constraint = VersionConstraint.parse('>1.0.0 >=1.2.3 <1.3.0'); expect( - constraint, - allows(Version.parse('1.2.3'), Version.parse('1.2.5')), - ); + constraint, allows(Version.parse('1.2.3'), Version.parse('1.2.5'))); expect( - constraint, - doesNotAllow( - Version.parse('1.2.3-pre'), - Version.parse('1.3.0'), - Version.parse('3.4.5'), - ), - ); + constraint, + doesNotAllow(Version.parse('1.2.3-pre'), Version.parse('1.3.0'), + Version.parse('3.4.5'))); }); test('parses a pre-release-only constraint', () { var constraint = VersionConstraint.parse('>=1.0.0-dev.2 <1.0.0'); - expect( - constraint, - allows(Version.parse('1.0.0-dev.2'), Version.parse('1.0.0-dev.3')), - ); - expect( - constraint, - doesNotAllow(Version.parse('1.0.0-dev.1'), Version.parse('1.0.0')), - ); + expect(constraint, + allows(Version.parse('1.0.0-dev.2'), Version.parse('1.0.0-dev.3'))); + expect(constraint, + doesNotAllow(Version.parse('1.0.0-dev.1'), Version.parse('1.0.0'))); }); test('ignores whitespace around comparison operators', () { var constraint = VersionConstraint.parse(' >1.0.0>=1.2.3 < 1.3.0'); expect( - constraint, - allows(Version.parse('1.2.3'), Version.parse('1.2.5')), - ); + constraint, allows(Version.parse('1.2.3'), Version.parse('1.2.5'))); expect( - constraint, - doesNotAllow( - Version.parse('1.2.3-pre'), - Version.parse('1.3.0'), - Version.parse('3.4.5'), - ), - ); + constraint, + doesNotAllow(Version.parse('1.2.3-pre'), Version.parse('1.3.0'), + Version.parse('3.4.5'))); }); test('does not allow "any" to be mixed with other constraints', () { @@ -173,37 +121,25 @@ void main() { }); test('parses a "^" version', () { - expect( - VersionConstraint.parse('^0.0.3'), - equals(VersionConstraint.compatibleWith(v003)), - ); + expect(VersionConstraint.parse('^0.0.3'), + equals(VersionConstraint.compatibleWith(v003))); - expect( - VersionConstraint.parse('^0.7.2'), - equals(VersionConstraint.compatibleWith(v072)), - ); + expect(VersionConstraint.parse('^0.7.2'), + equals(VersionConstraint.compatibleWith(v072))); - expect( - VersionConstraint.parse('^1.2.3'), - equals(VersionConstraint.compatibleWith(v123)), - ); + expect(VersionConstraint.parse('^1.2.3'), + equals(VersionConstraint.compatibleWith(v123))); var min = Version.parse('0.7.2-pre+1'); - expect( - VersionConstraint.parse('^0.7.2-pre+1'), - equals(VersionConstraint.compatibleWith(min)), - ); + expect(VersionConstraint.parse('^0.7.2-pre+1'), + equals(VersionConstraint.compatibleWith(min))); }); test('does not allow "^" to be mixed with other constraints', () { - expect( - () => VersionConstraint.parse('>=1.2.3 ^1.0.0'), - throwsFormatException, - ); - expect( - () => VersionConstraint.parse('^1.0.0 <1.2.3'), - throwsFormatException, - ); + expect(() => VersionConstraint.parse('>=1.2.3 ^1.0.0'), + throwsFormatException); + expect(() => VersionConstraint.parse('^1.0.0 <1.2.3'), + throwsFormatException); }); test('ignores whitespace around "^"', () { @@ -221,7 +157,7 @@ void main() { '1.0.0 foo', '1.0.0foo', // Bad text after version. 'anything', // Bad text after "any". '<>1.0.0', // Multiple operators. - '1.0.0<', // Trailing operator. + '1.0.0<' // Trailing operator. ]; for (var text in bad) { @@ -235,11 +171,9 @@ void main() { var constraint = VersionConstraint.compatibleWith(v072); expect( - constraint, - equals( - VersionRange(min: v072, includeMin: true, max: v072.nextBreaking), - ), - ); + constraint, + equals(VersionRange( + min: v072, includeMin: true, max: v072.nextBreaking))); }); test('toString() uses "^"', () { @@ -284,19 +218,15 @@ void main() { }); test('of a range and a version it allows is that version', () { - var constraint = VersionConstraint.intersection([ - VersionRange(max: v200), - v123, - ]); + var constraint = + VersionConstraint.intersection([VersionRange(max: v200), v123]); expect(constraint, equals(v123)); }); test('of a range and a version it does not allow is empty', () { - var constraint = VersionConstraint.intersection([ - VersionRange(max: v140), - v200, - ]); + var constraint = + VersionConstraint.intersection([VersionRange(max: v140), v200]); expect(constraint.isEmpty, isTrue); }); @@ -321,14 +251,11 @@ void main() { ]); expect( - constraint, - equals( - VersionUnion.fromRanges([ + constraint, + equals(VersionUnion.fromRanges([ VersionRange(min: v072, max: v123), VersionRange(min: v200, max: v250), - ]), - ), - ); + ]))); }); }); } diff --git a/pkgs/string_scanner/lib/src/line_scanner.dart b/pkgs/string_scanner/lib/src/line_scanner.dart index c16b85b927..160f127fdd 100644 --- a/pkgs/string_scanner/lib/src/line_scanner.dart +++ b/pkgs/string_scanner/lib/src/line_scanner.dart @@ -30,10 +30,8 @@ mixin _LineScanner on StringScanner { set state(LineScannerState state) { if (!identical(state._scanner, this)) { - throw ArgumentError( - 'The given LineScannerState was not returned by ' - 'this LineScanner.', - ); + throw ArgumentError('The given LineScannerState was not returned by ' + 'this LineScanner.'); } super.position = state.position; @@ -64,9 +62,9 @@ mixin _LineScanner on StringScanner { } else if (char == $cr) { final nextIsLf = (i + 1 < newPosition && string.codeUnitAt(i + 1) == $lf) || - (i + 1 == newPosition && - newPosition < string.length && - string.codeUnitAt(newPosition) == $lf); + (i + 1 == newPosition && + newPosition < string.length && + string.codeUnitAt(newPosition) == $lf); if (!nextIsLf) { newlines++; lastNewlineEnd = i + 1; diff --git a/pkgs/string_scanner/lib/src/span_scanner.dart b/pkgs/string_scanner/lib/src/span_scanner.dart index 929c219687..b6177687a4 100644 --- a/pkgs/string_scanner/lib/src/span_scanner.dart +++ b/pkgs/string_scanner/lib/src/span_scanner.dart @@ -29,10 +29,8 @@ class SpanScanner extends StringScanner implements LineScanner { @override set state(LineScannerState state) { if (state is! _SpanScannerState || !identical(state._scanner, this)) { - throw ArgumentError( - 'The given LineScannerState was not returned by ' - 'this LineScanner.', - ); + throw ArgumentError('The given LineScannerState was not returned by ' + 'this LineScanner.'); } position = state.position; @@ -61,7 +59,7 @@ class SpanScanner extends StringScanner implements LineScanner { /// [FileSpan]s as well as for error reporting. It can be a [String], a /// [Uri], or `null`. SpanScanner(super.string, {super.sourceUrl, super.position}) - : _sourceFile = SourceFile.fromString(string, url: sourceUrl); + : _sourceFile = SourceFile.fromString(string, url: sourceUrl); /// Creates a new [SpanScanner] that eagerly computes line and column numbers. /// diff --git a/pkgs/unified_analytics/lib/src/analytics.dart b/pkgs/unified_analytics/lib/src/analytics.dart index 21f2f69495..7f518690e6 100644 --- a/pkgs/unified_analytics/lib/src/analytics.dart +++ b/pkgs/unified_analytics/lib/src/analytics.dart @@ -629,8 +629,9 @@ class AnalyticsImpl implements Analytics { // Collect any errors encountered and send _sendPendingErrorEvents(); - await Future.wait(_futures) - .timeout(Duration(milliseconds: delayDuration), onTimeout: () => []); + await Future.wait( + _futures, + ).timeout(Duration(milliseconds: delayDuration), onTimeout: () => []); _gaClient.close(); } diff --git a/pkgs/unified_analytics/lib/src/enums.dart b/pkgs/unified_analytics/lib/src/enums.dart index 74d75c95d3..b789c60e16 100644 --- a/pkgs/unified_analytics/lib/src/enums.dart +++ b/pkgs/unified_analytics/lib/src/enums.dart @@ -137,7 +137,8 @@ enum DashEvent { ), flutterTrackAndroidDependencies( label: 'flutter_android_dependencies', - description: 'Information related to min/target/compile SDK, JDK, NDK, Gradle version', + description: + 'Information related to min/target/compile SDK, JDK, NDK, Gradle version', toolOwner: DashTool.flutterTool, ), hotReloadTime( diff --git a/pkgs/unified_analytics/test/unified_analytics_test.dart b/pkgs/unified_analytics/test/unified_analytics_test.dart index 06e701d47d..0e70686243 100644 --- a/pkgs/unified_analytics/test/unified_analytics_test.dart +++ b/pkgs/unified_analytics/test/unified_analytics_test.dart @@ -296,7 +296,8 @@ void main() { expect( configFile.readAsStringSync().startsWith(kConfigString), true, - reason: 'The config file should have the same message from the constants file', + reason: + 'The config file should have the same message from the constants file', ); }); @@ -637,10 +638,12 @@ void main() { ); }); - test('Config file resets when there is not exactly one match for the reporting flag', () async { - // Write to the config file a string that is not formatted correctly - // (ie. there is more than one match for the reporting flag) - configFile.writeAsStringSync(''' + test( + 'Config file resets when there is not exactly one match for the reporting flag', + () async { + // Write to the config file a string that is not formatted correctly + // (ie. there is more than one match for the reporting flag) + configFile.writeAsStringSync(''' # INTRODUCTION # # This is the Flutter and Dart telemetry reporting @@ -678,17 +681,18 @@ reporting=1 # a number representing the version of the message that was # displayed.'''); - // Disable telemetry which should result in a reset of the config file - await analytics.setTelemetry(false); + // Disable telemetry which should result in a reset of the config file + await analytics.setTelemetry(false); - expect( - configFile.readAsStringSync().startsWith(kConfigString), - true, - reason: - 'The tool should have reset the config file ' - 'because it was not formatted correctly', - ); - }); + expect( + configFile.readAsStringSync().startsWith(kConfigString), + true, + reason: + 'The tool should have reset the config file ' + 'because it was not formatted correctly', + ); + }, + ); test('Config file resets when there is not exactly one match for the tool', () { // Write to the config file a string that is not formatted correctly @@ -972,30 +976,34 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion }, ); - test('The UserProperty class truncates the ai_agent value to a maximum of 36 characters', () { - final longAgentAnalytics = Analytics.fake( - tool: initialTool, - homeDirectory: home, - flutterChannel: flutterChannel, - toolsMessageVersion: toolsMessageVersion, - toolsMessage: toolsMessage, - flutterVersion: flutterVersion, - dartVersion: dartVersion, - fs: fs, - platform: platform, - clientIde: 'CursorIDE', - agent: - 'ThisIsAnExtremelyLongAgentNameThatExceedsThe36CharacterLimitOfGA4', - ); + test( + 'The UserProperty class truncates the ai_agent value to a maximum of 36 characters', + () { + final longAgentAnalytics = Analytics.fake( + tool: initialTool, + homeDirectory: home, + flutterChannel: flutterChannel, + toolsMessageVersion: toolsMessageVersion, + toolsMessage: toolsMessage, + flutterVersion: flutterVersion, + dartVersion: dartVersion, + fs: fs, + platform: platform, + clientIde: 'CursorIDE', + agent: + 'ThisIsAnExtremelyLongAgentNameThatExceedsThe36CharacterLimitOfGA4', + ); - final expectedAgent = 'ThisIsAnExtremelyLongAgentNameThatEx'; - expect(expectedAgent.length, 36); - expect( - longAgentAnalytics.userPropertyMap['ai_agent']?['value'], - expectedAgent, - reason: 'The ai_agent user property should be truncated to 36 characters', - ); - }); + final expectedAgent = 'ThisIsAnExtremelyLongAgentNameThatEx'; + expect(expectedAgent.length, 36); + expect( + longAgentAnalytics.userPropertyMap['ai_agent']?['value'], + expectedAgent, + reason: + 'The ai_agent user property should be truncated to 36 characters', + ); + }, + ); test('AiAgent.detectAgentName detects AI agents based on environment', () { expect(AiAgent.detectAgentName({}), isNull); @@ -1494,26 +1502,30 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion ); }); - test('The list of enabled features is included as an event parameter in every sent event', () { - final eventData = {'time': 5, 'command': 'run'}; + test( + 'The list of enabled features is included as an event parameter in every sent event', + () { + final eventData = {'time': 5, 'command': 'run'}; - final Map body = generateRequestBody( - clientId: Uuid().generateV4(), - eventName: DashEvent.hotReloadTime, - eventData: eventData, - userProperty: analytics.userProperty, - enabledFeatures: 'enable-native-assets', - ); + final Map body = generateRequestBody( + clientId: Uuid().generateV4(), + eventName: DashEvent.hotReloadTime, + eventData: eventData, + userProperty: analytics.userProperty, + enabledFeatures: 'enable-native-assets', + ); - expect( - (body['events'][0] as Map)['params'], - contains('enabled_features'), - ); - expect( - (body['events'][0] as Map)['params']['enabled_features'], - 'enable-native-assets', - ); - }); + expect( + (body['events'][0] as Map)['params'], + contains('enabled_features'), + ); + expect( + (body['events'][0] + as Map)['params']['enabled_features'], + 'enable-native-assets', + ); + }, + ); test('Check that log file is correctly persisting events sent', () { final int numberOfEvents = max((kLogFileLength * 0.1).floor(), 5); @@ -1648,7 +1660,8 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion expect( query, isNull, - reason: 'The query should be null because `tool` is missing under `user_properties`', + reason: + 'The query should be null because `tool` is missing under `user_properties`', ); }); @@ -1672,7 +1685,8 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion expect( query, isNull, - reason: 'The query should be null because the `local_time` value is malformed', + reason: + 'The query should be null because the `local_time` value is malformed', ); }); @@ -1697,9 +1711,9 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion ); // Parse the contents of the change log file - final changeLogFirstLineString = io.File('CHANGELOG.md') - .readAsLinesSync() - .first; + final changeLogFirstLineString = io.File( + 'CHANGELOG.md', + ).readAsLinesSync().first; expect( changeLogFirstLineString.substring(3), kPackageVersion, @@ -1710,74 +1724,71 @@ ${initialTool.label}=$dateStamp,$toolsMessageVersion }, ); - test( - 'Null values for flutter parameters is reflected properly in log file', - () { - // Because we are using the `MemoryFileSystem.test` constructor, - // we don't have a real clock in the filesystem, and because we - // are checking the last modified timestamp for the session file - // to determine if we need to update the session id, manually setting - // that timestamp will ensure we are not updating session id when it - // first gets created - sessionFile.setLastModifiedSync(DateTime.now()); - - // Use a for loop two initialize the second analytics instance - // twice to account for no events being sent on the first instance - // run for a given tool - Analytics? secondAnalytics; - for (var i = 0; i < 2; i++) { - secondAnalytics = Analytics.fake( - tool: secondTool, - homeDirectory: home, - // flutterChannel: flutterChannel, THIS NEEDS TO REMAIN REMOVED - toolsMessageVersion: toolsMessageVersion, - toolsMessage: toolsMessage, - flutterVersion: 'Flutter 3.6.0-7.0.pre.47', - dartVersion: 'Dart 2.19.0', - fs: fs, - platform: platform, - ); - secondAnalytics.clientShowedMessage(); - } + test('Null values for flutter parameters is reflected properly in log file', () { + // Because we are using the `MemoryFileSystem.test` constructor, + // we don't have a real clock in the filesystem, and because we + // are checking the last modified timestamp for the session file + // to determine if we need to update the session id, manually setting + // that timestamp will ensure we are not updating session id when it + // first gets created + sessionFile.setLastModifiedSync(DateTime.now()); - // Send an event and check that the query stats reflects what is expected - secondAnalytics!.send(testEvent); + // Use a for loop two initialize the second analytics instance + // twice to account for no events being sent on the first instance + // run for a given tool + Analytics? secondAnalytics; + for (var i = 0; i < 2; i++) { + secondAnalytics = Analytics.fake( + tool: secondTool, + homeDirectory: home, + // flutterChannel: flutterChannel, THIS NEEDS TO REMAIN REMOVED + toolsMessageVersion: toolsMessageVersion, + toolsMessage: toolsMessage, + flutterVersion: 'Flutter 3.6.0-7.0.pre.47', + dartVersion: 'Dart 2.19.0', + fs: fs, + platform: platform, + ); + secondAnalytics.clientShowedMessage(); + } - // Query the log file stats to verify that there are two tools - final query = analytics.logFileStats()!; + // Send an event and check that the query stats reflects what is expected + secondAnalytics!.send(testEvent); - expect(query.toolCount, { - 'dart-tool': 1, - }, reason: 'There should have only been on tool that sent events'); - expect( - query.flutterChannelCount.isEmpty, - true, - reason: - 'The instance does not have flutter information so it should be 0', - ); + // Query the log file stats to verify that there are two tools + final query = analytics.logFileStats()!; - // Sending a query with the first analytics instance which has flutter information - // available should reflect in the query that there is 1 flutter channel present - analytics.send(testEvent); - final query2 = analytics.logFileStats()!; + expect(query.toolCount, { + 'dart-tool': 1, + }, reason: 'There should have only been on tool that sent events'); + expect( + query.flutterChannelCount.isEmpty, + true, + reason: + 'The instance does not have flutter information so it should be 0', + ); - expect( - query2.toolCount, - {'dart-tool': 1, 'flutter-tool': 1}, - reason: - 'Two different analytics instances have ' - 'been initialized and sent events', - ); - expect( - query2.sessionCount, - query.sessionCount, - reason: 'The session should have remained the same', - ); - expect(query2.flutterChannelCount, { - 'flutterChannel': 1, - }, reason: 'The first instance has flutter information initialized'); - }, - ); + // Sending a query with the first analytics instance which has flutter information + // available should reflect in the query that there is 1 flutter channel present + analytics.send(testEvent); + final query2 = analytics.logFileStats()!; + + expect( + query2.toolCount, + {'dart-tool': 1, 'flutter-tool': 1}, + reason: + 'Two different analytics instances have ' + 'been initialized and sent events', + ); + expect( + query2.sessionCount, + query.sessionCount, + reason: 'The session should have remained the same', + ); + expect(query2.flutterChannelCount, { + 'flutterChannel': 1, + }, reason: 'The first instance has flutter information initialized'); + }); group('Testing against Google Analytics limitations:', () { // Link to limitations documentation diff --git a/pkgs/yaml/lib/src/loader.dart b/pkgs/yaml/lib/src/loader.dart index d661c5f187..771257c65c 100644 --- a/pkgs/yaml/lib/src/loader.dart +++ b/pkgs/yaml/lib/src/loader.dart @@ -37,18 +37,10 @@ class Loader { FileSpan _span; /// Creates a loader that loads [source]. - factory Loader( - String source, { - Uri? sourceUrl, - bool recover = false, - ErrorListener? errorListener, - }) { - var parser = Parser( - source, - sourceUrl: sourceUrl, - recover: recover, - errorListener: errorListener, - ); + factory Loader(String source, + {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) { + var parser = Parser(source, + sourceUrl: sourceUrl, recover: recover, errorListener: errorListener); var event = parser.parse(); assert(event.type == EventType.streamStart); return Loader._(parser, event.span); @@ -82,23 +74,23 @@ class Loader { assert(lastEvent.type == EventType.documentEnd); return YamlDocument.internal( - contents, - firstEvent.span.expand(lastEvent.span), - firstEvent.versionDirective, - firstEvent.tagDirectives, - startImplicit: firstEvent.isImplicit, - endImplicit: lastEvent.isImplicit, - ); + contents, + firstEvent.span.expand(lastEvent.span), + firstEvent.versionDirective, + firstEvent.tagDirectives, + startImplicit: firstEvent.isImplicit, + endImplicit: lastEvent.isImplicit); } /// Composes a node. YamlNode _loadNode(Event firstEvent) => switch (firstEvent.type) { - EventType.alias => _loadAlias(firstEvent as AliasEvent), - EventType.scalar => _loadScalar(firstEvent as ScalarEvent), - EventType.sequenceStart => _loadSequence(firstEvent as SequenceStartEvent), - EventType.mappingStart => _loadMapping(firstEvent as MappingStartEvent), - _ => throw StateError('Unreachable'), - }; + EventType.alias => _loadAlias(firstEvent as AliasEvent), + EventType.scalar => _loadScalar(firstEvent as ScalarEvent), + EventType.sequenceStart => + _loadSequence(firstEvent as SequenceStartEvent), + EventType.mappingStart => _loadMapping(firstEvent as MappingStartEvent), + _ => throw StateError('Unreachable') + }; /// Registers an anchor. void _registerAnchor(String? anchor, YamlNode node) { @@ -117,9 +109,7 @@ class Loader { if (alias != null) { if (_activeAnchors.contains(event.name)) { throw YamlException( - 'Self-referential collections are not supported.', - event.span, - ); + 'Self-referential collections are not supported.', event.span); } return alias; } @@ -251,7 +241,7 @@ class Loader { $t || $T => length == 4 ? _parseBool(scalar) : null, $f || $F => length == 5 ? _parseBool(scalar) : null, $tilde => length == 1 ? YamlScalar.internal(null, scalar) : null, - _ => (firstChar >= $0 && firstChar <= $9) ? _parseNumber(scalar) : null, + _ => (firstChar >= $0 && firstChar <= $9) ? _parseNumber(scalar) : null }; } @@ -259,47 +249,39 @@ class Loader { /// /// Returns a Dart `null` if parsing fails. YamlScalar? _parseNull(ScalarEvent scalar) => switch (scalar.value) { - '' || - 'null' || - 'Null' || - 'NULL' || - '~' => YamlScalar.internal(null, scalar), - _ => null, - }; + '' || + 'null' || + 'Null' || + 'NULL' || + '~' => + YamlScalar.internal(null, scalar), + _ => null + }; /// Parse a boolean scalar. /// /// Returns `null` if parsing fails. YamlScalar? _parseBool(ScalarEvent scalar) => switch (scalar.value) { - 'true' || 'True' || 'TRUE' => YamlScalar.internal(true, scalar), - 'false' || 'False' || 'FALSE' => YamlScalar.internal(false, scalar), - _ => null, - }; + 'true' || 'True' || 'TRUE' => YamlScalar.internal(true, scalar), + 'false' || 'False' || 'FALSE' => YamlScalar.internal(false, scalar), + _ => null + }; /// Parses a numeric scalar. /// /// Returns `null` if parsing fails. - YamlScalar? _parseNumber( - ScalarEvent scalar, { - bool allowInt = true, - bool allowFloat = true, - }) { - var value = _parseNumberValue( - scalar.value, - allowInt: allowInt, - allowFloat: allowFloat, - ); + YamlScalar? _parseNumber(ScalarEvent scalar, + {bool allowInt = true, bool allowFloat = true}) { + var value = _parseNumberValue(scalar.value, + allowInt: allowInt, allowFloat: allowFloat); return value == null ? null : YamlScalar.internal(value, scalar); } /// Parses the value of a number. /// /// Returns the number if it's parsed successfully, or `null` if it's not. - num? _parseNumberValue( - String contents, { - bool allowInt = true, - bool allowFloat = true, - }) { + num? _parseNumberValue(String contents, + {bool allowInt = true, bool allowFloat = true}) { assert(allowInt || allowFloat); var length = contents.length; diff --git a/pkgs/yaml/lib/src/parser.dart b/pkgs/yaml/lib/src/parser.dart index 1196426777..c89a956494 100644 --- a/pkgs/yaml/lib/src/parser.dart +++ b/pkgs/yaml/lib/src/parser.dart @@ -46,18 +46,13 @@ class Parser { /// return invalid or synthetic nodes. If [errorListener] is also supplied, /// its onError method will be called for each error recovered from. It is not /// valid to provide [errorListener] if [recover] is false. - Parser( - String source, { - Uri? sourceUrl, - bool recover = false, - ErrorListener? errorListener, - }) : assert(recover || errorListener == null), - _scanner = Scanner( - source, - sourceUrl: sourceUrl, - recover: recover, - errorListener: errorListener, - ); + Parser(String source, + {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) + : assert(recover || errorListener == null), + _scanner = Scanner(source, + sourceUrl: sourceUrl, + recover: recover, + errorListener: errorListener); /// Consumes and returns the next event. Event parse() { @@ -184,12 +179,10 @@ class Parser { _states.add(_State.DOCUMENT_END); _state = _State.DOCUMENT_CONTENT; _scanner.scan(); - return DocumentStartEvent( - start.expand(token.span), - versionDirective: versionDirective, - tagDirectives: tagDirectives, - isImplicit: false, - ); + return DocumentStartEvent(start.expand(token.span), + versionDirective: versionDirective, + tagDirectives: tagDirectives, + isImplicit: false); } /// Parses the productions: @@ -308,12 +301,8 @@ class Parser { if (indentlessSequence && token.type == TokenType.blockEntry) { _state = _State.INDENTLESS_SEQUENCE_ENTRY; - return SequenceStartEvent( - span.expand(token.span), - CollectionStyle.BLOCK, - anchor: anchor, - tag: tag, - ); + return SequenceStartEvent(span.expand(token.span), CollectionStyle.BLOCK, + anchor: anchor, tag: tag); } if (token is ScalarToken) { @@ -322,53 +311,32 @@ class Parser { _state = _states.removeLast(); _scanner.scan(); - return ScalarEvent( - span.expand(token.span), - token.value, - token.style, - anchor: anchor, - tag: tag, - ); + return ScalarEvent(span.expand(token.span), token.value, token.style, + anchor: anchor, tag: tag); } if (token.type == TokenType.flowSequenceStart) { _state = _State.FLOW_SEQUENCE_FIRST_ENTRY; - return SequenceStartEvent( - span.expand(token.span), - CollectionStyle.FLOW, - anchor: anchor, - tag: tag, - ); + return SequenceStartEvent(span.expand(token.span), CollectionStyle.FLOW, + anchor: anchor, tag: tag); } if (token.type == TokenType.flowMappingStart) { _state = _State.FLOW_MAPPING_FIRST_KEY; - return MappingStartEvent( - span.expand(token.span), - CollectionStyle.FLOW, - anchor: anchor, - tag: tag, - ); + return MappingStartEvent(span.expand(token.span), CollectionStyle.FLOW, + anchor: anchor, tag: tag); } if (block && token.type == TokenType.blockSequenceStart) { _state = _State.BLOCK_SEQUENCE_FIRST_ENTRY; - return SequenceStartEvent( - span.expand(token.span), - CollectionStyle.BLOCK, - anchor: anchor, - tag: tag, - ); + return SequenceStartEvent(span.expand(token.span), CollectionStyle.BLOCK, + anchor: anchor, tag: tag); } if (block && token.type == TokenType.blockMappingStart) { _state = _State.BLOCK_MAPPING_FIRST_KEY; - return MappingStartEvent( - span.expand(token.span), - CollectionStyle.BLOCK, - anchor: anchor, - tag: tag, - ); + return MappingStartEvent(span.expand(token.span), CollectionStyle.BLOCK, + anchor: anchor, tag: tag); } if (anchor != null || tag != null) { @@ -417,13 +385,11 @@ class Parser { return _parseNode(block: true); } - final message = StringBuffer( - "While parsing a block collection, expected '-'.", - ); + final message = + StringBuffer("While parsing a block collection, expected '-'."); if (token.type == TokenType.value) { message.write( - ' You cannot mix list and key-value syntax in the same collection.', - ); + ' You cannot mix list and key-value syntax in the same collection.'); } throw YamlException(message.toString(), token.span.start.pointSpan()); } @@ -496,13 +462,11 @@ class Parser { return Event(EventType.mappingEnd, token.span); } - final message = StringBuffer( - 'Expected a key while parsing a block mapping.', - ); + final message = + StringBuffer('Expected a key while parsing a block mapping.'); if (token.type == TokenType.blockEntry) { message.write( - ' You cannot mix list and key-value syntax in the same collection.', - ); + ' You cannot mix list and key-value syntax in the same collection.'); } throw YamlException(message.toString(), token.span.start.pointSpan()); } @@ -559,9 +523,8 @@ class Parser { if (!first) { if (token.type != TokenType.flowEntry) { throw YamlException( - "While parsing a flow sequence, expected ',' or ']'.", - token.span.start.pointSpan(), - ); + "While parsing a flow sequence, expected ',' or ']'.", + token.span.start.pointSpan()); } token = _scanner.advance()!; @@ -658,9 +621,8 @@ class Parser { if (!first) { if (token.type != TokenType.flowEntry) { throw YamlException( - "While parsing a flow mapping, expected ',' or '}'.", - token.span.start.pointSpan(), - ); + "While parsing a flow mapping, expected ',' or '}'.", + token.span.start.pointSpan()); } token = _scanner.advance()!; @@ -733,17 +695,14 @@ class Parser { if (token.major != 1 || token.minor == 0) { throw YamlException( - 'Incompatible YAML document. This parser only supports YAML 1.1 ' - 'and 1.2.', - token.span, - ); + 'Incompatible YAML document. This parser only supports YAML 1.1 ' + 'and 1.2.', + token.span); } else if (token.minor > 2) { // TODO(nweiz): Print to stderr when issue 6943 is fixed and dart:io // is available. - warn( - 'Warning: this parser only supports YAML 1.1 and 1.2.', - token.span, - ); + warn('Warning: this parser only supports YAML 1.1 and 1.2.', + token.span); } versionDirective = VersionDirective(token.major, token.minor); @@ -756,26 +715,18 @@ class Parser { token = _scanner.advance()!; } + _appendTagDirective(TagDirective('!', '!'), token.span.start.pointSpan(), + allowDuplicates: true); _appendTagDirective( - TagDirective('!', '!'), - token.span.start.pointSpan(), - allowDuplicates: true, - ); - _appendTagDirective( - TagDirective('!!', 'tag:yaml.org,2002:'), - token.span.start.pointSpan(), - allowDuplicates: true, - ); + TagDirective('!!', 'tag:yaml.org,2002:'), token.span.start.pointSpan(), + allowDuplicates: true); return (versionDirective, tagDirectives); } /// Adds a tag directive to the directives stack. - void _appendTagDirective( - TagDirective newDirective, - FileSpan span, { - bool allowDuplicates = false, - }) { + void _appendTagDirective(TagDirective newDirective, FileSpan span, + {bool allowDuplicates = false}) { if (_tagDirectives.containsKey(newDirective.handle)) { if (allowDuplicates) return; throw YamlException('Duplicate %TAG directive.', span); @@ -803,9 +754,8 @@ class _State { static const BLOCK_NODE = _State('BLOCK_NODE'); /// Expect the first entry of a block sequence. - static const BLOCK_SEQUENCE_FIRST_ENTRY = _State( - 'BLOCK_SEQUENCE_FIRST_ENTRY', - ); + static const BLOCK_SEQUENCE_FIRST_ENTRY = + _State('BLOCK_SEQUENCE_FIRST_ENTRY'); /// Expect an entry of a block sequence. static const BLOCK_SEQUENCE_ENTRY = _State('BLOCK_SEQUENCE_ENTRY'); @@ -829,19 +779,16 @@ class _State { static const FLOW_SEQUENCE_ENTRY = _State('FLOW_SEQUENCE_ENTRY'); /// Expect a key of an ordered mapping. - static const FLOW_SEQUENCE_ENTRY_MAPPING_KEY = _State( - 'FLOW_SEQUENCE_ENTRY_MAPPING_KEY', - ); + static const FLOW_SEQUENCE_ENTRY_MAPPING_KEY = + _State('FLOW_SEQUENCE_ENTRY_MAPPING_KEY'); /// Expect a value of an ordered mapping. - static const FLOW_SEQUENCE_ENTRY_MAPPING_VALUE = _State( - 'FLOW_SEQUENCE_ENTRY_MAPPING_VALUE', - ); + static const FLOW_SEQUENCE_ENTRY_MAPPING_VALUE = + _State('FLOW_SEQUENCE_ENTRY_MAPPING_VALUE'); /// Expect the and of an ordered mapping entry. - static const FLOW_SEQUENCE_ENTRY_MAPPING_END = _State( - 'FLOW_SEQUENCE_ENTRY_MAPPING_END', - ); + static const FLOW_SEQUENCE_ENTRY_MAPPING_END = + _State('FLOW_SEQUENCE_ENTRY_MAPPING_END'); /// Expect the first key of a flow mapping. static const FLOW_MAPPING_FIRST_KEY = _State('FLOW_MAPPING_FIRST_KEY'); diff --git a/pkgs/yaml/lib/src/scanner.dart b/pkgs/yaml/lib/src/scanner.dart index ded191266a..8f5bc14dd0 100644 --- a/pkgs/yaml/lib/src/scanner.dart +++ b/pkgs/yaml/lib/src/scanner.dart @@ -285,14 +285,11 @@ class Scanner { (_scanner.matches('---') || _scanner.matches('...')); /// Creates a scanner that scans [source]. - Scanner( - String source, { - Uri? sourceUrl, - bool recover = false, - ErrorListener? errorListener, - }) : _recover = recover, - _errorListener = errorListener, - _scanner = SpanScanner.eager(source, sourceUrl: sourceUrl); + Scanner(String source, + {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) + : _recover = recover, + _errorListener = errorListener, + _scanner = SpanScanner.eager(source, sourceUrl: sourceUrl); /// Consumes and returns the next token. Token scan() { @@ -331,9 +328,8 @@ class Scanner { // If the current token could be a simple key, we need to scan more // tokens until we determine whether it is or not. Otherwise we might // not emit the `KEY` token before we emit the value of the key. - if (!_simpleKeys.any( - (key) => key != null && key.tokenNumber == _tokensParsed, - )) { + if (!_simpleKeys + .any((key) => key != null && key.tokenNumber == _tokensParsed)) { break; } } @@ -497,10 +493,8 @@ class Scanner { message.write(" If this is a list entry, it must start with '- '."); } _reportError(YamlException(message.toString(), _scanner.emptySpan)); - _tokens.insert( - key.tokenNumber - _tokensParsed, - Token(TokenType.key, key.location.pointSpan() as FileSpan), - ); + _tokens.insert(key.tokenNumber - _tokensParsed, + Token(TokenType.key, key.location.pointSpan() as FileSpan)); } _simpleKeys[i] = null; @@ -520,22 +514,19 @@ class Scanner { // If the current position may start a simple key, save it. _removeSimpleKey(); _simpleKeys[_simpleKeys.length - 1] = _SimpleKey( - _tokensParsed + _tokens.length, - _scanner.line, - _scanner.column, - _scanner.location, - required: required, - ); + _tokensParsed + _tokens.length, + _scanner.line, + _scanner.column, + _scanner.location, + required: required); } /// Removes a potential simple key at the current flow level. void _removeSimpleKey() { var key = _simpleKeys.last; if (key != null && key.required) { - throw YamlException( - "Could not find expected ':' for simple key.", - key.location.pointSpan(), - ); + throw YamlException("Could not find expected ':' for simple key.", + key.location.pointSpan()); } _simpleKeys[_simpleKeys.length - 1] = null; @@ -558,12 +549,8 @@ class Scanner { /// If it is, appends or inserts the specified token into [_tokens]. If /// [tokenNumber] is provided, the corresponding token will be replaced; /// otherwise, the token will be added at the end. - void _rollIndent( - int column, - TokenType type, - SourceLocation location, { - int? tokenNumber, - }) { + void _rollIndent(int column, TokenType type, SourceLocation location, + {int? tokenNumber}) { if (!_inBlockContext) return; if (_indent != -1 && _indent >= column) return; @@ -670,16 +657,11 @@ class Scanner { if (_inBlockContext) { if (!_simpleKeyAllowed) { throw YamlException( - 'Block sequence entries are not allowed here.', - _scanner.emptySpan, - ); + 'Block sequence entries are not allowed here.', _scanner.emptySpan); } _rollIndent( - _scanner.column, - TokenType.blockSequenceStart, - _scanner.location, - ); + _scanner.column, TokenType.blockSequenceStart, _scanner.location); } else { // It is an error for the '-' indicator to occur in the flow context, but // we let the Parser detect and report it because it's able to point to @@ -696,16 +678,11 @@ class Scanner { if (_inBlockContext) { if (!_simpleKeyAllowed) { throw YamlException( - 'Mapping keys are not allowed here.', - _scanner.emptySpan, - ); + 'Mapping keys are not allowed here.', _scanner.emptySpan); } _rollIndent( - _scanner.column, - TokenType.blockMappingStart, - _scanner.location, - ); + _scanner.column, TokenType.blockMappingStart, _scanner.location); } // Simple keys are allowed after `?` in a block context. @@ -719,19 +696,14 @@ class Scanner { if (simpleKey != null) { // Add a [TokenType.KEY] directive before the first token of the simple // key so the parser knows that it's part of a key/value pair. - _tokens.insert( - simpleKey.tokenNumber - _tokensParsed, - Token(TokenType.key, simpleKey.location.pointSpan() as FileSpan), - ); + _tokens.insert(simpleKey.tokenNumber - _tokensParsed, + Token(TokenType.key, simpleKey.location.pointSpan() as FileSpan)); // In the block context, we may need to add the // [TokenType.BLOCK_MAPPING_START] token. _rollIndent( - simpleKey.column, - TokenType.blockMappingStart, - simpleKey.location, - tokenNumber: simpleKey.tokenNumber, - ); + simpleKey.column, TokenType.blockMappingStart, simpleKey.location, + tokenNumber: simpleKey.tokenNumber); // Remove the simple key. _simpleKeys[_simpleKeys.length - 1] = null; @@ -741,19 +713,15 @@ class Scanner { } else if (_inBlockContext) { if (!_simpleKeyAllowed) { throw YamlException( - 'Mapping values are not allowed here. Did you miss a colon ' - 'earlier?', - _scanner.emptySpan, - ); + 'Mapping values are not allowed here. Did you miss a colon ' + 'earlier?', + _scanner.emptySpan); } // If we're here, we've found the ':' indicator following a complex key. _rollIndent( - _scanner.column, - TokenType.blockMappingStart, - _scanner.location, - ); + _scanner.column, TokenType.blockMappingStart, _scanner.location); _simpleKeyAllowed = true; } else if (_simpleKeyAllowed) { // If we're here, we've found the ':' indicator with an empty key. This @@ -829,10 +797,8 @@ class Scanner { } if (_scanner.peekChar() == TAB) { - _scanner.error( - 'Tab characters are not allowed as indentation.', - length: 1, - ); + _scanner.error('Tab characters are not allowed as indentation.', + length: 1); } // Eat a comment until a line break. @@ -887,10 +853,8 @@ class Scanner { _skipComment(); if (!_isBreakOrEnd) { - throw YamlException( - 'Expected comment or line break after directive.', - _scanner.spanFrom(start), - ); + throw YamlException('Expected comment or line break after directive.', + _scanner.spanFrom(start)); } _skipLine(); @@ -916,9 +880,7 @@ class Scanner { throw YamlException('Expected directive name.', _scanner.emptySpan); } else if (!_isBlankOrEnd) { throw YamlException( - 'Unexpected character in directive name.', - _scanner.emptySpan, - ); + 'Unexpected character in directive name.', _scanner.emptySpan); } return name; @@ -1002,9 +964,7 @@ class Scanner { next != RIGHT_SQUARE && next != RIGHT_CURLY)) { throw YamlException( - 'Expected alphanumeric character.', - _scanner.emptySpan, - ); + 'Expected alphanumeric character.', _scanner.emptySpan); } if (anchor) { @@ -1039,11 +999,8 @@ class Scanner { if (handle.length > 1 && handle.startsWith('!') && handle.endsWith('!')) { suffix = _scanTagUri(flowSeparators: false); } else { - suffix = _scanTagUri( - head: handle, - headStart: start, - flowSeparators: false, - ); + suffix = + _scanTagUri(head: handle, headStart: start, flowSeparators: false); // There was no explicit handle. if (suffix.isEmpty) { @@ -1093,11 +1050,8 @@ class Scanner { /// [head] is the initial portion of the tag that's already been scanned. /// [flowSeparators] indicates whether the tag URI can contain flow /// separators. - String _scanTagUri({ - String? head, - LineScannerState? headStart, - bool flowSeparators = true, - }) { + String _scanTagUri( + {String? head, LineScannerState? headStart, bool flowSeparators = true}) { var length = head == null ? 0 : head.length; var buffer = StringBuffer(); @@ -1170,10 +1124,8 @@ class Scanner { if (_isDigit) { // Check that the indentation is greater than 0. if (_scanner.peekChar() == NUMBER_0) { - throw YamlException( - '0 may not be used as an indentation indicator.', - _scanner.spanFrom(start), - ); + throw YamlException('0 may not be used as an indentation indicator.', + _scanner.spanFrom(start)); } increment = _scanner.readCodePoint() - NUMBER_0; @@ -1181,10 +1133,8 @@ class Scanner { } else if (_isDigit) { // Do the same as above, but in the opposite order. if (_scanner.peekChar() == NUMBER_0) { - throw YamlException( - '0 may not be used as an indentation indicator.', - _scanner.spanFrom(start), - ); + throw YamlException('0 may not be used as an indentation indicator.', + _scanner.spanFrom(start)); } increment = _scanner.readCodePoint() - NUMBER_0; @@ -1203,9 +1153,7 @@ class Scanner { // Check if we're at the end of the line. if (!_isBreakOrEnd) { throw YamlException( - 'Expected comment or line break.', - _scanner.emptySpan, - ); + 'Expected comment or line break.', _scanner.emptySpan); } _skipLine(); @@ -1285,11 +1233,8 @@ class Scanner { if (chomping != _Chomping.strip) buffer.write(leadingBreak); if (chomping == _Chomping.keep) buffer.write(trailingBreaks); - return ScalarToken( - _scanner.spanFrom(start, end), - buffer.toString(), - literal ? ScalarStyle.LITERAL : ScalarStyle.FOLDED, - ); + return ScalarToken(_scanner.spanFrom(start, end), buffer.toString(), + literal ? ScalarStyle.LITERAL : ScalarStyle.FOLDED); } /// Scans indentation spaces and line breaks for a block scalar. @@ -1431,9 +1376,7 @@ class Scanner { break; default: throw YamlException( - 'Unknown escape character.', - _scanner.spanFrom(escapeStart), - ); + 'Unknown escape character.', _scanner.spanFrom(escapeStart)); } _scanner.readChar(); @@ -1445,9 +1388,8 @@ class Scanner { if (!_isHex) { _scanner.readChar(); throw YamlException( - 'Expected $codeLength-digit hexidecimal number.', - _scanner.spanFrom(escapeStart), - ); + 'Expected $codeLength-digit hexidecimal number.', + _scanner.spanFrom(escapeStart)); } value = (value << 4) + _asHex(_scanner.readChar()); @@ -1455,10 +1397,8 @@ class Scanner { // Check the value and write the character. if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) { - throw YamlException( - 'Invalid Unicode character escape code.', - _scanner.spanFrom(escapeStart), - ); + throw YamlException('Invalid Unicode character escape code.', + _scanner.spanFrom(escapeStart)); } buffer.writeCharCode(value); @@ -1512,11 +1452,8 @@ class Scanner { // Eat the right quote. _scanner.readChar(); - return ScalarToken( - _scanner.spanFrom(start), - buffer.toString(), - singleQuote ? ScalarStyle.SINGLE_QUOTED : ScalarStyle.DOUBLE_QUOTED, - ); + return ScalarToken(_scanner.spanFrom(start), buffer.toString(), + singleQuote ? ScalarStyle.SINGLE_QUOTED : ScalarStyle.DOUBLE_QUOTED); } /// Scans a plain scalar. @@ -1597,10 +1534,7 @@ class Scanner { if (leadingBreak.isNotEmpty) _simpleKeyAllowed = true; return ScalarToken( - _scanner.spanFrom(start, end), - buffer.toString(), - ScalarStyle.PLAIN, - ); + _scanner.spanFrom(start, end), buffer.toString(), ScalarStyle.PLAIN); } /// Moves past the current line break, if there is one. @@ -1674,13 +1608,17 @@ class Scanner { var char = _scanner.peekChar(offset); return switch (char) { null => false, - COMMA || LEFT_SQUARE || RIGHT_SQUARE || LEFT_CURLY || RIGHT_CURLY => + COMMA || + LEFT_SQUARE || + RIGHT_SQUARE || + LEFT_CURLY || + RIGHT_CURLY => // These characters are delimiters in a flow context and thus are only // safe in a block context. _inBlockContext, SP || TAB || LF || CR || BOM => false, NEL => true, - _ => _isStandardCharacterAt(offset), + _ => _isStandardCharacterAt(offset) }; } @@ -1783,5 +1721,5 @@ enum _Chomping { clip, /// All trailing whitespace is preserved. - keep, + keep } diff --git a/pkgs/yaml/lib/src/yaml_document.dart b/pkgs/yaml/lib/src/yaml_document.dart index fb3806cd73..839a0d7342 100644 --- a/pkgs/yaml/lib/src/yaml_document.dart +++ b/pkgs/yaml/lib/src/yaml_document.dart @@ -35,14 +35,10 @@ class YamlDocument { /// Users of the library should not use this constructor. /// /// @nodoc - YamlDocument.internal( - this.contents, - this.span, - this.versionDirective, - List tagDirectives, { - this.startImplicit = false, - this.endImplicit = false, - }) : tagDirectives = UnmodifiableListView(tagDirectives); + YamlDocument.internal(this.contents, this.span, this.versionDirective, + List tagDirectives, + {this.startImplicit = false, this.endImplicit = false}) + : tagDirectives = UnmodifiableListView(tagDirectives); @override String toString() => contents.toString(); diff --git a/pkgs/yaml/lib/src/yaml_node.dart b/pkgs/yaml/lib/src/yaml_node.dart index 819d40236e..bd17b6cb99 100644 --- a/pkgs/yaml/lib/src/yaml_node.dart +++ b/pkgs/yaml/lib/src/yaml_node.dart @@ -81,16 +81,14 @@ class YamlMap extends YamlNode with collection.MapMixin, UnmodifiableMapMixin { /// passed, it's used as the [SourceSpan.sourceUrl]. /// /// [sourceUrl] may be either a [String], a [Uri], or `null`. - factory YamlMap.wrap( - Map dartMap, { - Object? sourceUrl, - CollectionStyle style = CollectionStyle.ANY, - }) => YamlMapWrapper(dartMap, sourceUrl, style: style); + factory YamlMap.wrap(Map dartMap, + {Object? sourceUrl, CollectionStyle style = CollectionStyle.ANY}) => + YamlMapWrapper(dartMap, sourceUrl, style: style); /// Users of the library should not use this constructor. YamlMap.internal(Map nodes, super.span, this.style) - : nodes = UnmodifiableMapView(nodes), - super._(); + : nodes = UnmodifiableMapView(nodes), + super._(); @override dynamic operator [](Object? key) => nodes[key]?.value; @@ -133,16 +131,14 @@ class YamlList extends YamlNode with collection.ListMixin { /// passed, it's used as the [SourceSpan.sourceUrl]. /// /// [sourceUrl] may be either a [String], a [Uri], or `null`. - factory YamlList.wrap( - List dartList, { - Object? sourceUrl, - CollectionStyle style = CollectionStyle.ANY, - }) => YamlListWrapper(dartList, sourceUrl, style: style); + factory YamlList.wrap(List dartList, + {Object? sourceUrl, CollectionStyle style = CollectionStyle.ANY}) => + YamlListWrapper(dartList, sourceUrl, style: style); /// Users of the library should not use this constructor. YamlList.internal(List nodes, super.span, this.style) - : nodes = UnmodifiableListView(nodes), - super._(); + : nodes = UnmodifiableListView(nodes), + super._(); @override dynamic operator [](int index) => nodes[index].value; @@ -169,19 +165,19 @@ class YamlScalar extends YamlNode { /// /// [sourceUrl] may be either a [String], a [Uri], or `null`. YamlScalar.wrap(this.value, {Object? sourceUrl, this.style = ScalarStyle.ANY}) - : super._(NullSpan(sourceUrl)) { + : super._(NullSpan(sourceUrl)) { ArgumentError.checkNotNull(style, 'style'); } /// Users of the library should not use this constructor. YamlScalar.internal(this.value, ScalarEvent scalar) - : style = scalar.style, - super._(scalar.span); + : style = scalar.style, + super._(scalar.span); /// Users of the library should not use this constructor. YamlScalar.internalWithSpan(this.value, SourceSpan span) - : style = ScalarStyle.ANY, - super._(span); + : style = ScalarStyle.ANY, + super._(span); @override String toString() => value.toString(); diff --git a/pkgs/yaml/test/error_listener_test.dart b/pkgs/yaml/test/error_listener_test.dart index e1a1507c59..a7d8f61fd2 100644 --- a/pkgs/yaml/test/error_listener_test.dart +++ b/pkgs/yaml/test/error_listener_test.dart @@ -42,10 +42,14 @@ linter: }), ); expect(collector.errors, hasLength(1)); - expect(collector.errors.first.message, contains("Expected ':'")); + expect( + collector.errors.first.message, + contains("Expected ':'"), + ); }); - test('custom ErrorListener implementation receives errors during recovery ' + test( + 'custom ErrorListener implementation receives errors during recovery ' 'parsing', () { final listener = _CustomErrorListener(); final result = loadYaml( @@ -63,6 +67,9 @@ linter: }), ); expect(listener.messages, hasLength(1)); - expect(listener.messages.first, contains("Expected ':'")); + expect( + listener.messages.first, + contains("Expected ':'"), + ); }); } diff --git a/pkgs/yaml/test/yaml_test.dart b/pkgs/yaml/test/yaml_test.dart index 0b18ba2452..e987290c76 100644 --- a/pkgs/yaml/test/yaml_test.dart +++ b/pkgs/yaml/test/yaml_test.dart @@ -17,24 +17,18 @@ void main() { var nan = double.parse('NaN'); group('has a friendly error message for', () { - var tabError = predicate( - (e) => e.toString().contains( - 'Tab characters are not allowed as indentation', - ), - ); + var tabError = predicate((e) => + e.toString().contains('Tab characters are not allowed as indentation')); test('using a tab as indentation', () { expect(() => loadYaml('foo:\n\tbar'), throwsA(tabError)); }); test('using a tab not as indentation', () { - expect( - () => loadYaml(''' + expect(() => loadYaml(''' "foo \tbar" - error'''), - throwsA(isNot(tabError)), - ); + error'''), throwsA(isNot(tabError))); }); Matcher yamlError(String message, int line, int column) => @@ -46,60 +40,44 @@ void main() { test('a list entry in a block mapping', () { expect( - () => loadYaml( - 'linter:\n' - ' rules:\n' - ' close_sinks: false\n' - ' - empty_statements\n', - ), - throwsA( - yamlError( - 'Expected a key while parsing a block mapping. ' - 'You cannot mix list and key-value syntax in the same ' - 'collection.', - 3, - 4, - ), - ), - ); + () => loadYaml('linter:\n' + ' rules:\n' + ' close_sinks: false\n' + ' - empty_statements\n'), + throwsA(yamlError( + 'Expected a key while parsing a block mapping. ' + 'You cannot mix list and key-value syntax in the same ' + 'collection.', + 3, + 4))); }); test('a mapping entry in a block sequence', () { expect( - () => loadYaml( - 'linter:\n' - ' rules:\n' - ' - empty_statements\n' - ' close_sinks: false\n', - ), - throwsA( - yamlError( - "While parsing a block collection, expected '-'. " - 'You cannot mix list and key-value syntax in the same ' - 'collection.', - 3, - 15, - ), - ), - ); + () => loadYaml('linter:\n' + ' rules:\n' + ' - empty_statements\n' + ' close_sinks: false\n'), + throwsA(yamlError( + "While parsing a block collection, expected '-'. " + 'You cannot mix list and key-value syntax in the same ' + 'collection.', + 3, + 15))); }); test('a block scalar where a mapping key is expected', () { expect( - () => loadYaml('a: 1\n|\n b\n'), - throwsA( - yamlError('Expected a key while parsing a block mapping.', 1, 0), - ), - ); + () => loadYaml('a: 1\n|\n b\n'), + throwsA(yamlError( + 'Expected a key while parsing a block mapping.', 1, 0))); }); test('a block scalar where a list entry is expected', () { expect( - () => loadYaml('- a\n|\n b\n'), - throwsA( - yamlError("While parsing a block collection, expected '-'.", 1, 0), - ), - ); + () => loadYaml('- a\n|\n b\n'), + throwsA(yamlError( + "While parsing a block collection, expected '-'.", 1, 0))); }); }); @@ -151,11 +129,13 @@ void main() { '''); var result = loadYaml(yaml, recover: true, errorListener: collector); expect( - result, - deepEquals({ - 'dependencies': {'zero': null, 'one': 'any'}, - }), - ); + result, + deepEquals({ + 'dependencies': { + 'zero': null, + 'one': 'any', + } + })); expect(collector.errors.length, equals(1)); // These errors are reported at the start of the next token (after the // whitespace/newlines). @@ -177,18 +157,17 @@ void main() { '''); var result = loadYaml(yaml, recover: true, errorListener: collector); expect( - result, - deepEquals({ - 'dependencies': { - 'one': 'any', - 'two': null, - 'three': null, - 'four': null, - 'five': '1.2.3', - 'six': '5.4.3', - }, - }), - ); + result, + deepEquals({ + 'dependencies': { + 'one': 'any', + 'two': null, + 'three': null, + 'four': null, + 'five': '1.2.3', + 'six': '5.4.3', + } + })); expect(collector.errors.length, equals(2)); // These errors are reported at the start of the next token (after the @@ -204,11 +183,13 @@ void main() { '''); var result = loadYaml(yaml, recover: true); expect( - result, - deepEquals({ - 'dependencies': {'six': '5.4.3', 'seven': null}, - }), - ); + result, + deepEquals({ + 'dependencies': { + 'six': '5.4.3', + 'seven': null, + } + })); }); test('from list elements with missing "- " prefix', () { final yaml = cleanUpLiteral(r''' @@ -219,20 +200,18 @@ void main() { '''); var result = loadYaml(yaml, recover: true, errorListener: collector); expect( - result, - deepEquals({ - 'linter': { - 'rules': ['annotate_overrides', 'alway'], - }, - }), - ); + result, + deepEquals({ + 'linter': { + 'rules': ['annotate_overrides', 'alway'], + } + })); expect(collector.errors.length, equals(1)); expectErrorAtLineCol( - collector.errors[0], - "Expected ':'. If this is a list entry, it must start with '- '.", - 4, - 4, - ); + collector.errors[0], + "Expected ':'. If this is a list entry, it must start with '- '.", + 4, + 4); }); }); @@ -288,32 +267,24 @@ void main() { // the spec. group('2.1: Collections', () { test('[Example 2.1]', () { - expectYamlLoads( - ['Mark McGwire', 'Sammy Sosa', 'Ken Griffey'], - ''' + expectYamlLoads(['Mark McGwire', 'Sammy Sosa', 'Ken Griffey'], ''' - Mark McGwire - Sammy Sosa - - Ken Griffey''', - ); + - Ken Griffey'''); }); test('[Example 2.2]', () { - expectYamlLoads( - {'hr': 65, 'avg': 0.278, 'rbi': 147}, - ''' + expectYamlLoads({'hr': 65, 'avg': 0.278, 'rbi': 147}, ''' hr: 65 # Home runs avg: 0.278 # Batting average - rbi: 147 # Runs Batted In''', - ); + rbi: 147 # Runs Batted In'''); }); test('[Example 2.3]', () { - expectYamlLoads( - { - 'american': ['Boston Red Sox', 'Detroit Tigers', 'New York Yankees'], - 'national': ['New York Mets', 'Chicago Cubs', 'Atlanta Braves'], - }, - ''' + expectYamlLoads({ + 'american': ['Boston Red Sox', 'Detroit Tigers', 'New York Yankees'], + 'national': ['New York Mets', 'Chicago Cubs', 'Atlanta Braves'], + }, ''' american: - Boston Red Sox - Detroit Tigers @@ -321,17 +292,14 @@ void main() { national: - New York Mets - Chicago Cubs - - Atlanta Braves''', - ); + - Atlanta Braves'''); }); test('[Example 2.4]', () { - expectYamlLoads( - [ - {'name': 'Mark McGwire', 'hr': 65, 'avg': 0.278}, - {'name': 'Sammy Sosa', 'hr': 63, 'avg': 0.288}, - ], - ''' + expectYamlLoads([ + {'name': 'Mark McGwire', 'hr': 65, 'avg': 0.278}, + {'name': 'Sammy Sosa', 'hr': 63, 'avg': 0.288}, + ], ''' - name: Mark McGwire hr: 65 @@ -339,48 +307,39 @@ void main() { - name: Sammy Sosa hr: 63 - avg: 0.288''', - ); + avg: 0.288'''); }); test('[Example 2.5]', () { - expectYamlLoads( - [ - ['name', 'hr', 'avg'], - ['Mark McGwire', 65, 0.278], - ['Sammy Sosa', 63, 0.288], - ], - ''' + expectYamlLoads([ + ['name', 'hr', 'avg'], + ['Mark McGwire', 65, 0.278], + ['Sammy Sosa', 63, 0.288] + ], ''' - [name , hr, avg ] - [Mark McGwire, 65, 0.278] - - [Sammy Sosa , 63, 0.288]''', - ); + - [Sammy Sosa , 63, 0.288]'''); }); test('[Example 2.6]', () { - expectYamlLoads( - { - 'Mark McGwire': {'hr': 65, 'avg': 0.278}, - 'Sammy Sosa': {'hr': 63, 'avg': 0.288}, - }, - ''' + expectYamlLoads({ + 'Mark McGwire': {'hr': 65, 'avg': 0.278}, + 'Sammy Sosa': {'hr': 63, 'avg': 0.288} + }, ''' Mark McGwire: {hr: 65, avg: 0.278} Sammy Sosa: { hr: 63, avg: 0.288 - }''', - ); + }'''); }); }); group('2.2: Structures', () { test('[Example 2.7]', () { - expectYamlStreamLoads( - [ - ['Mark McGwire', 'Sammy Sosa', 'Ken Griffey'], - ['Chicago Cubs', 'St Louis Cardinals'], - ], - ''' + expectYamlStreamLoads([ + ['Mark McGwire', 'Sammy Sosa', 'Ken Griffey'], + ['Chicago Cubs', 'St Louis Cardinals'] + ], ''' # Ranking of 1998 home runs --- - Mark McGwire @@ -390,21 +349,14 @@ void main() { # Team ranking --- - Chicago Cubs - - St Louis Cardinals''', - ); + - St Louis Cardinals'''); }); test('[Example 2.8]', () { - expectYamlStreamLoads( - [ - { - 'time': '20:03:20', - 'player': 'Sammy Sosa', - 'action': 'strike (miss)', - }, - {'time': '20:03:47', 'player': 'Sammy Sosa', 'action': 'grand slam'}, - ], - ''' + expectYamlStreamLoads([ + {'time': '20:03:20', 'player': 'Sammy Sosa', 'action': 'strike (miss)'}, + {'time': '20:03:47', 'player': 'Sammy Sosa', 'action': 'grand slam'}, + ], ''' --- time: 20:03:20 player: Sammy Sosa @@ -414,17 +366,14 @@ void main() { time: 20:03:47 player: Sammy Sosa action: grand slam - ...''', - ); + ...'''); }); test('[Example 2.9]', () { - expectYamlLoads( - { - 'hr': ['Mark McGwire', 'Sammy Sosa'], - 'rbi': ['Sammy Sosa', 'Ken Griffey'], - }, - ''' + expectYamlLoads({ + 'hr': ['Mark McGwire', 'Sammy Sosa'], + 'rbi': ['Sammy Sosa', 'Ken Griffey'] + }, ''' --- hr: # 1998 hr ranking - Mark McGwire @@ -432,17 +381,14 @@ void main() { rbi: # 1998 rbi ranking - Sammy Sosa - - Ken Griffey''', - ); + - Ken Griffey'''); }); test('[Example 2.10]', () { - expectYamlLoads( - { - 'hr': ['Mark McGwire', 'Sammy Sosa'], - 'rbi': ['Sammy Sosa', 'Ken Griffey'], - }, - ''' + expectYamlLoads({ + 'hr': ['Mark McGwire', 'Sammy Sosa'], + 'rbi': ['Sammy Sosa', 'Ken Griffey'] + }, ''' --- hr: - Mark McGwire @@ -450,8 +396,7 @@ void main() { - &SS Sammy Sosa rbi: - *SS # Subsequent occurrence - - Ken Griffey''', - ); + - Ken Griffey'''); }); test('[Example 2.11]', () { @@ -460,7 +405,7 @@ void main() { doc[['New York Yankees', 'Atlanta Braves']] = [ '2001-07-02', '2001-08-12', - '2001-08-14', + '2001-08-14' ]; expectYamlLoads(doc, ''' ? - Detroit Tigers @@ -475,13 +420,11 @@ void main() { }); test('[Example 2.12]', () { - expectYamlLoads( - [ - {'item': 'Super Hoop', 'quantity': 1}, - {'item': 'Basketball', 'quantity': 4}, - {'item': 'Big Shoes', 'quantity': 1}, - ], - ''' + expectYamlLoads([ + {'item': 'Super Hoop', 'quantity': 1}, + {'item': 'Basketball', 'quantity': 4}, + {'item': 'Big Shoes', 'quantity': 1}, + ], ''' --- # Products purchased - item : Super Hoop @@ -489,46 +432,38 @@ void main() { - item : Basketball quantity: 4 - item : Big Shoes - quantity: 1''', - ); + quantity: 1'''); }); }); group('2.3: Scalars', () { test('[Example 2.13]', () { - expectYamlLoads( - cleanUpLiteral(''' + expectYamlLoads(cleanUpLiteral(''' \\//||\\/|| - // || ||__\n'''), - ''' + // || ||__\n'''), ''' # ASCII Art --- | \\//||\\/|| - // || ||__''', - ); + // || ||__'''); }); test('[Example 2.14]', () { expectYamlLoads( - "Mark McGwire's year was crippled by a knee injury.\n", - ''' + "Mark McGwire's year was crippled by a knee injury.\n", ''' --- > Mark McGwire's year was crippled - by a knee injury.''', - ); + by a knee injury.'''); }); test('[Example 2.15]', () { - expectYamlLoads( - cleanUpLiteral(''' + expectYamlLoads(cleanUpLiteral(''' Sammy Sosa completed another fine season with great stats. 63 Home Runs 0.288 Batting Average - What a year!\n'''), - ''' + What a year!\n'''), ''' > Sammy Sosa completed another fine season with great stats. @@ -536,43 +471,35 @@ void main() { 63 Home Runs 0.288 Batting Average - What a year!''', - ); + What a year!'''); }); test('[Example 2.16]', () { - expectYamlLoads( - { - 'name': 'Mark McGwire', - 'accomplishment': - 'Mark set a major league home run record in 1998.\n', - 'stats': '65 Home Runs\n0.278 Batting Average\n', - }, - ''' + expectYamlLoads({ + 'name': 'Mark McGwire', + 'accomplishment': 'Mark set a major league home run record in 1998.\n', + 'stats': '65 Home Runs\n0.278 Batting Average\n' + }, ''' name: Mark McGwire accomplishment: > Mark set a major league home run record in 1998. stats: | 65 Home Runs - 0.278 Batting Average''', - ); + 0.278 Batting Average'''); }); test('[Example 2.17]', () { - expectYamlLoads( - { - 'unicode': 'Sosa did fine.\u263A \u{1F680}', - 'control': '\b1998\t1999\t2000\n', - 'hex esc': '\r\n is \r\n', - 'single': '"Howdy!" he cried.', - 'quoted': " # Not a 'comment'.", - 'tie-fighter': '|\\-*-/|', - 'surrogate-pair': 'I \u{D83D}\u{DE03} ️Dart!', - 'key-\u{D83D}\u{DD11}': - 'Look\u{D83D}\u{DE03}\u{D83C}\u{DF89}surprise!', - }, - """ + expectYamlLoads({ + 'unicode': 'Sosa did fine.\u263A \u{1F680}', + 'control': '\b1998\t1999\t2000\n', + 'hex esc': '\r\n is \r\n', + 'single': '"Howdy!" he cried.', + 'quoted': " # Not a 'comment'.", + 'tie-fighter': '|\\-*-/|', + 'surrogate-pair': 'I \u{D83D}\u{DE03} ️Dart!', + 'key-\u{D83D}\u{DD11}': 'Look\u{D83D}\u{DE03}\u{D83C}\u{DF89}surprise!', + }, """ unicode: "Sosa did fine.\\u263A \\U0001F680" control: "\\b1998\\t1999\\t2000\\n" hex esc: "\\x0d\\x0a is \\r\\n" @@ -582,61 +509,56 @@ void main() { tie-fighter: '|\\-*-/|' surrogate-pair: I \u{D83D}\u{DE03} ️Dart! - key-\u{D83D}\u{DD11}: Look\u{D83D}\u{DE03}\u{D83C}\u{DF89}surprise!""", - ); + key-\u{D83D}\u{DD11}: Look\u{D83D}\u{DE03}\u{D83C}\u{DF89}surprise!"""); }); test('[Example 2.18]', () { - expectYamlLoads( - { - 'plain': 'This unquoted scalar spans many lines.', - 'quoted': 'So does this quoted scalar.\n', - }, - ''' + expectYamlLoads({ + 'plain': 'This unquoted scalar spans many lines.', + 'quoted': 'So does this quoted scalar.\n' + }, ''' plain: This unquoted scalar spans many lines. quoted: "So does this - quoted scalar.\\n"''', - ); + quoted scalar.\\n"'''); }); }); group('2.4: Tags', () { test('[Example 2.19]', () { - expectYamlLoads( - {'canonical': 12345, 'decimal': 12345, 'octal': 12, 'hexadecimal': 12}, - ''' + expectYamlLoads({ + 'canonical': 12345, + 'decimal': 12345, + 'octal': 12, + 'hexadecimal': 12 + }, ''' canonical: 12345 decimal: +12345 octal: 0o14 - hexadecimal: 0xC''', - ); + hexadecimal: 0xC'''); }); test('[Example 2.20]', () { - expectYamlLoads( - { - 'canonical': 1230.15, - 'exponential': 1230.15, - 'fixed': 1230.15, - 'negative infinity': -infinity, - 'not a number': nan, - }, - ''' + expectYamlLoads({ + 'canonical': 1230.15, + 'exponential': 1230.15, + 'fixed': 1230.15, + 'negative infinity': -infinity, + 'not a number': nan + }, ''' canonical: 1.23015e+3 exponential: 12.3015e+02 fixed: 1230.15 negative infinity: -.inf - not a number: .NaN''', - ); + not a number: .NaN'''); }); test('[Example 2.21]', () { var doc = deepEqualsMap({ 'booleans': [true, false], - 'string': '012345', + 'string': '012345' }); doc[null] = null; expectYamlLoads(doc, """ @@ -654,33 +576,31 @@ void main() { // doesn't plan to support. test('[Example 2.28]', () { - expectYamlStreamLoads( - [ - { - 'Time': '2001-11-23 15:01:42 -5', - 'User': 'ed', - 'Warning': 'This is an error message for the log file', - }, - { - 'Time': '2001-11-23 15:02:31 -5', - 'User': 'ed', - 'Warning': 'A slightly different error message.', - }, - { - 'DateTime': '2001-11-23 15:03:17 -5', - 'User': 'ed', - 'Fatal': 'Unknown variable "bar"', - 'Stack': [ - { - 'file': 'TopClass.py', - 'line': 23, - 'code': 'x = MoreObject("345\\n")\n', - }, - {'file': 'MoreClass.py', 'line': 58, 'code': 'foo = bar'}, - ], - }, - ], - ''' + expectYamlStreamLoads([ + { + 'Time': '2001-11-23 15:01:42 -5', + 'User': 'ed', + 'Warning': 'This is an error message for the log file' + }, + { + 'Time': '2001-11-23 15:02:31 -5', + 'User': 'ed', + 'Warning': 'A slightly different error message.' + }, + { + 'DateTime': '2001-11-23 15:03:17 -5', + 'User': 'ed', + 'Fatal': 'Unknown variable "bar"', + 'Stack': [ + { + 'file': 'TopClass.py', + 'line': 23, + 'code': 'x = MoreObject("345\\n")\n' + }, + {'file': 'MoreClass.py', 'line': 58, 'code': 'foo = bar'} + ] + } + ], ''' --- Time: 2001-11-23 15:01:42 -5 User: ed @@ -706,8 +626,7 @@ void main() { - file: MoreClass.py line: 58 code: |- - foo = bar''', - ); + foo = bar'''); }); }); @@ -718,18 +637,14 @@ void main() { group('5.1: Character Set', () { void expectAllowsCharacter(int charCode) { var char = String.fromCharCodes([charCode]); - expectYamlLoads( - 'The character "$char" is allowed', - 'The character "$char" is allowed', - ); + expectYamlLoads('The character "$char" is allowed', + 'The character "$char" is allowed'); } void expectAllowsQuotedCharacter(int charCode) { var char = String.fromCharCodes([charCode]); - expectYamlLoads( - "The character '$char' is allowed", - '"The character \'$char\' is allowed"', - ); + expectYamlLoads("The character '$char' is allowed", + '"The character \'$char\' is allowed"'); } void expectDisallowsCharacter(int charCode) { @@ -776,32 +691,26 @@ void main() { }); test('[Example 5.3]', () { - expectYamlLoads( - { - 'sequence': ['one', 'two'], - 'mapping': {'sky': 'blue', 'sea': 'green'}, - }, - ''' + expectYamlLoads({ + 'sequence': ['one', 'two'], + 'mapping': {'sky': 'blue', 'sea': 'green'} + }, ''' sequence: - one - two mapping: ? sky : blue - sea : green''', - ); + sea : green'''); }); test('[Example 5.4]', () { - expectYamlLoads( - { - 'sequence': ['one', 'two'], - 'mapping': {'sky': 'blue', 'sea': 'green'}, - }, - ''' + expectYamlLoads({ + 'sequence': ['one', 'two'], + 'mapping': {'sky': 'blue', 'sea': 'green'} + }, ''' sequence: [ one, two, ] - mapping: { sky: blue, sea: green }''', - ); + mapping: { sky: blue, sea: green }'''); }); test('[Example 5.5]', () => expectYamlLoads(null, '# Comment only.')); @@ -809,27 +718,21 @@ void main() { // Skipping 5.6 because it uses an undefined tag. test('[Example 5.7]', () { - expectYamlLoads( - {'literal': 'some\ntext\n', 'folded': 'some text\n'}, - ''' + expectYamlLoads({'literal': 'some\ntext\n', 'folded': 'some text\n'}, ''' literal: | some text folded: > some text - ''', - ); + '''); }); test('[Example 5.8]', () { - expectYamlLoads( - {'single': 'text', 'double': 'text'}, - ''' + expectYamlLoads({'single': 'text', 'double': 'text'}, ''' single: 'text' double: "text" - ''', - ); + '''); }); test('[Example 5.9]', () { @@ -859,65 +762,55 @@ void main() { group('in a scalar context must be normalized', () { test( - 'from \\r to \\n', - () => - expectYamlLoads(['foo\nbar\n'], indentLiteral('- |\n foo\r bar')), - ); + 'from \\r to \\n', + () => expectYamlLoads( + ['foo\nbar\n'], indentLiteral('- |\n foo\r bar'))); test( - 'from \\r\\n to \\n', - () => expectYamlLoads([ - 'foo\nbar\n', - ], indentLiteral('- |\n foo\r\n bar')), - ); + 'from \\r\\n to \\n', + () => expectYamlLoads( + ['foo\nbar\n'], indentLiteral('- |\n foo\r\n bar'))); }); test('[Example 5.11]', () { - expectYamlLoads( - cleanUpLiteral(''' + expectYamlLoads(cleanUpLiteral(''' Line break (no glyph) - Line break (glyphed)\n'''), - ''' + Line break (glyphed)\n'''), ''' | Line break (no glyph) - Line break (glyphed)''', - ); + Line break (glyphed)'''); }); }); group('5.5: White Space Characters', () { test('[Example 5.12]', () { - expectYamlLoads( - { - 'quoted': 'Quoted \t', - 'block': 'void main() {\n\tprintf("Hello, world!\\n");\n}\n', - }, - ''' + expectYamlLoads({ + 'quoted': 'Quoted \t', + 'block': 'void main() {\n\tprintf("Hello, world!\\n");\n}\n' + }, ''' # Tabs and spaces quoted: "Quoted \t" block:\t| void main() { \tprintf("Hello, world!\\n"); } - ''', - ); + '''); }); }); group('5.7: Escaped Characters', () { test('[Example 5.13]', () { expectYamlLoads( - 'Fun with \x5C ' - '\x22 \x07 \x08 \x1B \x0C ' - '\x0A \x0D \x09 \x0B \x00 ' - '\x20 \xA0 \x85 \u2028 \u2029 ' - 'A A A', - ''' + 'Fun with \x5C ' + '\x22 \x07 \x08 \x1B \x0C ' + '\x0A \x0D \x09 \x0B \x00 ' + '\x20 \xA0 \x85 \u2028 \u2029 ' + 'A A A', + ''' "Fun with \\\\ \\" \\a \\b \\e \\f \\ \\n \\r \\t \\v \\0 \\ \\ \\_ \\N \\L \\P \\ - \\x41 \\u0041 \\U00000041"''', - ); + \\x41 \\u0041 \\U00000041"'''); }); test('[Example 5.14]', () { @@ -943,28 +836,23 @@ void main() { }); test('may be different for the children of sibling nodes', () { - expectYamlLoads( - [ - ['foo'], - ['bar'], - ], - ''' + expectYamlLoads([ + ['foo'], + ['bar'] + ], ''' - - foo - - - bar''', - ); + - bar'''); }); test('[Example 6.1]', () { - expectYamlLoads( - { - 'Not indented': { - 'By one space': 'By four\n spaces\n', - 'Flow style': ['By two', 'Also by two', 'Still by two'], - }, - }, - ''' + expectYamlLoads({ + 'Not indented': { + 'By one space': 'By four\n spaces\n', + 'Flow style': ['By two', 'Also by two', 'Still by two'] + } + }, ''' # Leading comment line spaces are # neither content nor indentation. @@ -976,51 +864,42 @@ void main() { By two, # in flow style Also by two, # are neither \tStill by two # content nor - ] # indentation.''', - ); + ] # indentation.'''); }); test('[Example 6.2]', () { - expectYamlLoads( - { - 'a': [ - 'b', - ['c', 'd'], - ], - }, - ''' + expectYamlLoads({ + 'a': [ + 'b', + ['c', 'd'] + ] + }, ''' ? a : -\tb - -\tc - - d''', - ); + - d'''); }); }); group('6.2: Separation Spaces', () { test('[Example 6.3]', () { - expectYamlLoads( - [ - {'foo': 'bar'}, - ['baz', 'baz'], - ], - ''' + expectYamlLoads([ + {'foo': 'bar'}, + ['baz', 'baz'] + ], ''' - foo:\t bar - - baz - -\tbaz''', - ); + -\tbaz'''); }); }); group('6.3: Line Prefixes', () { test('[Example 6.4]', () { - expectYamlLoads( - { - 'plain': 'text lines', - 'quoted': 'text lines', - 'block': 'text\n \tlines\n', - }, - ''' + expectYamlLoads({ + 'plain': 'text lines', + 'quoted': 'text lines', + 'block': 'text\n \tlines\n' + }, ''' plain: text lines quoted: "text @@ -1028,27 +907,23 @@ void main() { block: | text \tlines - ''', - ); + '''); }); }); group('6.4: Empty Lines', () { test('[Example 6.5]', () { - expectYamlLoads( - { - 'Folding': 'Empty line\nas a line feed', - 'Chomping': 'Clipped empty lines\n', - }, - ''' + expectYamlLoads({ + 'Folding': 'Empty line\nas a line feed', + 'Chomping': 'Clipped empty lines\n', + }, ''' Folding: "Empty line \t as a line feed" Chomping: | Clipped empty lines - ''', - ); + '''); }); }); @@ -1096,72 +971,54 @@ void main() { }); test('[Example 6.9]', () { - expectYamlLoads( - {'key': 'value'}, - ''' + expectYamlLoads({'key': 'value'}, ''' key: # Comment - value''', - ); + value'''); }); group('outside of scalar content', () { test('may appear on a line of their own', () { - expectYamlLoads( - [1, 2], - ''' + expectYamlLoads([1, 2], ''' - 1 # Comment - - 2''', - ); + - 2'''); }); test('are independent of indentation level', () { - expectYamlLoads( - [ - [1, 2], - ], - ''' + expectYamlLoads([ + [1, 2] + ], ''' - - 1 # Comment - - 2''', - ); + - 2'''); }); test('include lines containing only white space characters', () { - expectYamlLoads( - [1, 2], - ''' + expectYamlLoads([1, 2], ''' - 1 \t - - 2''', - ); + - 2'''); }); }); group('within scalar content', () { test('may not appear on a line of their own', () { - expectYamlLoads( - ['foo\n# not comment\nbar\n'], - ''' + expectYamlLoads(['foo\n# not comment\nbar\n'], ''' - | foo # not comment bar - ''', - ); + '''); }); test("don't include lines containing only white space characters", () { - expectYamlLoads( - ['foo\n \t \nbar\n'], - ''' + expectYamlLoads(['foo\n \t \nbar\n'], ''' - | foo \t bar - ''', - ); + '''); }); }); @@ -1173,26 +1030,20 @@ void main() { }); test('[Example 6.11]', () { - expectYamlLoads( - {'key': 'value'}, - ''' + expectYamlLoads({'key': 'value'}, ''' key: # Comment # lines value - ''', - ); + '''); }); group('ending a block scalar header', () { test('may not be followed by additional comment lines', () { - expectYamlLoads( - ['# not comment\nfoo\n'], - ''' + expectYamlLoads(['# not comment\nfoo\n'], ''' - | # comment # not comment foo - ''', - ); + '''); }); }); }); @@ -1219,18 +1070,24 @@ void main() { group('6.8: Directives', () { test('[Example 6.13]', () { - expectYamlLoadsWithWarning('foo', ''' + expectYamlLoadsWithWarning( + 'foo', + ''' %FOO bar baz # Should be ignored # with a warning. - --- "foo"''', 'unknown directive.'); + --- "foo"''', + 'unknown directive.'); }); test('[Example 6.14]', () { - expectYamlLoadsWithWarning('foo', ''' + expectYamlLoadsWithWarning( + 'foo', + ''' %YAML 1.3 # Attempt parsing # with a warning --- - "foo"''', 'this parser only supports YAML 1.1 and 1.2.'); + "foo"''', + 'this parser only supports YAML 1.1 and 1.2.'); }); test('[Example 6.15]', () { @@ -1260,22 +1117,16 @@ void main() { group('6.9: Node Properties', () { test('may be specified in any order', () { - expectYamlLoads( - ['foo', 'bar'], - ''' + expectYamlLoads(['foo', 'bar'], ''' - !!str &a1 foo - - &a2 !!str bar''', - ); + - &a2 !!str bar'''); }); test('[Example 6.23]', () { - expectYamlLoads( - {'foo': 'bar', 'baz': 'foo'}, - ''' + expectYamlLoads({'foo': 'bar', 'baz': 'foo'}, ''' !!str &a1 "foo": !!str bar - &a2 baz : *a1''', - ); + &a2 baz : *a1'''); }); // Example 6.24 tests custom tag URIs, which this implementation currently @@ -1290,83 +1141,78 @@ void main() { // currently doesn't plan to support. test('[Example 6.28]', () { - expectYamlLoads( - ['12', 12, '12'], - ''' + expectYamlLoads(['12', 12, '12'], ''' # Assuming conventional resolution: - "12" - 12 - - ! 12''', - ); + - ! 12'''); }); test('[Example 6.29]', () { expectYamlLoads( - {'First occurrence': 'Value', 'Second occurrence': 'Value'}, - ''' + {'First occurrence': 'Value', 'Second occurrence': 'Value'}, ''' First occurrence: &anchor Value - Second occurrence: *anchor''', - ); + Second occurrence: *anchor'''); }); - test( - 'rejects malformed percent-encoding in tag URIs with YamlException', - () { - for (var input in [ - '!<%> foo', - '!a!% foo', - '%TAG ! tag:%\n---\n!foo bar', - '!% foo', - '!<%GG> foo', - ]) { - expect(() => loadYaml(input), throwsYamlException); - expect(() => loadYamlNode(input), throwsYamlException); - } - }, - ); + test('rejects malformed percent-encoding in tag URIs with YamlException', + () { + for (var input in [ + '!<%> foo', + '!a!% foo', + '%TAG ! tag:%\n---\n!foo bar', + '!% foo', + '!<%GG> foo', + ]) { + expect(() => loadYaml(input), throwsYamlException); + expect(() => loadYamlNode(input), throwsYamlException); + } + }); test( - 'rejects invalid UTF-8 percent-encoding in tag URIs with YamlException', - () { - for (var input in ['!<%C3%28> foo', '!%C3%28 foo']) { - expect(() => loadYaml(input), throwsYamlException); - expect(() => loadYamlNode(input), throwsYamlException); - } - }, - ); + 'rejects invalid UTF-8 percent-encoding in tag URIs with YamlException', + () { + for (var input in [ + '!<%C3%28> foo', + '!%C3%28 foo', + ]) { + expect(() => loadYaml(input), throwsYamlException); + expect(() => loadYamlNode(input), throwsYamlException); + } + }); test('rejects undefined local tags with YamlException', () { - for (var input in ['!custom 123', '! 123']) { + for (var input in [ + '!custom 123', + '! 123', + ]) { expect(() => loadYaml(input), throwsYamlException); expect(() => loadYamlNode(input), throwsYamlException); } // When %TAG ! is mapped to the standard YAML tag prefix, shorthand !str // and !int tags resolve through the primary handle. - expectYamlLoads( - ['12', 12], - ''' + expectYamlLoads(['12', 12], ''' %TAG ! tag:yaml.org,2002: --- - !str 12 - - !int "12"''', - ); + - !int "12"'''); }); test('handles block sequence, simple key, and CRLF edge cases cleanly', () { - for (var input in ['- :?\t-\r:', 'a: "\r\n:']) { + for (var input in [ + '- :?\t-\r:', + 'a: "\r\n:', + ]) { expect(() => loadYaml(input), throwsYamlException); expect(() => loadYamlNode(input), throwsYamlException); } expect( - loadYaml('?\r-'), - deepEquals( - deepEqualsMap({ - [null]: null, - }), - ), - ); + loadYaml('?\r-'), + deepEquals(deepEqualsMap({ + [null]: null + }))); expect(loadYamlNode('?\r-'), isA()); expect(loadYaml('-\n...'), equals([null])); expect(loadYamlNode('-\n...'), isA()); @@ -1388,94 +1234,68 @@ void main() { }); group('must not specify', () { - test( - 'tag properties', - () => expectYamlFails(''' + test('tag properties', () => expectYamlFails(''' - &anchor foo - - !str *anchor'''), - ); + - !str *anchor''')); - test( - 'anchor properties', - () => expectYamlFails(''' + test('anchor properties', () => expectYamlFails(''' - &anchor foo - - &anchor2 *anchor'''), - ); + - &anchor2 *anchor''')); - test( - 'content', - () => expectYamlFails(''' + test('content', () => expectYamlFails(''' - &anchor foo - - *anchor bar'''), - ); + - *anchor bar''')); }); test('must preserve structural equality', () { - var doc = loadYaml( - cleanUpLiteral(''' + var doc = loadYaml(cleanUpLiteral(''' anchor: &anchor [a, b, c] - alias: *anchor'''), - ); + alias: *anchor''')); var anchorList = doc['anchor']; var aliasList = doc['alias']; expect(anchorList, same(aliasList)); - doc = loadYaml( - cleanUpLiteral(''' + doc = loadYaml(cleanUpLiteral(''' ? &anchor [a, b, c] : ? *anchor - : bar'''), - ); + : bar''')); anchorList = doc.keys.first; aliasList = doc[['a', 'b', 'c']].keys.first; expect(anchorList, same(aliasList)); }); test('self-referential list throws FormatException', () { - expect( - () => loadYaml( - cleanUpLiteral(''' + expect(() => loadYaml(cleanUpLiteral(''' ? &anchor [*anchor] - : value'''), - ), - throwsA(isA()), - ); + : value''')), throwsA(isA())); }); test('self-referential map throws FormatException', () { - expect( - () => loadYaml('&map { *map : *map }'), - throwsA(isA()), - ); + expect(() => loadYaml('&map { *map : *map }'), + throwsA(isA())); }); test('[Example 7.1]', () { - expectYamlLoads( - { - 'First occurrence': 'Foo', - 'Second occurrence': 'Foo', - 'Override anchor': 'Bar', - 'Reuse anchor': 'Bar', - }, - ''' + expectYamlLoads({ + 'First occurrence': 'Foo', + 'Second occurrence': 'Foo', + 'Override anchor': 'Bar', + 'Reuse anchor': 'Bar', + }, ''' First occurrence: &anchor Foo Second occurrence: *anchor Override anchor: &anchor Bar - Reuse anchor: *anchor''', - ); + Reuse anchor: *anchor'''); }); }); group('7.2: Empty Nodes', () { test('[Example 7.2]', () { - expectYamlLoads( - {'foo': '', '': 'bar'}, - ''' + expectYamlLoads({'foo': '', '': 'bar'}, ''' { foo : !!str, !!str : bar, - }''', - ); + }'''); }); test('[Example 7.3]', () { @@ -1491,29 +1311,24 @@ void main() { group('7.3: Flow Scalar Styles', () { test('[Example 7.4]', () { - expectYamlLoads( - { - 'implicit block key': [ - {'implicit flow key': 'value'}, - ], - }, - ''' + expectYamlLoads({ + 'implicit block key': [ + {'implicit flow key': 'value'} + ] + }, ''' "implicit block key" : [ "implicit flow key" : value, - ]''', - ); + ]'''); }); test('[Example 7.5]', () { expectYamlLoads( - 'folded to a space,\nto a line feed, or \t \tnon-content', - ''' + 'folded to a space,\nto a line feed, or \t \tnon-content', ''' "folded to a space,\t to a line feed, or \t\\ - \\ \tnon-content"''', - ); + \\ \tnon-content"'''); }); test('[Example 7.6]', () { @@ -1529,17 +1344,14 @@ void main() { }); test('[Example 7.8]', () { - expectYamlLoads( - { - 'implicit block key': [ - {'implicit flow key': 'value'}, - ], - }, - """ + expectYamlLoads({ + 'implicit block key': [ + {'implicit flow key': 'value'} + ] + }, """ 'implicit block key' : [ 'implicit flow key' : value, - ]""", - ); + ]"""); }); test('[Example 7.9]', () { @@ -1551,22 +1363,20 @@ void main() { }); test('[Example 7.10]', () { - expectYamlLoads( + expectYamlLoads([ + '::vector', + ': - ()', + 'Up, up, and away!', + -123, + 'http://example.com/foo#bar', [ '::vector', ': - ()', 'Up, up, and away!', -123, - 'http://example.com/foo#bar', - [ - '::vector', - ': - ()', - 'Up, up, and away!', - -123, - 'http://example.com/foo#bar', - ], - ], - ''' + 'http://example.com/foo#bar' + ] + ], ''' # Outside flow collection: - ::vector - ": - ()" @@ -1578,22 +1388,18 @@ void main() { ": - ()", "Up, up, and away!", -123, - http://example.com/foo#bar ]''', - ); + http://example.com/foo#bar ]'''); }); test('[Example 7.11]', () { - expectYamlLoads( - { - 'implicit block key': [ - {'implicit flow key': 'value'}, - ], - }, - ''' + expectYamlLoads({ + 'implicit block key': [ + {'implicit flow key': 'value'} + ] + }, ''' implicit block key : [ implicit flow key : value, - ]''', - ); + ]'''); }); test('[Example 7.12]', () { @@ -1607,27 +1413,22 @@ void main() { group('7.4: Flow Collection Styles', () { test('[Example 7.13]', () { - expectYamlLoads( - [ - ['one', 'two'], - ['three', 'four'], - ], - ''' + expectYamlLoads([ + ['one', 'two'], + ['three', 'four'] + ], ''' - [ one, two, ] - - [three ,four]''', - ); + - [three ,four]'''); }); test('[Example 7.14]', () { - expectYamlLoads( - [ - 'double quoted', - 'single quoted', - 'plain text', - ['nested'], - {'single': 'pair'}, - ], - """ + expectYamlLoads([ + 'double quoted', + 'single quoted', + 'plain text', + ['nested'], + {'single': 'pair'} + ], """ [ "double quoted", 'single @@ -1635,20 +1436,16 @@ void main() { plain text, [ nested ], single: pair, - ]""", - ); + ]"""); }); test('[Example 7.15]', () { - expectYamlLoads( - [ - {'one': 'two', 'three': 'four'}, - {'five': 'six', 'seven': 'eight'}, - ], - ''' + expectYamlLoads([ + {'one': 'two', 'three': 'four'}, + {'five': 'six', 'seven': 'eight'}, + ], ''' - { one : two , three: four , } - - {five: six,seven : eight}''', - ); + - {five: six,seven : eight}'''); }); test('[Example 7.16]', () { @@ -1666,7 +1463,7 @@ void main() { var doc = deepEqualsMap({ 'unquoted': 'separate', 'http://foo.com': null, - 'omitted value': null, + 'omitted value': null }); doc[null] = 'omitted key'; expectYamlLoads(doc, ''' @@ -1680,39 +1477,31 @@ void main() { test('[Example 7.18]', () { expectYamlLoads( - {'adjacent': 'value', 'readable': 'value', 'empty': null}, - ''' + {'adjacent': 'value', 'readable': 'value', 'empty': null}, ''' { "adjacent":value, "readable": value, "empty": - }''', - ); + }'''); }); test('[Example 7.19]', () { - expectYamlLoads( - [ - {'foo': 'bar'}, - ], - ''' + expectYamlLoads([ + {'foo': 'bar'} + ], ''' [ foo: bar - ]''', - ); + ]'''); }); test('[Example 7.20]', () { - expectYamlLoads( - [ - {'foo bar': 'baz'}, - ], - ''' + expectYamlLoads([ + {'foo bar': 'baz'} + ], ''' [ ? foo bar : baz - ]''', - ); + ]'''); }); test('[Example 7.21]', () { @@ -1722,19 +1511,16 @@ void main() { var el2 = deepEqualsMap(); el2[{'JSON': 'like'}] = 'adjacent'; - expectYamlLoads( + expectYamlLoads([ [ - [ - {'YAML': 'separate'}, - ], - [el1], - [el2], + {'YAML': 'separate'} ], - ''' + [el1], + [el2] + ], ''' - [ YAML : separate ] - [ : empty key entry ] - - [ {JSON: like}:adjacent ]''', - ); + - [ {JSON: like}:adjacent ]'''); }); // TODO(nweiz): enable this when we throw an error for long or multiline @@ -1753,42 +1539,34 @@ void main() { group('7.5: Flow Nodes', () { test('[Example 7.23]', () { - expectYamlLoads( - [ - ['a', 'b'], - {'a': 'b'}, - 'a', - 'b', - 'c', - ], - ''' + expectYamlLoads([ + ['a', 'b'], + {'a': 'b'}, + 'a', + 'b', + 'c' + ], ''' - [ a, b ] - { a: b } - 'a' - 'b' - - c''', - ); + - c'''); }); test('[Example 7.24]', () { - expectYamlLoads( - ['a', 'b', 'c', 'c', ''], - ''' + expectYamlLoads(['a', 'b', 'c', 'c', ''], ''' - !!str "a" - 'b' - &anchor "c" - *anchor - - !!str''', - ); + - !!str'''); }); }); // Chapter 8: Block Styles group('8.1: Block Scalar Styles', () { test('[Example 8.1]', () { - expectYamlLoads( - ['literal\n', ' folded\n', 'keep\n\n', ' strip'], - ''' + expectYamlLoads(['literal\n', ' folded\n', 'keep\n\n', ' strip'], ''' - | # Empty header literal - >1 # Indentation indicator @@ -1797,8 +1575,7 @@ void main() { keep - >1- # Both indicators - strip''', - ); + strip'''); }); test('[Example 8.2]', () { @@ -1807,8 +1584,8 @@ void main() { // confident that "\t\ndetected\n" is correct when parsed according to the // rest of the spec. expectYamlLoads( - ['detected\n', '\n\n# detected\n', ' explicit\n', '\t\ndetected\n'], - ''' + ['detected\n', '\n\n# detected\n', ' explicit\n', '\t\ndetected\n'], + ''' - | detected - > @@ -1820,8 +1597,7 @@ void main() { - > \t detected - ''', - ); + '''); }); test('[Example 8.3]', () { @@ -1841,17 +1617,14 @@ void main() { }); test('[Example 8.4]', () { - expectYamlLoads( - {'strip': 'text', 'clip': 'text\n', 'keep': 'text\n'}, - ''' + expectYamlLoads({'strip': 'text', 'clip': 'text\n', 'keep': 'text\n'}, ''' strip: |- text clip: | text keep: |+ text - ''', - ); + '''); }); test('[Example 8.5]', () { @@ -1859,8 +1632,7 @@ void main() { // value, but as far as I can tell that's not how it's supposed to be // parsed according to the rest of the spec. expectYamlLoads( - {'strip': '# text', 'clip': '# text\n', 'keep': '# text\n\n'}, - ''' + {'strip': '# text', 'clip': '# text\n', 'keep': '# text\n\n'}, ''' # Strip # Comments: strip: |- @@ -1880,22 +1652,18 @@ void main() { # Trail # comments. - ''', - ); + '''); }); test('[Example 8.6]', () { - expectYamlLoads( - {'strip': '', 'clip': '', 'keep': '\n'}, - ''' + expectYamlLoads({'strip': '', 'clip': '', 'keep': '\n'}, ''' strip: >- clip: > keep: |+ - ''', - ); + '''); }); test('[Example 8.7]', () { @@ -1928,8 +1696,7 @@ void main() { }); test('[Example 8.10]', () { - expectYamlLoads( - cleanUpLiteral(''' + expectYamlLoads(cleanUpLiteral(''' folded line next line @@ -1939,8 +1706,7 @@ void main() { * lines last line - '''), - ''' + '''), ''' > folded @@ -1956,8 +1722,7 @@ void main() { last line - # Comment''', - ); + # Comment'''); }); // Examples 8.11 through 8.13 are duplicates of 8.10. @@ -1965,68 +1730,56 @@ void main() { group('8.2: Block Collection Styles', () { test('[Example 8.14]', () { - expectYamlLoads( - { - 'block sequence': [ - 'one', - {'two': 'three'}, - ], - }, - ''' + expectYamlLoads({ + 'block sequence': [ + 'one', + {'two': 'three'} + ] + }, ''' block sequence: - one - - two : three''', - ); + - two : three'''); }); test('[Example 8.15]', () { - expectYamlLoads( - [ - null, - 'block node\n', - ['one', 'two'], - {'one': 'two'}, - ], - ''' + expectYamlLoads([ + null, + 'block node\n', + ['one', 'two'], + {'one': 'two'} + ], ''' - # Empty - | block node - - one # Compact - two # sequence - - one: two # Compact mapping''', - ); + - one: two # Compact mapping'''); }); test('[Example 8.16]', () { - expectYamlLoads( - { - 'block mapping': {'key': 'value'}, - }, - ''' + expectYamlLoads({ + 'block mapping': {'key': 'value'} + }, ''' block mapping: - key: value''', - ); + key: value'''); }); test('[Example 8.17]', () { - expectYamlLoads( - { - 'explicit key': null, - 'block key\n': ['one', 'two'], - }, - ''' + expectYamlLoads({ + 'explicit key': null, + 'block key\n': ['one', 'two'] + }, ''' ? explicit key # Empty value ? | block key : - one # Explicit compact - - two # block value''', - ); + - two # block value'''); }); test('[Example 8.18]', () { var doc = deepEqualsMap({ 'plain key': 'in-line value', - 'quoted key': ['entry'], + 'quoted key': ['entry'] }); doc[null] = null; expectYamlLoads(doc, ''' @@ -2039,67 +1792,55 @@ void main() { test('[Example 8.19]', () { var el = deepEqualsMap(); el[{'earth': 'blue'}] = {'moon': 'white'}; - expectYamlLoads( - [ - {'sun': 'yellow'}, - el, - ], - ''' + expectYamlLoads([ + {'sun': 'yellow'}, + el + ], ''' - sun: yellow - ? earth: blue - : moon: white''', - ); + : moon: white'''); }); test('[Example 8.20]', () { - expectYamlLoads( - [ - 'flow in block', - 'Block scalar\n', - {'foo': 'bar'}, - ], - ''' + expectYamlLoads([ + 'flow in block', + 'Block scalar\n', + {'foo': 'bar'} + ], ''' - "flow in block" - > Block scalar - !!map # Block collection - foo : bar''', - ); + foo : bar'''); }); test('[Example 8.21]', () { // The spec doesn't include a newline after "value" in the parsed map, but // the block scalar is clipped so it should be retained. - expectYamlLoads( - {'literal': 'value\n', 'folded': 'value\n'}, - ''' + expectYamlLoads({'literal': 'value\n', 'folded': 'value\n'}, ''' literal: |2 value folded: !!str >1 - value''', - ); + value'''); }); test('[Example 8.22]', () { - expectYamlLoads( - { - 'sequence': [ - 'entry', - ['nested'], - ], - 'mapping': {'foo': 'bar'}, - }, - ''' + expectYamlLoads({ + 'sequence': [ + 'entry', + ['nested'] + ], + 'mapping': {'foo': 'bar'} + }, ''' sequence: !!seq - entry - !!seq - nested mapping: !!map - foo: bar''', - ); + foo: bar'''); }); }); @@ -2125,8 +1866,7 @@ void main() { // indented the same amount, the text would be part of the literal, which // implies that the spec's parse of this document is incorrect. expectYamlStreamLoads( - ['Bare document', '%!PS-Adobe-2.0 # Not the first line\n'], - ''' + ['Bare document', '%!PS-Adobe-2.0 # Not the first line\n'], ''' Bare document ... @@ -2134,33 +1874,27 @@ void main() { ... | %!PS-Adobe-2.0 # Not the first line - ''', - ); + '''); }); test('[Example 9.4]', () { - expectYamlStreamLoads( - [ - {'matches %': 20}, - null, - ], - ''' + expectYamlStreamLoads([ + {'matches %': 20}, + null + ], ''' --- { matches % : 20 } ... --- # Empty - ...''', - ); + ...'''); }); test('[Example 9.5]', () { // The spec doesn't have a space between the second // "YAML" and "1.2", but this seems to be a typo. - expectYamlStreamLoads( - ['%!PS-Adobe-2.0\n', null], - ''' + expectYamlStreamLoads(['%!PS-Adobe-2.0\n', null], ''' %YAML 1.2 --- | %!PS-Adobe-2.0 @@ -2168,83 +1902,66 @@ void main() { %YAML 1.2 --- # Empty - ...''', - ); + ...'''); }); test('[Example 9.6]', () { - expectYamlStreamLoads( - [ - 'Document', - null, - {'matches %': 20}, - ], - ''' + expectYamlStreamLoads([ + 'Document', + null, + {'matches %': 20} + ], ''' Document --- # Empty ... %YAML 1.2 --- - matches %: 20''', - ); + matches %: 20'''); }); }); // Chapter 10: Recommended Schemas group('10.1: Failsafe Schema', () { test('[Example 10.1]', () { - expectYamlLoads( - { - 'Block style': { - 'Clark': 'Evans', - 'Ingy': 'döt Net', - 'Oren': 'Ben-Kiki', - }, - 'Flow style': { - 'Clark': 'Evans', - 'Ingy': 'döt Net', - 'Oren': 'Ben-Kiki', - }, + expectYamlLoads({ + 'Block style': { + 'Clark': 'Evans', + 'Ingy': 'döt Net', + 'Oren': 'Ben-Kiki' }, - ''' + 'Flow style': {'Clark': 'Evans', 'Ingy': 'döt Net', 'Oren': 'Ben-Kiki'} + }, ''' Block style: !!map Clark : Evans Ingy : döt Net Oren : Ben-Kiki - Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }''', - ); + Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }'''); }); test('[Example 10.2]', () { - expectYamlLoads( - { - 'Block style': ['Clark Evans', 'Ingy döt Net', 'Oren Ben-Kiki'], - 'Flow style': ['Clark Evans', 'Ingy döt Net', 'Oren Ben-Kiki'], - }, - ''' + expectYamlLoads({ + 'Block style': ['Clark Evans', 'Ingy döt Net', 'Oren Ben-Kiki'], + 'Flow style': ['Clark Evans', 'Ingy döt Net', 'Oren Ben-Kiki'] + }, ''' Block style: !!seq - Clark Evans - Ingy döt Net - Oren Ben-Kiki - Flow style: !!seq [ Clark Evans, Ingy döt Net, Oren Ben-Kiki ]''', - ); + Flow style: !!seq [ Clark Evans, Ingy döt Net, Oren Ben-Kiki ]'''); }); test('[Example 10.3]', () { - expectYamlLoads( - { - 'Block style': 'String: just a theory.', - 'Flow style': 'String: just a theory.', - }, - ''' + expectYamlLoads({ + 'Block style': 'String: just a theory.', + 'Flow style': 'String: just a theory.' + }, ''' Block style: !!str |- String: just a theory. - Flow style: !!str "String: just a theory."''', - ); + Flow style: !!str "String: just a theory."'''); }); }); @@ -2252,55 +1969,43 @@ void main() { test('[Example 10.4]', () { var doc = deepEqualsMap({'key with null value': null}); doc[null] = 'value for null key'; - expectYamlStreamLoads( - [doc], - ''' + expectYamlStreamLoads([doc], ''' !!null null: value for null key - key with null value: !!null null''', - ); + key with null value: !!null null'''); }); test('[Example 10.5]', () { - expectYamlStreamLoads( - [ - {'YAML is a superset of JSON': true, 'Pluto is a planet': false}, - ], - ''' + expectYamlStreamLoads([ + {'YAML is a superset of JSON': true, 'Pluto is a planet': false} + ], ''' YAML is a superset of JSON: !!bool true - Pluto is a planet: !!bool false''', - ); + Pluto is a planet: !!bool false'''); }); test('[Example 10.6]', () { - expectYamlStreamLoads( - [ - {'negative': -12, 'zero': 0, 'positive': 34}, - ], - ''' + expectYamlStreamLoads([ + {'negative': -12, 'zero': 0, 'positive': 34} + ], ''' negative: !!int -12 zero: !!int 0 - positive: !!int 34''', - ); + positive: !!int 34'''); }); test('[Example 10.7]', () { - expectYamlStreamLoads( - [ - { - 'negative': -1, - 'zero': 0, - 'positive': 23000, - 'infinity': infinity, - 'not a number': nan, - }, - ], - ''' + expectYamlStreamLoads([ + { + 'negative': -1, + 'zero': 0, + 'positive': 23000, + 'infinity': infinity, + 'not a number': nan + } + ], ''' negative: !!float -1 zero: !!float 0 positive: !!float 2.3e4 infinity: !!float .inf - not a number: !!float .nan''', - ); + not a number: !!float .nan'''); }); test('rejects empty and invalid 1-character !!int and !!float scalars', () { @@ -2320,58 +2025,56 @@ void main() { } }); - test('rejects unseparated content after a multiline quoted scalar at block ' + test( + 'rejects unseparated content after a multiline quoted scalar at block ' 'indent', () { - for (var input in [' a: "\n"b', " a: '\n'b"]) { + for (var input in [ + ' a: "\n"b', + " a: '\n'b", + ]) { expect(() => loadYaml(input), throwsYamlException); expect(() => loadYamlNode(input), throwsYamlException); } }); test('[Example 10.8]', () { - expectYamlStreamLoads( - [ - { - 'A null': null, - 'Booleans': [true, false], - 'Integers': [0, -0, 3, -19], - 'Floats': [0, 0, 12000, -200000], - // Despite being invalid in the JSON schema, these values are valid in - // the core schema which this implementation supports. - 'Invalid': [true, null, 7, 0x3A, 12.3], - }, - ], - ''' + expectYamlStreamLoads([ + { + 'A null': null, + 'Booleans': [true, false], + 'Integers': [0, -0, 3, -19], + 'Floats': [0, 0, 12000, -200000], + // Despite being invalid in the JSON schema, these values are valid in + // the core schema which this implementation supports. + 'Invalid': [true, null, 7, 0x3A, 12.3] + } + ], ''' A null: null Booleans: [ true, false ] Integers: [ 0, -0, 3, -19 ] Floats: [ 0., -0.0, 12e03, -2E+05 ] - Invalid: [ True, Null, 0o7, 0x3A, +12.3 ]''', - ); + Invalid: [ True, Null, 0o7, 0x3A, +12.3 ]'''); }); }); group('10.3: Core Schema', () { test('[Example 10.9]', () { - expectYamlLoads( - { - 'A null': null, - 'Also a null': null, - 'Not a null': '', - 'Booleans': [true, true, false, false], - 'Integers': [0, 7, 0x3A, -19], - 'Floats': [0, 0, 0.5, 12000, -200000], - 'Also floats': [infinity, -infinity, infinity, nan], - }, - ''' + expectYamlLoads({ + 'A null': null, + 'Also a null': null, + 'Not a null': '', + 'Booleans': [true, true, false, false], + 'Integers': [0, 7, 0x3A, -19], + 'Floats': [0, 0, 0.5, 12000, -200000], + 'Also floats': [infinity, -infinity, infinity, nan] + }, ''' A null: null Also a null: # Empty Not a null: "" Booleans: [ true, True, false, FALSE ] Integers: [ 0, 0o7, 0x3A, -19 ] Floats: [ 0., -0.0, .5, +12e03, -2E+05 ] - Also floats: [ .inf, -.Inf, +.INF, .NAN ]''', - ); + Also floats: [ .inf, -.Inf, +.INF, .NAN ]'''); }); }); @@ -2383,10 +2086,8 @@ void main() { expect(loadYaml(yaml).keys.toList(), permutation); sanityCheckCount++; } - final expectedPermutationCount = List.generate( - keys.length, - (i) => i + 1, - ).reduce((n, i) => n * i); + final expectedPermutationCount = + List.generate(keys.length, (i) => i + 1).reduce((n, i) => n * i); expect(sanityCheckCount, expectedPermutationCount); }); } From 45157252f8ae28789114219f942f59384f297e2a Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 19 Oct 2026 18:06:01 +0000 Subject: [PATCH 4/4] Use Map? for platforms --- pkgs/pubspec_parse/lib/src/pubspec.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/pubspec_parse/lib/src/pubspec.dart b/pkgs/pubspec_parse/lib/src/pubspec.dart index 1b77c33260..1db2e1b480 100644 --- a/pkgs/pubspec_parse/lib/src/pubspec.dart +++ b/pkgs/pubspec_parse/lib/src/pubspec.dart @@ -105,7 +105,7 @@ class Pubspec { /// `web` and `windows`. Values are currently always `null`. /// /// See https://dart.dev/tools/pub/pubspec#platforms. - final Map? platforms; + final Map? platforms; /// If [author] and [authors] are both provided, their values are combined /// with duplicates eliminated.