aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-19 23:33:02 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-19 23:33:02 +0000
commit707da4f73f86edf8df6baf5b4c0759e49f817694 (patch)
tree50db3331a236d3a16d66806c979dd2d576922bf7 /src
parent42c4670e27fe5bdc694875cddedc5151fe8c5244 (diff)
downloadtor-707da4f73f86edf8df6baf5b4c0759e49f817694.tar
tor-707da4f73f86edf8df6baf5b4c0759e49f817694.tar.gz
start checking the return value of crypto_pk_asn1_encode() while
we're trying to establish an introduction point. bug reported by veracode. svn:r13599
Diffstat (limited to 'src')
-rw-r--r--src/or/rendservice.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 063d5ea87..21163cf0c 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -850,8 +850,14 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
else
intro_key = circuit->intro_key;
/* Build the payload for a RELAY_ESTABLISH_INTRO cell. */
- len = crypto_pk_asn1_encode(intro_key, buf+2,
- RELAY_PAYLOAD_SIZE-2);
+ r = crypto_pk_asn1_encode(intro_key, buf+2,
+ RELAY_PAYLOAD_SIZE-2);
+ if (r < 0) {
+ log_warn(LD_BUG, "Internal error; failed to establish intro point.");
+ reason = END_CIRC_REASON_INTERNAL;
+ goto err;
+ }
+ len = r;
set_uint16(buf, htons((uint16_t)len));
len += 2;
memcpy(auth, circuit->cpath->prev->handshake_digest, DIGEST_LEN);