diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-11-09 18:44:17 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-11-09 19:07:34 +0100 |
commit | 24063ec94bd3f8407827f03ccde8bd99790f85e2 (patch) | |
tree | 1987db5f906e367f382a5cda4069efdfcab36545 | |
parent | 25205d5b29d0aade0ebd7c6405a91995d02a3a7c (diff) |
comphelper: also bump PDBKDF2 count for password-to-modify
The password-to-modify misfeature does not actually provide any
security, but it may induce users to re-use passwords, so at least make
it harder to crack the passwords.
Change-Id: I0adf0e8e11b222fc469013e17a2695bd7122ad01
-rw-r--r-- | comphelper/source/misc/docpasswordhelper.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index d384b4fd8375..49fc0c3b5807 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -74,9 +74,9 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo uno::Sequence< beans::PropertyValue > aResult; uno::Sequence< sal_Int8 > aSalt = GenerateRandomByteSequence( 16 ); - sal_Int32 nCount = 1024; + sal_Int32 const nPBKDF2IterationCount = 100000; - uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, 16 ); + uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash(aPassword, aSalt, nPBKDF2IterationCount, 16); if ( aNewHash.getLength() ) { aResult.realloc( 4 ); @@ -85,7 +85,7 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo aResult[1].Name = "salt"; aResult[1].Value <<= aSalt; aResult[2].Name = "iteration-count"; - aResult[2].Value <<= nCount; + aResult[2].Value <<= nPBKDF2IterationCount; aResult[3].Name = "hash"; aResult[3].Value <<= aNewHash; } |