aboutsummaryrefslogtreecommitdiff
path: root/src/or/ext_orport.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2013-07-18 19:58:42 +0300
committerNick Mathewson <nickm@torproject.org>2013-08-15 12:03:36 -0400
commite1d1d7a8dabf37043cdabc11432116cf08792f22 (patch)
tree849c3e152380e73d210c4276fa93e65c56b77e23 /src/or/ext_orport.c
parent03e3881043de68f371883fdb82a1d2bebf4179ed (diff)
downloadtor-e1d1d7a8dabf37043cdabc11432116cf08792f22.tar
tor-e1d1d7a8dabf37043cdabc11432116cf08792f22.tar.gz
Fix some ext_orport.c DOCDOCs.
Diffstat (limited to 'src/or/ext_orport.c')
-rw-r--r--src/or/ext_orport.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index b1bb11bd4..9b4db73c3 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -225,8 +225,12 @@ connection_ext_or_auth_handle_client_nonce(connection_t *conn)
EXT_OR_PORT_AUTH_NONCE_LEN, conn) < 0)
return -1;
- /* DOCDOC comment this function more, with comments about what the
- * protocol is. */
+ /* We extract the ClientNonce from the received data, and use it to
+ calculate ServerHash and ServerNonce according to proposal 217.
+
+ We also calculate our own ClientHash value and save it in the
+ connection state. We validate it later against the ClientHash
+ sent by the client. */
/* Get our nonce */
if (crypto_rand(server_nonce, EXT_OR_PORT_AUTH_NONCE_LEN) < 0)
@@ -375,7 +379,16 @@ connection_ext_or_auth_process_inbuf(or_connection_t *or_conn)
{
connection_t *conn = TO_CONN(or_conn);
- /* DOCDOC Document the state machine here! */
+ /* State transitions of the Extended ORPort authentication protocol:
+
+ EXT_OR_CONN_STATE_AUTH_WAIT_AUTH_TYPE (start state) ->
+ EXT_OR_CONN_STATE_AUTH_WAIT_CLIENT_NONCE ->
+ EXT_OR_CONN_STATE_AUTH_WAIT_CLIENT_HASH ->
+ EXT_OR_CONN_STATE_OPEN
+
+ During EXT_OR_CONN_STATE_OPEN, data is handled by
+ connection_ext_or_process_inbuf().
+ */
switch (conn->state) { /* Functionify */
case EXT_OR_CONN_STATE_AUTH_WAIT_AUTH_TYPE: