diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-03 16:33:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-08 11:29:54 +0200 |
commit | e5aa87aeeb66a8f8068b41275d23c491f2dbd0f2 (patch) | |
tree | d3ac3b25fdbfec19e77599fd860016f661f9f5fb /sw/source | |
parent | 1eaae3966db362b5094feee4ac9a462ee9993d90 (diff) |
drop requirement for rtl_random_getBytes to have "Pool" arg
Seeing as since:
commit e9531b792ddf0cfc2db11713b574c5fc7ae09e2c
Date: Tue Feb 6 14:39:47 2024 +0100
sal: rtlRandomPool: require OS random device, abort if not present
Both rtl_random_createPool() and rtl_random_getBytes() first try to get
random data from the OS, via /dev/urandom or rand_s() (documented to
call RtlGenRandom(), see [1]).
we don't use the initial arg to rtl_random_getBytes anymore, drop the
requirement to have one. Then simplify our usages of that, and
addtionally deprecate rtl_random_createPool and rtl_random_destroyPool.
Change-Id: I13dcc067714a8a741a4e8f2bfcf2006373f832c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167067
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index b252e4d1533d..f56a04de65a4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3524,13 +3524,11 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec if ( pPasswordItem && !pPasswordItem->GetValue().isEmpty() && pPasswordItem->GetValue().getLength() <= 15 ) { // Generate random number with a seed of time as salt. - rtlRandomPool aRandomPool = rtl_random_createPool (); sal_uInt8 pDocId[ 16 ]; - if (rtl_random_getBytes(aRandomPool, pDocId, 16) != rtl_Random_E_None) + if (rtl_random_getBytes(nullptr, pDocId, 16) != rtl_Random_E_None) { throw uno::RuntimeException("rtl_random_getBytes failed"); } - rtl_random_destroyPool( aRandomPool ); sal_uInt16 aPassword[16] = {}; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 943c80759109..c5a827c7eea8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5673,13 +5673,11 @@ namespace // in the MediaDescriptor ::msfilter::MSCodec_Std97 aCodec97; - rtlRandomPool aRandomPool = rtl_random_createPool(); sal_uInt8 pDocId[ 16 ]; - if (rtl_random_getBytes(aRandomPool, pDocId, 16) != rtl_Random_E_None) + if (rtl_random_getBytes(nullptr, pDocId, 16) != rtl_Random_E_None) { throw uno::RuntimeException("rtl_random_getBytes failed"); } - rtl_random_destroyPool( aRandomPool ); sal_uInt16 pStd97Pass[16] = {}; for( sal_Int32 nChar = 0; nChar < nLen; ++nChar ) |