fix: Update decryption key variable from myPrivateKey to privateKey in attachment functions

This commit is contained in:
k1ngsterr1
2026-01-24 17:59:13 +05:00
parent 8fe0afea20
commit 23e1d72ac0

View File

@@ -194,7 +194,7 @@ fun ImageAttachment(
// КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop)
// Сначала расшифровываем его: Buffer.from(await decrypt(message.chacha_key, privatePlain), "binary").toString('utf-8')
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey)
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey)
val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8)
Log.d(TAG, "🔑 Decrypted chacha_key: ${decryptKeyString.length} chars")
@@ -397,7 +397,7 @@ fun FileAttachment(
// КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop)
// Сначала расшифровываем его
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey)
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey)
val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8)
val decrypted = MessageCrypto.decryptAttachmentBlobWithPassword(
@@ -592,7 +592,7 @@ fun AvatarAttachment(
// КРИТИЧНО: chachaKey ЗАШИФРОВАН в БД (как в Desktop)
// Сначала расшифровываем его
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, myPrivateKey)
val decryptedKeyAndNonce = MessageCrypto.decryptKeyFromSender(chachaKey, privateKey)
val decryptKeyString = String(decryptedKeyAndNonce, Charsets.UTF_8)
val decrypted = MessageCrypto.decryptAttachmentBlobWithPassword(