diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-01 11:58:31 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-01 11:58:31 +0000 |
| commit | cd218ff692df40b0324ea6834eb4924293970de0 (patch) | |
| tree | a9b0cc13722e3a149ee14c59e58e6e144faf5794 /src/QXmppSaslAuth.cpp | |
| parent | 4cc43f4f91ea32eee2537184d78c98e4d8755076 (diff) | |
| download | qxmpp-cd218ff692df40b0324ea6834eb4924293970de0.tar.gz | |
unify random number generation
Diffstat (limited to 'src/QXmppSaslAuth.cpp')
| -rw-r--r-- | src/QXmppSaslAuth.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/QXmppSaslAuth.cpp b/src/QXmppSaslAuth.cpp index 6b642f13..89f4edd4 100644 --- a/src/QXmppSaslAuth.cpp +++ b/src/QXmppSaslAuth.cpp @@ -106,9 +106,7 @@ void QXmppSaslDigestMd5::setPassword(const QByteArray &password) QByteArray QXmppSaslDigestMd5::generateNonce() { - QByteArray nonce(32, 'm'); - for(int n = 0; n < nonce.size(); ++n) - nonce[n] = (char)(256.0*qrand()/(RAND_MAX+1.0)); + QByteArray nonce = generateRandomBytes(32); // The random data can the '=' char is not valid as it is a delimiter, // so to be safe, base64 the nonce |
