mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 20:24:32 +01:00
Update sad paths around manual backup key restore.
This commit is contained in:
committed by
Greyson Parrelli
parent
b5f323d4af
commit
139b62e469
@@ -30,6 +30,14 @@ class AccountEntropyPool(val value: String) {
|
||||
|
||||
return AccountEntropyPool(stripped)
|
||||
}
|
||||
|
||||
fun isFullyValid(input: String): Boolean {
|
||||
return LibSignalAccountEntropyPool.isValid(input)
|
||||
}
|
||||
|
||||
fun removeIllegalCharacters(input: String): String {
|
||||
return input.replace(INVALID_CHARACTERS, "")
|
||||
}
|
||||
}
|
||||
|
||||
fun deriveMasterKey(): MasterKey {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package org.whispersystems.signalservice.api.kbs;
|
||||
|
||||
import org.signal.libsignal.protocol.kdf.HKDF;
|
||||
import org.whispersystems.signalservice.api.backup.MessageBackupKey;
|
||||
import org.signal.core.util.Base64;
|
||||
import org.whispersystems.signalservice.api.storage.StorageKey;
|
||||
import org.whispersystems.signalservice.internal.util.Hex;
|
||||
import org.signal.core.util.Base64;
|
||||
import org.whispersystems.util.StringUtil;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
@@ -46,11 +44,6 @@ public final class MasterKey {
|
||||
return derive("Logging Key");
|
||||
}
|
||||
|
||||
public MessageBackupKey deriveMessageBackupKey() {
|
||||
// TODO [backup] Derive from AEP
|
||||
return new MessageBackupKey(HKDF.deriveSecrets(masterKey, "20231003_Signal_Backups_GenerateBackupKey".getBytes(), 32));
|
||||
}
|
||||
|
||||
private byte[] derive(String keyName) {
|
||||
return hmacSha256(masterKey, StringUtil.utf8(keyName));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user