summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2014-10-20Use correct day of year in correct_tm()teor
Set the correct day of year value in correct_tm() when the system's localtime(_r) or gmtime(_r) functions fail to set struct tm. Fixes bug 13476.
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5Nick Mathewson
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2014-10-15Disable SSLv3 unconditionally. Closes ticket 13426.Nick Mathewson
The POODLE attack doesn't affect Tor, but there's no reason to tempt fate: SSLv3 isn't going to get any better.
2014-10-13Clean whitespace in last patch.Nick Mathewson
2014-10-12Avoid overflow in format_time_interval, create unit teststeor
Fix an instance of integer overflow in format_time_interval() when taking the absolute value of the supplied signed interval value. Fixes bug 13393. Create unit tests for format_time_interval().
2014-10-09Merge remote-tracking branch 'public/bug10816'Nick Mathewson
2014-10-03Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-10-03Merge remote-tracking branch 'public/bug13325_024' into maint-0.2.5Nick Mathewson
2014-10-03Run correctly on OpenBSD systems without SSL_METHOD.get_cipher_by_charNick Mathewson
Also, make sure we will compile correctly on systems where they finally rip it out. Fixes issue #13325. Caused by this openbsd commit: ​http://marc.info/?l=openbsd-cvs&m=140768179627976&w=2 Reported by Fredzupy.
2014-09-29Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-29Don't use the getaddrinfo sandbox cache from tor-resolveNick Mathewson
Fixes bug 13295; bugfix on 0.2.5.3-alpha. The alternative here is to call crypto_global_init() from tor-resolve, but let's avoid linking openssl into tor-resolve for as long as we can.
2014-09-26Merge remote-tracking branch 'public/require_some_c99'Nick Mathewson
2014-09-26Avoid a "constant variable guards dead code" warning from coverityNick Mathewson
Fixes CID 752028
2014-09-26Check key_len in secret_to_key_new()Nick Mathewson
This bug shouldn't be reachable so long as secret_to_key_len and secret_to_key_make_specifier stay in sync, but we might screw up someday. Found by coverity; this is CID 1241500
2014-09-25Fix on that last fix.Nick Mathewson
2014-09-25Fix warnings on 32-bit builds.Nick Mathewson
When size_t is the most memory you can have, make sure that things referring to real parts of memory are size_t, not uint64_t or off_t. But not on any released Tor.
2014-09-25Merge branch 'ed25519_ref10_squashed'Nick Mathewson
Conflicts: src/common/include.am src/ext/README
2014-09-25Comments and tweaks based on review by asnNick Mathewson
Add some documentation Rename "derive" -> "blind" Check for failure on randombytes().
2014-09-25More documentation for ed25519 stuff.Nick Mathewson
2014-09-25Draft implementation for ed25519 key blinding, as in prop224Nick Mathewson
This implementation allows somebody to add a blinding factor to a secret key, and a corresponding blinding factor to the public key. Robert Ransom came up with this idea, I believe. Nick Hopper proved a scheme like this secure. The bugs are my own.
2014-09-25Add curve25519->ed25519 key conversion per proposal 228Nick Mathewson
For proposal 228, we need to cross-certify our identity with our curve25519 key, so that we can prove at descriptor-generation time that we own that key. But how can we sign something with a key that is only for doing Diffie-Hellman? By converting it to the corresponding ed25519 point. See the ALL-CAPS warning in the documentation. According to djb (IIUC), it is safe to use these keys in the ways that ntor and prop228 are using them, but it might not be safe if we start providing crazy oracle access. (Unit tests included. What kind of a monster do you take me for?)
2014-09-25Support for writing ed25519 public/private components to disk.Nick Mathewson
This refactors the "== type:tag ==" code from crypto_curve25519.c
2014-09-25Add encode/decode functions for ed25519 public keysNick Mathewson
2014-09-25Restore the operation of extra_strong in ed25519_secret_key_generateNick Mathewson
2014-09-25Another ed25519 tweak: store secret keys in expanded formatNick Mathewson
This will be needed/helpful for the key blinding of prop224, I believe.
2014-09-25Fix API for ed25519_ref10_open()Nick Mathewson
This is another case where DJB likes sticking the whole signature prepended to the message, and I don't think that's the hottest idea. The unit tests still pass.
2014-09-25Tweak ed25519 ref10 signing interface to use less space.Nick Mathewson
Unit tests still pass.
2014-09-25Add Ed25519 support, wrappers, and tests.Nick Mathewson
Taken from earlier ed25519 branch based on floodyberry's ed25519-donna. Tweaked so that it applies to ref10 instead.
2014-09-25Merge branch 'libscrypt_trunnel_squashed'Nick Mathewson
Conflicts: src/test/test_crypto.c
2014-09-25Use trunnel for crypto_pwbox encoding/decoding.Nick Mathewson
This reduces the likelihood that I have made any exploitable errors in the encoding/decoding. This commit also imports the trunnel runtime source into Tor.
2014-09-25Adjust pwbox format: use a random IV each timeNick Mathewson
Suggested by yawning
2014-09-25Use preferred key-expansion means for pbkdf2, scrypt.Nick Mathewson
Use HKDF for RFC2440 s2k only.
2014-09-25Tweak and expose secret_to_key_compute_key for testingNick Mathewson
Doing this lets me pass in a salt of an unusual length.
2014-09-25Rudimentary-but-sufficient passphrase-encrypted box code.Nick Mathewson
See crypto_pwbox.c for a description of the file format. There are tests for successful operation, but it still needs error-case tests.
2014-09-25More generic passphrase hashing code, including scrypt supportNick Mathewson
Uses libscrypt when found; otherwise, we don't have scrypt and we only support openpgp rfc2440 s2k hashing, or pbkdf2. Includes documentation and unit tests; coverage around 95%. Remaining uncovered code is sanity-checks that shouldn't be reachable fwict.
2014-09-25Tell autoconf to make the compiler act as c99Nick Mathewson
Apparently some compilers want extra switches.
2014-09-25Tweak address.c to use a little c99 syntaxNick Mathewson
Since address.c is the first file to get compiled, let's have it use a little judicious c99 in order to catch broken compilers that somehow make it past our autoconf tests.
2014-09-15Clear up another clangalyzer issueNick Mathewson
"The NULL pointer warnings on the return value of tor_addr_to_in6_addr32() are incorrect. But clang can't work this out itself due to limited analysis depth. To teach the analyser that the return value is safe to dereference, I applied tor_assert to the return value." Patch from teor. Part of 13157.
2014-09-11Merge remote-tracking branch 'public/bug13104_025'Nick Mathewson
2014-09-11Avoid an overflow on negation in format_helper_exit_statusNick Mathewson
Part of 13104; patch from teor.
2014-09-10Avoid overflows and underflows in sscanf and friendsNick Mathewson
(Patch from teor on 13104)
2014-09-09Add unittests for finding the third quartile of a set.George Kadianakis
2014-09-09Use S?SIZE_MAX, not S?SIZE_T_MAXNick Mathewson
This fixes bug 13102 (not on any released Tor) where using the standard SSIZE_MAX name broke mingw64, and we didn't realize. I did this with perl -i -pe 's/SIZE_T_MAX/SIZE_MAX/' src/*/*.[ch] src/*/*/*.[ch]
2014-09-09Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-09Clean up the MVSC nmake files so they work again.Nick Mathewson
Fixes bug 13081; bugfix on 0.2.5.1-alpha. Patch from "NewEraCracker."
2014-09-02Make iter for DECLARE_TYPED_DIGESTMAP_FNS be a pointer.Nick Mathewson
This fixes a clangalyzer warning, and makes our C slightly better C.
2014-09-02Add more assertions to esc_for_log to please the clangalyzer.Nick Mathewson
2014-09-02Add an assertion to read_file_to_str_until_eofNick Mathewson
The clangalyzer doesn't believe our math here. I'm pretty sure our math is right. Also, add some unit tests.