aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-01 21:46:27 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-01 21:46:27 +0000
commitb3907865822a932a2cf0b3dd177a6831e1df0787 (patch)
tree547a0be669cac6038aa9ec3e963e4b9a4053de01 /src/or/rendclient.c
parentce79bab7f1880136eb511195eb670c1cc06cbc69 (diff)
downloadtor-b3907865822a932a2cf0b3dd177a6831e1df0787.tar
tor-b3907865822a932a2cf0b3dd177a6831e1df0787.tar.gz
Hidden service operators had a bug in version 1 style INTRODUCE cells
that made them fail. Fix the bug, and revert clients to use version 0 until 0.0.9pre4 is obsolete. svn:r2641
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index f2bbdc089..553506a5a 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -92,11 +92,20 @@ rend_client_send_introduction(circuit_t *introcirc, circuit_t *rendcirc) {
}
/* write the remaining items into tmp */
+#if 0 /* switch over when 0.0.9pre4 is obsolete */
tmp[0] = 1; /* version 1 of the cell format */
strncpy(tmp+1, rendcirc->build_state->chosen_exit_name, (MAX_HEX_NICKNAME_LEN+1)); /* nul pads */
memcpy(tmp+1+MAX_HEX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN);
+#else
+ strncpy(tmp, rendcirc->build_state->chosen_exit_name, (MAX_NICKNAME_LEN+1)); /* nul pads */
+ memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN);
+#endif
if (crypto_dh_get_public(cpath->handshake_state,
+#if 0
tmp+1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN,
+#else
+ tmp+MAX_NICKNAME_LEN+1+REND_COOKIE_LEN,
+#endif
DH_KEY_LEN)<0) {
log_fn(LOG_WARN, "Couldn't extract g^x");
goto err;
@@ -105,7 +114,11 @@ rend_client_send_introduction(circuit_t *introcirc, circuit_t *rendcirc) {
/*XXX maybe give crypto_pk_public_hybrid_encrypt a max_len arg,
* to avoid buffer overflows? */
r = crypto_pk_public_hybrid_encrypt(entry->parsed->pk, tmp,
+#if 0
1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN,
+#else
+ MAX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN,
+#endif
payload+DIGEST_LEN,
PK_PKCS1_OAEP_PADDING, 0);
if (r<0) {