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 /cppuhelper/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 'cppuhelper/source')
-rw-r--r-- | cppuhelper/source/bootstrap.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx index a6387c1ff1aa..e3a47c6154ba 100644 --- a/cppuhelper/source/bootstrap.cxx +++ b/cppuhelper/source/bootstrap.cxx @@ -139,14 +139,10 @@ Reference< XComponentContext > SAL_CALL bootstrap() throw BootstrapException( u"no local component context!"_ustr ); // create a random pipe name - rtlRandomPool hPool = rtl_random_createPool(); - if ( hPool == nullptr ) - throw BootstrapException( u"cannot create random pool!"_ustr ); sal_uInt8 bytes[ 16 ]; - if ( rtl_random_getBytes( hPool, bytes, std::size( bytes ) ) + if ( rtl_random_getBytes( nullptr, bytes, std::size( bytes ) ) != rtl_Random_E_None ) throw BootstrapException( u"random pool error!"_ustr ); - rtl_random_destroyPool( hPool ); OUStringBuffer buf("uno"); for (unsigned char byte : bytes) buf.append( static_cast< sal_Int32 >( byte ) ); |