Revert the change fetching SelfEncryptionKey from the Local Secondary.
As a part of APKAM changes, in SelfKeyEncryption and SelfKeyDecryption the self encryption key is fetched from AtChops instance and removed the code related to fetching the self encryption key from local secondary.
But in AtClientMobile->AtClientService.dart, the only RSA keys pairs are set to AtChops Instance, but SelfEncryptionKey is not set.
Refer to the snippet below:
/// AtClientMobile-> at_client_service.dart
AtChops createAtChops(Map<String, String> decryptedAtKeys) {
final atEncryptionKeyPair = AtEncryptionKeyPair.create(
decryptedAtKeys[BackupKeyConstants.ENCRYPTION_PUBLIC_KEY_FROM_FILE]!,
decryptedAtKeys[BackupKeyConstants.ENCRYPTION_PRIVATE_KEY_FROM_FILE]!);
final atPkamKeyPair = AtPkamKeyPair.create(
decryptedAtKeys[BackupKeyConstants.PKAM_PUBLIC_KEY_FROM_KEY_FILE]!,
decryptedAtKeys[BackupKeyConstants.PKAM_PRIVATE_KEY_FROM_KEY_FILE]!);
final atChopsKeys = AtChopsKeys.create(atEncryptionKeyPair, atPkamKeyPair);
final atChops = AtChopsImpl(atChopsKeys);
return atChops;
}
Consequently, Since SelfEncryptionKey is not set in AtChops, When initial sync happens, below error occurs.
SEVERE|2024-04-10 18:39:07.668706|SyncService (@aquamarine659)|Exception in sync 6c0e9bc7-b737-435a-9d6a-373834f89687. Reason: Failed to syncData caused by
I/flutter (17198): Failed to encrypt the data caused by Self encryption key not found caused by
I/flutter (17198): Failed to encrypt the data
I/flutter (17198): SEVERE|2024-04-10 18:39:07.670964|SyncService (@aquamarine659)|system sync error Failed to encrypt the data caused by Self encryption key not found
This happens with the existing version of at_client_mobile. So prevent backward compatibility issues, reverting the change related to fetching SelfEncryptionKey from Local Secondary.
Raised a bug in AtClientMobile to track the issue: https://github.com/atsign-foundation/at_client_sdk/issues/1294
- How to verify it
All tests should pass.
Manually tested with buzz app and able to onboard the atSign successfully without errors.
- What I did
As a part of APKAM changes, in
SelfKeyEncryption
andSelfKeyDecryption
the self encryption key is fetched from AtChops instance and removed the code related to fetching the self encryption key from local secondary.But in AtClientMobile->AtClientService.dart, the only RSA keys pairs are set to AtChops Instance, but SelfEncryptionKey is not set.
Refer to the snippet below:
Consequently, Since SelfEncryptionKey is not set in AtChops, When initial sync happens, below error occurs.
This happens with the existing version of at_client_mobile. So prevent backward compatibility issues, reverting the change related to fetching SelfEncryptionKey from Local Secondary. Raised a bug in AtClientMobile to track the issue: https://github.com/atsign-foundation/at_client_sdk/issues/1294
- How to verify it