diff options
author | David Goulet <dgoulet@torproject.org> | 2019-05-07 08:02:39 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-05-07 08:02:39 -0400 |
commit | b72f5da03d12e0ac2212d18e3dea309d23ded79c (patch) | |
tree | 82789d2222286e6b5500cb357448def627171df9 /src/lib/crypt_ops | |
parent | c8c64caf371c2960bf217fc10d2353144e7e24b3 (diff) | |
parent | 295feeb09377c4d78f9ee43ec3197b908d7cb960 (diff) | |
download | tor-b72f5da03d12e0ac2212d18e3dea309d23ded79c.tar.gz tor-b72f5da03d12e0ac2212d18e3dea309d23ded79c.zip |
Merge branch 'tor-github/pr/994'
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/lib/crypt_ops')
-rw-r--r-- | src/lib/crypt_ops/crypto_ed25519.c | 2 | ||||
-rw-r--r-- | src/lib/crypt_ops/crypto_format.c | 2 | ||||
-rw-r--r-- | src/lib/crypt_ops/crypto_rand.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/crypt_ops/crypto_ed25519.c b/src/lib/crypt_ops/crypto_ed25519.c index 400f963898..0581529125 100644 --- a/src/lib/crypt_ops/crypto_ed25519.c +++ b/src/lib/crypt_ops/crypto_ed25519.c @@ -226,7 +226,7 @@ ed25519_keypair_generate(ed25519_keypair_t *keypair_out, int extra_strong) int ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey) { - return tor_mem_is_zero((char*)pubkey->pubkey, ED25519_PUBKEY_LEN); + return safe_mem_is_zero((char*)pubkey->pubkey, ED25519_PUBKEY_LEN); } /* Return a heap-allocated array that contains <b>msg</b> prefixed by the diff --git a/src/lib/crypt_ops/crypto_format.c b/src/lib/crypt_ops/crypto_format.c index e11b391194..118cd79045 100644 --- a/src/lib/crypt_ops/crypto_format.c +++ b/src/lib/crypt_ops/crypto_format.c @@ -104,7 +104,7 @@ crypto_read_tagged_contents_from_file(const char *fname, prefix[32] = 0; /* Check type, extract tag. */ if (strcmpstart(prefix, "== ") || strcmpend(prefix, " ==") || - ! tor_mem_is_zero(prefix+strlen(prefix), 32-strlen(prefix))) { + ! fast_mem_is_zero(prefix+strlen(prefix), 32-strlen(prefix))) { saved_errno = EINVAL; goto end; } diff --git a/src/lib/crypt_ops/crypto_rand.c b/src/lib/crypt_ops/crypto_rand.c index 0b1cb96c1b..79c8ed1eed 100644 --- a/src/lib/crypt_ops/crypto_rand.c +++ b/src/lib/crypt_ops/crypto_rand.c @@ -36,6 +36,7 @@ #include "lib/defs/digest_sizes.h" #include "lib/crypt_ops/crypto_digest.h" +#include "lib/ctime/di_ops.h" #ifdef ENABLE_NSS #include "lib/crypt_ops/crypto_nss_mgt.h" @@ -314,7 +315,7 @@ crypto_strongest_rand_raw(uint8_t *out, size_t out_len) } } - if ((out_len < sanity_min_size) || !tor_mem_is_zero((char*)out, out_len)) + if ((out_len < sanity_min_size) || !safe_mem_is_zero((char*)out, out_len)) return 0; } |