summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2016-12-02Add accessor for inspecting timer callbacks.Nick Mathewson
2016-12-01Add an extra warning message to check_private_dirteor
2016-11-22Merge remote-tracking branch 'teor/fix-mingw-pagesize'Nick Mathewson
2016-11-16finish_writing_to_file_impl(): Remove temporary file if replacing the ↵Fabian Keil
existing one failed Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-08Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-08Use va_copy() in pure-windows version of tor_asprintf().Nick Mathewson
It's not okay to use the same varargs list twice, and apparently some windows build environments produce code here that would leave tor_asprintf() broken. Fix for bug 20560; bugfix on 0.2.2.11-alpha when tor_asprintf() was introduced.
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
Conflicts: src/or/rendservice.c
2016-11-07Merge remote-tracking branch 'teor/bug20484_029_v2' into maint-0.2.9Nick Mathewson
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-06Always Use EVP_aes_*_ctr() with openssl 1.1Nick Mathewson
(OpenSSL 1.1 makes EVP_CIPHER_CTX opaque, _and_ adds acceleration for counter mode on more architectures. So it won't work if we try the older approach, and it might help if we try the newer one.) Fixes bug 20588.
2016-11-03Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2016-11-03Merge branch 'bug20551_028' into maint-0.2.8Nick Mathewson
2016-11-03Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2016-11-03Merge branch 'bug20553_028'Nick Mathewson
2016-11-03Work around a behavior change in openssl's BUF_MEM codeNick Mathewson
In our code to write public keys to a string, for some unfathomable reason since 253f0f160e1185c, we would allocate a memory BIO, then set the NOCLOSE flag on it, extract its memory buffer, and free it. Then a little while later we'd free the memory buffer with BUF_MEM_free(). As of openssl 1.1 this doesn't work any more, since there is now a BIO_BUF_MEM structure that wraps the BUF_MEM structure. This BIO_BUF_MEM doesn't get freed in our code. So, we had a memory leak! Is this an openssl bug? Maybe. But our code was already pretty silly. Why mess around with the NOCLOSE flag here when we can just keep the BIO object around until we don't need the buffer any more? Fixes bug 20553; bugfix on 0.0.2pre8
2016-11-03Merge branch 'bug20551_028'Nick Mathewson
2016-11-03Use explicit casts to avoid warnings when building with openssl 1.1Nick Mathewson
fixes bug 20551; bugfix on 0.2.1.1-alpha
2016-11-03Merge branch 'feature_15055_v2'Nick Mathewson
2016-11-03Audit use of tor_tls_cert_get_key().Nick Mathewson
This function is allowed to return NULL if the certified key isn't RSA. But in a couple of places we were treating this as a bug or internal error, and in one other place we weren't checking for it at all! Caught by Isis during code review for #15055. The serious bug was only on the 15055 branch, thank goodness.
2016-11-03Generate our x509 certificates using sha256, not sha1.Nick Mathewson
All supported Tors (0.2.4+) require versions of openssl that can handle this. Now that our link certificates are RSA2048, this might actually help vs fingerprinting a little.
2016-11-03For testing: add a tor_x509_cert_dup().Nick Mathewson
2016-11-03Increase TLS RSA link key length to 2048 bitsNick Mathewson
Oddly, nothing broke. Closes ticket 13752.
2016-11-03Make the current time an argument to x509 cert-checking functionsNick Mathewson
This makes the code a bit cleaner by having more of the functions be pure functions that don't depend on the current time.
2016-11-03New authentication types to use RFC5705.Nick Mathewson
See proposal 244. This feature lets us stop looking at the internals of SSL objects, *and* should let us port better to more SSL libraries, if they have RFC5705 support. Preparatory for #19156
2016-11-03Check for getpagesize before using it to mmap filesteor
This fixes compilation in some MinGW environments. Fixes bug 20530; bugfix on commit bf72878 in tor-0.1.2.1-alpha. Reported by "ice".
2016-11-02Improve comments in check_private_dir and onion poisoningteor
Comment changes only
2016-10-31Merge branch 'maint-0.2.9'Nick Mathewson
2016-10-31Actually clamp the number of detected CPUs to 16.Nick Mathewson
Previously we said we did, but didn't. Fixes #19968; bugfix on 0.2.3.1-alpha.
2016-10-27Automated change to use smartlist_add_strdupovercaffeinated
Use the following coccinelle script to change uses of smartlist_add(sl, tor_strdup(str)) to smartlist_add_strdup(sl, string) (coccinelle script from nickm via bug 20048): @@ expression a; expression b; @@ - smartlist_add + smartlist_add_strdup (a, - tor_strdup( b - ) )
2016-10-27Add implementation of smartlist_add_strdupovercaffeinated
Add smartlist_add_strdup(sl, string) - replaces the use of smartlist_add(sl, tor_strdup(string)). Fixes bug 20048.
2016-10-17Fix a syntax problemNick Mathewson
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-10-14Merge remote-tracking branch 'public/spaces_in_unix_addrs'Nick Mathewson
2016-10-11Switch from "AF_UNIX is always equal" to "always unequal" to avoid wacky ↵Nick Mathewson
bugs. See discussion on 20261
2016-10-11Merge remote-tracking branch 'yawning-schwanenlied/bug20261'Nick Mathewson
2016-10-11torrc parsing b0rks on carriage-returnpaolo.ingls@gmail.com
(Specifically, carriage return after a quoted value in a config line. Fixes bug 19167; bugfix on 0.2.0.16-alpha when we introduced support for quoted values. Unit tests, changes file, and this parenthetical by nickm.)
2016-10-10Bug 20261: Treat AF_UNIX addresses as equal when comparing them.Yawning Angel
This is a kludge to deal with the fact that `tor_addr_t` doesn't contain `sun_path`. This currently ONLY happens when circuit isolation is being checked, for an isolation mode that is force disabled anyway, so the kludge is "ugly but adequate", but realistically, making `tor_addr_t` and the AF_UNIX SocksPort code do the right thing is probably the better option.
2016-10-06Stop implying that we support openssl 1.0.0; we don't.Nick Mathewson
Closes ticket 20303. The LIBRESSL_VERSION_NUMBER check is needed because if our openssl is really libressl, it will have an openssl version number we can't really believe.
2016-10-04Allow a unix: address to contain a C-style quoted string.Nick Mathewson
Feature 18753 -- all this to allow spaces.
2016-10-03Avoid reordering IPv6 interface addressescypherpunks
When deleting unsuitable addresses in get_interface_address6_list(), to avoid reordering IPv6 interface addresses and keep the order returned by the OS, use SMARTLIST_DEL_CURRENT_KEEPORDER() instead of SMARTLIST_DEL_CURRENT(). This issue was reported by René Mayrhofer. [Closes ticket 20163; changes file written by teor. This paragraph added by nickm]
2016-09-24Merge branch 'osx_sierra_028'Nick Mathewson
2016-09-24Fix pthread_cond_timedwait() on OSX SierraNick Mathewson
Sierra provides clock_gettime(), but not pthread_condattr_setclock. So we had better lot try to use CLOCK_MONOTONIC as our source for time when waiting, since we ccan never actually tell the condition that we mean CLOCK_MONOTONIC. This isn't a tor bug yet, since we never actually pass a timeout to tor_cond_wait() outside of the unit tests.
2016-09-24Fix compilation on OSX Sierra (10.12)Nick Mathewson
2016-09-22Fix conflicting types errors for aes.c.Nick Mathewson
2016-09-16Add support for AES256 and AES192Nick Mathewson
(This will be used by prop224)
2016-09-16Remove a needless level of indirection from crypto_cipher_tNick Mathewson
Now that crypto_cipher_t only contains a pointer, it no longer has any reason for an independent existence.
2016-09-16Simplify the crypto_cipher_t interface and structureNick Mathewson
Previously, the IV and key were stored in the structure, even though they mostly weren't needed. The only purpose they had was to support a seldom-used API where you could pass NULL when creating a cipher in order to get a random key/IV, and then pull that key/IV back out. This saves 32 bytes per AES instance, and makes it easier to support different key lengths.
2016-09-16In aes.c, support 192-bit and 256-bit keys.Nick Mathewson
Also, change the input types for aes_new_cipher to be unsigned, as they should have been all along.
2016-09-14Remove an extraneous parenthesis in IF_BUG_OHNCE__Nick Mathewson
Fixes bug 20141; bugfix on 0.2.9.1-alpha. Patch from Gisle Vanem.
2016-09-13Merge remote-tracking branch 'public/bug20063'Nick Mathewson