diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-22 08:30:06 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-22 08:30:06 +0000 |
commit | 7459d067a5b158f39ac8ff9a90ce6059e91d4302 (patch) | |
tree | 74501e22937458399ab1d98939a2261d60a57e8d /src/or/rendservice.c | |
parent | ea43172c11af49dcf770fdcbcf80fcbef3437c19 (diff) | |
download | tor-7459d067a5b158f39ac8ff9a90ce6059e91d4302.tar.gz tor-7459d067a5b158f39ac8ff9a90ce6059e91d4302.zip |
now base16_encode() and base32_encode() can't ever fail
svn:r2103
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 4e3323e903..76a725a9f9 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -353,10 +353,8 @@ rend_service_introduce(circuit_t *circuit, const char *request, int request_len) char serviceid[REND_SERVICE_ID_LEN+1]; char hexcookie[9]; - if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1, - circuit->rend_pk_digest,10)) { - return -1; - } + base32_encode(serviceid, REND_SERVICE_ID_LEN+1, + circuit->rend_pk_digest,10); log_fn(LOG_INFO, "Received INTRODUCE2 cell for service %s on circ %d", serviceid, circuit->n_circ_id); @@ -382,9 +380,7 @@ rend_service_introduce(circuit_t *circuit, const char *request, int request_len) return -1; } if (memcmp(circuit->rend_pk_digest, request, DIGEST_LEN)) { - if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1, request, 10)) { - return -1; - } + base32_encode(serviceid, REND_SERVICE_ID_LEN+1, request, 10); log_fn(LOG_WARN, "Got an INTRODUCE2 cell for the wrong service (%s)", serviceid); return -1; @@ -552,10 +548,8 @@ rend_service_intro_has_opened(circuit_t *circuit) tor_assert(circuit->purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO); tor_assert(CIRCUIT_IS_ORIGIN(circuit) && circuit->cpath); - if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1, - circuit->rend_pk_digest,10)) { - tor_assert(0); - } + base32_encode(serviceid, REND_SERVICE_ID_LEN+1, + circuit->rend_pk_digest,10); service = rend_service_get_by_pk_digest(circuit->rend_pk_digest); if (!service) { @@ -644,10 +638,8 @@ rend_service_rendezvous_has_opened(circuit_t *circuit) tor_assert(hop); hex_encode(circuit->rend_cookie, 4, hexcookie); - if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1, - circuit->rend_pk_digest,10)) { - tor_assert(0); - } + base32_encode(serviceid, REND_SERVICE_ID_LEN+1, + circuit->rend_pk_digest,10); log_fn(LOG_INFO, "Done building circuit %d to rendezvous with cookie %s for service %s", @@ -933,11 +925,8 @@ rend_service_set_connection_addr_port(connection_t *conn, circuit_t *circ) tor_assert(circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED); log_fn(LOG_DEBUG,"beginning to hunt for addr/port"); - if (base32_encode(serviceid, REND_SERVICE_ID_LEN+1, - circ->rend_pk_digest,10)) { - log_fn(LOG_WARN,"bug: base32 failed"); - return -1; - } + base32_encode(serviceid, REND_SERVICE_ID_LEN+1, + circ->rend_pk_digest,10); service = rend_service_get_by_pk_digest(circ->rend_pk_digest); if (!service) { log_fn(LOG_WARN, "Couldn't find any service associated with pk %s on rendezvous circuit %d; closing", |