Fix message type metadata leakage in websocket
This commit is contained in:
@@ -432,9 +432,12 @@ void AppDataServer::saveNonceHex(NonceType nt, QString noncehex) {
|
|||||||
|
|
||||||
// Encrypt an outgoing message with the stored secret key.
|
// Encrypt an outgoing message with the stored secret key.
|
||||||
QString AppDataServer::encryptOutgoing(QString msg) {
|
QString AppDataServer::encryptOutgoing(QString msg) {
|
||||||
if (msg.length() % 256 > 0) {
|
int padding = 16*1024;
|
||||||
msg = msg + QString(" ").repeated(256 - (msg.length() % 256));
|
qDebug() << "Encrypt msg(pad="<<padding<<") prepad len=" << msg.length();
|
||||||
|
if (msg.length() % padding > 0) {
|
||||||
|
msg = msg + QString(" ").repeated(padding - (msg.length() % padding));
|
||||||
}
|
}
|
||||||
|
qDebug() << "Encrypt msg postpad len=" << msg.length();
|
||||||
|
|
||||||
QString localNonceHex = getNonceHex(NonceType::LOCAL);
|
QString localNonceHex = getNonceHex(NonceType::LOCAL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user