summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
AgeCommit message (Collapse)Author
2018-02-01Merge branch 'bug24658-rsa_squashed'Nick Mathewson
2018-02-01Tweaks into functions and variables in crypto_rsa.[ch]Fernando Fernandez Mancera
crypto_get_rsa_padding_overhead() and crypto_get_rsa_padding() are not static inline anymore in order to split the crypto_rsa module from crypto.[ch]. Also included necessary modules in order to solve dependency issues. Also made two functions in crypto.c use crypto_pk_asn1_encdoe() instead of reaching into the crypto_pk_t struct.
2018-02-01Remove commented functions in crypto module.Fernando Fernandez Mancera
OpenSSL never uses these callbacks anymore so the code is disabled. Fixes #25097. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-26Refactor crypto.[ch] into smaller RSA module.Fernando Fernandez Mancera
Add two new files (crypto_rsa.c, crypto_rsa.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to RSA operations. Those have been removed from crypto.[ch]. All new changes related to RSA operations must be done in these files. Follows #24658 Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-23openssl_mutexes code belongs in openssl_mgt.cNick Mathewson
2018-01-23Merge remote-tracking branch 'ffmancera/bug24658-openssl'Nick Mathewson
2018-01-22Move the openssl namespace back into .c files.Fernando Fernandez Mancera
As we're trying not to have all the other modules in Tor, we moved the openssl namespace includes back into crypto.c and crypto_openssl_mgt.c files. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2018-01-19Tweaks into functions and variables in crypto_openssl_mgt.[ch]Fernando Fernandez Mancera
Renamed free_openssl() to crypto_openssl_free_all(). Also we made variables and functions static again. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-11On shutdown, mark openssl as uninitialized.Nick Mathewson
This causes openssl to get completely reinitialized on startup, which is probably a good idea.
2018-01-11Merge branch 'restart_nocrash'Nick Mathewson
2018-01-08Add free_openssl() to crypto_openssl module.Fernando Fernandez Mancera
Add free_openssl() function to free the memory allocated for OpenSSL version management variables. It is required since OpenSSL management has been isolated from the crypto module. Follows #24658. Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-08Refactor crypto.[ch] into smaller OpenSSL module.Fernando Fernandez Mancera
Add two new files (crypto_openssl.c, crypto_openssl.h) as new module of crypto.[ch]. This new module includes all functions and dependencies related to OpenSSL management. Those have been removed from crypto.[ch]. All new changes related to OpenSSL management must be done in these files. Follows #24658 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2018-01-05Merge branch 'maint-0.3.2'Roger Dingledine
2018-01-05remove redundant "implement this" from log messageRoger Dingledine
2017-12-11Set DH parameters to NULL on shutdownNick Mathewson
If we don't do this, we will use freed memory on restart. Part of 24581.
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-05Tweaks to strings in 24500Nick Mathewson
2017-12-05Make errno error log more useful for getrandom()Fernando Fernandez Mancera
Making errno error log more useful for getrandom() call. Adding if statement to make difference between ENOSYS and other errors. Fixes #24500 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-11-30Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2017-11-30Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-11-30Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-11-30Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-11-30Merge branch 'maint-0.2.5' into maint-0.2.8Nick Mathewson
2017-11-27Avoid asking for passphrase on junky PEM inputNick Mathewson
Fixes bug 24246 and TROVE-2017-011. This bug is so old, it's in Matej's code. Seems to have been introduced with e01522bbed6eea.
2017-11-17Make all the crypto free() functions macros that clear their targetsNick Mathewson
2017-09-28Move around some LCOV_EXCLs in src/commonNick Mathewson
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-08-03Switch to offsetof()Neel Chauhan
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-07-07Hide crypto_digest_t again and use an accessor for tests.George Kadianakis
2017-07-07test: Crypto groundwork for e2e circuit unittests.George Kadianakis
- Move some crypto structures so that they are visible by tests. - Introduce a func to count number of hops in cpath which will be used by the tests. - Mark a function as mockable.
2017-05-26Cleanup MOCK_IMPL (etc) to be findable with etagsNick Mathewson
A fair number of our mock_impl declarations were messed up so that even our special AM_ETAGSFLAGS couldn't find them. This should be a whitespace-only patch.
2017-04-07Merge branch 'ticket21842_squashed'Nick Mathewson
2017-04-07Remove tor-checkkey as obsoleteNick Mathewson
CVE-2008-0166 is long gone, and we no longer need a helper tool to dump out public key moduli so folks can detect it. Closes ticket 21842.
2017-03-31Isolate dmalloc/openssl bridge code to crypto.cNick Mathewson
This makes it so main.c, and the rest of src/or, no longer need to include any openssl headers.
2017-03-15Run the copyright update script.Nick Mathewson
2017-02-07Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-07Merge remote-tracking branch 'public/bug19152_024_v2' into maint-0.2.4Nick Mathewson
2017-02-07Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-02-07Refine the memwipe() arguments check for 18089 a little more.Nick Mathewson
We still silently ignore memwipe(NULL, ch, 0); and memwipe(ptr, ch, 0); /* for ptr != NULL */ But we now assert on: memwipe(NULL, ch, 30);
2017-02-07Make memwipe() do nothing when passed a NULL pointer or zero sizeteor (Tim Wilson-Brown)
Check size argument to memwipe() for underflow. Closes bug #18089. Reported by "gk", patch by "teor". Bugfix on 0.2.3.25 and 0.2.4.6-alpha (#7352), commit 49dd5ef3 on 7 Nov 2012.
2017-01-30Make a bunch of signature/digest-checking functions mockableNick Mathewson
2016-12-18clarify debug-level log while initializing entropyRoger Dingledine
I got confused when I saw my Tor saying it was opening a file that doesn't exist. It turns out it isn't opening it, it's just calling open() on it and then moving on when it's not there.
2016-12-14Merge branch 'dgoulet_ticket19043_030_03_squashed'Nick Mathewson
2016-12-14crypto: Change crypto_mac_sha3_256 to use the key length in the constructionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-12-14prop224 prepwork: Introduce HMAC-SHA3 function.George Kadianakis
2016-12-05whitespace fixNick Mathewson
2016-12-0520865: Don't use getentropy() on OSX Sierra.Nick Mathewson
Tor 0.2.9 has a broader range of fixes and workarounds here, but for 0.2.8, we're just going to maintain the existing behavior. (The alternative would be to backport both 1eba088054eca1555b455ee4a2adfafecb888af9 and 16fcbd21c963a9a65bf55024680c8323c8b7175d , but the latter is kind of a subtle kludge in the configure.ac script, and I'm not a fan of backporting that kind of thing.)
2016-11-24crypto_digest512 returns expected error value of -1Chelsea H. Komlo
2016-11-24crypto_digest256 returns expected error value of -1Chelsea H. Komlo