memzero() segfaulted for unknown reasons... probably pebkac...

This commit is contained in:
Dubslow 2014-09-11 22:42:22 -05:00
parent 26566666aa
commit c26c6d86ae
2 changed files with 4 additions and 2 deletions

View File

@ -80,7 +80,7 @@ Suite * encryptsave_suite(void)
{
Suite *s = suite_create("encryptsave");
DEFTESTCASE_SLOW(known_kdf, 60);
DEFTESTCASE_SLOW(known_kdf, 60); /* is 5-10 seconds on my computer, but is directly dependent on CPU */
DEFTESTCASE(save_friend);
return s;

View File

@ -72,6 +72,8 @@ int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint3
/* out of memory most likely */
return -1;
}
/* calling sodium_memzero segfaults, but printing passphrase works, so... libsodium bug?
* ...eh, it's not segfaulting anywhere else, so I'll assume pebkac...
sodium_memzero(passphrase, pplength); /* wipe plaintext pw */
/* next get plain save data */
@ -140,7 +142,7 @@ int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *
/* out of memory most likely */
return -1;
}
sodium_memzero(passphrase, pplength); /* wipe plaintext pw */
/* sodium_memzero(passphrase, pplength); /* wipe plaintext pw */
/* decrypt the data */
uint8_t temp_data[decrypt_length];