Nick Mathewson
b5fddbd241
Avoid double-close on TCP sockets under NSS.
2018-09-04 14:52:35 -04:00
Nick Mathewson
52d5f4da12
Avoid spurious error logs when using NSS
...
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-04 14:52:35 -04:00
Nick Mathewson
dd04fc35c6
Remove tor_tls_shutdown()
...
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-04 14:52:35 -04:00
Nick Mathewson
5205c7fd90
Initial NSS support for TLS.
...
This is enough to get a chutney network to bootstrap, though a bunch
of work remains.
2018-09-04 14:52:35 -04:00
Nick Mathewson
c567b8fcb4
NSS support for x509 certs
...
7 unit tests are failing at this point, but they're all TLS-related.
2018-08-22 16:11:45 -04:00
Nick Mathewson
de66bd397c
Merge branch 'maint-0.3.4'
2018-08-21 19:20:37 -04:00
Nick Mathewson
5245a296c5
Make some x509 functions generic; remove some fields NSS doesn't need
2018-08-21 12:25:33 -04:00
Nick Mathewson
b9ca8f2356
Extract internal-only parts of x509.h
2018-08-21 12:25:33 -04:00
Nick Mathewson
108d9879eb
Extract the non-generic part of tor_tls_context_decref().
2018-08-21 12:25:33 -04:00
Nick Mathewson
6a88d8f6b4
When enabling NSS, disable OpenSSL.
...
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-21 12:25:33 -04:00
Nick Mathewson
1992c76130
Split tls modules and their tests into openssl and generic.
...
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-21 12:25:33 -04:00
Nick Mathewson
91c1e88b7a
Refactor some of the certificate-manipulation logic
2018-08-21 12:25:33 -04:00
Nick Mathewson
598bc78bfa
Extract tortls structures into a new header; clean up a little
2018-08-21 12:25:33 -04:00
Nick Mathewson
9a4f05b05c
Split X509 code out of tortls.c
2018-08-21 12:25:33 -04:00
Nick Mathewson
824009cde5
Rename openssl-bridging functions in crypto_rsa
...
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-21 12:24:08 -04:00
Nick Mathewson
32bbc8f6b5
Refactor the dependency between tortls and crypto_dh.
...
We only ever need this to get us a DH ephemeral key object,
so make a function that does just that.
2018-07-31 19:46:00 -04:00
Nick Mathewson
f45107e7de
Rename crypto.c to crypto_cipher.c (since that's all it still has.)
2018-07-11 14:12:36 -04:00
Nick Mathewson
79267bad65
Add a configure switch to build with NSS.
...
When it is set, include the NSS headers and libraries as
appropriate. Doesn't actually use them yet, though.
2018-07-11 13:22:20 -04:00
Nick Mathewson
e7f5f48d68
Rename torlog.[ch] to log.[ch]
...
Fun fact: these files used to be called log.[ch] until we ran into
conflicts with systems having a log.h file. But now that we always
include "lib/log/log.h", we should be fine.
2018-07-10 15:20:30 -04:00
Nick Mathewson
4f42c923d6
File-level summary documentation for src/lib/*/*.[ch]
2018-07-10 12:22:01 -04:00
Nick Mathewson
d5a3bb960d
Retire U64_TO_DBL and DBL_TO_U64
...
These were necessary long ago to work around a bug in VC6.
2018-07-03 10:45:43 -04:00
Nick Mathewson
83a4946e7b
Prune the .may_include files a bit; detect unused lines in them
2018-07-01 18:14:28 -04:00
Nick Mathewson
b21108f839
Remove an errant (and unused) include permission in lib/tls
2018-06-29 12:21:52 -04:00
Nick Mathewson
d8b34e0886
Move buffers into container
...
Split the network-only and compression-only parts of buffers into
the appropriate modules.
2018-06-28 16:28:08 -04:00
Nick Mathewson
a742a826f6
Remove all include common/ uses in crypto_ops and tls.
2018-06-28 14:40:25 -04:00
Nick Mathewson
b2d4e786b7
Remove the util_bug.h include from smartlist.h.
...
This change makes a whole bunch of things in torlog.c break, since
apparently I did not find all the fd dependencies.
2018-06-22 10:50:14 -04:00
Nick Mathewson
da4ae8a6b6
Automated fixup of include paths after torlog.h movement.
2018-06-22 10:32:10 -04:00
Nick Mathewson
d1cada5a8a
Update permissible includes
2018-06-22 09:49:13 -04:00
Nick Mathewson
de508c5f50
Extract smartlist.h from container.h
2018-06-22 09:49:13 -04:00
Nick Mathewson
b8be8265b6
Rectify include paths after container split (automatic)
2018-06-22 09:49:13 -04:00
Nick Mathewson
999f7984e1
New script to check includes for modularity violations
...
Includes configuration files to enforce these rules on lib and
common. Of course, "common" *is* a modularity violation right now,
so these rules aren't as strict as I would like them to be.
2018-06-21 14:05:33 -04:00
Nick Mathewson
3305ae5044
Rectify include paths (automated).
...
You have no idea how glad I am that this is automated.
2018-06-21 13:20:07 -04:00
Nick Mathewson
accf239fa3
Rectify include paths (automated)
2018-06-21 13:19:00 -04:00
Nick Mathewson
25ccfff86a
Split crypto and tls libraries into directories
...
I am calling the crypto library "crypt_ops", since I want
higher-level crypto things to be separated from lower-level ones.
This library will hold only the low-level ones, once we have it
refactored.
2018-06-21 13:14:14 -04:00