mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
memzero() segfaulted for unknown reasons... probably pebkac...
This commit is contained in:
parent
26566666aa
commit
c26c6d86ae
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user