diff options
author | Roman Proskuryakov <humbug@deeptown.org> | 2016-01-24 19:16:40 +0300 |
---|---|---|
committer | Roman Proskuryakov <humbug@deeptown.org> | 2016-01-27 02:14:59 +0300 |
commit | ed3a794c9bf6380801ee21c816505f457b6a1348 (patch) | |
tree | 14e1b8fa1c8c1b7f45b08bae5e0b6169054c3751 /toxcore/util.c | |
parent | 61f8e65c0157049ac26bf9b081ba6842d7defdeb (diff) |
fix: compare sensitive data with sodium_memcmp
fix: make increment_nonce & increment_nonce_number independent of user-controlled input
fix: make crypto_core more stable agains null ptr dereference
Diffstat (limited to 'toxcore/util.c')
-rw-r--r-- | toxcore/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/util.c b/toxcore/util.c index 28d8721c..ea1988e4 100644 --- a/toxcore/util.c +++ b/toxcore/util.c | |||
@@ -60,7 +60,7 @@ int is_timeout(uint64_t timestamp, uint64_t timeout) | |||
60 | /* id functions */ | 60 | /* id functions */ |
61 | bool id_equal(const uint8_t *dest, const uint8_t *src) | 61 | bool id_equal(const uint8_t *dest, const uint8_t *src) |
62 | { | 62 | { |
63 | return memcmp(dest, src, crypto_box_PUBLICKEYBYTES) == 0; | 63 | return public_key_cmp(dest, src) == 0; |
64 | } | 64 | } |
65 | 65 | ||
66 | uint32_t id_copy(uint8_t *dest, const uint8_t *src) | 66 | uint32_t id_copy(uint8_t *dest, const uint8_t *src) |