aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-09-04Fix documentation of initialized fields in crypto_init.cNick Mathewson
2018-09-04Make some additional RSA functions constNick Mathewson
2018-09-04Rename crypto_pk_check_key(), use it more reasonably, add testsNick Mathewson
This function was a wrapper around RSA_check_key() in openssl, which checks for invalid RSA private keys (like those where p or q are composite, or where d is not the inverse of e, or where n != p*q). We don't need a function like this in NSS, since unlike OpenSSL, NSS won't let you import a bogus private key. I've renamed the function and changed its return type to make it more reasonable, and added a unit test for trying to read a key where n != p*q.
2018-09-04Unify functions for reading/writing PEM keys, to avoid duplication.Nick Mathewson
2018-09-04Do not leave a certificate allocated after testing dirvote_add()Nick Mathewson
2018-09-04Do not leak a reference to "slot" when decoding private key.Nick Mathewson
2018-09-04Update prefork and postfork NSS code for unit tests.Nick Mathewson
2018-09-04Test a few more tortls.c functionsNick Mathewson
2018-09-04Several unit tests to improve test coverage of x509*.cNick Mathewson
2018-09-04Remove tor_x509_get_cert_impl as unneeded.Nick Mathewson
2018-09-04Avoid double-close on TCP sockets under NSS.Nick Mathewson
2018-09-04Avoid spurious error logs when using NSSNick Mathewson
The tls_log_errors() function now behaves differently for NSS than it did for OpenSSL, so we need to tweak it a bit.
2018-09-04Remove tor_tls_shutdown()Nick Mathewson
This function was supposed to implement a half-duplex mode for our TLS connections. However, nothing in Tor actually uses it (besides some unit tests), and the implementation looks really questionable to me. It's probably best to remove it. We can add a tested one later if we need one in the future.
2018-09-04Initial NSS support for TLS.Nick Mathewson
This is enough to get a chutney network to bootstrap, though a bunch of work remains.
2018-08-22NSS support for x509 certsNick Mathewson
7 unit tests are failing at this point, but they're all TLS-related.
2018-08-22Log error strings in crypto_nss_log_errors().Nick Mathewson
I'll need this for debugging.
2018-08-22Change log_test_helpers macros to use printf, not pastingNick Mathewson
This ensures that our test failure messages actually tell us what strings Tor was expecting. I will need this to debug some test failures.
2018-08-21Make some x509 functions generic; remove some fields NSS doesn't needNick Mathewson
2018-08-21Extract internal-only parts of x509.hNick Mathewson
2018-08-21Extract the non-generic part of tor_tls_context_decref().Nick Mathewson
2018-08-21Implement PBKDF2 with NSS.Nick Mathewson
This was a gap that we left in the last commit.
2018-08-21When enabling NSS, disable OpenSSL.Nick Mathewson
We used to link both libraries at once, but now that I'm working on TLS, there's nothing left to keep OpenSSL around for when NSS is enabled. Note that this patch causes a couple of places that still assumed OpenSSL to be disabled when NSS is enabled - tor-gencert - pbkdf2
2018-08-21Split tls modules and their tests into openssl and generic.Nick Mathewson
Also, add a stubbed-out nss version of the modules. The tests won't pass with NSS yet since the NSS modules don't do anything. This is a good patch to read with --color-moved.
2018-08-21Refactor some of the certificate-manipulation logicNick Mathewson
2018-08-21Extract tortls structures into a new header; clean up a littleNick Mathewson
2018-08-21Split X509 code out of tortls.cNick Mathewson
2018-08-21The RSA_free in this test is no longer needed or wantedNick Mathewson
2018-08-21Implement RSA for NSS.Nick Mathewson
2018-08-21Also reinitialize the pregenerated keys postfork.Nick Mathewson
2018-08-21Refactor crypto_rsa to use pem module.Nick Mathewson
This cleans up a lot of junk from crypto_rsa_openssl, and will save us duplicated code in crypto_rsa_nss (when it exists). (Actually, it already exists, but I am going to use git rebase so that this commit precedes the creation of crypto_rsa_nss.)
2018-08-21Add rudimentary support for PEM-encoding, since NSS doesn't do that.Nick Mathewson
2018-08-21Use a constant for "65537"Nick Mathewson
2018-08-21Rename openssl-bridging functions in crypto_rsaNick Mathewson
These functions exist only to expose RSA keys to other places in Tor that use OpenSSL; let's be specific about their purpose.
2018-08-21Remove a redundant function.Nick Mathewson
2018-08-21Rename functions that encode/decode private keysNick Mathewson
It is not nice to expose a private key's contents without having the function name advertise the fact. Fortunately, we weren't misusing these yet.
2018-08-21Extract openssl RSA functionality into its own file.Nick Mathewson
2018-08-14Adjust windows stubs for new start/finish_daemon() return typesNick Mathewson
2018-08-08Call crypto_postfork on start_daemon() instead.Nick Mathewson
2018-08-08Make finish_daemon() return a boolean to say whether it did anything.Nick Mathewson
2018-08-08When RunAsDaemon is set, crypto_postfork() as neededNick Mathewson
2018-08-02Suppress strict-prototypes warning in crypto_nss_mgt.cNick Mathewson
2018-08-02Fix double-link of crypto_openssl_mgt.cNick Mathewson
2018-08-02Add a cast to make clang happier.Nick Mathewson
2018-07-31Fix issues with crypto_ope compilation now that crypto.h is goneNick Mathewson
2018-07-31Merge branch 'nss_dh_squashed' into nss_dh_squashed_mergedNick Mathewson
2018-07-31Only link crypto_dh_openssl.c onceNick Mathewson
(We do this unconditionally, since we still need it for tortls.c)
2018-07-31Additional tests for NSS DHNick Mathewson
Notably, there's a test to make sure that it round-trips with OpenSSL, if OpenSSL is enabled.
2018-07-31Implement DH in NSS.Nick Mathewson
2018-07-31Refactor the dependency between tortls and crypto_dh.Nick Mathewson
We only ever need this to get us a DH ephemeral key object, so make a function that does just that.
2018-07-31Extract the shared part of crypto_dh_compute_secret.Nick Mathewson