diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-09-26 15:20:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 15:20:53 +0200 |
commit | 4c8dcbc308eb0f4900e416e698f5f30e71daaad8 (patch) | |
tree | aa5fdaa81234a21c6919fac4958f84d7c26cd397 /lib/e2ee/qolmutils.cpp | |
parent | 5904a61c59f0eef00aef07ef998658fd791ff139 (diff) | |
parent | 15b840d82d4794358fbf1271ea76e446b47db7e5 (diff) | |
download | libquotient-4c8dcbc308eb0f4900e416e698f5f30e71daaad8.tar.gz libquotient-4c8dcbc308eb0f4900e416e698f5f30e71daaad8.zip |
Merge #571: Unify reporting and handling of Olm errors
Diffstat (limited to 'lib/e2ee/qolmutils.cpp')
-rw-r--r-- | lib/e2ee/qolmutils.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/e2ee/qolmutils.cpp b/lib/e2ee/qolmutils.cpp index 6f7937e8..c6e51bcd 100644 --- a/lib/e2ee/qolmutils.cpp +++ b/lib/e2ee/qolmutils.cpp @@ -15,9 +15,8 @@ QByteArray Quotient::toKey(const Quotient::PicklingMode &mode) return std::get<Quotient::Encrypted>(mode).key; } -QByteArray Quotient::getRandom(size_t bufferSize) +RandomBuffer::RandomBuffer(size_t size) + : QByteArray(static_cast<int>(size), '\0') { - QByteArray buffer(bufferSize, '0'); - QRandomGenerator::system()->generate(buffer.begin(), buffer.end()); - return buffer; + QRandomGenerator::system()->generate(begin(), end()); } |