Skip to content

Commit

Permalink
Merge #10912: [tests] Fix incorrect memory_cleanse(…) call in crypto_…
Browse files Browse the repository at this point in the history
…tests.cpp

065039d [tests] Fix incorrect memory_cleanse(…) call in crypto_tests.cpp (practicalswift)

Pull request description:

  `chKey` and `chIV` are pointers, not arrays :-)

  Probably the result of copy-pasting of old code where the code was operating on arrays instead of pointers.

  If I'm reading the code correctly the absence/presence of these `memory_cleanse(…)` calls won't alter the outcome of the test in question (`TestPassphraseSingle`) even if fixed. Therefore removing.

Tree-SHA512: a053b2817bedf6ef889744e546ce9a0f165dee94aef6850d9d6a6bb05b0018789597371ecf154a4aec8588c0ef5626ef08c23c35e35927f6b0497b5f086146fe
  • Loading branch information
laanwj committed Jul 26, 2017
2 parents 9dd6a2b + 065039d commit 5c8eb79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/test/crypto_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ bool OldSetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<u

if (i != (int)WALLET_CRYPTO_KEY_SIZE)
{
memory_cleanse(chKey, sizeof(chKey));
memory_cleanse(chIV, sizeof(chIV));
memory_cleanse(chKey, WALLET_CRYPTO_KEY_SIZE);
memory_cleanse(chIV, WALLET_CRYPTO_IV_SIZE);
return false;
}
return true;
Expand Down

0 comments on commit 5c8eb79

Please sign in to comment.