diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-12-13 19:34:01 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-12-15 22:31:11 -0500 |
commit | b8a7bad7995fceee83e61f2f403685d42d8759ce (patch) | |
tree | d04e748ba1175325b01887439e674a7ab4df1c02 /src/or/onion.c | |
parent | 785086cfbaf15a78a921f5589a76517b1d4840b1 (diff) | |
download | tor-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/onion.c')
-rw-r--r-- | src/or/onion.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/onion.c b/src/or/onion.c index 8ee59f2847..42e02c690c 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -336,9 +336,9 @@ onion_skin_client_handshake(crypto_dh_env_t *handshake_state, * Return 0 on success, <0 on failure. **/ int -fast_server_handshake(const char *key_in, /* DIGEST_LEN bytes */ - char *handshake_reply_out, /* DIGEST_LEN*2 bytes */ - char *key_out, +fast_server_handshake(const uint8_t *key_in, /* DIGEST_LEN bytes */ + uint8_t *handshake_reply_out, /* DIGEST_LEN*2 bytes */ + uint8_t *key_out, size_t key_out_len) { char tmp[DIGEST_LEN+DIGEST_LEN]; @@ -346,7 +346,7 @@ fast_server_handshake(const char *key_in, /* DIGEST_LEN bytes */ size_t out_len; int r = -1; - if (crypto_rand(handshake_reply_out, DIGEST_LEN)<0) + if (crypto_rand((char*)handshake_reply_out, DIGEST_LEN)<0) return -1; memcpy(tmp, key_in, DIGEST_LEN); @@ -379,9 +379,9 @@ fast_server_handshake(const char *key_in, /* DIGEST_LEN bytes */ * and protected by TLS). */ int -fast_client_handshake(const char *handshake_state, /* DIGEST_LEN bytes */ - const char *handshake_reply_out, /* DIGEST_LEN*2 bytes */ - char *key_out, +fast_client_handshake(const uint8_t *handshake_state, /* DIGEST_LEN bytes */ + const uint8_t *handshake_reply_out, /* DIGEST_LEN*2 bytes */ + uint8_t *key_out, size_t key_out_len) { char tmp[DIGEST_LEN+DIGEST_LEN]; |