diff --git a/example/pubspec.lock b/example/pubspec.lock index 33457546..95f98153 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: "direct main" description: @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" url: "https://pub.dev" source: hosted - version: "1.6.3" + version: "1.7.2" crypto: dependency: transitive description: @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -199,6 +199,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" logging: dependency: transitive description: @@ -211,26 +235,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -259,18 +283,18 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" pool: dependency: transitive description: @@ -283,10 +307,10 @@ packages: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "5.0.2" pub_semver: dependency: transitive description: @@ -360,18 +384,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -400,26 +424,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.9" typed_data: dependency: transitive description: @@ -440,10 +464,10 @@ packages: dependency: transitive description: name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "11.7.1" + version: "13.0.0" watcher: dependency: transitive description: @@ -452,14 +476,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -479,10 +495,10 @@ packages: dependency: transitive description: name: webdriver - sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" webkit_inspection_protocol: dependency: transitive description: @@ -500,5 +516,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.0.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index cb324fc7..a4c9f5d7 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -20,8 +20,8 @@ description: Demonstrates how to use the webcrypto plugin. publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: '>=2.17.0 <3.0.0' - flutter: '>=3.0.0' + sdk: '>=3.3.0 <4.0.0' + flutter: '>=3.19.0' dependencies: flutter: diff --git a/lib/src/testing/utils/testrunner.dart b/lib/src/testing/utils/testrunner.dart index 0480f713..6aed509a 100644 --- a/lib/src/testing/utils/testrunner.dart +++ b/lib/src/testing/utils/testrunner.dart @@ -809,7 +809,7 @@ void _runTests( signature = c.signature; } else { test('create signature', () async { - signature = await r._signBytes!( + signature = await r._signBytes( privateKey as PrivateKey, c.plaintext!, c.signVerifyParams!, @@ -838,7 +838,7 @@ void _runTests( ciphertext = c.ciphertext!; } else { test('create ciphertext', () async { - ciphertext = await r._encryptBytes!( + ciphertext = await r._encryptBytes( publicKey as PublicKey, c.plaintext!, c.encryptDecryptParams!, @@ -866,7 +866,7 @@ void _runTests( derivedBits = c.derivedBits!; } else { test('create derivedBits', () async { - derivedBits = await r._deriveBits!( + derivedBits = await r._deriveBits( _KeyPair( privateKey: privateKey as PrivateKey, publicKey: publicKey as PublicKey), @@ -877,7 +877,7 @@ void _runTests( } test('validated derivedBits', () async { - final derived = await r._deriveBits!( + final derived = await r._deriveBits( _KeyPair( privateKey: privateKey as PrivateKey, publicKey: publicKey as PublicKey), @@ -901,7 +901,7 @@ void _runTests( 'failed to verify signature', ); check( - !await r._verifyBytes!( + !await r._verifyBytes( key, flipFirstBits(sig), c.plaintext!, @@ -911,7 +911,7 @@ void _runTests( ); if (c.plaintext!.isNotEmpty) { check( - !await r._verifyBytes!( + !await r._verifyBytes( key, sig, flipFirstBits(c.plaintext!), @@ -931,7 +931,7 @@ void _runTests( // If ciphertext is mangled some primitives like AES-GCM must throw // others may return garbled plaintext. try { - final invalidText = await r._decryptBytes!( + final invalidText = await r._decryptBytes( key, flipFirstBits(ctext), c.encryptDecryptParams!, @@ -974,7 +974,7 @@ void _runTests( await checkVerifyBytes(publicKey as PublicKey, signature); } if (r._encryptBytes != null) { - final ctext = await r._encryptBytes!( + final ctext = await r._encryptBytes( publicKey as PublicKey, c.plaintext!, c.encryptDecryptParams!, @@ -982,7 +982,7 @@ void _runTests( await checkCipherText(ctext); } if (r._deriveBits != null) { - final derived = await r._deriveBits!( + final derived = await r._deriveBits( _KeyPair( privateKey: privateKey as PrivateKey, publicKey: publicKey as PublicKey), @@ -997,7 +997,7 @@ void _runTests( Future checkPrivateKey(PrivateKey? privateKey) async { check(privateKey != null, 'privateKey is null'); if (r._signBytes != null) { - final sig = await r._signBytes!( + final sig = await r._signBytes( privateKey as PrivateKey, c.plaintext!, c.signVerifyParams!, @@ -1008,7 +1008,7 @@ void _runTests( await checkDecryptBytes(privateKey as PrivateKey, ciphertext!); } if (r._deriveBits != null) { - final derived = await r._deriveBits!( + final derived = await r._deriveBits( _KeyPair( privateKey: privateKey as PrivateKey, publicKey: publicKey as PublicKey), @@ -1093,7 +1093,7 @@ void _runTests( if (r._signBytes != null) { test('signBytes(plaintext)', () async { - final sig = await r._signBytes!( + final sig = await r._signBytes( privateKey as PrivateKey, c.plaintext!, c.signVerifyParams!, @@ -1104,7 +1104,7 @@ void _runTests( if (r._signStream != null) { test('signStream(plaintext)', () async { - final sig = await r._signStream!( + final sig = await r._signStream( privateKey as PrivateKey, Stream.value(c.plaintext!), c.signVerifyParams!, @@ -1113,7 +1113,7 @@ void _runTests( }); test('signStream(fibChunked(plaintext))', () async { - final sig = await r._signStream!( + final sig = await r._signStream( privateKey as PrivateKey, fibonacciChunkedStream(c.plaintext!), c.signVerifyParams!, @@ -1127,7 +1127,7 @@ void _runTests( if (r._verifyBytes != null) { test('verifyBytes(signature, plaintext)', () async { check( - await r._verifyBytes!( + await r._verifyBytes( publicKey as PublicKey, signature!, c.plaintext!, @@ -1137,7 +1137,7 @@ void _runTests( ); check( - !await r._verifyBytes!( + !await r._verifyBytes( publicKey as PublicKey, flipFirstBits(signature!), c.plaintext!, @@ -1148,7 +1148,7 @@ void _runTests( if (c.plaintext!.isNotEmpty) { check( - !await r._verifyBytes!( + !await r._verifyBytes( publicKey as PublicKey, signature!, flipFirstBits(c.plaintext!), @@ -1163,7 +1163,7 @@ void _runTests( if (r._verifyStream != null) { test('verifyStream(signature, Stream.value(plaintext))', () async { check( - await r._verifyStream!( + await r._verifyStream( publicKey as PublicKey, signature!, Stream.value(c.plaintext!), @@ -1173,7 +1173,7 @@ void _runTests( ); check( - !await r._verifyStream!( + !await r._verifyStream( publicKey as PublicKey, flipFirstBits(signature!), Stream.value(c.plaintext!), @@ -1184,7 +1184,7 @@ void _runTests( if (c.plaintext!.isNotEmpty) { check( - !await r._verifyStream!( + !await r._verifyStream( publicKey as PublicKey, signature!, Stream.value(flipFirstBits(c.plaintext!)), @@ -1197,7 +1197,7 @@ void _runTests( test('verifyStream(signature, fibChunkedStream(plaintext))', () async { check( - await r._verifyStream!( + await r._verifyStream( publicKey as PublicKey, signature!, fibonacciChunkedStream(c.plaintext!), @@ -1207,7 +1207,7 @@ void _runTests( ); check( - !await r._verifyStream!( + !await r._verifyStream( publicKey as PublicKey, flipFirstBits(signature!), fibonacciChunkedStream(c.plaintext!), @@ -1218,7 +1218,7 @@ void _runTests( if (c.plaintext!.isNotEmpty) { check( - !await r._verifyStream!( + !await r._verifyStream( publicKey as PublicKey, signature!, fibonacciChunkedStream(flipFirstBits(c.plaintext!)), @@ -1234,7 +1234,7 @@ void _runTests( if (r._encryptBytes != null) { test('encryptBytes(plaintext)', () async { - final ctext = await r._encryptBytes!( + final ctext = await r._encryptBytes( publicKey as PublicKey, c.plaintext!, c.encryptDecryptParams!, @@ -1245,7 +1245,7 @@ void _runTests( if (r._encryptStream != null) { test('encryptStream(plaintext)', () async { - final ctext = await bufferStream(r._encryptStream!( + final ctext = await bufferStream(r._encryptStream( publicKey as PublicKey, Stream.value(c.plaintext!), c.encryptDecryptParams!, @@ -1254,7 +1254,7 @@ void _runTests( }); test('encryptStream(fibChunked(plaintext))', () async { - final ctext = await bufferStream(r._encryptStream!( + final ctext = await bufferStream(r._encryptStream( publicKey as PublicKey, fibonacciChunkedStream(c.plaintext!), c.encryptDecryptParams!, @@ -1267,7 +1267,7 @@ void _runTests( if (r._decryptBytes != null) { test('decryptBytes(plaintext)', () async { - final text = await r._decryptBytes!( + final text = await r._decryptBytes( privateKey as PrivateKey, ciphertext!, c.encryptDecryptParams!, @@ -1281,7 +1281,7 @@ void _runTests( // If ciphertext is mangled some primitives like AES-GCM must throw // others may return garbled plaintext. try { - final text2 = await r._decryptBytes!( + final text2 = await r._decryptBytes( privateKey as PrivateKey, flipFirstBits(ciphertext!), c.encryptDecryptParams!, @@ -1299,7 +1299,7 @@ void _runTests( if (r._decryptStream != null) { test('decryptStream(Stream.value(ciphertext))', () async { - final text = await bufferStream(r._decryptStream!( + final text = await bufferStream(r._decryptStream( privateKey as PrivateKey, Stream.value(ciphertext!), c.encryptDecryptParams!, @@ -1313,7 +1313,7 @@ void _runTests( // If ciphertext is mangled some primitives like AES-GCM must throw // others may return garbled plaintext. try { - final text2 = await bufferStream(r._decryptStream!( + final text2 = await bufferStream(r._decryptStream( privateKey as PrivateKey, Stream.value(flipFirstBits(ciphertext!)), c.encryptDecryptParams!, @@ -1329,7 +1329,7 @@ void _runTests( }); test('decryptStream(fibChunkedStream(ciphertext))', () async { - final text = await bufferStream(r._decryptStream!( + final text = await bufferStream(r._decryptStream( privateKey as PrivateKey, fibonacciChunkedStream(ciphertext!), c.encryptDecryptParams!, @@ -1343,7 +1343,7 @@ void _runTests( // If ciphertext is mangled some primitives like AES-GCM must throw // others may return garbled plaintext. try { - final text2 = await bufferStream(r._decryptStream!( + final text2 = await bufferStream(r._decryptStream( privateKey as PrivateKey, fibonacciChunkedStream(flipFirstBits(ciphertext!)), c.encryptDecryptParams!, @@ -1362,7 +1362,7 @@ void _runTests( //------------------------------ Test derivedBits if (r._deriveBits != null) { test('deriveBits', () async { - final derived = await r._deriveBits!( + final derived = await r._deriveBits( _KeyPair( privateKey: privateKey as PrivateKey, publicKey: publicKey as PublicKey), @@ -1376,7 +1376,7 @@ void _runTests( //------------------------------ export/import private key if (r._exportPrivateRawKey != null) { test('export/import raw private key', () async { - final keyData = await r._exportPrivateRawKey!(privateKey as PrivateKey); + final keyData = await r._exportPrivateRawKey(privateKey as PrivateKey); check(keyData.isNotEmpty, 'exported key is empty'); final key = await r._importPrivateRawKey!(keyData, c.importKeyParams!); @@ -1386,7 +1386,7 @@ void _runTests( if (r._exportPrivatePkcs8Key != null) { test('export/import pkcs8 private key', () async { - final keyData = await r._exportPrivatePkcs8Key!(privateKey as PrivateKey); + final keyData = await r._exportPrivatePkcs8Key(privateKey as PrivateKey); check(keyData.isNotEmpty, 'exported key is empty'); final key = await r._importPrivatePkcs8Key!(keyData, c.importKeyParams!); @@ -1396,7 +1396,7 @@ void _runTests( if (r._exportPrivateJsonWebKey != null) { test('export/import jwk private key', () async { - final jwk = await r._exportPrivateJsonWebKey!(privateKey as PrivateKey); + final jwk = await r._exportPrivateJsonWebKey(privateKey as PrivateKey); check(jwk.isNotEmpty, 'exported key is empty'); final key = await r._importPrivateJsonWebKey!(jwk, c.importKeyParams!); @@ -1410,7 +1410,7 @@ void _runTests( assert(!r._isSymmetric && r._importPublicRawKey != null); test('export/import raw public key', () async { - final keyData = await r._exportPublicRawKey!(publicKey as PublicKey); + final keyData = await r._exportPublicRawKey(publicKey as PublicKey); check(keyData.isNotEmpty, 'exported key is empty'); final key = await r._importPublicRawKey!(keyData, c.importKeyParams!); @@ -1422,7 +1422,7 @@ void _runTests( assert(!r._isSymmetric && r._importPublicSpkiKey != null); test('export/import pkcs8 public key', () async { - final keyData = await r._exportPublicSpkiKey!(publicKey as PublicKey); + final keyData = await r._exportPublicSpkiKey(publicKey as PublicKey); check(keyData.isNotEmpty, 'exported key is empty'); final key = await r._importPublicSpkiKey!(keyData, c.importKeyParams!); @@ -1434,7 +1434,7 @@ void _runTests( assert(!r._isSymmetric && r._importPublicJsonWebKey != null); test('export/import jwk public key', () async { - final jwk = await r._exportPublicJsonWebKey!(publicKey as PublicKey); + final jwk = await r._exportPublicJsonWebKey(publicKey as PublicKey); check(jwk.isNotEmpty, 'exported key is empty'); final key = await r._importPublicJsonWebKey!(jwk, c.importKeyParams!); diff --git a/pubspec.yaml b/pubspec.yaml index 21ebc9ef..f4541bdc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,8 +18,8 @@ description: Cross-platform implementation of Web Cryptography APIs for Flutter. repository: https://github.com/google/webcrypto.dart environment: - sdk: ^3.0.0 - flutter: '>=3.0.0' + sdk: ^3.3.0 + flutter: '>=3.19.0' dependencies: ffi: ^2.0.0