diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2024-02-01 11:20:18 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-02-07 22:57:27 +0100 |
commit | 4beb8f34b18d80a2f4b42ebed9ed08b4eaf11403 (patch) | |
tree | c0f5c7d4f67222b05a88ff76286f0ceb48ffe043 /svl | |
parent | a77fa2be1e0d8c22198a3a45153bb25ecf3135dd (diff) |
check that rtl_random_getBytes() was successful
... everywhere it is used to generate material for encryption.
Change-Id: Id3390376bb2f3a5fa1bbfd735850fce886ef7db2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162873
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit b85c2459ced6a41915dbaf567613fb5e244a0ada)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162890
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/passwordcontainer/passwordcontainer.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 333e2921b493..90b27c29f7b0 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -654,7 +654,10 @@ OUString PasswordContainer::createIV() { rtlRandomPool randomPool = mRandomPool.get(); unsigned char iv[RTL_DIGEST_LENGTH_MD5]; - rtl_random_getBytes(randomPool, iv, RTL_DIGEST_LENGTH_MD5); + if (rtl_random_getBytes(randomPool, iv, RTL_DIGEST_LENGTH_MD5) != rtl_Random_E_None) + { + throw uno::RuntimeException("rtl_random_getBytes failed"); + } OUStringBuffer aBuffer; for (sal_uInt8 i : iv) { |