diff options
author | Arlo Breault <arlolra@gmail.com> | 2013-08-03 22:36:32 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-04 09:29:22 -0400 |
commit | 506a01bda8fd6f055ff1deef0e73036f8031e7a4 (patch) | |
tree | 79e6c7eaf415d203b77da788cb785555ff653f11 /src/or | |
parent | 468e44a0efaae8761d236042b80ac0125884980d (diff) | |
download | tor-506a01bda8fd6f055ff1deef0e73036f8031e7a4.tar.gz tor-506a01bda8fd6f055ff1deef0e73036f8031e7a4.zip |
Use size_t for length in replaycache_add_test_and_elapsed()
For consistency with the rest of buffer lengths in Tor.
See #8960
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rendservice.c | 2 | ||||
-rw-r--r-- | src/or/replaycache.c | 8 | ||||
-rw-r--r-- | src/or/replaycache.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index a8f63ddf66..061efe6cce 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1207,7 +1207,7 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request, /* check for replay of PK-encrypted portion. */ replay = replaycache_add_test_and_elapsed( intro_point->accepted_intro_rsa_parts, - parsed_req->ciphertext, (int)parsed_req->ciphertext_len, + parsed_req->ciphertext, parsed_req->ciphertext_len, &elapsed); if (replay) { diff --git a/src/or/replaycache.c b/src/or/replaycache.c index 122efb7030..90f87c12d5 100644 --- a/src/or/replaycache.c +++ b/src/or/replaycache.c @@ -65,7 +65,7 @@ replaycache_new(time_t horizon, time_t interval) STATIC int replaycache_add_and_test_internal( - time_t present, replaycache_t *r, const void *data, int len, + time_t present, replaycache_t *r, const void *data, size_t len, time_t *elapsed) { int rv = 0; @@ -73,7 +73,7 @@ replaycache_add_and_test_internal( time_t *access_time; /* sanity check */ - if (present <= 0 || !r || !data || len <= 0) { + if (present <= 0 || !r || !data || len == 0) { log_info(LD_BUG, "replaycache_add_and_test_internal() called with stupid" " parameters; please fix this."); goto done; @@ -176,7 +176,7 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r) */ int -replaycache_add_and_test(replaycache_t *r, const void *data, int len) +replaycache_add_and_test(replaycache_t *r, const void *data, size_t len) { return replaycache_add_and_test_internal(time(NULL), r, data, len, NULL); } @@ -187,7 +187,7 @@ replaycache_add_and_test(replaycache_t *r, const void *data, int len) int replaycache_add_test_and_elapsed( - replaycache_t *r, const void *data, int len, time_t *elapsed) + replaycache_t *r, const void *data, size_t len, time_t *elapsed) { return replaycache_add_and_test_internal(time(NULL), r, data, len, elapsed); } diff --git a/src/or/replaycache.h b/src/or/replaycache.h index c60c408103..cd713fe891 100644 --- a/src/or/replaycache.h +++ b/src/or/replaycache.h @@ -46,7 +46,7 @@ replaycache_t * replaycache_new(time_t horizon, time_t interval); */ STATIC int replaycache_add_and_test_internal( - time_t present, replaycache_t *r, const void *data, int len, + time_t present, replaycache_t *r, const void *data, size_t len, time_t *elapsed); STATIC void replaycache_scrub_if_needed_internal( time_t present, replaycache_t *r); @@ -57,9 +57,9 @@ STATIC void replaycache_scrub_if_needed_internal( * replaycache_t methods */ -int replaycache_add_and_test(replaycache_t *r, const void *data, int len); +int replaycache_add_and_test(replaycache_t *r, const void *data, size_t len); int replaycache_add_test_and_elapsed( - replaycache_t *r, const void *data, int len, time_t *elapsed); + replaycache_t *r, const void *data, size_t len, time_t *elapsed); void replaycache_scrub_if_needed(replaycache_t *r); #endif |