diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-12-25 22:25:09 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-01-03 11:29:48 -0500 |
commit | 5f219ddd029348df2d384fca5012d96957885cbc (patch) | |
tree | 436e9e85c7bc06fd31194cf63b021fa069762b21 /src/common | |
parent | f07a5125cb5bb9ee5968ded163cfdd73e5ad028c (diff) | |
download | tor-5f219ddd029348df2d384fca5012d96957885cbc.tar.gz tor-5f219ddd029348df2d384fca5012d96957885cbc.zip |
Use safe_mem_is_zero for checking curve25519 output for 0-ness
This should make the intent more explicit. Probably needless, though.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto_curve25519.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c index 60347065d1..f3ecdb5c7e 100644 --- a/src/common/crypto_curve25519.c +++ b/src/common/crypto_curve25519.c @@ -49,11 +49,7 @@ curve25519_impl(uint8_t *output, const uint8_t *secret, int curve25519_public_key_is_ok(const curve25519_public_key_t *key) { - static const uint8_t zero[] = - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - - return tor_memneq(key->public_key, zero, CURVE25519_PUBKEY_LEN); + return !safe_mem_is_zero(key->public_key, CURVE25519_PUBKEY_LEN); } /** Generate a new keypair and return the secret key. If <b>extra_strong</b> |