Commit Graph

17302 Commits

Author SHA1 Message Date
George Kadianakis
f549e4c36d Write some free_all functions to free the auth. cookies.
We started allocating space for them on the heap in the previous
commit.

Conflicts:
	src/or/ext_orport.h
2013-08-15 12:03:38 -04:00
George Kadianakis
33c3e60a37 Implement and use a generic auth. cookie initialization function.
Use the generic function for both the ControlPort cookie and the
ExtORPort cookie.

Also, place the global cookie variables in the heap so that we can
pass them around more easily as pointers.

Also also, fix the unit tests that broke by this change.

Conflicts:
	src/or/config.h
	src/or/ext_orport.c
2013-08-15 12:03:37 -04:00
George Kadianakis
13784d4753 Warn if the Extended ORPort listens on a public IP address. 2013-08-15 12:03:37 -04:00
George Kadianakis
bdeddecd29 Better documentation for ext_or_auth_correct_client_hash. 2013-08-15 12:03:37 -04:00
Nick Mathewson
28bb673584 White-box tests for the succeeding case of ext_or_port handshake.
(Okay, white-box plus mocking enough other functions so they don't
crash.)
2013-08-15 12:03:37 -04:00
Nick Mathewson
636aeb1f24 Test for initializing ext_or_auth_cookie file 2013-08-15 12:03:37 -04:00
Nick Mathewson
ba78a3c800 Make 0x01==SAFECOOKIE a macro, not a magic number 2013-08-15 12:03:37 -04:00
Nick Mathewson
4e868a9bc3 Unit test for the ext_orport safe_cookie handshake 2013-08-15 12:03:37 -04:00
Nick Mathewson
d7358e8598 Expose/mock some functions to make ext_orport.c testing possible 2013-08-15 12:03:37 -04:00
Nick Mathewson
fd6749203e More unit tests for handle_client_auth_nonce
Incidentally, this business here where I make crypto_rand mockable:
this is exactly the kind of thing that would make me never want to
include test-support stuff in production builds.
2013-08-15 12:03:37 -04:00
Nick Mathewson
4526c3e0b6 Unit test for basic ext_or_cookie authentication backend 2013-08-15 12:03:37 -04:00
Nick Mathewson
b64351ed17 Split the cryptographic part of handle_client_auth_nonce into new fn 2013-08-15 12:03:36 -04:00
George Kadianakis
e1d1d7a8da Fix some ext_orport.c DOCDOCs. 2013-08-15 12:03:36 -04:00
Nick Mathewson
03e3881043 Tests for connection_write_ext_or_command. 2013-08-15 12:03:36 -04:00
Nick Mathewson
c342ea9879 Unit tests for ext_or_id_map. 2013-08-15 12:03:36 -04:00
Nick Mathewson
7da59721a9 Unit tests for fetch_ext_or_cmd 2013-08-15 12:03:36 -04:00
Nick Mathewson
7a12cbc03d Split out buffers and socks tests into separate modules.
No other changes were made here.  Keeping everything in
src/test/test.c was a legacy of back when we had all our unit tests in
one big file.

Doing this now because I'm adding an ext_or_command test.
2013-08-15 12:03:36 -04:00
Nick Mathewson
9d8ffa91ce Add a clientmap_entry_free().
Remove a nedless strdup/free pair.
2013-08-15 12:03:36 -04:00
Nick Mathewson
34d02484c0 Fix hash functions for transport_name in client entry 2013-08-15 12:03:35 -04:00
Nick Mathewson
50136b6698 Use memdup_nulterm and check for NULs in handle_cmd_transport 2013-08-15 12:03:35 -04:00
Nick Mathewson
550af7be0a Fix a variety of issues in 4773
memwipe some stack-allocated stuff
Add DOCDOC comments for state machines
Use memdup_nulterm as appropriate
Check for NULs in useraddr
Add a macro so that <= AUTH_MAX has a meaning.
2013-08-15 12:03:35 -04:00
Nick Mathewson
6dd8ff0ad9 Break up <??> differently, and explain why 2013-08-15 12:03:35 -04:00
Nick Mathewson
e4a241af11 Add guards to ext_orport.h, rename get_file to get_file_name 2013-08-15 12:03:34 -04:00
Nick Mathewson
6568424410 Use only uintptr_t for the value of transport_count 2013-08-15 12:03:34 -04:00
George Kadianakis
6ad535e6dc If a single client connects with multiple transports, note all transports. 2013-08-15 12:03:34 -04:00
George Kadianakis
cb54e44587 Fix a number of issues with the #5040 code.
- Don't leak if a transport proxy sends us a TRANSPORT command more
  than once.

