Fix local backup restore AEP handling and conditional re-enable.

This commit is contained in:
Alex Hart
2026-03-19 12:50:00 -03:00
committed by Cody Henthorne
parent c7a6c7ad9e
commit 78d3db319c
16 changed files with 528 additions and 58 deletions

View File

@@ -34,7 +34,14 @@ class MessageBackupKey(override val value: ByteArray) : BackupKey {
* @param forwardSecrecyToken Should be present for any backup located on the archive CDN. Absent for other uses (i.e. link+sync).
*/
fun deriveBackupSecrets(aci: ServiceId.ACI, forwardSecrecyToken: BackupForwardSecrecyToken?): BackupKeyMaterial {
val backupId = deriveBackupId(aci)
return deriveBackupSecrets(deriveBackupId(aci), forwardSecrecyToken)
}
/**
* Derives the cryptographic material used to encrypt a backup, using a [BackupId] directly
* instead of deriving it from an ACI.
*/
fun deriveBackupSecrets(backupId: BackupId, forwardSecrecyToken: BackupForwardSecrecyToken?): BackupKeyMaterial {
val libsignalBackupKey = LibSignalBackupKey(value)
val libsignalMessageMessageBackupKey = MessageBackupKey(libsignalBackupKey, backupId.value, forwardSecrecyToken)