summaryrefslogtreecommitdiff
path: root/src/websockets/qdefaultmaskgenerator_p.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-11-20 13:18:51 +0100
committerLiang Qi <liang.qi@qt.io>2017-11-20 15:05:51 +0100
commit534ed7ddbe86c58dc7d59c5c693b027ed8f18737 (patch)
treeb5fe6e7deec116c213f7eadc5a3b142600bb2a1b /src/websockets/qdefaultmaskgenerator_p.cpp
parentf7c5b8fce9517b3062eeab0ec7e8e46867d1f977 (diff)
parent57e1ebecf0e9e1fbc23f7fe32a90c63e242e692b (diff)
downloadqtwebsockets-534ed7ddbe86c58dc7d59c5c693b027ed8f18737.tar.gz
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/websockets/qwebsocket_p.cpp tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp Change-Id: I40922fab198a09a3fbba1b2f11b42f2d40e53720
Diffstat (limited to 'src/websockets/qdefaultmaskgenerator_p.cpp')
-rw-r--r--src/websockets/qdefaultmaskgenerator_p.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/websockets/qdefaultmaskgenerator_p.cpp b/src/websockets/qdefaultmaskgenerator_p.cpp
index 7dc0cee..7763868 100644
--- a/src/websockets/qdefaultmaskgenerator_p.cpp
+++ b/src/websockets/qdefaultmaskgenerator_p.cpp
@@ -48,7 +48,7 @@
malicious scripts to attack bad behaving proxies.
For more information about the importance of good masking,
see \l {"Talking to Yourself for Fun and Profit" by Lin-Shung Huang et al}.
- The default mask generator uses the reasonably secure QRandomGenerator::get32() function.
+ The default mask generator uses the reasonably secure QRandomGenerator::global()->generate() function.
The best measure against attacks mentioned in the document above,
is to use QWebSocket over a secure connection (\e wss://).
In general, always be careful to not have 3rd party script access to
@@ -90,16 +90,16 @@ bool QDefaultMaskGenerator::seed() Q_DECL_NOEXCEPT
}
/*!
- Generates a new random mask using the insecure QRandomGenerator::get32() method.
+ Generates a new random mask using the insecure QRandomGenerator::global()->generate() method.
\internal
*/
quint32 QDefaultMaskGenerator::nextMask() Q_DECL_NOEXCEPT
{
- quint32 value = QRandomGenerator::get32();
+ quint32 value = QRandomGenerator::global()->generate();
while (Q_UNLIKELY(value == 0)) {
// a mask of zero has a special meaning
- value = QRandomGenerator::get32();
+ value = QRandomGenerator::global()->generate();
}
return value;
}