From c83b09ab19e72818f38266808e109efd0f1f64c0 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 7 Dec 2017 23:44:03 +0100 Subject: rtlRandomPool: remove pointless seeding with system time Change-Id: I88647a66a72d092303560a4348ce3dc55ee6c321 Reviewed-on: https://gerrit.libreoffice.org/46055 Tested-by: Jenkins Reviewed-by: Michael Stahl --- comphelper/source/misc/docpasswordhelper.cxx | 3 --- comphelper/source/misc/storagehelper.cxx | 4 ---- 2 files changed, 7 deletions(-) (limited to 'comphelper/source/misc') diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 7d761bb9c740..79af2be034d6 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -248,10 +248,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence( { uno::Sequence< sal_Int8 > aResult( nLength ); - TimeValue aTime; - osl_getSystemTime( &aTime ); rtlRandomPool aRandomPool = rtl_random_createPool (); - rtl_random_addBytes ( aRandomPool, &aTime, 8 ); rtl_random_getBytes ( aRandomPool, aResult.getArray(), nLength ); rtl_random_destroyPool ( aRandomPool ); diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index d51055211e8a..a6f2109ba37e 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -436,11 +436,7 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreateGpgPackageEncryptionDat // generate session key // -------------------- - // Get a random number generator and seed it with current timestamp - TimeValue aTime; - osl_getSystemTime( &aTime ); rtlRandomPool aRandomPool = rtl_random_createPool(); - rtl_random_addBytes(aRandomPool, &aTime, 8); // get 16 random chars out of it uno::Sequence < sal_Int8 > aVector(16); -- cgit