From 9960d33e0c2bbe4dd8f305cae3b01c2d704d28ff Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 6 Feb 2022 20:00:01 +0100 Subject: Port to QRandomGenerator --- lib/e2ee/qolmutils.cpp | 5 ++--- 1 file 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 -#include +#include 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(buffer.data()), buffer.size()); + QRandomGenerator::system()->generate(buffer.begin(), buffer.end()); return buffer; } -- cgit v1.2.3