KeyAttributes: make more fields nullable

This commit is contained in:
Neeraj Gupta 2023-01-11 10:41:02 +05:30
parent 8ebc5e49b5
commit 11da7a4aae
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
3 changed files with 6 additions and 6 deletions

View file

@ -374,9 +374,9 @@ class Configuration {
Uint8List masterKey;
try {
masterKey = await CryptoUtil.decrypt(
Sodium.base642bin(attributes!.masterKeyEncryptedWithRecoveryKey),
Sodium.base642bin(attributes!.masterKeyEncryptedWithRecoveryKey!),
Sodium.hex2bin(recoveryKey),
Sodium.base642bin(attributes.masterKeyDecryptionNonce),
Sodium.base642bin(attributes.masterKeyDecryptionNonce!),
);
} catch (e) {
_logger.severe(e);

View file

@ -9,8 +9,8 @@ class KeyAttributes {
final String secretKeyDecryptionNonce;
final int? memLimit;
final int? opsLimit;
final String masterKeyEncryptedWithRecoveryKey;
final String masterKeyDecryptionNonce;
final String? masterKeyEncryptedWithRecoveryKey;
final String? masterKeyDecryptionNonce;
final String? recoveryKeyEncryptedWithMasterKey;
final String? recoveryKeyDecryptionNonce;

View file

@ -414,8 +414,8 @@ class UserService {
Future<void> setRecoveryKey(KeyAttributes keyAttributes) async {
try {
final setRecoveryKeyRequest = SetRecoveryKeyRequest(
keyAttributes.masterKeyEncryptedWithRecoveryKey,
keyAttributes.masterKeyDecryptionNonce,
keyAttributes.masterKeyEncryptedWithRecoveryKey!,
keyAttributes.masterKeyDecryptionNonce!,
keyAttributes.recoveryKeyEncryptedWithMasterKey!,
keyAttributes.recoveryKeyDecryptionNonce!,
);