Skip to content

Commit f7d1127

Browse files
committed
Raises Dart SDK version minimum to 3.1.0 and other configuration file changes.
1 parent 76b9bbc commit f7d1127

File tree

24 files changed

+167
-131
lines changed

24 files changed

+167
-131
lines changed

cryptography/lib/src/cryptography/cipher.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,16 @@ abstract class Cipher {
399399
String clearText, {
400400
required SecretKey secretKey,
401401
}) async {
402-
final bytes = utf8.encode(clearText);
402+
final bytes = utf8.encode(clearText) as Uint8List;
403403
final secretBox = await encrypt(
404404
bytes,
405405
secretKey: secretKey,
406-
possibleBuffer: bytes is Uint8List ? bytes : null,
406+
possibleBuffer: bytes,
407407
);
408408

409409
// Overwrite `bytes` if it was not overwritten by the cipher.
410410
final cipherText = secretBox.cipherText;
411-
if (bytes is! Uint8List ||
412-
cipherText is! Uint8List ||
411+
if (cipherText is! Uint8List ||
413412
!identical(bytes.buffer, cipherText.buffer)) {
414413
bytes.fillRange(0, bytes.length, 0);
415414
}

cryptography/lib/src/cryptography/cipher_wand.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,16 @@ abstract class CipherWand extends Wand {
175175
/// }
176176
/// ```
177177
Future<SecretBox> encryptString(String clearText) async {
178-
final bytes = utf8.encode(clearText);
178+
final bytes = utf8.encode(clearText) as Uint8List;
179179
final secretBox = await encrypt(
180180
bytes,
181-
possibleBuffer: bytes is Uint8List ? bytes : null,
181+
possibleBuffer: bytes,
182182
);
183183

184184
// Cut the amount of possibly sensitive data in the heap.
185185
// This should be a cheap operation relative to encryption.
186186
final cipherText = secretBox.cipherText;
187-
if (bytes is! Uint8List ||
188-
cipherText is! Uint8List ||
187+
if (cipherText is! Uint8List ||
189188
!identical(bytes.buffer, cipherText.buffer)) {
190189
bytes.fillRange(0, bytes.length, 0);
191190
}

cryptography/lib/src/dart/_helpers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void checkSystemIsLittleEndian() {
2929
}
3030

3131
/// A helper for using "package:crypto" hash algorithms.
32-
class PackageCryptoDigestCaptureSink extends Sink<other.Digest> {
32+
class PackageCryptoDigestCaptureSink implements Sink<other.Digest> {
3333
Hash? _result;
3434

3535
PackageCryptoDigestCaptureSink();

cryptography/pubspec.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: cryptography
2-
version: 2.5.0
2+
version: 2.5.1
33
homepage: https://github.com/dint-dev/cryptography
44
description:
55
Cryptographic algorithms for encryption, digital signatures, key agreement, authentication, and
66
hashing. AES, Chacha20, ED25519, X25519, and more. Good cross-platform support.
77

88
environment:
9-
sdk: '>=2.17.0 <3.0.0'
9+
sdk: '>=3.1.0 <4.0.0'
1010

1111
dependencies:
1212
#
13-
# Packages by the Google:
13+
# Packages by Google:
1414
#
15-
collection: ^1.16.0
16-
crypto: ^3.0.0
17-
js: ^0.6.2
18-
meta: ^1.3.0
15+
collection: ^1.17.0
16+
crypto: ^3.0.3
17+
js: ^0.6.7
18+
meta: ^1.8.0
1919
typed_data: ^1.3.0
2020

2121
dev_dependencies:
2222
#
23-
# Packages by the Google:
23+
# Packages by Google:
2424
#
25-
lints: ^2.0.1
26-
test: ^1.19.0
25+
lints: ^2.1.1
26+
test: ^1.24.0

cryptography/test/algorithms/pbkdf2_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void _main() {
4747
test('deriveKey(...): Hmac(sha256), 10k iterations in 300ms', () async {
4848
final macAlgorithm = Hmac.sha256();
4949
final n = 10 * 1000;
50-
const maxDuration = Duration(milliseconds: 300);
50+
const maxDuration = Duration(milliseconds: 1000);
5151

5252
final pbkdf2 = Pbkdf2(
5353
macAlgorithm: macAlgorithm,

cryptography/test/algorithms/poly1305_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
..[0] = 1
2828
..[2] = 2;
2929
var k = SecretKey(secretKeyBytes);
30-
var state = utf8.encode('Hello world');
30+
List<int> state = utf8.encode('Hello world');
3131
for (var i = 0; i < 100000; i++) {
3232
final mac = await algorithm.calculateMac(
3333
state,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PODS:
2+
- cryptography_flutter (0.2.0):
3+
- Flutter
4+
- Flutter (1.0.0)
5+
6+
DEPENDENCIES:
7+
- cryptography_flutter (from `.symlinks/plugins/cryptography_flutter/ios`)
8+
- Flutter (from `Flutter`)
9+
10+
EXTERNAL SOURCES:
11+
cryptography_flutter:
12+
:path: ".symlinks/plugins/cryptography_flutter/ios"
13+
Flutter:
14+
:path: Flutter
15+
16+
SPEC CHECKSUMS:
17+
cryptography_flutter: 381bdacc984abcfbe3ca45ef7c76566ff061614c
18+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
19+
20+
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
21+
22+
COCOAPODS: 1.11.2

cryptography_flutter/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12+
711F84593B067D3E8259BBC1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EC8489F0C5EA88B2E903A512 /* Pods_Runner.framework */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1314
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1415
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -31,30 +32,54 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
270F485DE6CCD37328140D21 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
5828B94549AB37F503A5B3A9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3538
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3639
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3740
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
41+
908BB949651678774F105BDF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3842
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3943
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4044
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4145
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4246
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4347
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4448
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49+
EC8489F0C5EA88B2E903A512 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4550
/* End PBXFileReference section */
4651

4752
/* Begin PBXFrameworksBuildPhase section */
4853
97C146EB1CF9000F007C117D /* Frameworks */ = {
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
711F84593B067D3E8259BBC1 /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
077B5E69D4F8C1F59E682221 /* Pods */ = {
65+
isa = PBXGroup;
66+
children = (
67+
908BB949651678774F105BDF /* Pods-Runner.debug.xcconfig */,
68+
5828B94549AB37F503A5B3A9 /* Pods-Runner.release.xcconfig */,
69+
270F485DE6CCD37328140D21 /* Pods-Runner.profile.xcconfig */,
70+
);
71+
name = Pods;
72+
path = Pods;
73+
sourceTree = "<group>";
74+
};
75+
4297D930FAA1E3AD6DA3CDD4 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
EC8489F0C5EA88B2E903A512 /* Pods_Runner.framework */,
79+
);
80+
name = Frameworks;
81+
sourceTree = "<group>";
82+
};
5883
9740EEB11CF90186004384FC /* Flutter */ = {
5984
isa = PBXGroup;
6085
children = (
@@ -72,6 +97,8 @@
7297
9740EEB11CF90186004384FC /* Flutter */,
7398
97C146F01CF9000F007C117D /* Runner */,
7499
97C146EF1CF9000F007C117D /* Products */,
100+
077B5E69D4F8C1F59E682221 /* Pods */,
101+
4297D930FAA1E3AD6DA3CDD4 /* Frameworks */,
75102
);
76103
sourceTree = "<group>";
77104
};
@@ -105,12 +132,14 @@
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
10D702F8AE9D1E4997C9D077 /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
6F06FFDA631C38BC01B81CBA /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -127,7 +156,7 @@
127156
97C146E61CF9000F007C117D /* Project object */ = {
128157
isa = PBXProject;
129158
attributes = {
130-
LastUpgradeCheck = 1300;
159+
LastUpgradeCheck = 1430;
131160
ORGANIZATIONNAME = "";
132161
TargetAttributes = {
133162
97C146ED1CF9000F007C117D = {
@@ -169,13 +198,36 @@
169198
/* End PBXResourcesBuildPhase section */
170199

171200
/* Begin PBXShellScriptBuildPhase section */
201+
10D702F8AE9D1E4997C9D077 /* [CP] Check Pods Manifest.lock */ = {
202+
isa = PBXShellScriptBuildPhase;
203+
buildActionMask = 2147483647;
204+
files = (
205+
);
206+
inputFileListPaths = (
207+
);
208+
inputPaths = (
209+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
210+
"${PODS_ROOT}/Manifest.lock",
211+
);
212+
name = "[CP] Check Pods Manifest.lock";
213+
outputFileListPaths = (
214+
);
215+
outputPaths = (
216+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
217+
);
218+
runOnlyForDeploymentPostprocessing = 0;
219+
shellPath = /bin/sh;
220+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
221+
showEnvVarsInLog = 0;
222+
};
172223
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173224
isa = PBXShellScriptBuildPhase;
174225
alwaysOutOfDate = 1;
175226
buildActionMask = 2147483647;
176227
files = (
177228
);
178229
inputPaths = (
230+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
179231
);
180232
name = "Thin Binary";
181233
outputPaths = (
@@ -184,6 +236,23 @@
184236
shellPath = /bin/sh;
185237
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
186238
};
239+
6F06FFDA631C38BC01B81CBA /* [CP] Embed Pods Frameworks */ = {
240+
isa = PBXShellScriptBuildPhase;
241+
buildActionMask = 2147483647;
242+
files = (
243+
);
244+
inputFileListPaths = (
245+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
246+
);
247+
name = "[CP] Embed Pods Frameworks";
248+
outputFileListPaths = (
249+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
250+
);
251+
runOnlyForDeploymentPostprocessing = 0;
252+
shellPath = /bin/sh;
253+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
254+
showEnvVarsInLog = 0;
255+
};
187256
9740EEB61CF901F6004384FC /* Run Script */ = {
188257
isa = PBXShellScriptBuildPhase;
189258
alwaysOutOfDate = 1;

cryptography_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

cryptography_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)