aboutsummaryrefslogtreecommitdiff
path: root/src/ext
AgeCommit message (Collapse)Author
2015-03-23Merge remote-tracking branch 'public/bug15436_025' into maint-0.2.6Nick Mathewson
2015-03-23Fix unaligned access in SipHash-2-4.Yawning Angel
The compiler is allowed to assume that a "uint64_t *" is aligned correctly, and will inline a version of memcpy that acts as such. Use "uint8_t *", so the compiler does the right thing.
2015-02-17Have tinytest tolerate systems where char has > 8 bytesNick Mathewson
CID 1064418
2015-01-29Use HT_BUCKET_NUM_ in more placesNick Mathewson
(patch from sysrqb)
2015-01-29Merge remote-tracking branch 'public/ticket11737'Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-12Replace operators used as macro arguments with OP_XX macrosNick Mathewson
Part of fix for 13172
2014-11-06Add correctness assertions for hashtable iterationNick Mathewson
This is meant to prevent memory corruption bugs from doing unspeakable infinite-loop-like things to the hashtables. Addresses ticket 11737. We should disable these if they turn out to be expensive.
2014-10-31Re-run latest git trunnel to get fix from teor for #13577Nick Mathewson
2014-10-30Silence spurious clang warningsteor
Silence clang warnings under --enable-expensive-hardening, including: + implicit truncation of 64 bit values to 32 bit; + const char assignment to self; + tautological compare; and + additional parentheses around equality tests. (gcc uses these to silence assignment, so clang warns when they're present in an equality test. But we need to use extra parentheses in macros to isolate them from other code).
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-29Automake syntax error :/Nick Mathewson
2014-09-29Add missing ed25519_ref10 headers to NOINST_HEADERS.Nick Mathewson
2014-09-28Stop ed25519 8-bit signed left shift overflowingteor
Standardise usage in ge_scalarmult_base.c for 1 new fix.
2014-09-28Use SHL{8,32,64} in ed25519/ref10 to avoid left-shifting negative valuesNick Mathewson
This helps us avoid undefined behavior. It's based on a patch from teor, except that I wrote a perl script to regenerate the patch: #!/usr/bin/perl -p -w -i BEGIN { %vartypes = (); } if (/^[{}]/) { %vartypes = (); } if (/^ *crypto_int(\d+) +([a-zA-Z_][_a-zA-Z0-9]*)/) { $vartypes{$2} = $1; } elsif (/^ *(?:signed +)char +([a-zA-Z_][_a-zA-Z0-9]*)/) { $vartypes{$1} = '8'; } # This fixes at most one shift per line. But that's all the code does. if (/([a-zA-Z_][a-zA-Z_0-9]*) *<< *(\d+)/) { $v = $1; if (exists $vartypes{$v}) { s/$v *<< *(\d+)/SHL$vartypes{$v}($v,$1)/; } } # remove extra parenthesis s/\(SHL64\((.*)\)\)/SHL64\($1\)/; s/\(SHL32\((.*)\)\)/SHL32\($1\)/; s/\(SHL8\((.*)\)\)/SHL8\($1\)/;
2014-09-28Stop signed left shifts overflowing in ed25519: Macrosteor
The macros let us use unsigned types for potentially overflowing left shifts. Create SHL32() and SHL64() and SHL8() macros for convenience.
2014-09-26Comment-out dead code in ed25519/ref10Nick Mathewson
There are some loops of the form for (i=1;i<1;++i) ... And of course, if the loop index is initialized to 1, it will never be less than 1, and the loop body will never be executed. This upsets coverity. Patch fixes CID 1221543 and 1221542
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-25Fix linux compilation of ed25519_ref10Nick Mathewson
Our integer-definition headers apparently suck in a definition for select(2), which interferes with the select() in ge_scalarmult_base.c
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-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-25Tweak ref10 keygen APIs to be more sane.Nick Mathewson
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-25Use --require-version to prevent running trunnel pre-1.2Nick Mathewson
(Also, regenerate trunnel stuff with trunnel 1.2. This just adds a few comments to our output.)
2014-09-25Mention trunnel in LICENSE and src/ext/READMENick Mathewson
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-09Remove now-pointless SIZE_MAX stanza from OpenBSD_malloc_linuxNick Mathewson
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-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-08-26ed25519_ref10: use uint64_t and int64_t, not long longNick Mathewson
2014-08-26Add headers as needed to make ed25519_ref10 compile.Nick Mathewson
2014-08-26Add some explicit casts as needed to make ed25519_ref10 compileNick Mathewson
Apparently, ref10 likes implicit conversions from int64 to int32 more than our warnings do.
2014-08-26Integrate ed25519_ref10 into our build system.Nick Mathewson
2014-08-26Add the ed25519 ref10 code verbatim from supercop-20140622Nick Mathewson
We might use libsodium or ed25519-donna later on, but for now, let's see whether this is fast enough. We should use it in all cases when performance doesn't matter.
2014-07-23Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5Nick Mathewson
2014-07-15Small tweaks to make curve25519-donna32 compile with our warningsNick Mathewson
2014-07-15Update to latest curve25519-donna32Nick Mathewson
2014-06-14Add ATTR_UNUSED to HT_FINDNick Mathewson
The fix for bug 8746 added a hashtable instance that never actually invoked HT_FIND. This caused a warning, since we didn't mark HT_FIND as okay-not-to-use.
2014-05-08Fix numerous type errors in the unit testsNick Mathewson
Remove tinytest casts that were suppressing them. Fix for #11825.
2014-05-07Mention siphash in src/ext/READMENick Mathewson
2014-05-06Fix compilation with DEBUG_DNS_CACHENick Mathewson
Reported by cypherpunks. Fix for #11761; bugfix on 0.2.3.13-alpha where we made ht.h stop using _identifiers.