Skip to content

Commit d28e823

Browse files
Merge pull request #17 from AaronFeickert/padding-error
Use a separate error for invalid padding flag
2 parents 39a9426 + 62c61ce commit d28e823

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/secure_storage.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ class VersionError implements Exception {
112112
String errMsg() => 'Bad version';
113113
}
114114

115+
/// Padding flag is invalid
116+
class InvalidPadding implements Exception {
117+
String errMsg() => 'Padding flag is invalid';
118+
}
119+
115120
///
116121
/// StorageCryptoHandler
117122
///
@@ -279,7 +284,7 @@ class StorageCryptoHandler {
279284

280285
// The padding flag is invalid, which should never happen
281286
if (paddedValue[0] != 0x01) {
282-
throw BadDecryption();
287+
throw InvalidPadding();
283288
}
284289

285290
// Extract the value length

0 commit comments

Comments
 (0)