diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-25 12:31:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-25 12:32:08 -0400 |
commit | 1b13139709348f6a7f19808c1cd82d2b62823680 (patch) | |
tree | 9bfacb5a828c940149e981b46ffc02608c4e0588 /src/trunnel | |
parent | 36700ee99e00efe8e0c5c124ce581fbbb60ee3f2 (diff) | |
download | tor-1b13139709348f6a7f19808c1cd82d2b62823680.tar.gz tor-1b13139709348f6a7f19808c1cd82d2b62823680.zip |
Add a script to run trunnel on the trunnel files.
Also, re-run the latest trunnel.
Closes ticket 13242
Diffstat (limited to 'src/trunnel')
-rw-r--r-- | src/trunnel/pwbox.c | 12 | ||||
-rw-r--r-- | src/trunnel/pwbox.h | 5 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/trunnel/pwbox.c b/src/trunnel/pwbox.c index b1246277fd..0fbbf2eb6a 100644 --- a/src/trunnel/pwbox.c +++ b/src/trunnel/pwbox.c @@ -1,5 +1,6 @@ - -/* pwbox.c -- generated by trunnel. */ +/* pwbox.c -- generated by Trunnel v1.1-dev. + * https://gitweb.torproject.org/trunnel.git + */ #include <stdlib.h> #include "trunnel-impl.h" @@ -303,12 +304,18 @@ pwbox_encoded_encode(uint8_t *output, size_t avail, const pwbox_encoded_t *obj) size_t written = 0; uint8_t *ptr = output; const char *msg; +#ifdef TRUNNEL_CHECK_ENCODED_LEN + const ssize_t encoded_len = pwbox_encoded_encoded_len(obj); +#endif int enforce_avail = 0; const size_t avail_orig = avail; if (NULL != (msg = pwbox_encoded_check(obj))) goto check_failed; +#ifdef TRUNNEL_CHECK_ENCODED_LEN + trunnel_assert(encoded_len >= 0); +#endif /* Encode u32 fixedbytes0 IN [PWBOX0_CONST0] */ trunnel_assert(written <= avail); @@ -383,7 +390,6 @@ pwbox_encoded_encode(uint8_t *output, size_t avail, const pwbox_encoded_t *obj) goto check_failed; #ifdef TRUNNEL_CHECK_ENCODED_LEN { - ssize_t encoded_len = pwbox_encoded_encoded_len(obj); trunnel_assert(encoded_len >= 0); trunnel_assert((size_t)encoded_len == written); } diff --git a/src/trunnel/pwbox.h b/src/trunnel/pwbox.h index d37ef5d7ee..84bbdf3a80 100644 --- a/src/trunnel/pwbox.h +++ b/src/trunnel/pwbox.h @@ -1,5 +1,6 @@ - -/* pwbox.h -- generated by trunnel. */ +/* pwbox.h -- generated by by Trunnel v1.1-dev. + * https://gitweb.torproject.org/trunnel.git + */ #ifndef TRUNNEL_PWBOX_H #define TRUNNEL_PWBOX_H |