commit b5cfcb2045262a3ce9485c4d5a0c91b89174e539 Author: Nick Mathewson nickm@torproject.org Date: Thu Jul 16 11:10:14 2015 -0400
Fix most check-spaces issues --- src/common/compat.c | 4 +++- src/common/crypto_curve25519.c | 2 +- src/common/util.c | 2 +- src/or/config.c | 1 - src/or/rendcache.c | 11 ++++++----- src/or/rendcache.h | 1 + src/or/routerkeys.c | 1 - src/or/routerparse.c | 1 - src/test/test_crypto_slow.c | 10 +++++----- 9 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/src/common/compat.c b/src/common/compat.c index 07f011d..4930c05 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -80,7 +80,8 @@ wint_t _getwch(void); #define WEOF (wchar_t)(0xFFFF) #endif #if defined(HAVE_DECL_SECUREZEROMEMORY) && !HAVE_DECL_SECUREZEROMEMORY -static inline void SecureZeroMemory(PVOID ptr, SIZE_T cnt) +static inline void +SecureZeroMemory(PVOID ptr, SIZE_T cnt) { volatile char *vcptr = (volatile char*)ptr; while (cnt--) @@ -3378,3 +3379,4 @@ tor_getpass(const char *prompt, char *output, size_t buflen) #error "No implementation for tor_getpass found!" #endif } + diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c index 113ac89..0437824 100644 --- a/src/common/crypto_curve25519.c +++ b/src/common/crypto_curve25519.c @@ -353,7 +353,7 @@ curve25519_basepoint_spot_check(void)
/* Check the most basic possible sanity via the test secret/public key pair * used in "Cryptography in NaCl - 2. Secret keys and public keys". This - * may catch catastrophic failures on systems where Curve25519 is expensive, + * may catch catastrophic failures on systems where Curve25519 is expensive, * without requiring a ton of key generation. */ curve25519_use_ed = 1; diff --git a/src/common/util.c b/src/common/util.c index 1849613..a5b5488 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2561,7 +2561,7 @@ read_file_to_str_until_eof(int fd, size_t max_bytes_to_read, size_t *sz_out) size_t string_max = 0;
if (max_bytes_to_read+1 >= SIZE_T_CEILING) { - errno = EINVAL; + errno = EINVAL; return NULL; }
diff --git a/src/or/config.c b/src/or/config.c index bd74db6..2f65664 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2591,7 +2591,6 @@ options_validate_cb(void *old_options, void *options, void *default_options, STMT_BEGIN log_warn(LD_CONFIG, args, ##__VA_ARGS__); STMT_END #endif
- /** Log a warning message iff <b>filepath</b> is not absolute. * Warning message must contain option name <b>option</b> and * an absolute path that <b>filepath<b> will resolve to. diff --git a/src/or/rendcache.c b/src/or/rendcache.c index 37d3f12..be94ef4 100644 --- a/src/or/rendcache.c +++ b/src/or/rendcache.c @@ -237,7 +237,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e) *e = entry; }
-end: + end: return ret; }
@@ -374,9 +374,9 @@ rend_cache_store_v2_desc_as_dir(const char *desc)
number_stored++; goto advance; -skip: + skip: rend_service_descriptor_free(parsed); -advance: + advance: /* advance to next descriptor, if available. */ current_desc = next_desc; /* check if there is a next descriptor. */ @@ -566,14 +566,15 @@ rend_cache_store_v2_desc_as_client(const char *desc, } return RCS_OKAY;
-okay: + okay: if (entry) { *entry = e; } retval = RCS_OKAY;
-err: + err: rend_service_descriptor_free(parsed); tor_free(intro_content); return retval; } + diff --git a/src/or/rendcache.h b/src/or/rendcache.h index f34f599..f33ea66 100644 --- a/src/or/rendcache.h +++ b/src/or/rendcache.h @@ -54,3 +54,4 @@ rend_cache_store_status_t rend_cache_store_v2_desc_as_client(const char *desc, size_t rend_cache_get_total_allocation(void);
#endif /* TOR_RENDCACHE_H */ + diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 955cb9c..47a6c89 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -61,7 +61,6 @@ read_encrypted_secret_key(ed25519_secret_key_t *out, * it right. */ }
- if (secret_len != ED25519_SECKEY_LEN) { log_err(LD_OR, "%s is corrupted.", fname); saved_errno = EINVAL; diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 3904671..c2206f1 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -4498,7 +4498,6 @@ microdescs_parse_from_string(const char *s, const char *eos, } }
- if (tokenize_string(area, s, start_of_next_microdesc, tokens, microdesc_token_table, flags)) { log_warn(LD_DIR, "Unparseable microdescriptor"); diff --git a/src/test/test_crypto_slow.c b/src/test/test_crypto_slow.c index 2bd76f2..8d6787a 100644 --- a/src/test/test_crypto_slow.c +++ b/src/test/test_crypto_slow.c @@ -172,8 +172,8 @@ test_libscrypt_eq_openssl(void *arg) p = 16;
libscrypt_retval = - libscrypt_scrypt((const uint8_t *)"password", 0, - (const uint8_t *)"NaCl", 0, + libscrypt_scrypt((const uint8_t *)"password", 0, + (const uint8_t *)"NaCl", 0, r, N, p, buf1, dk_len); openssl_retval = EVP_PBE_scrypt((const char *)"password", 0, @@ -211,10 +211,10 @@ test_libscrypt_eq_openssl(void *arg) memset(buf2,0,64);
r = 1048576; - + libscrypt_retval = - libscrypt_scrypt((const uint8_t *)"pleaseletmein", 0, - (const uint8_t *)"SodiumChloride", 0, + libscrypt_scrypt((const uint8_t *)"pleaseletmein", 0, + (const uint8_t *)"SodiumChloride", 0, N, r, p, buf1, dk_len); openssl_retval = EVP_PBE_scrypt((const char *)"pleaseletmein", 0,