AVATAR & IMAGES ARE WORKING ON DESKTOP
This commit is contained in:
@@ -1079,11 +1079,14 @@ fun AvatarAttachment(
|
||||
val encryptedContent = TransportManager.downloadFile(attachment.id, downloadTag)
|
||||
downloadStatus = DownloadStatus.DECRYPTING
|
||||
|
||||
// 🔥 КРИТИЧНО: Аватар зашифрован с AVATAR_PASSWORD (как на desktop)
|
||||
// НЕ используем ChaCha ключ сообщения!
|
||||
val decrypted = CryptoManager.decryptWithPassword(
|
||||
// КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop)
|
||||
// Сначала расшифровываем его
|
||||
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey)
|
||||
val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8)
|
||||
|
||||
val decrypted = MessageCrypto.decryptAttachmentBlobWithPassword(
|
||||
encryptedContent,
|
||||
AvatarFileManager.getAvatarPassword()
|
||||
decryptKeyString
|
||||
)
|
||||
|
||||
if (decrypted != null) {
|
||||
|
||||
Reference in New Issue
Block a user