aboutsummaryrefslogtreecommitdiff
path: root/lib/e2ee
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-02-06 20:00:01 +0100
committerTobias Fella <fella@posteo.de>2022-02-06 20:01:18 +0100
commit9960d33e0c2bbe4dd8f305cae3b01c2d704d28ff (patch)
tree47857d0f46d50e18212e5bc97e7224a835f0766c /lib/e2ee
parentac53741920b1e92b8ac61bb7c11afcae5722b241 (diff)
downloadlibquotient-9960d33e0c2bbe4dd8f305cae3b01c2d704d28ff.tar.gz
libquotient-9960d33e0c2bbe4dd8f305cae3b01c2d704d28ff.zip
Port to QRandomGenerator
Diffstat (limited to 'lib/e2ee')
-rw-r--r--lib/e2ee/qolmutils.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/e2ee/qolmutils.cpp b/lib/e2ee/qolmutils.cpp
index ce27710d..6f7937e8 100644
--- a/lib/e2ee/qolmutils.cpp
+++ b/lib/e2ee/qolmutils.cpp
@@ -3,8 +3,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "e2ee/qolmutils.h"
-#include <QDebug>
-#include <openssl/rand.h>
+#include <QtCore/QRandomGenerator>
using namespace Quotient;
@@ -19,6 +18,6 @@ QByteArray Quotient::toKey(const Quotient::PicklingMode &mode)
QByteArray Quotient::getRandom(size_t bufferSize)
{
QByteArray buffer(bufferSize, '0');
- RAND_bytes(reinterpret_cast<uint8_t *>(buffer.data()), buffer.size());
+ QRandomGenerator::system()->generate(buffer.begin(), buffer.end());
return buffer;
}