From b1bf1c73b90d91fa18ed3ce5b17320173185f64c Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 19 Jan 2020 11:53:42 +0100 Subject: [PATCH] Fix message type metadata leakage in websocket --- src/websockets.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/websockets.cpp b/src/websockets.cpp index 920b98c..afbbca6 100644 --- a/src/websockets.cpp +++ b/src/websockets.cpp @@ -432,9 +432,12 @@ void AppDataServer::saveNonceHex(NonceType nt, QString noncehex) { // Encrypt an outgoing message with the stored secret key. QString AppDataServer::encryptOutgoing(QString msg) { - if (msg.length() % 256 > 0) { - msg = msg + QString(" ").repeated(256 - (msg.length() % 256)); + int padding = 16*1024; + qDebug() << "Encrypt msg(pad="<