aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-05-27 17:55:51 -0400
committerNick Mathewson <nickm@torproject.org>2009-05-27 17:55:51 -0400
commitec7e0546681f57a1ba1769cca2b8339f9b0dc8b0 (patch)
treeec878942a37b05ee542606c1ee6ebe42c6b43d15 /src/common
parentf0453c45c8c3963762b208cfe4f6fb2e1e96cc34 (diff)
downloadtor-ec7e0546681f57a1ba1769cca2b8339f9b0dc8b0.tar.gz
tor-ec7e0546681f57a1ba1769cca2b8339f9b0dc8b0.zip
Spell-check Tor.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/address.c20
-rw-r--r--src/common/aes.c12
-rw-r--r--src/common/compat.c18
-rw-r--r--src/common/compat.h2
-rw-r--r--src/common/container.c2
-rw-r--r--src/common/container.h4
-rw-r--r--src/common/crypto.c38
-rw-r--r--src/common/ht.h2
-rw-r--r--src/common/log.h2
-rw-r--r--src/common/util.h2
10 files changed, 51 insertions, 51 deletions
diff --git a/src/common/address.c b/src/common/address.c
index ced1d0cd8f..fac9d50e15 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -465,7 +465,7 @@ tor_addr_to_reverse_lookup_name(char *out, size_t outlen,
*cp++ = "0123456789abcdef"[byte >> 4];
*cp++ = '.';
}
- memcpy(cp, "ip6.arpa", 9); /* 8 characters plus nul */
+ memcpy(cp, "ip6.arpa", 9); /* 8 characters plus NUL */
return 0;
}
return -1;
@@ -619,7 +619,7 @@ tor_addr_parse_mask_ports(const char *s, tor_addr_t *addr_out,
} else {
if (mask) {
log_warn(LD_GENERAL,
- "Unexpected mask in addrss %s; rejecting", escaped(s));
+ "Unexpected mask in address %s; rejecting", escaped(s));
goto err;
}
}
@@ -642,7 +642,7 @@ tor_addr_parse_mask_ports(const char *s, tor_addr_t *addr_out,
} else {
if (port) {
log_warn(LD_GENERAL,
- "Unexpected ports in addrss %s; rejecting", escaped(s));
+ "Unexpected ports in address %s; rejecting", escaped(s));
goto err;
}
}
@@ -654,9 +654,9 @@ tor_addr_parse_mask_ports(const char *s, tor_addr_t *addr_out,
return -1;
}
-/** Determine whether an address is IPv4, either native or ipv4-mapped ipv6.
+/** Determine whether an address is IPv4, either native or IPv4-mapped IPv6.
* Note that this is about representation only, as any decent stack will
- * reject ipv4-mapped addresses received on the wire (and won't use them
+ * reject IPv4-mapped addresses received on the wire (and won't use them
* on the wire either).
*/
int
@@ -766,11 +766,11 @@ tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
/** Given two addresses <b>addr1</b> and <b>addr2</b>, return 0 if the two
* addresses are equivalent under the mask mbits, less than 0 if addr1
- * preceeds addr2, and greater than 0 otherwise.
+ * precedes addr2, and greater than 0 otherwise.
*
* Different address families (IPv4 vs IPv6) are always considered unequal if
* <b>how</b> is CMP_EXACT; otherwise, IPv6-mapped IPv4 addresses are
- * cosidered equivalent to their IPv4 equivalents.
+ * considered equivalent to their IPv4 equivalents.
*/
int
tor_addr_compare(const tor_addr_t *addr1, const tor_addr_t *addr2,
@@ -1021,7 +1021,7 @@ tor_addr_port_parse(const char *s, tor_addr_t *addr_out, uint16_t *port_out)
}
/** Set *<b>addr</b> to the IP address (if any) of whatever interface
- * connects to the internet. This address should only be used in checking
+ * connects to the Internet. This address should only be used in checking
* whether our address has changed. Return 0 on success, -1 on failure.
*/
int
@@ -1039,7 +1039,7 @@ get_interface_address6(int severity, sa_family_t family, tor_addr_t *addr)
/* Use the "discard" service port */
((struct sockaddr_in*)&target_addr)->sin_port = 9;
/* Don't worry: no packets are sent. We just need to use a real address
- * on the actual internet. */
+ * on the actual Internet. */
if (family == AF_INET6) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)&target_addr;
sock = tor_open_socket(PF_INET6,SOCK_DGRAM,IPPROTO_UDP);
@@ -1380,7 +1380,7 @@ tor_dup_ip(uint32_t addr)
/**
* Set *<b>addr</b> to the host-order IPv4 address (if any) of whatever
- * interface connects to the internet. This address should only be used in
+ * interface connects to the Internet. This address should only be used in
* checking whether our address has changed. Return 0 on success, -1 on
* failure.
*/
diff --git a/src/common/aes.c b/src/common/aes.c
index 5a979bfa58..e07665635b 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -27,9 +27,9 @@
* via OpenSSL's EVP_EncryptUpdate function, or via the built-in AES
* implementation below. */
-/** Defined iff we're using openssl's AES functions for AES. */
+/** Defined iff we're using OpenSSL's AES functions for AES. */
#undef USE_OPENSSL_AES
-/** Defined iff we're using openssl's EVP code for AES. */
+/** Defined iff we're using OpenSSL's EVP code for AES. */
#undef USE_OPENSSL_EVP
/** Defined iff we're using Tor's internal AES implementation, defined
* below. */
@@ -64,13 +64,13 @@
!defined(USE_OPENSSL_EVP))
/* OpenSSL 0.9.7 was the first to support AES. It was slower than our
- * builtin implementation.
+ * built-in implementation.
* OpenSSL 0.9.8 added assembly implementations for i386 and ia64.
* Either the i386 stuff isn't used for x86-64, or it isn't faster.
* OpenSSL 0.9.9 (not yet out) has added assembly implementations for
* x86_64 (aka amd64), sparc9, and arm
*
- * Note: the "f" at the end of openssl version numbers below means
+ * Note: the "f" at the end of OpenSSL version numbers below means
* "release". */
# if defined(CPU_IS_X86) || defined(CPU_IS_IA64)
# if OPENSSL_VERSION_NUMBER >= 0x0090800fL
@@ -84,7 +84,7 @@
# endif
# endif
-/* Otherwise, use the builtin implementation below. */
+/* Otherwise, use the built-in implementation below. */
# ifndef USE_OPENSSL_AES
# define USE_BUILTIN_AES
# endif
@@ -380,7 +380,7 @@ aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv)
*
* @version 3.0 (December 2000)
*
- * Optimised ANSI C code for the Rijndael cipher (now AES)
+ * Optimized ANSI C code for the Rijndael cipher (now AES)
*
* @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
* @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
diff --git a/src/common/compat.c b/src/common/compat.c
index 51794c762c..35bb3a9ad3 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -403,7 +403,7 @@ const char TOR_TOLOWER_TABLE[256] = {
* function is called on __FILE__ to fix a MSVC nit where __FILE__
* contains the full path to the file. This is bad, because it
* confuses users to find the home directory of the person who
- * compiled the binary in their warrning messages.
+ * compiled the binary in their warning messages.
*/
const char *
tor_fix_source_file(const char *fname)
@@ -490,7 +490,7 @@ set_uint64(char *cp, uint64_t v)
}
/**
- * Rename the file <b>from</b> to the file <b>to</b>. On unix, this is
+ * Rename the file <b>from</b> to the file <b>to</b>. On Unix, this is
* the same as rename(2). On windows, this removes <b>to</b> first if
* it already exists.
* Returns 0 on success. Returns -1 and sets errno on failure.
@@ -632,7 +632,7 @@ tor_lockfile_unlock(tor_lockfile_t *lockfile)
tor_free(lockfile);
}
-/* Some old versions of unix didn't define constants for these values,
+/* Some old versions of Unix didn't define constants for these values,
* and instead expect you to say 0, 1, or 2. */
#ifndef SEEK_CUR
#define SEEK_CUR 1
@@ -1568,7 +1568,7 @@ get_uname(void)
if (!uname_result_is_set) {
#ifdef HAVE_UNAME
if (uname(&u) != -1) {
- /* (linux says 0 is success, solaris says 1 is success) */
+ /* (Linux says 0 is success, Solaris says 1 is success) */
tor_snprintf(uname_result, sizeof(uname_result), "%s %s",
u.sysname, u.machine);
} else
@@ -1729,7 +1729,7 @@ tor_pthread_helper_fn(void *_data)
#endif
/** Minimalist interface to run a void function in the background. On
- * unix calls fork, on win32 calls beginthread. Returns -1 on failure.
+ * Unix calls fork, on win32 calls beginthread. Returns -1 on failure.
* func should not return, but rather should call spawn_exit.
*
* NOTE: if <b>data</b> is used, it should not be allocated on the stack,
@@ -1803,7 +1803,7 @@ tor_gettimeofday(struct timeval *timeval)
{
#ifdef MS_WINDOWS
/* Epoch bias copied from perl: number of units between windows epoch and
- * unix epoch. */
+ * Unix epoch. */
#define EPOCH_BIAS U64_LITERAL(116444736000000000)
#define UNITS_PER_SEC U64_LITERAL(10000000)
#define USEC_PER_SEC U64_LITERAL(1000000)
@@ -1936,7 +1936,7 @@ static pthread_mutexattr_t attr_reentrant;
/** True iff we've called tor_threads_init() */
static int threads_initialized = 0;
/** Initialize <b>mutex</b> so it can be locked. Every mutex must be set
- * up eith tor_mutex_init() or tor_mutex_new(); not both. */
+ * up with tor_mutex_init() or tor_mutex_new(); not both. */
void
tor_mutex_init(tor_mutex_t *mutex)
{
@@ -2259,7 +2259,7 @@ struct { int code; const char *msg; } windows_socket_errors[] = {
*/
{ -1, NULL },
};
-/** There does not seem to be a strerror equivalent for winsock errors.
+/** There does not seem to be a strerror equivalent for Winsock errors.
* Naturally, we have to roll our own.
*/
const char *
@@ -2301,7 +2301,7 @@ network_init(void)
/** Return a newly allocated string describing the windows system error code
* <b>err</b>. Note that error codes are different from errno. Error codes
* come from GetLastError() when a winapi call fails. errno is set only when
- * ansi functions fail. Whee. */
+ * ANSI functions fail. Whee. */
char *
format_win32_error(DWORD err)
{
diff --git a/src/common/compat.h b/src/common/compat.h
index 0e2875dabc..edc38faf64 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2003-2004, Roger Dingledinex
+/* Copyright (c) 2003-2004, Roger Dingledine
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2009, The Tor Project, Inc. */
/* See LICENSE for licensing information */
diff --git a/src/common/container.c b/src/common/container.c
index 1ef0044f1b..c649787c0f 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -1227,7 +1227,7 @@ IMPLEMENT_ORDER_FUNC(find_nth_long, long)
digestset_t *
digestset_new(int max_elements)
{
- /* The probability of false positivies is about P=(1 - exp(-kn/m))^k, where k
+ /* The probability of false positives is about P=(1 - exp(-kn/m))^k, where k
* is the number of hash functions per entry, m is the bits in the array,
* and n is the number of elements inserted. For us, k==4, n<=max_elements,
* and m==n_bits= approximately max_elements*32. This gives
diff --git a/src/common/container.h b/src/common/container.h
index f7f835874b..e626552467 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -11,7 +11,7 @@
/** A resizeable list of pointers, with associated helpful functionality.
*
* The members of this struct are exposed only so that macros and inlines can
- * use them; all access to smartlist internals should go throuch the functions
+ * use them; all access to smartlist internals should go through the functions
* and macros defined here.
**/
typedef struct smartlist_t {
@@ -229,7 +229,7 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
STMT_END
/* Helper: Given two lists of items, possibly of different types, such that
- * both lists are sorted on some common field (as determened by a comparison
+ * both lists are sorted on some common field (as determined by a comparison
* expression <b>cmpexpr</b>), and such that one list (<b>sl1</b>) has no
* duplicates on the common field, loop through the lists in lockstep, and
* execute <b>unmatched_var2</b> on items in var2 that do not appear in
diff --git a/src/common/crypto.c b/src/common/crypto.c
index bc7eb0c6ca..037982601b 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -18,7 +18,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <wincrypt.h>
-/* Windows defines this; so does openssl 0.9.8h and later. We don't actually
+/* Windows defines this; so does OpenSSL 0.9.8h and later. We don't actually
* use either definition. */
#undef OCSP_RESPONSE
#endif
@@ -56,7 +56,7 @@
#include "compat.h"
#if OPENSSL_VERSION_NUMBER < 0x00907000l
-#error "We require openssl >= 0.9.7"
+#error "We require OpenSSL >= 0.9.7"
#endif
#include <openssl/engine.h>
@@ -67,13 +67,13 @@
#define PRIVATE_KEY_OK(k) ((k) && (k)->key && (k)->key->p)
#ifdef TOR_IS_MULTITHREADED
-/** A number of prealloced mutexes for use by openssl. */
+/** A number of preallocated mutexes for use by OpenSSL. */
static tor_mutex_t **_openssl_mutexes = NULL;
-/** How many mutexes have we allocated for use by openssl? */
+/** How many mutexes have we allocated for use by OpenSSL? */
static int _n_openssl_mutexes = 0;
#endif
-/** A public key, or a public/private keypair. */
+/** A public key, or a public/private key-pair. */
struct crypto_pk_env_t
{
int refs; /* reference counting so we don't have to copy keys */
@@ -405,10 +405,10 @@ crypto_pk_generate_key(crypto_pk_env_t *env)
if (env->key)
RSA_free(env->key);
#if OPENSSL_VERSION_NUMBER < 0x00908000l
- /* In openssl 0.9.7, RSA_generate_key is all we have. */
+ /* In OpenSSL 0.9.7, RSA_generate_key is all we have. */
env->key = RSA_generate_key(PK_BYTES*8,65537, NULL, NULL);
#else
- /* In openssl 0.9.8, RSA_generate_key is deprecated. */
+ /* In OpenSSL 0.9.8, RSA_generate_key is deprecated. */
{
BIGNUM *e = BN_new();
RSA *r = NULL;
@@ -452,7 +452,7 @@ crypto_pk_read_private_key_from_string(crypto_pk_env_t *env,
tor_assert(env);
tor_assert(s);
- /* Create a read-only memory BIO, backed by the nul-terminated string 's' */
+ /* Create a read-only memory BIO, backed by the NUL-terminated string 's' */
b = BIO_new_mem_buf((char*)s, -1);
if (env->key)
@@ -1054,7 +1054,7 @@ crypto_pk_asn1_decode(const char *str, size_t len)
RSA *rsa;
unsigned char *buf;
/* This ifdef suppresses a type warning. Take out the first case once
- * everybody is using openssl 0.9.7 or later.
+ * everybody is using OpenSSL 0.9.7 or later.
*/
const unsigned char *cp;
cp = buf = tor_malloc(len);
@@ -1393,7 +1393,7 @@ crypto_digest_add_bytes(crypto_digest_env_t *digest, const char *data,
tor_assert(digest);
tor_assert(data);
/* Using the SHA1_*() calls directly means we don't support doing
- * sha1 in hardware. But so far the delay of getting the question
+ * SHA1 in hardware. But so far the delay of getting the question
* to the hardware, and hearing the answer, is likely higher than
* just doing it ourselves. Hashes are fast.
*/
@@ -1554,7 +1554,7 @@ crypto_dh_generate_public(crypto_dh_env_t *dh)
if (tor_check_dh_key(dh->dh->pub_key)<0) {
log_warn(LD_CRYPTO, "Weird! Our own DH key was invalid. I guess once-in-"
"the-universe chances really do happen. Trying again.");
- /* Free and clear the keys, so openssl will actually try again. */
+ /* Free and clear the keys, so OpenSSL will actually try again. */
BN_free(dh->dh->pub_key);
BN_free(dh->dh->priv_key);
dh->dh->pub_key = dh->dh->priv_key = NULL;
@@ -1593,7 +1593,7 @@ crypto_dh_get_public(crypto_dh_env_t *dh, char *pubkey, size_t pubkey_len)
return 0;
}
-/** Check for bad diffie-hellman public keys (g^x). Return 0 if the key is
+/** Check for bad Diffie-Hellman public keys (g^x). Return 0 if the key is
* okay (in the subgroup [2,p-2]), or -1 if it's bad.
* See http://www.cl.cam.ac.uk/ftp/users/rja14/psandqs.ps.gz for some tips.
*/
@@ -1742,11 +1742,11 @@ crypto_dh_free(crypto_dh_env_t *dh)
* work for us too. */
#define ADD_ENTROPY 32
-/* Use RAND_poll if openssl is 0.9.6 release or later. (The "f" means
+/* Use RAND_poll if OpenSSL is 0.9.6 release or later. (The "f" means
"release".) */
#define HAVE_RAND_POLL (OPENSSL_VERSION_NUMBER >= 0x0090600fl)
-/* Versions of openssl prior to 0.9.7k and 0.9.8c had a bug where RAND_poll
+/* Versions of OpenSSL prior to 0.9.7k and 0.9.8c had a bug where RAND_poll
* would allocate an fd_set on the stack, open a new file, and try to FD_SET
* that fd without checking whether it fit in the fd_set. Thus, if the
* system has not just been started up, it is unsafe to call */
@@ -2281,7 +2281,7 @@ secret_to_key(char *key_out, size_t key_out_len, const char *secret,
}
#ifdef TOR_IS_MULTITHREADED
-/** Helper: openssl uses this callback to manipulate mutexes. */
+/** Helper: OpenSSL uses this callback to manipulate mutexes. */
static void
_openssl_locking_cb(int mode, int n, const char *file, int line)
{
@@ -2298,12 +2298,12 @@ _openssl_locking_cb(int mode, int n, const char *file, int line)
tor_mutex_release(_openssl_mutexes[n]);
}
-/** OpenSSL helper type: wraps a Tor mutex so that openssl can */
+/** OpenSSL helper type: wraps a Tor mutex so that OpenSSL can */
struct CRYPTO_dynlock_value {
tor_mutex_t *lock;
};
-/** Openssl callback function to allocate a lock: see CRYPTO_set_dynlock_*
+/** OpenSSL callback function to allocate a lock: see CRYPTO_set_dynlock_*
* documentation in OpenSSL's docs for more info. */
static struct CRYPTO_dynlock_value *
_openssl_dynlock_create_cb(const char *file, int line)
@@ -2316,7 +2316,7 @@ _openssl_dynlock_create_cb(const char *file, int line)
return v;
}
-/** Openssl callback function to acquire or release a lock: see
+/** OpenSSL callback function to acquire or release a lock: see
* CRYPTO_set_dynlock_* documentation in OpenSSL's docs for more info. */
static void
_openssl_dynlock_lock_cb(int mode, struct CRYPTO_dynlock_value *v,
@@ -2330,7 +2330,7 @@ _openssl_dynlock_lock_cb(int mode, struct CRYPTO_dynlock_value *v,
tor_mutex_release(v->lock);
}
-/** Openssl callback function to free a lock: see CRYPTO_set_dynlock_*
+/** OpenSSL callback function to free a lock: see CRYPTO_set_dynlock_*
* documentation in OpenSSL's docs for more info. */
static void
_openssl_dynlock_destroy_cb(struct CRYPTO_dynlock_value *v,
diff --git a/src/common/ht.h b/src/common/ht.h
index ff1e5551cc..b31492ec3c 100644
--- a/src/common/ht.h
+++ b/src/common/ht.h
@@ -426,7 +426,7 @@ ht_string_hash(const char *s)
/*
* Copyright 2005, Nick Mathewson. Implementation logic is adapted from code
- * by Cristopher Clark, retrofit to allow drop-in memory management, and to
+ * by Christopher Clark, retrofit to allow drop-in memory management, and to
* use the same interface as Niels Provos's HT_H. I'm not sure whether this
* is a derived work any more, but whether it is or not, the license below
* applies.
diff --git a/src/common/log.h b/src/common/log.h
index c72fb6fb16..834b1724b3 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -53,7 +53,7 @@
/** Catch-all for miscellaneous events and fatal errors. */
#define LD_GENERAL (1u<<0)
-/** The cryptography subsytem. */
+/** The cryptography subsystem. */
#define LD_CRYPTO (1u<<1)
/** Networking. */
#define LD_NET (1u<<2)
diff --git a/src/common/util.h b/src/common/util.h
index 6d59754d90..dca2f86cd1 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -29,7 +29,7 @@
*/
#ifdef NDEBUG
/* Nobody should ever want to build with NDEBUG set. 99% of our asserts will
- * be outside the critical path anyway, so it's silly to disable bugchecking
+ * be outside the critical path anyway, so it's silly to disable bug-checking
* throughout the entire program just because a few asserts are slowing you
* down. Profile, optimize the critical path, and keep debugging on.
*