]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a script to run trunnel on the trunnel files.
authorNick Mathewson <nickm@torproject.org>
Thu, 25 Sep 2014 16:31:31 +0000 (12:31 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 25 Sep 2014 16:32:08 +0000 (12:32 -0400)
Also, re-run the latest trunnel.

Closes ticket 13242

scripts/codegen/run_trunnel.sh [new file with mode: 0755]
src/trunnel/pwbox.c
src/trunnel/pwbox.h

diff --git a/scripts/codegen/run_trunnel.sh b/scripts/codegen/run_trunnel.sh
new file mode 100755 (executable)
index 0000000..3a3deb2
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if test "x$TRUNNEL_PATH" != "x"; then
+  PYTHONPATH="${TRUNNEL_PATH}:${PYTHONPATH}"
+  export PYTHONPATH
+fi
+
+python -m trunnel ./src/trunnel/*.trunnel
+
index b1246277fdb477b8a7116d82b1ddafbc61eec59c..0fbbf2eb6a57b2aa0ceff20a5e9df1b33555750f 100644 (file)
@@ -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);
   }
index d37ef5d7ee5ccf0f387e9639bd7b677a7966e30f..84bbdf3a80326ad5c6bd98326d8c6e6bccf68a1b 100644 (file)
@@ -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