diff options
author | Dubslow <bunslow@gmail.com> | 2014-09-11 22:42:22 -0500 |
---|---|---|
committer | Dubslow <bunslow@gmail.com> | 2014-09-11 22:42:22 -0500 |
commit | c26c6d86aeb2a0dd672ff7611394ebbf806d70c7 (patch) | |
tree | 24dd4d8865e2efb3822bb3b26fba3e0ed85aadc5 /toxencryptsave | |
parent | 26566666aa6d0ce36620a2749f4ffa956d180b8b (diff) |
memzero() segfaulted for unknown reasons... probably pebkac...
Diffstat (limited to 'toxencryptsave')
-rw-r--r-- | toxencryptsave/toxencryptsave.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/toxencryptsave/toxencryptsave.c b/toxencryptsave/toxencryptsave.c index 390a5e5d..ae042199 100644 --- a/toxencryptsave/toxencryptsave.c +++ b/toxencryptsave/toxencryptsave.c | |||
@@ -72,6 +72,8 @@ int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint3 | |||
72 | /* out of memory most likely */ | 72 | /* out of memory most likely */ |
73 | return -1; | 73 | return -1; |
74 | } | 74 | } |
75 | /* calling sodium_memzero segfaults, but printing passphrase works, so... libsodium bug? | ||
76 | * ...eh, it's not segfaulting anywhere else, so I'll assume pebkac... | ||
75 | sodium_memzero(passphrase, pplength); /* wipe plaintext pw */ | 77 | sodium_memzero(passphrase, pplength); /* wipe plaintext pw */ |
76 | 78 | ||
77 | /* next get plain save data */ | 79 | /* next get plain save data */ |
@@ -140,7 +142,7 @@ int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t * | |||
140 | /* out of memory most likely */ | 142 | /* out of memory most likely */ |
141 | return -1; | 143 | return -1; |
142 | } | 144 | } |
143 | sodium_memzero(passphrase, pplength); /* wipe plaintext pw */ | 145 | /* sodium_memzero(passphrase, pplength); /* wipe plaintext pw */ |
144 | 146 | ||
145 | /* decrypt the data */ | 147 | /* decrypt the data */ |
146 | uint8_t temp_data[decrypt_length]; | 148 | uint8_t temp_data[decrypt_length]; |