summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-10-12 14:59:51 -0700
committerLars Knoll <lars.knoll@qt.io>2017-10-29 10:13:01 +0000
commit81f251660026fff198daf8920edc62bbc782ff7d (patch)
tree9939cc07543eb69b5ee8e80496fca4a42c45d5fd /src/network/kernel
parentfd9dd8e95b7563a439b1672fa622729bdcb6f4fc (diff)
QRandomGenerator: add system() and global()
Right now,this does really nothing. This commit is just to allow us to transition the other modules (besides qtbase) to use the syntax that will become the API. I've marked three places to use the system CSPRNG: 1) the QHash seed 2) QUuid 3) QAuthenticator I didn't think the HTTP multipart boundary needed to be cryptographically safe, so I changed that one to the global generator. Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qauthenticator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 099d9586d2..a3ccf13e82 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -48,6 +48,7 @@
#include <qendian.h>
#include <qstring.h>
#include <qdatetime.h>
+#include <qrandom.h>
#ifdef Q_OS_WIN
#include <qmutex.h>
@@ -357,7 +358,7 @@ QAuthenticatorPrivate::QAuthenticatorPrivate()
, phase(Start)
, nonceCount(0)
{
- cnonce = QCryptographicHash::hash(QByteArray::number(qrand(), 16) + QByteArray::number(qrand(), 16),
+ cnonce = QCryptographicHash::hash(QByteArray::number(QRandomGenerator::system()->generate64(), 16),
QCryptographicHash::Md5).toHex();
nonceCount = 0;
}