diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-10-06 14:58:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-10-10 23:14:31 -0400 |
commit | 1bd65680bdfcd46e1c96e71e3912cbdef4fc158a (patch) | |
tree | 2c74b4fbd250d3175964a41d4fe809e409c13df8 /src/or/connection_or.c | |
parent | 059d3d06132048135bd45a1ecf23a62731b3a8cc (diff) | |
download | tor-1bd65680bdfcd46e1c96e71e3912cbdef4fc158a.tar.gz tor-1bd65680bdfcd46e1c96e71e3912cbdef4fc158a.zip |
Add more log statements for protocol/internal failures
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index a5b965b8d1..b4c1fd0e62 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -2176,15 +2176,20 @@ connection_or_send_authenticate_cell(or_connection_t *conn, int authtype) int cell_maxlen; /* XXXX make sure we're actually supposed to send this! */ - if (!pk) - return -1;/*XXXX log*/ - if (authtype != AUTHTYPE_RSA_SHA256_TLSSECRET) - return -1;/*XXXX log*/ + if (!pk) { + log_warn(LD_BUG, "Unable to compute authenticate cell: no client auth key"); + return -1; + } + if (authtype != AUTHTYPE_RSA_SHA256_TLSSECRET) { + log_warn(LD_BUG, "Tried to send authenticate cell with unknown " + "authentication type %d", authtype); + return -1; + } cell_maxlen = 4 + /* overhead */ V3_AUTH_BODY_LEN + /* Authentication body */ crypto_pk_keysize(pk) + /* Max signature length */ - 16 /* just in case XXXX */ ; + 16 /* add a few extra bytes just in case. */; cell = var_cell_new(cell_maxlen); cell->command = CELL_AUTHENTICATE; @@ -2197,7 +2202,7 @@ connection_or_send_authenticate_cell(or_connection_t *conn, int authtype) pk, 0 /* not server */); if (authlen < 0) { - /* XXXX log */ + log_warn(LD_BUG, "Unable to compute authenticate cell!"); var_cell_free(cell); return -1; } |