aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.c
Commit message (Collapse)AuthorAge
* Use EVP for AES only when hardware accel is presentNick Mathewson2011-11-25
| | | | Fixes bug 4525, fix on 0.2.3.8-alpha.
* Remove some duplicate includesAndrea Gelmini2011-11-03
|
* Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-10-26
|\
| * Make internal error check for unrecognized digest algorithm more robustNick Mathewson2011-10-06
| | | | | | | | Fixes Coverity CID 479.
* | Remove a no-longer-relevant commentNick Mathewson2011-10-10
| |
* | Add a sha256 hmac function, with testsNick Mathewson2011-10-10
| |
* | New function to get all digests of a public keyNick Mathewson2011-10-10
| |
* | Make WIN32_WINNT defines conditionalNick Mathewson2011-07-15
| | | | | | | | | | Requested by Gisle Vanem on tor-dev. I'm not quite sure this is the right solution, but it's probably harmless.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-06
|\|
| * Check maximum properly in crypto_rand_int()Nick Mathewson2011-06-06
| | | | | | | | | | | | | | | | | | | | | | | | George Kadianakis notes that if you give crypto_rand_int() a value above INT_MAX, it can return a negative number, which is not what the documentation would imply. The simple solution is to assert that the input is in [1,INT_MAX+1]. If in the future we need a random-value function that can return values up to UINT_MAX, we can add one. Fixes bug 3306; bugfix on 0.2.2pre14.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-06-03
|\|
| * Reject 128-byte keys that are not 1024-bitNick Mathewson2011-06-03
| | | | | | | | | | | | | | | | | | | | When we added the check for key size, we required that the keys be 128 bytes. But RSA_size (which defers to BN_num_bytes) will return 128 for keys of length 1017..1024. This patch adds a new crypto_pk_num_bits() that returns the actual number of significant bits in the modulus, and uses that to enforce key sizes. Also, credit the original bug3318 in the changes file.
* | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-05-16
|\|
| * Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-05-16
| |\ | | | | | | | | | | | | | | | | | | | | | Fixed trivial conflict due to headers moving into their own .h files from or.h. Conflicts: src/or/or.h
| | * squash! Add crypto_pk_check_key_public_exponent functionNick Mathewson2011-05-16
| | | | | | | | | | | | | | | | | | Rename crypto_pk_check_key_public_exponent to crypto_pk_public_exponent_ok: it's nice to name predicates s.t. you can tell how to interpret true and false.
| | * Add crypto_pk_check_key_public_exponent functionRobert Ransom2011-05-16
| | |
* | | Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson2011-05-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
| * | Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson2011-05-11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
| | * Hand-conversion and audit phase of memcmp transitionNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
| | * Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-04-27
|\| |
| * | Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-04-27
| |\| | | | | | | | | | | | | Conflicts: src/common/torint.h
| | * Make SIZE_T_CEILING unsigned; add a signed SSIZE_T_CEILINGNick Mathewson2011-04-26
| | | | | | | | | | | | | | | | | | | | | None of the comparisons were _broken_ previously, but avoiding signed/unsigned comparisons makes everybody happier. Fixes bug2475.
| | * Make the DH parameter we use for TLS match the one from Apache's mod_sslNick Mathewson2011-02-10
| | | | | | | | | | | | | | | | | | | | | | | | Our regular DH parameters that we use for circuit and rendezvous crypto are unchanged. This is yet another small step on the path of protocol fingerprinting resistance. (Backport from 0.2.2's 5ed73e3807d90dd0a3)
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-03-16
|\| | | | | | | | | | | | | | Conflicts: src/common/crypto.c
| * | Clean up whitespaceNick Mathewson2011-03-16
| | |
* | | Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson2011-03-16
|\| | | | | | | | | | | | | | | | | | | | Trivial Conflicts in src/common/crypto.c src/or/main.h src/or/or.h
| * | Doxygen documentation for about 100 things that didn't have anyNick Mathewson2011-03-16
| | | | | | | | | | | | About 860 doxygen-less things remain in 0.2.2
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-02-03
|\| |
| * | Correctly detect BIO_new failuresNick Mathewson2011-01-25
| | | | | | | | | | | | | | | | | | This bug was noticed by cypherpunks; fixes bug 2378. Bugfix on svn commit r110.
| * | Always treat failure to allocate an RSA key as an unrecoverable allocation errorNick Mathewson2011-01-25
| | |
| * | Remove an unused function in crypto.cNick Mathewson2011-01-25
| | |
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-24
|\| |
| * | Make the DH parameter we use for TLS match the one from Apache's mod_sslNick Mathewson2011-01-24
| | | | | | | | | | | | | | | | | | Our regular DH parameters that we use for circuit and rendezvous crypto are unchanged. This is yet another small step on the path of protocol fingerprinting resistance.
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-15
|\| |
| * | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-15
| |\|
| | * Zero out some more key data before freeing itNick Mathewson2011-01-15
| | | | | | | | | | | | Found by cypherpunks; fixes bug 2384.
* | | Merge remote branch 'origin/maint-0.2.2'Nick Mathewson2011-01-15
|\| |
| * | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-15
| |\| | | | | | | | | | | | | | | | Conflicts: src/or/routerparse.c src/or/test.c
| | * Merge branch 'bug2352_obsize' into maint-0.2.1Nick Mathewson2011-01-15
| | |\
| | | * Add logic in routerparse to not read overlong private keysNick Mathewson2011-01-10
| | | | | | | | | | | | | | | | | | | | I am not at all sure that it is possible to trigger a bug here, but better safe than sorry.
* | | | Remove some unnecessary occurrences of +1.Robert Ransom2011-01-15
|/ / / | | | | | | | | | | | | I dug through the OpenSSL source and verified that RSA_private_decrypt will not write more than RSA_size(key) bytes to its output buffer.
* | | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/or/config.c src/or/networkstatus.c src/or/rendcommon.c src/or/routerparse.c src/or/test.c
| * | Fix a heap overflow found by debuger, and make it harder to make that ↵Nick Mathewson2011-01-15
| |/ | | | | | | | | | | | | | | | | mistake again Our public key functions assumed that they were always writing into a large enough buffer. In one case, they weren't. (Incorporates fixes from sebastian)
* | Fix size_t vs unsigned comparison tooNick Mathewson2011-01-05
| |
* | Fix up size and sign issues in base32 codeNick Mathewson2011-01-03
| | | | | | | | Fixes bug 2331.
* | Merge remote branch 'sebastian/bug2314' into maint-0.2.2Nick Mathewson2011-01-03
|\ \
| * | Fix compile wanrings revealed by gcc 4.5 on mingwSebastian Hahn2010-12-27
| | |
* | | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
|\ \ \ | |/ / |/| / | |/ | | | | Conflicts: src/common/test.h src/or/test.c
| * Bump copyright statements to 2011Nick Mathewson2011-01-03
| |