summaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-12-13 19:34:01 -0500
committerNick Mathewson <nickm@torproject.org>2010-12-15 22:31:11 -0500
commitb8a7bad7995fceee83e61f2f403685d42d8759ce (patch)
treed04e748ba1175325b01887439e674a7ab4df1c02 /src/or/rendservice.c
parent785086cfbaf15a78a921f5589a76517b1d4840b1 (diff)
downloadtor-b8a7bad7995fceee83e61f2f403685d42d8759ce.tar.gz
tor-b8a7bad7995fceee83e61f2f403685d42d8759ce.zip
Make payloads into uint8_t.
This will avoid some signed/unsigned assignment-related bugs.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 289d64d399..f5917bc973 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -895,7 +895,7 @@ clean_accepted_intros(rend_service_t *service, time_t now)
* rendezvous point.
*/
int
-rend_service_introduce(origin_circuit_t *circuit, const char *request,
+rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
size_t request_len)
{
char *ptr, *r_cookie;
@@ -964,7 +964,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request,
crypto_pk_get_digest(intro_key, intro_key_digest);
if (memcmp(intro_key_digest, request, DIGEST_LEN)) {
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32+1,
- request, REND_SERVICE_ID_LEN);
+ (char*)request, REND_SERVICE_ID_LEN);
log_warn(LD_REND, "Got an INTRODUCE2 cell for the wrong service (%s).",
escaped(serviceid));
return -1;
@@ -979,7 +979,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request,
/* Next N bytes is encrypted with service key */
note_crypto_pk_op(REND_SERVER);
r = crypto_pk_private_hybrid_decrypt(
- intro_key,buf,request+DIGEST_LEN,request_len-DIGEST_LEN,
+ intro_key,buf,(char*)(request+DIGEST_LEN),request_len-DIGEST_LEN,
PK_PKCS1_OAEP_PADDING,1);
if (r<0) {
log_warn(LD_PROTOCOL, "Couldn't decrypt INTRODUCE2 cell.");
@@ -1451,7 +1451,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
* live introduction point, and note that the service descriptor is
* now out-of-date.*/
int
-rend_service_intro_established(origin_circuit_t *circuit, const char *request,
+rend_service_intro_established(origin_circuit_t *circuit,
+ const uint8_t *request,
size_t request_len)
{
rend_service_t *service;