Skip to content

Commit

Permalink
memzero() segfaulted for unknown reasons... probably pebkac...
Browse files Browse the repository at this point in the history
  • Loading branch information
dubslow committed Sep 12, 2014
1 parent 2656666 commit c26c6d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auto_tests/encryptsave_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion toxencryptsave/toxencryptsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit c26c6d8

Please sign in to comment.