summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2013-02-11Merge remote-tracking branch 'public/bug7801_v2'Nick Mathewson
2013-02-08Improve comment at Andrea's requestNick Mathewson
2013-02-08Merge remote-tracking branch 'public/signof_enum'Nick Mathewson
2013-02-08Fix numerous problems with Tor's weak RNG.Nick Mathewson
We need a weak RNG in a couple of places where the strong RNG is both needless and too slow. We had been using the weak RNG from our platform's libc implementation, but that was problematic (because many platforms have exceptionally horrible weak RNGs -- like, ones that only return values between 0 and SHORT_MAX) and because we were using it in a way that was wrong for LCG-based weak RNGs. (We were counting on the low bits of the LCG output to be as random as the high ones, which isn't true.) This patch adds a separate type for a weak RNG, adds an LCG implementation for it, and uses that exclusively where we had been using the platform weak RNG.
2013-02-07Merge remote-tracking branch 'public/easy_ratelim'Nick Mathewson
Conflicts: src/or/connection.c
2013-02-07Have autoconf check whether enums are signed.Nick Mathewson
Fixes bug 7727; fix on 0.2.4.10-alpha.
2013-02-07Merge remote-tracking branch 'public/bug7816_023'Nick Mathewson
Conflicts: src/common/util.c
2013-02-07Tolerate curve25519 backends where the high bit of the pk isn't ignoredNick Mathewson
Right now, all our curve25519 backends ignore the high bit of the public key. But possibly, others could treat the high bit of the public key as encoding out-of-bounds values, or as something to be preserved. This could be used to distinguish clients with different backends, at the cost of killing a circuit. As a workaround, let's just clear the high bit of each public key indiscriminately before we use it. Fix for bug 8121, reported by rransom. Bugfix on 0.2.4.8-alpha.
2013-02-04Fix compilation with --disable-curve25519 optionNick Mathewson
The fix is to move the two functions to format/parse base64 curve25519 public keys into a new "crypto_format.c" file. I could have put them in crypto.c, but that's a big file worth splitting anyway. Fixes bug 8153; bugfix on 0.2.4.8-alpha where I did the fix for 7869.
2013-02-01fix wide lines from tor_log renameNick Mathewson
2013-02-01Fix a silly mistake in the tor_mathlog() documentation. Give it a unit test.Nick Mathewson
2013-02-01Remove old wrapper code and defines for keeping log() and log(3) apartNick Mathewson
This is the non-automated portion of bug 7599.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-31typo in crypto_curve25519.c comment, spotted by rransomNick Mathewson
2013-01-31whitespace fixNick Mathewson
2013-01-29Detect platforms where memset(0) doesn't set doubles to 0.0.Nick Mathewson
This is allowed by the C statndard, which permits you to represent doubles any way you like, but in practice we have some code that assumes that memset() clears doubles in structs. Noticed as part of 7802 review; see 8081 for more info.
2013-01-21More of b30d06255c24165 for #6826: fix compat_libevent compilationNick Mathewson
It looks like there was a compilation error for 6826 on some platforms. Removing even more now-uncallable code to handle detecting libevent versions before 1.3e. Fixes bug 8012; bug not in any released Tor.
2013-01-17Replace base-{16,32,64} with base{16,32,64} in the codeNick Mathewson
Patch from onizuka generated with find ./ -type f -perm -u+rw -exec sed -ri 's/(Base)-(16|32|64)/\1\2/gi' {} \; Fixes issue 6875 on Tor.
2013-01-17Add ntor-related modules to the Makefiles.nmakeNick Mathewson
2013-01-17Even more code-removal for 6826Nick Mathewson
(Pull on a thread and the whole sweater unravels.)
2013-01-17Merge branch 'bug6826_squashed'Nick Mathewson
2013-01-17Drop detection logic for pre-1.3 busted libeventsNick Mathewson
This won't actually break them any worse than they were broken before: it just removes a set of warnings that nobody was actually seeing, I hope. Closes 6826
2013-01-17Merge remote-tracking branch 'public/bug6302'Nick Mathewson
2013-01-16Merge branch '024_msvc_squashed'Nick Mathewson
Conflicts: src/or/or.h srcwin32/orconfig.h
2013-01-16Fix an instance of snprintf; don't use _snprintf directlyNick Mathewson
2013-01-16When building with MSVC, call every enum bitfield unsignedNick Mathewson
Fixes bug 7305.
2013-01-16Fix a const warning under msvcNick Mathewson
2013-01-16Add clean target and test subdir to makefile.nmakeNick Mathewson
2013-01-16Add missing includes and libs to makefile.nmakeNick Mathewson
Fixes bugs 7312 and 7310.
2013-01-16Define SIZEOF_INTPTR_T when defining replacement intptr_tNick Mathewson
Fixes bug 7669
2013-01-16Rename *_isin to *_containsNick Mathewson
This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
2013-01-16Refactor: Use SOCK_ERRNO to avoid some #ifdef _WIN32sNick Mathewson
Fixes ticket 6302
2013-01-16Check for nacl headers in nacl/ subdirNick Mathewson
Fix for bug 7972
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-15Clean up odds and endsRoger Dingledine
2013-01-14Merge branch 'bug7869'Nick Mathewson
2013-01-11Handle EWOULDBLOCK as EAGAIN if they happen to be different.Nick Mathewson
Fixes bug 7935. Reported by 'oftc_must_be_destroyed'.
2013-01-05Make the = at the end of ntor-onion-key optional.Nick Mathewson
Makes bug 7869 more easily fixable if we ever choose to do so.
2013-01-03Merge branch 'ntor-resquashed'Nick Mathewson
Conflicts: src/or/cpuworker.c src/or/or.h src/test/bench.c
2013-01-03Check all crypto_rand return values for ntor.Nick Mathewson
2013-01-03Use safe_mem_is_zero for checking curve25519 output for 0-nessNick Mathewson
This should make the intent more explicit. Probably needless, though.
2013-01-03Implement a constant-time safe_mem_is_zero.Nick Mathewson
2013-01-03Make libcurve25519_donna get built as a .aNick Mathewson
This lets us give it compiler flags differing from the rest of libor-crypto.a
2013-01-02Move curve25519 keypair type to src/common; give it functionsNick Mathewson
This patch moves curve25519_keypair_t from src/or/onion_ntor.h to src/common/crypto_curve25519.h, and adds new functions to generate, load, and store keypairs.
2013-01-02Refactor strong os-RNG into its own functionNick Mathewson
Previously, we only used the strong OS entropy source as part of seeding OpenSSL's RNG. But with curve25519, we'll have occasion to want to generate some keys using extremely-good entopy, as well as the means to do so. So let's! This patch refactors the OS-entropy wrapper into its own crypto_strongest_rand() function, and makes our new curve25519_secret_key_generate function try it as appropriate.
2013-01-02Add a wrapper around, and test and build support for, curve25519.Nick Mathewson
We want to use donna-c64 when we have a GCC with support for 64x64->uint128_t multiplying. If not, we want to use libnacl if we can, unless it's giving us the unsafe "ref" implementation. And if that isn't going to work, we'd like to use the portable-and-safe-but-slow 32-bit "donna" implementation. We might need more library searching for the correct libnacl, especially once the next libnacl release is out -- it's likely to have bunches of better curve25519 implementations. I also define a set of curve25519 wrapper functions, though it really shouldn't be necessary. We should eventually make the -donna*.c files get build with -fomit-frame-pointer, since that can make a difference.
2013-01-02Add a data-invariant linear-search map structureNick Mathewson
I'm going to use this for looking op keys server-side for ntor.
2012-12-31Fix a couple of harmless clang3.2 warningsSebastian Hahn
2012-12-28Fix various small leaks on error casesNick Mathewson
Spotted by coverity, bug 7816, bugfix on various versions.
2012-12-26Wrapper function for the common rate-limited-log pattern.Nick Mathewson