Merge pull request #4306

56b50faa wallet: use wipeable_string in more places where a secret is used (moneromooo-monero)
07ec748c wipeable_string: add hex_to_pod function (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-09-18 17:32:11 +02:00
commit 580497d5f9
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
6 changed files with 70 additions and 40 deletions

View file

@ -32,6 +32,7 @@
#include "misc_log_ex.h"
#include "wipeable_string.h"
#include "hex.h"
TEST(wipeable_string, ctor)
{
@ -202,3 +203,9 @@ TEST(wipeable_string, parse_hexstr)
ASSERT_TRUE((s = epee::wipeable_string("414243").parse_hexstr()));
ASSERT_EQ(*s, epee::wipeable_string("ABC"));
}
TEST(wipeable_string, to_hex)
{
ASSERT_TRUE(epee::to_hex::wipeable_string(epee::span<const uint8_t>((const uint8_t*)"", 0)) == epee::wipeable_string(""));
ASSERT_TRUE(epee::to_hex::wipeable_string(epee::span<const uint8_t>((const uint8_t*)"abc", 3)) == epee::wipeable_string("616263"));
}