diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 8163ddf216d..6a76c275201 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -996,7 +996,7 @@ public: QByteArray key; QByteArray result; QBasicMutex finalizeMutex; - QCryptographicHash messageHash; + QCryptographicHashPrivate messageHash; const QCryptographicHash::Algorithm method; void initMessageHash(); @@ -1022,7 +1022,8 @@ void QMessageAuthenticationCodePrivate::initMessageHash() if (key.size() > blockSize) { messageHash.addData(key); - key = messageHash.result(); + messageHash.finalizeUnchecked(); + key = messageHash.resultView().toByteArray(); messageHash.reset(); } @@ -1186,6 +1187,7 @@ void QMessageAuthenticationCodePrivate::finalizeUnchecked() { const int blockSize = qt_hash_block_size(method); + messageHash.finalizeUnchecked(); QByteArrayView hashedMessage = messageHash.resultView(); QVarLengthArray oKeyPad(blockSize);