- Don't use smartlist_string_isin() in geoip_get_transport_history().
  (pointed out by Nick)

- Use the 'join' argument of smartlist_join_strings() instead of
  trying to write the separator on our own.
  (pointed out by Nick)

- Document 'ext_or_transport' a bit better.
  (pointed out by Nick)

- Be a bit more consistent with the types of the values of 'transport_counts'.
  (pointed out by Nick)
2013-08-15 12:03:34 -04:00
George Kadianakis
85c556a4c2 Trivially change unittests to make them more readable.
Pluggable transport names are now in alphabetical order like they
appear in the bridge-ip-transports string.
2013-08-15 12:03:34 -04:00
George Kadianakis
b2c7379aec Make check-spaces happy. 2013-08-15 12:03:34 -04:00
George Kadianakis
4d32518288 Add a changes file for #5040. 2013-08-15 12:03:34 -04:00
George Kadianakis
f8a9591d31 Fix some unittests that broke when we added bridge-ip-transports. 2013-08-15 12:03:33 -04:00
George Kadianakis
f4b36bee7e Add a unittest for the bridge-ip-transports extra-info line. 2013-08-15 12:03:33 -04:00
George Kadianakis
05306ad74f Write extra-info bridge-ip-transports lines. 2013-07-18 14:59:57 -04:00
George Kadianakis
e765d6ed84 Make a channel getter method to retrieve transport names. 2013-07-18 14:59:57 -04:00
George Kadianakis
0ec4e5a698 Add transport information to the GeoIP database. 2013-07-18 14:59:57 -04:00
George Kadianakis
210210f219 Make the Extended ORPort understand the TRANSPORT command. 2013-07-18 14:59:56 -04:00
George Kadianakis
895709db07 Fix logging severities and remove some trivial XXXs. 2013-07-18 14:59:56 -04:00
George Kadianakis
c46f1b810d More Extended ORPort code improvements.
* Change name of init_ext_or_auth_cookie_authentication().
* Add a small comment.
2013-07-18 14:59:56 -04:00
George Kadianakis
d8f74cc439 Move Extended ORPort code to its own module.
Move the code from the connection_or module to ext_orport.

This commit only moves code: it shouldn't modify anything.
2013-07-18 14:59:56 -04:00
George Kadianakis
2207525a69 Satisfy check-spaces. 2013-07-18 14:59:56 -04:00
George Kadianakis
e2e0d09dab Various Extended ORPort code improvements.
* Add documentation.
* Free ext_or_auth_correct_client_hash.
* Use VPORT(ExtORPort) instead of V(ExtORPOrt).
  See dfe03d36c8 for details.
2013-07-18 14:59:56 -04:00
George Kadianakis
85b7c73168 Move USERADDR handling to a dedicated function. 2013-07-18 14:59:56 -04:00
George Kadianakis
4a55e39997 Implement Extended ORPort authentication. 2013-07-18 14:59:56 -04:00
George Kadianakis
93b9f85d41 Prepare codebase for the implementation of Extended ORPort auth. 2013-07-18 14:59:56 -04:00
George Kadianakis
d303228eca Create the Extended ORPort authentication cookie file. 2013-07-18 14:59:55 -04:00
George Kadianakis
ba30d635c5 Document code and change the Extended ORPort command numbers. 2013-07-18 14:59:55 -04:00
Nick Mathewson
8bf0382b22 Skeleton ExtORPort implementation. Needs testing, documentation.
Does not implement TransportControlPort yet.
2013-07-18 14:59:55 -04:00
Nick Mathewson
f45e1fbd5b Start of a unit test for options_validate.
I added this so I could write a unit test for ServerTransportOptions,
but it incidentally exercises the succeed-on-defaults case of
options_validate too.
2013-07-18 14:40:12 -04:00
Nick Mathewson
abedd35de0 Merge branch 'simpleq_for_cells_3' 2013-07-18 11:24:57 -04:00
Nick Mathewson
1e78100b25 Add a test for n_cells_in_circuit_queues 2013-07-18 11:23:45 -04:00
Nick Mathewson
ae64197195 Unit tests for cell queues.
This removes some INLINE markers from functions that probably didn't
need them.
2013-07-18 11:23:45 -04:00