fix: Check correct key length for AFV encryption

This commit is contained in:
Lars Toenning
2024-05-12 21:26:51 +02:00
parent cec87b6768
commit 382289611d
5 changed files with 24 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ namespace BlackCore::Afv::Crypto
template <typename T>
static QByteArray serialize(const QString &channelTag, CryptoDtoMode mode, const QByteArray &transmitKey, uint sequenceToBeSent, T dto)
{
Q_ASSERT_X(transmitKey.size() == crypto_aead_chacha20poly1305_IETF_KEYBYTES, Q_FUNC_INFO, "");
const CryptoDtoHeaderDto header = { channelTag.toStdString(), sequenceToBeSent, mode };
QBuffer headerBuffer;