Унификация кодирования chacha_key_plain теперь он в hex, а не в utf8 с потерей данных
This commit is contained in:
@@ -181,7 +181,7 @@ export function useSynchronize() {
|
||||
* Этот тип вложения приходит сразу в blob и не нуждается
|
||||
* в последующем скачивании
|
||||
*/
|
||||
const decryptedBlob = await decodeWithPassword(chachaDecryptedKey.toString('utf-8'), attachment.blob);
|
||||
const decryptedBlob = await decodeWithPassword(chachaDecryptedKey.toString('hex'), attachment.blob);
|
||||
writeFile(`m/${await generateMd5(attachment.id + publicKey)}`,
|
||||
Buffer.from(await encodeWithPassword(privatePlain, decryptedBlob)).toString('binary'));
|
||||
messageAttachments[nextLength - 1].blob = decryptedBlob;
|
||||
@@ -202,7 +202,7 @@ export function useSynchronize() {
|
||||
content: content,
|
||||
timestamp: timestamp,
|
||||
readed: 1, //сообщение прочитано
|
||||
chacha_key: chachaDecryptedKey.toString('utf-8'),
|
||||
chacha_key: chachaDecryptedKey.toString('hex'),
|
||||
from_me: 1, //сообщение от нас
|
||||
plain_message: (decryptedContent as string),
|
||||
delivered: DeliveredMessageState.DELIVERED,
|
||||
|
||||
Reference in New Issue
Block a user