[tor-commits] [torspec/master] Add proposal 295 from Tomer Ashur.

2018-07-03 Thread nickm
commit b0d5698c49cb143c60c012655c282adde2722048
Author: Nick Mathewson 
Date:   Tue Jul 3 17:38:26 2018 -0400

Add proposal 295 from Tomer Ashur.
---
 proposals/000-index.txt |   2 +
 proposals/295-relay-crypto-with-atl.txt | 276 
 2 files changed, 278 insertions(+)

diff --git a/proposals/000-index.txt b/proposals/000-index.txt
index d82839d..d9c7e93 100644
--- a/proposals/000-index.txt
+++ b/proposals/000-index.txt
@@ -215,6 +215,7 @@ Proposals by number:
 292  Mesh-based vanguards [ACCEPTED]
 293  Other ways for relays to know when to publish [OPEN]
 294  TLS 1.3 Migration [DRAFT]
+295  Using the ATL construction for relay cryptography (solving the 
crypto-tagging attack) [OPEN]
 
 
 Proposals by status:
@@ -244,6 +245,7 @@ Proposals by status:
287  Reduce circuit lifetime without overloading the network
289  Authenticating sendme cells to mitigate bandwidth attacks
293  Other ways for relays to know when to publish [for 0.3.5]
+   295  Using the ATL construction for relay cryptography (solving the 
crypto-tagging attack)
  ACCEPTED:
188  Bridge Guards and other anti-enumeration defenses
249  Allow CREATE cells with >505 bytes of handshake data
diff --git a/proposals/295-relay-crypto-with-atl.txt 
b/proposals/295-relay-crypto-with-atl.txt
new file mode 100644
index 000..74e31b1
--- /dev/null
+++ b/proposals/295-relay-crypto-with-atl.txt
@@ -0,0 +1,276 @@
+Filename: 295-relay-crypto-with-atl.txt
+Title: Using the ATL construction for relay cryptography (solving the 
crypto-tagging attack)
+Author: Tomer Ashur
+Created: 09 Apr 2018
+Status: Open
+
+
+0. Context
+
+   Although Crypto Tagging Attacks were identified already in the
+   original Tor design, it was not before the rise of the Procyonidae in
+   2012 that their severity was fully realized. In Proposal 202 (Two
+   improved relay encryption protocols for Tor cells) Nick Mathewson
+   discussed two approaches to stymie tagging attacks and generally
+   improve Tor's cryptography. In Proposal 261 (AEZ for relay
+   cryptography) Nick put forward a concrete approach which uses the
+   tweakable wide-block cipher AEZ.
+
+1. Motivation
+
+   For motivations, see proposal 202.
+
+2. Summary and preliminaries
+
+   This proposal suggests an alternative approach to Proposal 261 using
+   the notion of Release (of) Unverified Plaintexts (RUP-security). It
+   describes an improved algorithm for circuit encryption based on
+   CTR-mode which is already used in Tor, and an additional component
+   for hashing. When this additional component is GHash, a GCM-based
+   solution can be used from the OpenSSL library. If a solution that is
+   based solely on components that already exist in Tor is desirable,
+   SHA-1 can be used for hashing (however, this is highly discouraged as
+   SHA-1 is broken!).
+
+   Incidentally, and similar to Proposal 261, this proposal employs the
+   ENCODE-then-ENCIPHER approach thus it improves Tor's E2E integrity by
+   using (sufficiently enough) redundancy.
+
+For more information about the scheme and a security proof for its
+RUP-security see
+
+  Tomer Ashur, Orr Dunkelman, Atul Luykx: Boosting Authenticated
+  Encryption Robustness with Minimal Modifications. CRYPTO (3) 2017:
+  3-33 available online at https://eprint.iacr.org/2017/239 .
+
+2.1 An instructive 1-node circuit
+
+   Noting that in CTR-mode the nonce is essential for the
+   encryption/decryption operations, the proposed solution is based on
+   encrypting its value in such a way that any change to the ciphertext
+   or the tag (e.g., through a tagging attack) would randomize the nonce
+   and result in a random value as the output of CTR-mode.
+
+   The basic crypto components of the proposal are:
+   * a block cipher E(·)
+   * A universal hash function, H(·);
+
+   Using the block cipher E(·) and a non-repeating nonce N, one can
+   construct the CTR mode-of-operation:
+
+   CTR(N) = E(N)||E(N+1)||...||E(N+l)
+
+  For simplicity, let us for now consider normal encryption using
+  CTR-mode (This is akin to building a circuit with a single node. In
+  the sequel we will see what happens when this idea is used in a 3-node
+  circuit):
+
+   * Input: a nonce N, a message M = (m_0,...,m_l)
+   1. (z_0,...,z_l) = CTR(N)
+   2. (c_0,...,c_l) = (z_0 ^ m_0, ... z_l ^ m_l)
+
+   The client sends C = (c_0,...,c_l) to the receiver which repeats Step
+   (1) to generate the random stream Z = (z_0,...,z_l) and recovers the
+   message through M = C ^ Z. A protocol using this scheme is vulnerable
+   to the crypto tagging attack due to the malleability of
+   CTR-mode. Indeed, since Z depends only on N rather than on the
+   message M itself, a change to a ciphertext bit affects the respective
+   plaintext bit and nothing else.
+
+   Our solution is based on the idea that linking N and C makes it
+  

[tor-commits] [tor/release-0.3.4] Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

2018-07-03 Thread nickm
commit 32d9d69350f7fac564f4f4a245c57edd2e5c309a
Merge: d38e47495 dfdf32404
Author: Nick Mathewson 
Date:   Tue Jul 3 13:16:37 2018 -0400

Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Partially revert "Use tor_addr_from_getsockname() in several places"

2018-07-03 Thread nickm
commit dfdf32404cd93671646481f6f3c129591a6901d7
Author: Nick Mathewson 
Date:   Mon Jul 2 16:11:02 2018 -0400

Partially revert "Use tor_addr_from_getsockname() in several places"

This reverts part of commit 6ed384b827dce21ea3a44b587, in order to
fix bug 26568.  Bugfix on 0.3.4.1-alpha.
---
 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug26568 b/changes/bug26568
new file mode 100644
index 0..0c4c05d04
--- /dev/null
+++ b/changes/bug26568
@@ -0,0 +1,3 @@
+  o Minor bugfixes (controller):
+- Report the port correctly when a port is configured to bind to "auto".
+  Fixes bug 26568; bugfix on 0.3.4.1-alpha.
diff --git a/src/or/connection.c b/src/or/connection.c
index 5185b45b1..7283a8104 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1260,12 +1260,15 @@ connection_listener_new(const struct sockaddr 
*listensockaddr,
   gotPort = usePort;
 } else {
   tor_addr_t addr2;
-  if (tor_addr_from_getsockname(, s)<0) {
+  struct sockaddr_storage ss;
+  socklen_t ss_len=sizeof(ss);
+  if (getsockname(s, (struct sockaddr*), _len)<0) {
 log_warn(LD_NET, "getsockname() couldn't learn address for %s: %s",
  conn_type_to_string(type),
  tor_socket_strerror(tor_socket_errno(s)));
 gotPort = 0;
   }
+  tor_addr_from_sockaddr(, (struct sockaddr*), );
 }
 #ifdef HAVE_SYS_UN_H
   /*



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.4'

2018-07-03 Thread nickm
commit 2878dad9dbc1e07f608fa3acddc76261e4d76648
Merge: df9858285 32d9d6935
Author: Nick Mathewson 
Date:   Tue Jul 3 13:31:26 2018 -0400

Merge branch 'maint-0.3.4'

 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Partially revert "Use tor_addr_from_getsockname() in several places"

2018-07-03 Thread nickm
commit dfdf32404cd93671646481f6f3c129591a6901d7
Author: Nick Mathewson 
Date:   Mon Jul 2 16:11:02 2018 -0400

Partially revert "Use tor_addr_from_getsockname() in several places"

This reverts part of commit 6ed384b827dce21ea3a44b587, in order to
fix bug 26568.  Bugfix on 0.3.4.1-alpha.
---
 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug26568 b/changes/bug26568
new file mode 100644
index 0..0c4c05d04
--- /dev/null
+++ b/changes/bug26568
@@ -0,0 +1,3 @@
+  o Minor bugfixes (controller):
+- Report the port correctly when a port is configured to bind to "auto".
+  Fixes bug 26568; bugfix on 0.3.4.1-alpha.
diff --git a/src/or/connection.c b/src/or/connection.c
index 5185b45b1..7283a8104 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1260,12 +1260,15 @@ connection_listener_new(const struct sockaddr 
*listensockaddr,
   gotPort = usePort;
 } else {
   tor_addr_t addr2;
-  if (tor_addr_from_getsockname(, s)<0) {
+  struct sockaddr_storage ss;
+  socklen_t ss_len=sizeof(ss);
+  if (getsockname(s, (struct sockaddr*), _len)<0) {
 log_warn(LD_NET, "getsockname() couldn't learn address for %s: %s",
  conn_type_to_string(type),
  tor_socket_strerror(tor_socket_errno(s)));
 gotPort = 0;
   }
+  tor_addr_from_sockaddr(, (struct sockaddr*), );
 }
 #ifdef HAVE_SYS_UN_H
   /*



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

2018-07-03 Thread nickm
commit 32d9d69350f7fac564f4f4a245c57edd2e5c309a
Merge: d38e47495 dfdf32404
Author: Nick Mathewson 
Date:   Tue Jul 3 13:16:37 2018 -0400

Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'maint-0.3.4' into release-0.3.4

2018-07-03 Thread nickm
commit 5b0820702a213226d2cce47dae1da5e72a16bc82
Merge: 9b060547c 32d9d6935
Author: Nick Mathewson 
Date:   Tue Jul 3 13:31:18 2018 -0400

Merge branch 'maint-0.3.4' into release-0.3.4

 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

2018-07-03 Thread nickm
commit 32d9d69350f7fac564f4f4a245c57edd2e5c309a
Merge: d38e47495 dfdf32404
Author: Nick Mathewson 
Date:   Tue Jul 3 13:16:37 2018 -0400

Merge remote-tracking branch 'github/bug26568_034' into maint-0.3.4

 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Partially revert "Use tor_addr_from_getsockname() in several places"

2018-07-03 Thread nickm
commit dfdf32404cd93671646481f6f3c129591a6901d7
Author: Nick Mathewson 
Date:   Mon Jul 2 16:11:02 2018 -0400

Partially revert "Use tor_addr_from_getsockname() in several places"

This reverts part of commit 6ed384b827dce21ea3a44b587, in order to
fix bug 26568.  Bugfix on 0.3.4.1-alpha.
---
 changes/bug26568| 3 +++
 src/or/connection.c | 5 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/changes/bug26568 b/changes/bug26568
new file mode 100644
index 0..0c4c05d04
--- /dev/null
+++ b/changes/bug26568
@@ -0,0 +1,3 @@
+  o Minor bugfixes (controller):
+- Report the port correctly when a port is configured to bind to "auto".
+  Fixes bug 26568; bugfix on 0.3.4.1-alpha.
diff --git a/src/or/connection.c b/src/or/connection.c
index 5185b45b1..7283a8104 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1260,12 +1260,15 @@ connection_listener_new(const struct sockaddr 
*listensockaddr,
   gotPort = usePort;
 } else {
   tor_addr_t addr2;
-  if (tor_addr_from_getsockname(, s)<0) {
+  struct sockaddr_storage ss;
+  socklen_t ss_len=sizeof(ss);
+  if (getsockname(s, (struct sockaddr*), _len)<0) {
 log_warn(LD_NET, "getsockname() couldn't learn address for %s: %s",
  conn_type_to_string(type),
  tor_socket_strerror(tor_socket_errno(s)));
 gotPort = 0;
   }
+  tor_addr_from_sockaddr(, (struct sockaddr*), );
 }
 #ifdef HAVE_SYS_UN_H
   /*



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Retire U64_TO_DBL and DBL_TO_U64

2018-07-03 Thread nickm
commit d5a3bb960d41873ccfde0bbdb4adfb762528069e
Author: Nick Mathewson 
Date:   Tue Jul 3 10:43:43 2018 -0400

Retire U64_TO_DBL and DBL_TO_U64

These were necessary long ago to work around a bug in VC6.
---
 src/lib/cc/compat_compiler.h | 3 ---
 src/lib/tls/tortls.c | 4 ++--
 src/or/confparse.c   | 2 +-
 src/or/cpuworker.c   | 2 +-
 src/or/hibernate.c   | 3 +--
 src/or/main.c| 8 
 src/or/rephist.c | 4 ++--
 src/or/status.c  | 8 
 src/test/test_util.c | 6 +++---
 9 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index 42ceeadd3..0f1acc381 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -106,9 +106,6 @@
 #endif /* !defined(HAVE_MACRO__func__) */
 #endif /* defined(_MSC_VER) */
 
-#define U64_TO_DBL(x) ((double) (x))
-#define DBL_TO_U64(x) ((uint64_t) (x))
-
 #ifdef ENUM_VALS_ARE_SIGNED
 #define ENUM_BF(t) unsigned
 #else
diff --git a/src/lib/tls/tortls.c b/src/lib/tls/tortls.c
index 3eee41bd1..1cd22a7eb 100644
--- a/src/lib/tls/tortls.c
+++ b/src/lib/tls/tortls.c
@@ -2442,8 +2442,8 @@ tls_get_write_overhead_ratio,(void))
   if (total_bytes_written_over_tls == 0)
 return 1.0;
 
-  return U64_TO_DBL(total_bytes_written_by_tls) /
-U64_TO_DBL(total_bytes_written_over_tls);
+  return ((double)total_bytes_written_by_tls) /
+((double)total_bytes_written_over_tls);
 }
 
 /** Implement check_no_tls_errors: If there are any pending OpenSSL
diff --git a/src/or/confparse.c b/src/or/confparse.c
index 8db6d6080..08f5fd048 100644
--- a/src/or/confparse.c
+++ b/src/or/confparse.c
@@ -1117,7 +1117,7 @@ config_parse_units(const char *val, struct unit_table_t 
*u, int *ok)
 
   if (!cp) {
 *ok = 1;
-v = use_float ? DBL_TO_U64(d) :  v;
+v = use_float ? ((uint64_t)d) :  v;
 goto done;
   }
 
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 675079020..b37dfd168 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -283,7 +283,7 @@ get_overhead_for_onionskins(uint32_t *usec_out, double 
*frac_out,
 onionskins_usec_internal[onionskin_type];
 
   *usec_out = (uint32_t)(overhead / onionskins_n_processed[onionskin_type]);
-  *frac_out = U64_TO_DBL(overhead) / onionskins_usec_internal[onionskin_type];
+  *frac_out = ((double)overhead) / onionskins_usec_internal[onionskin_type];
 
   return 0;
 }
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index c6190bc89..30a5edc1f 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -799,7 +799,7 @@ hibernate_soft_limit_reached(void)
*   - We have used up 95% of our bytes.
*   - We have less than 500MB of bytes left.
*/
-  uint64_t soft_limit = DBL_TO_U64(U64_TO_DBL(acct_max) * SOFT_LIM_PCT);
+  uint64_t soft_limit = (uint64_t) (acct_max * SOFT_LIM_PCT);
   if (acct_max > SOFT_LIM_BYTES && acct_max - SOFT_LIM_BYTES > soft_limit) {
 soft_limit = acct_max - SOFT_LIM_BYTES;
   }
@@ -1227,4 +1227,3 @@ hibernate_set_state_for_testing_(hibernate_state_t 
newstate)
   hibernate_state = newstate;
 }
 #endif /* defined(TOR_UNIT_TESTS) */
-
diff --git a/src/or/main.c b/src/or/main.c
index c2fa416d6..f07d9da8b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -3279,12 +3279,12 @@ dumpstats(int severity)
   (stats_n_destroy_cells_processed));
   if (stats_n_data_cells_packaged)
 tor_log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
-100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
- U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
+100*(((double)stats_n_data_bytes_packaged) /
+ ((double)stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
   if (stats_n_data_cells_received)
 tor_log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
-100*(U64_TO_DBL(stats_n_data_bytes_received) /
- U64_TO_DBL(stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
+100*(((double)stats_n_data_bytes_received) /
+ ((double)stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
 
   cpuworker_log_onionskin_overhead(severity, ONION_HANDSHAKE_TYPE_TAP, "TAP");
   cpuworker_log_onionskin_overhead(severity, ONION_HANDSHAKE_TYPE_NTOR,"ntor");
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 12b0225aa..34c06760b 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1218,9 +1218,9 @@ rep_hist_bandwidth_assess(void)
   r = find_largest_max(read_array);
   w = find_largest_max(write_array);
   if (r>w)
-return (int)(U64_TO_DBL(w)/NUM_SECS_ROLLING_MEASURE);
+return (int)(((double)w)/NUM_SECS_ROLLING_MEASURE);
   else
-return (int)(U64_TO_DBL(r)/NUM_SECS_ROLLING_MEASURE);
+return (int)(((double)r)/NUM_SECS_ROLLING_MEASURE);
 }
 
 /** Print the bandwidth history of b (either [dir-]read_array or
diff --git a/src/or/status.c b/src/or/status.c
index 5c0a768ac..4538e22a5 100644
--- a/src/or/status.c
+++ 

[tor-commits] [tor/master] Require stdint.h and inttypes.h

2018-07-03 Thread nickm
commit e2a94dc48147c9bad1f09f8b14df3bec0e3f5e94
Author: Nick Mathewson 
Date:   Tue Jul 3 10:25:31 2018 -0400

Require stdint.h and inttypes.h

We've been silently requiring stdint.h for a while now, and nobody
has complained.  Closes ticket 26626.
---
 changes/ticket26626  |   3 +
 configure.ac |  17 ---
 src/lib/cc/compat_compiler.h |  53 ++---
 src/lib/cc/torint.h  | 271 ++-
 4 files changed, 20 insertions(+), 324 deletions(-)

diff --git a/changes/ticket26626 b/changes/ticket26626
new file mode 100644
index 0..84591342d
--- /dev/null
+++ b/changes/ticket26626
@@ -0,0 +1,3 @@
+  o Code simplification and refactoring:
+- Tor now assumes that you have standards-conformant stdint.h and
+  inttypes.h headers when compiling.  Closes ticket 26626.
diff --git a/configure.ac b/configure.ac
index 98635bcbd..557a81f41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1393,7 +1393,6 @@ AC_CHECK_HEADERS([errno.h \
   netinet/in6.h \
   pwd.h \
   readpassphrase.h \
-  stdint.h \
   stdatomic.h \
   sys/eventfd.h \
   sys/file.h \
@@ -1517,22 +1516,6 @@ AC_CHECK_MEMBERS([struct timeval.tv_sec], , ,
 #include 
 #endif])
 
-dnl In case we aren't given a working stdint.h, we'll need to grow our own.
-dnl Watch out.
-
-AC_CHECK_SIZEOF(int8_t)
-AC_CHECK_SIZEOF(int16_t)
-AC_CHECK_SIZEOF(int32_t)
-AC_CHECK_SIZEOF(int64_t)
-AC_CHECK_SIZEOF(uint8_t)
-AC_CHECK_SIZEOF(uint16_t)
-AC_CHECK_SIZEOF(uint32_t)
-AC_CHECK_SIZEOF(uint64_t)
-AC_CHECK_SIZEOF(intptr_t)
-AC_CHECK_SIZEOF(uintptr_t)
-
-dnl AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, 
uint32_t, uint64_t, intptr_t, uintptr_t])
-
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index 084923eb0..c1621724d 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -7,6 +7,7 @@
 #define TOR_COMPAT_COMPILER_H
 
 #include "orconfig.h"
+#include 
 
 #if defined(__has_feature)
 #  if __has_feature(address_sanitizer)
@@ -183,53 +184,19 @@
 #define OP_EQ ==
 #define OP_NE !=
 
-#ifdef _MSC_VER
-/** Casts the uint64_t value in a to the right type for an argument
- * to printf. */
-#define U64_PRINTF_ARG(a) (a)
-/** Casts the uint64_t* value in a to the right type for an argument
- * to scanf. */
-#define U64_SCANF_ARG(a) (a)
-/** Expands to a literal uint64_t-typed constant for the value n. */
-#define U64_LITERAL(n) (n ## ui64)
-#define I64_PRINTF_ARG(a) (a)
-#define I64_SCANF_ARG(a) (a)
-#define I64_LITERAL(n) (n ## i64)
-#else /* !(defined(_MSC_VER)) */
-#define U64_PRINTF_ARG(a) ((long long unsigned int)(a))
-#define U64_SCANF_ARG(a) ((long long unsigned int*)(a))
-#define U64_LITERAL(n) (n ## llu)
-#define I64_PRINTF_ARG(a) ((long long signed int)(a))
-#define I64_SCANF_ARG(a) ((long long signed int*)(a))
-#define I64_LITERAL(n) (n ## ll)
-#endif /* defined(_MSC_VER) */
-
 #if defined(__MINGW32__) || defined(__MINGW64__)
 #define MINGW_ANY
 #endif
 
-#if defined(_MSC_VER) || defined(MINGW_ANY)
-/** The formatting string used to put a uint64_t value in a printf() or
- * scanf() function.  See also U64_PRINTF_ARG and U64_SCANF_ARG. */
-#define U64_FORMAT "%I64u"
-#define I64_FORMAT "%I64d"
-#else /* !(defined(_MSC_VER) || defined(MINGW_ANY)) */
-#define U64_FORMAT "%llu"
-#define I64_FORMAT "%lld"
-#endif /* defined(_MSC_VER) || defined(MINGW_ANY) */
-
-#if (SIZEOF_INTPTR_T == SIZEOF_INT)
-#define INTPTR_T_FORMAT "%d"
-#define INTPTR_PRINTF_ARG(x) ((int)(x))
-#elif (SIZEOF_INTPTR_T == SIZEOF_LONG)
-#define INTPTR_T_FORMAT "%ld"
-#define INTPTR_PRINTF_ARG(x) ((long)(x))
-#elif (SIZEOF_INTPTR_T == 8)
-#define INTPTR_T_FORMAT I64_FORMAT
-#define INTPTR_PRINTF_ARG(x) I64_PRINTF_ARG(x)
-#else
-#error Unknown: SIZEOF_INTPTR_T
-#endif /* (SIZEOF_INTPTR_T == SIZEOF_INT) || ... */
+#define U64_PRINTF_ARG(a) ((uint64_t)a)
+#define U64_SCANF_ARG(a) (a)
+#define U64_LITERAL(n) UINT64_C(n)
+#define I64_PRINTF_ARG(a) ((int64_t)a)
+#define I64_SCANF_ARG(a) (a)
+#define I64_LITERAL(n) INT64_C(n)
+#define U64_FORMAT "%"PRIu64
+#define I64_FORMAT "%"PRId64
+#define INTPTR_T_FORMAT "%"PRIuPTR
 
 /** Macro: yield a pointer to the field at position off within the
  * structure st.  Example:
diff --git a/src/lib/cc/torint.h b/src/lib/cc/torint.h
index 5d536e78b..e633722ba 100644
--- a/src/lib/cc/torint.h
+++ b/src/lib/cc/torint.h
@@ -19,189 +19,16 @@
 
 #include "orconfig.h"
 
-#ifdef HAVE_STDINT_H
 #include 
-#endif
+#include 
+#include 
+
 #ifdef HAVE_SYS_TYPES_H
 #include 
 #endif
-#ifdef HAVE_LIMITS_H
-#include 
-#endif
 #ifdef HAVE_SYS_LIMITS_H
 #include 
 #endif
-#ifdef HAVE_MACHINE_LIMITS_H
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
-  /* FreeBSD has a bug where it complains that this file is obsolete,
- and I should migrate 

[tor-commits] [tor/master] Use the standard SHRT_MAX name.

2018-07-03 Thread nickm
commit 4638be5312f527e4769317b2b222faa52bbe0093
Author: Nick Mathewson 
Date:   Tue Jul 3 10:28:10 2018 -0400

Use the standard SHRT_MAX name.
---
 src/lib/cc/torint.h | 4 
 src/or/addressmap.c | 3 +--
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/lib/cc/torint.h b/src/lib/cc/torint.h
index e633722ba..91db25833 100644
--- a/src/lib/cc/torint.h
+++ b/src/lib/cc/torint.h
@@ -95,10 +95,6 @@ typedef int32_t ssize_t;
 #endif /* (SIZEOF_SIZE_T == 4) || ... */
 #endif /* !defined(SIZE_MAX) */
 
-#ifndef SHORT_MAX
-#define SHORT_MAX SHRT_MAX
-#endif
-
 #ifdef _WIN32
 #  ifdef _WIN64
 #define TOR_PRIuSZ PRIu64
diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index a0df5c986..805d21ae7 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -642,7 +642,7 @@ client_dns_incr_failures(const char *address)
 ent->expires = time(NULL) + MAX_DNS_ENTRY_AGE;
 strmap_set(addressmap,address,ent);
   }
-  if (ent->num_resolve_failures < SHORT_MAX)
+  if (ent->num_resolve_failures < SHRT_MAX)
 ++ent->num_resolve_failures; /* don't overflow */
   log_info(LD_APP, "Address %s now has %d resolve failures.",
safe_str_client(address),
@@ -1153,4 +1153,3 @@ addressmap_get_mappings(smartlist_t *sl, time_t 
min_expires,
  iter = strmap_iter_next(addressmap,iter);
}
 }
-



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'github/ticket26626'

2018-07-03 Thread nickm
commit df98582851a92d514c04061a5e0ec762c17a0cfb
Merge: fe8f77482 02a444252
Author: Nick Mathewson 
Date:   Tue Jul 3 12:52:43 2018 -0400

Merge remote-tracking branch 'github/ticket26626'

 changes/ticket26626  |   3 +
 configure.ac |  17 --
 src/common/procmon.c |   4 +-
 src/lib/cc/compat_compiler.h |  48 +-
 src/lib/cc/torint.h  | 267 +---
 src/lib/intmath/bits.c   |  16 +-
 src/lib/net/nettypes.h   |   2 +-
 src/lib/time/tvdiff.c|  20 +--
 src/lib/tls/tortls.c |   4 +-
 src/lib/wallclock/tm_cvt.c   |   4 +-
 src/lib/wallclock/tor_gettimeofday.c |   8 +-
 src/or/addressmap.c  |   2 +-
 src/or/channel.c | 290 +--
 src/or/channelpadding.c  |  26 ++--
 src/or/channeltls.c  |  72 -
 src/or/circuitbuild.c|  16 +-
 src/or/circuitlist.c |  16 +-
 src/or/circuitmux.c  |  58 +++
 src/or/circuitstats.c|   4 +-
 src/or/circuituse.c  |  11 +-
 src/or/command.c |   4 +-
 src/or/config.c  |  12 +-
 src/or/config.h  |   4 +-
 src/or/confparse.c   |  24 +--
 src/or/connection.c  |  12 +-
 src/or/connection_edge.c |   4 +-
 src/or/connection_or.c   |   4 +-
 src/or/control.c |  40 ++---
 src/or/cpuworker.c   |   2 +-
 src/or/dirauth/dirvote.c |  68 
 src/or/directory.c   |  12 +-
 src/or/geoip.c   |   8 +-
 src/or/hibernate.c   |  32 ++--
 src/or/main.c|  52 +++
 src/or/microdesc.c   |   6 +-
 src/or/policies.c|   6 +-
 src/or/rephist.c | 132 
 src/or/router.c  |   4 +-
 src/or/routerlist.c  |   8 +-
 src/or/routerparse.c | 170 ++--
 src/or/scheduler_vanilla.c   |  16 +-
 src/or/status.c  |  22 +--
 src/or/torcert.c |   2 +-
 src/test/test-timers.c   |   4 +-
 src/test/test.h  |  22 +--
 src/test/test_bwmgt.c|   2 +-
 src/test/test_channel.c  |   2 +-
 src/test/test_circuitmux.c   |   2 +-
 src/test/test_config.c   |   4 +-
 src/test/test_crypto.c   |  16 +-
 src/test/test_dir.c  |  10 +-
 src/test/test_geoip.c|   1 -
 src/test/test_mainloop.c |   4 +-
 src/test/test_options.c  |   2 +-
 src/test/test_status.c   |   2 +-
 src/test/test_util.c |  36 ++---
 src/test/test_util_format.c  |   4 +-
 57 files changed, 656 insertions(+), 987 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Retire some unused (or nearly unused) macros.

2018-07-03 Thread nickm
commit cf0b07c2e5284325fb89f2c8ee3ad99f5ed02195
Author: Nick Mathewson 
Date:   Tue Jul 3 10:31:19 2018 -0400

Retire some unused (or nearly unused) macros.
---
 src/lib/cc/compat_compiler.h | 3 ---
 src/lib/net/nettypes.h   | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index c1621724d..a043ae809 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -189,14 +189,11 @@
 #endif
 
 #define U64_PRINTF_ARG(a) ((uint64_t)a)
-#define U64_SCANF_ARG(a) (a)
 #define U64_LITERAL(n) UINT64_C(n)
 #define I64_PRINTF_ARG(a) ((int64_t)a)
-#define I64_SCANF_ARG(a) (a)
 #define I64_LITERAL(n) INT64_C(n)
 #define U64_FORMAT "%"PRIu64
 #define I64_FORMAT "%"PRId64
-#define INTPTR_T_FORMAT "%"PRIuPTR
 
 /** Macro: yield a pointer to the field at position off within the
  * structure st.  Example:
diff --git a/src/lib/net/nettypes.h b/src/lib/net/nettypes.h
index 9bae70d5f..f21237436 100644
--- a/src/lib/net/nettypes.h
+++ b/src/lib/net/nettypes.h
@@ -23,7 +23,7 @@ typedef int socklen_t;
  * any inadvertent checks for the socket being <= 0 or > 0 will probably
  * still work. */
 #define tor_socket_t intptr_t
-#define TOR_SOCKET_T_FORMAT INTPTR_T_FORMAT
+#define TOR_SOCKET_T_FORMAT "%"PRIuPTR
 #define SOCKET_OK(s) ((SOCKET)(s) != INVALID_SOCKET)
 #define TOR_INVALID_SOCKET INVALID_SOCKET
 #else /* !(defined(_WIN32)) */



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Fix up some windows compilation issues.

2018-07-03 Thread nickm
commit 02a4442524d84ea7edf6e3f136017faa73452d92
Author: Nick Mathewson 
Date:   Tue Jul 3 11:00:18 2018 -0400

Fix up some windows compilation issues.

These were mostly cases where our previous macros had been casting,
and the values that we were trying to printf were not in fact
uint64_t.
---
 src/common/procmon.c   |  4 ++--
 src/lib/time/tvdiff.c  | 10 +-
 src/lib/wallclock/tm_cvt.c |  2 +-
 src/or/channel.c   | 35 +--
 src/or/circuitlist.c   |  4 ++--
 src/or/directory.c |  7 +++
 src/test/test_util.c   |  2 +-
 7 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/src/common/procmon.c b/src/common/procmon.c
index 9799594d3..6c2b3e71e 100644
--- a/src/common/procmon.c
+++ b/src/common/procmon.c
@@ -35,8 +35,8 @@ typedef int pid_t;
 #define PID_T_FORMAT "%d"
 #elif (SIZEOF_PID_T == SIZEOF_LONG)
 #define PID_T_FORMAT "%ld"
-#elif (SIZEOF_PID_T == SIZEOF_INT64_T)
-#define PID_T_FORMAT I64_FORMAT
+#elif (SIZEOF_PID_T == 8)
+#define PID_T_FORMAT "%"PRId64
 #else
 #error Unknown: SIZEOF_PID_T
 #endif /* (0 == SIZEOF_PID_T) && defined(_WIN32) || ... */
diff --git a/src/lib/time/tvdiff.c b/src/lib/time/tvdiff.c
index 0af45a208..cfd1ace77 100644
--- a/src/lib/time/tvdiff.c
+++ b/src/lib/time/tvdiff.c
@@ -52,14 +52,14 @@ tv_udiff(const struct timeval *start, const struct timeval 
*end)
   if (start->tv_usec > TOR_USEC_PER_SEC || start->tv_usec < 0) {
 log_warn(LD_GENERAL, "comparing times on microsecond detail with bad "
  "start tv_usec: %"PRId64 " microseconds",
- (start->tv_usec));
+ (int64_t)start->tv_usec);
 return LONG_MAX;
   }
 
   if (end->tv_usec > TOR_USEC_PER_SEC || end->tv_usec < 0) {
 log_warn(LD_GENERAL, "comparing times on microsecond detail with bad "
  "end tv_usec: %"PRId64 " microseconds",
- (end->tv_usec));
+ (int64_t)end->tv_usec);
 return LONG_MAX;
   }
 
@@ -101,14 +101,14 @@ tv_mdiff(const struct timeval *start, const struct 
timeval *end)
   if (start->tv_usec > TOR_USEC_PER_SEC || start->tv_usec < 0) {
 log_warn(LD_GENERAL, "comparing times on millisecond detail with bad "
  "start tv_usec: %"PRId64 " microseconds",
- (start->tv_usec));
+ (int64_t)start->tv_usec);
 return LONG_MAX;
   }
 
   if (end->tv_usec > TOR_USEC_PER_SEC || end->tv_usec < 0) {
 log_warn(LD_GENERAL, "comparing times on millisecond detail with bad "
  "end tv_usec: %"PRId64 " microseconds",
- (end->tv_usec));
+ (int64_t)end->tv_usec);
 return LONG_MAX;
   }
 
@@ -124,7 +124,7 @@ tv_mdiff(const struct timeval *start, const struct timeval 
*end)
   if (secdiff > (int64_t)(LONG_MAX/1000 - 2) ||
   secdiff < (int64_t)(LONG_MIN/1000 + 1)) {
 log_warn(LD_GENERAL, "comparing times on millisecond detail too far "
- "apart: %"PRId64 " seconds", (secdiff));
+ "apart: %"PRId64 " seconds", (int64_t)secdiff);
 return LONG_MAX;
   }
 
diff --git a/src/lib/wallclock/tm_cvt.c b/src/lib/wallclock/tm_cvt.c
index 0a1a1cd43..31d929e63 100644
--- a/src/lib/wallclock/tm_cvt.c
+++ b/src/lib/wallclock/tm_cvt.c
@@ -102,7 +102,7 @@ correct_tm(int islocal, const time_t *timep, struct tm 
*resultbuf,
   if (err_out) {
 tor_asprintf(err_out, "%s(%"PRId64") failed with error %s: %s",
  islocal?"localtime":"gmtime",
- timep?(*timep):0,
+ timep?((int64_t)*timep):0,
  strerror(errno),
  outcome);
   }
diff --git a/src/or/channel.c b/src/or/channel.c
index 9b57eccd7..6ab02f3b2 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2544,10 +2544,10 @@ channel_dump_statistics, (channel_t *chan, int 
severity))
   " (%"PRIu64 " seconds ago) "
   "and last active at %"PRIu64 " (%"PRIu64 " seconds ago)",
   (chan->global_identifier),
-  (chan->timestamp_created),
-  (now - chan->timestamp_created),
-  (chan->timestamp_active),
-  (now - chan->timestamp_active));
+  (uint64_t)(chan->timestamp_created),
+  (uint64_t)(now - chan->timestamp_created),
+  (uint64_t)(chan->timestamp_active),
+  (uint64_t)(now - chan->timestamp_active));
 
   /* Handle digest. */
   if (!tor_digest_is_zero(chan->identity_digest)) {
@@ -2624,20 +2624,20 @@ channel_dump_statistics, (channel_t *chan, int 
severity))
   " * Channel %"PRIu64 " was last used by a "
   "client at %"PRIu64 " (%"PRIu64 " seconds ago)",
   (chan->global_identifier),
-  (chan->timestamp_client),
-  (now - chan->timestamp_client));
+  (uint64_t)(chan->timestamp_client),
+  (uint64_t)(now - chan->timestamp_client));
   tor_log(severity, LD_GENERAL,
   " * Channel %"PRIu64 " last received a cell "
   "at %"PRIu64 " (%"PRIu64 " seconds ago)",
   (chan->global_identifier),
-  (chan->timestamp_recv),
-  (now - 

[tor-commits] [tor/master] Replace U64_LITERAL with the standard UINT64_C

2018-07-03 Thread nickm
commit 52884f56d43670f1960d9354ccc3ace9a048e283
Author: Nick Mathewson 
Date:   Tue Jul 3 10:33:50 2018 -0400

Replace U64_LITERAL with the standard UINT64_C
---
 src/lib/cc/compat_compiler.h |  2 --
 src/lib/intmath/bits.c   | 16 
 src/lib/wallclock/tor_gettimeofday.c |  8 
 src/or/config.c  |  4 ++--
 src/or/config.h  |  4 ++--
 src/or/confparse.c   | 18 +-
 src/or/dirauth/dirvote.c | 12 ++--
 src/or/policies.c|  6 +++---
 src/or/routerparse.c |  2 +-
 src/test/test_bwmgt.c|  2 +-
 src/test/test_channel.c  |  2 +-
 src/test/test_circuitmux.c   |  2 +-
 src/test/test_config.c   |  4 ++--
 src/test/test_crypto.c   | 10 +-
 src/test/test_dir.c  | 10 +-
 src/test/test_mainloop.c |  4 ++--
 src/test/test_options.c  |  2 +-
 src/test/test_status.c   |  2 +-
 src/test/test_util.c | 24 
 src/test/test_util_format.c  |  4 ++--
 20 files changed, 68 insertions(+), 70 deletions(-)

diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index a043ae809..f14e48813 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -189,9 +189,7 @@
 #endif
 
 #define U64_PRINTF_ARG(a) ((uint64_t)a)
-#define U64_LITERAL(n) UINT64_C(n)
 #define I64_PRINTF_ARG(a) ((int64_t)a)
-#define I64_LITERAL(n) INT64_C(n)
 #define U64_FORMAT "%"PRIu64
 #define I64_FORMAT "%"PRId64
 
diff --git a/src/lib/intmath/bits.c b/src/lib/intmath/bits.c
index 4b5729e99..7da524449 100644
--- a/src/lib/intmath/bits.c
+++ b/src/lib/intmath/bits.c
@@ -16,27 +16,27 @@ int
 tor_log2(uint64_t u64)
 {
   int r = 0;
-  if (u64 >= (U64_LITERAL(1)<<32)) {
+  if (u64 >= (UINT64_C(1)<<32)) {
 u64 >>= 32;
 r = 32;
   }
-  if (u64 >= (U64_LITERAL(1)<<16)) {
+  if (u64 >= (UINT64_C(1)<<16)) {
 u64 >>= 16;
 r += 16;
   }
-  if (u64 >= (U64_LITERAL(1)<<8)) {
+  if (u64 >= (UINT64_C(1)<<8)) {
 u64 >>= 8;
 r += 8;
   }
-  if (u64 >= (U64_LITERAL(1)<<4)) {
+  if (u64 >= (UINT64_C(1)<<4)) {
 u64 >>= 4;
 r += 4;
   }
-  if (u64 >= (U64_LITERAL(1)<<2)) {
+  if (u64 >= (UINT64_C(1)<<2)) {
 u64 >>= 2;
 r += 2;
   }
-  if (u64 >= (U64_LITERAL(1)<<1)) {
+  if (u64 >= (UINT64_C(1)<<1)) {
 // u64 >>= 1; // not using this any more.
 r += 1;
   }
@@ -55,12 +55,12 @@ round_to_power_of_2(uint64_t u64)
 return 1;
 
   lg2 = tor_log2(u64);
-  low = U64_LITERAL(1) << lg2;
+  low = UINT64_C(1) << lg2;
 
   if (lg2 == 63)
 return low;
 
-  high = U64_LITERAL(1) << (lg2+1);
+  high = UINT64_C(1) << (lg2+1);
   if (high - u64 < u64 - low)
 return high;
   else
diff --git a/src/lib/wallclock/tor_gettimeofday.c 
b/src/lib/wallclock/tor_gettimeofday.c
index 74a640572..eb902e681 100644
--- a/src/lib/wallclock/tor_gettimeofday.c
+++ b/src/lib/wallclock/tor_gettimeofday.c
@@ -44,10 +44,10 @@ tor_gettimeofday, (struct timeval *timeval))
 #ifdef _WIN32
   /* Epoch bias copied from perl: number of units between windows epoch and
* Unix epoch. */
-#define EPOCH_BIAS U64_LITERAL(1164447360)
-#define UNITS_PER_SEC U64_LITERAL(1000)
-#define USEC_PER_SEC U64_LITERAL(100)
-#define UNITS_PER_USEC U64_LITERAL(10)
+#define EPOCH_BIAS UINT64_C(1164447360)
+#define UNITS_PER_SEC UINT64_C(1000)
+#define USEC_PER_SEC UINT64_C(100)
+#define UNITS_PER_USEC UINT64_C(10)
   union {
 uint64_t ft_64;
 FILETIME ft_ft;
diff --git a/src/or/config.c b/src/or/config.c
index e3a4faa31..c958706f4 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4581,8 +4581,8 @@ compute_real_max_mem_in_queues(const uint64_t val, int 
log_guess)
   uint64_t result;
 
   if (val == 0) {
-#define ONE_GIGABYTE (U64_LITERAL(1) << 30)
-#define ONE_MEGABYTE (U64_LITERAL(1) << 20)
+#define ONE_GIGABYTE (UINT64_C(1) << 30)
+#define ONE_MEGABYTE (UINT64_C(1) << 20)
 /* The user didn't pick a memory limit.  Choose a very large one
  * that is still smaller than the system memory */
 static int notice_sent = 0;
diff --git a/src/or/config.h b/src/or/config.h
index d2faf6c51..75470a9c9 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -24,9 +24,9 @@
 
 /** Maximum default value for MaxMemInQueues, in bytes. */
 #if SIZEOF_VOID_P >= 8
-#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (U64_LITERAL(8) << 30)
+#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (UINT64_C(8) << 30)
 #else
-#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (U64_LITERAL(2) << 30)
+#define MAX_DEFAULT_MEMORY_QUEUE_SIZE (UINT64_C(2) << 30)
 #endif
 
 MOCK_DECL(const char*, get_dirportfrontpage, (void));
diff --git a/src/or/confparse.c b/src/or/confparse.c
index b38e06c6a..c152fb171 100644
--- a/src/or/confparse.c
+++ b/src/or/confparse.c
@@ -1040,15 +1040,15 @@ static struct unit_table_t memory_units[] = {
   

[tor-commits] [tor/master] Clean up various things that broke with our stdint.h changes

2018-07-03 Thread nickm
commit c75215c23ad9e3a3142ce65a06a6231425f0e30e
Author: Nick Mathewson 
Date:   Tue Jul 3 10:26:06 2018 -0400

Clean up various things that broke with our stdint.h changes

Casting before printf was necessary; now it's not so smart.

We don't have SIZEOF_UINT8_T any more.
---
 src/or/torcert.c   |  3 +--
 src/test/test.h| 22 +++---
 src/test/test_crypto.c |  7 +++
 src/test/test_geoip.c  |  1 -
 src/test/test_util.c   |  2 +-
 5 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/src/or/torcert.c b/src/or/torcert.c
index 785132c17..f44373805 100644
--- a/src/or/torcert.c
+++ b/src/or/torcert.c
@@ -168,7 +168,7 @@ tor_cert_parse(const uint8_t *encoded, const size_t len)
 
   memcpy(cert->signed_key.pubkey, parsed->certified_key, 32);
   int64_t valid_until_64 = ((int64_t)parsed->exp_field) * 3600;
-#if SIZEOF_TIME_T < SIZEOF_INT64_T
+#if SIZEOF_TIME_T < 8
   if (valid_until_64 > TIME_MAX)
 valid_until_64 = TIME_MAX - 1;
 #endif
@@ -723,4 +723,3 @@ tor_cert_encode_ed22519(const tor_cert_t *cert, char 
**cert_str_out)
   tor_free(ed_cert_b64);
   return ret;
 }
-
diff --git a/src/test/test.h b/src/test/test.h
index c231bc5f8..602acca1c 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -50,28 +50,20 @@
   tt_double_op((a), OP_LE, (b)); \
   STMT_END
 
-#ifdef _MSC_VER
-#define U64_PRINTF_TYPE uint64_t
-#define I64_PRINTF_TYPE int64_t
-#else
-#define U64_PRINTF_TYPE unsigned long long
-#define I64_PRINTF_TYPE long long
-#endif /* defined(_MSC_VER) */
-
 #define tt_size_op(a,op,b)  \
   tt_assert_test_fmt_type(a,b,#a" "#op" "#b,size_t,(val1_ op val2_),\
-U64_PRINTF_TYPE, U64_FORMAT,\
-{print_ = (U64_PRINTF_TYPE) value_;}, {}, TT_EXIT_TEST_FUNCTION)
+size_t, "%"TOR_PRIuSZ,  \
+{print_ = (size_t) value_;}, {}, TT_EXIT_TEST_FUNCTION)
 
 #define tt_u64_op(a,op,b)  \
   tt_assert_test_fmt_type(a,b,#a" "#op" "#b,uint64_t,(val1_ op val2_), \
-U64_PRINTF_TYPE, U64_FORMAT,   \
-{print_ = (U64_PRINTF_TYPE) value_;}, {}, TT_EXIT_TEST_FUNCTION)
+uint64_t, "%"PRIu64,   \
+{print_ = (uint64_t) value_;}, {}, TT_EXIT_TEST_FUNCTION)
 
 #define tt_i64_op(a,op,b)  \
-  tt_assert_test_fmt_type(a,b,#a" "#op" "#b,int64_t,(val1_ op val2_), \
-I64_PRINTF_TYPE, I64_FORMAT,   \
-{print_ = (I64_PRINTF_TYPE) value_;}, {}, TT_EXIT_TEST_FUNCTION)
+  tt_assert_test_fmt_type(a,b,#a" "#op" "#b,int64_t,(val1_ op val2_),  \
+int64_t, "%"PRId64,\
+{print_ = (int64_t) value_;}, {}, TT_EXIT_TEST_FUNCTION)
 
 /**
  * Declare that the test is done, even though no tt___op() calls were made.
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index e8a2efe59..ecbc6745d 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -2862,12 +2862,12 @@ crypto_rand_check_failure_mode_identical(void)
 {
   /* just in case the buffer size isn't a multiple of sizeof(int64_t) */
 #define FAILURE_MODE_BUFFER_SIZE_I64 \
-  (FAILURE_MODE_BUFFER_SIZE/SIZEOF_INT64_T)
+  (FAILURE_MODE_BUFFER_SIZE/8)
 #define FAILURE_MODE_BUFFER_SIZE_I64_BYTES \
-  (FAILURE_MODE_BUFFER_SIZE_I64*SIZEOF_INT64_T)
+  (FAILURE_MODE_BUFFER_SIZE_I64*8)
 
 #if FAILURE_MODE_BUFFER_SIZE_I64 < 2
-#error FAILURE_MODE_BUFFER_SIZE needs to be at least 2*SIZEOF_INT64_T
+#error FAILURE_MODE_BUFFER_SIZE needs to be at least 2*8
 #endif
 
   int64_t buf[FAILURE_MODE_BUFFER_SIZE_I64];
@@ -3063,4 +3063,3 @@ struct testcase_t crypto_tests[] = {
   { "failure_modes", test_crypto_failure_modes, TT_FORK, NULL, NULL },
   END_OF_TESTCASES
 };
-
diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c
index d50dd134e..9aa46786e 100644
--- a/src/test/test_geoip.c
+++ b/src/test/test_geoip.c
@@ -575,4 +575,3 @@ struct testcase_t geoip_tests[] = {
 
   END_OF_TESTCASES
 };
-
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 7f37a2ab9..53d329210 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5564,7 +5564,7 @@ test_util_max_mem(void *arg)
 tt_uint_op(memory1, OP_GT, (1<<20));
   } else {
 /* You do not have a petabyte. */
-#if SIZEOF_SIZE_T == SIZEOF_UINT64_T
+#if SIZEOF_SIZE_T >= 8
 tt_u64_op(memory1, OP_LT, (U64_LITERAL(1)<<50));
 #endif
   }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'bug26522'

2018-07-03 Thread nickm
commit fe8f7748202816a9b90e04db542e449145283a66
Merge: 77e678c20 d0525c38d
Author: Nick Mathewson 
Date:   Tue Jul 3 11:34:36 2018 -0400

Merge branch 'bug26522'

 changes/bug26522| 6 ++
 src/lib/err/backtrace.c | 9 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Refrain from potentially insecure usage of strncat()

2018-07-03 Thread nickm
commit d0525c38d607504aee4ab8451d4651c2668997c0
Author: rl1987 
Date:   Tue Jul 3 13:36:15 2018 +0300

Refrain from potentially insecure usage of strncat()
---
 changes/bug26522| 6 ++
 src/lib/err/backtrace.c | 9 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/changes/bug26522 b/changes/bug26522
new file mode 100644
index 0..c6b30eed7
--- /dev/null
+++ b/changes/bug26522
@@ -0,0 +1,6 @@
+  o Minor bugfixes (security):
+- Refrain from potentially insecure usage of strncat() in
+  configure_backtrace_handler(). Use snprintf() instead.
+  Fixes bug 26522; bugfix on
+  a969ce464dc23db39725a891d60537f3d3e51b50 (not in any tor
+  release).
diff --git a/src/lib/err/backtrace.c b/src/lib/err/backtrace.c
index 5f5ecd3c3..d18a595c3 100644
--- a/src/lib/err/backtrace.c
+++ b/src/lib/err/backtrace.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef HAVE_CYGWIN_SIGNAL_H
 #include 
@@ -264,16 +265,12 @@ dump_stack_symbols_to_error_fds(void)
 int
 configure_backtrace_handler(const char *tor_version)
 {
-  char version[128];
-  strncpy(version, "Tor", sizeof(version)-1);
+  char version[128] = "Tor\0";
 
   if (tor_version) {
-strncat(version, " ", sizeof(version)-1);
-strncat(version, tor_version, sizeof(version)-1);
+snprintf(version, sizeof(version), "Tor %s", tor_version);
   }
 
-  version[sizeof(version) - 1] = 0;
-
   return install_bt_handler(version);
 }
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc] Update translations for tails-misc

2018-07-03 Thread translation
commit 051c0d5c079bf52903fc25e613311a46e07c5618
Author: Translation commit bot 
Date:   Tue Jul 3 15:16:50 2018 +

Update translations for tails-misc
---
 ar.po | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ar.po b/ar.po
index 0572221a7..11782ee59 100644
--- a/ar.po
+++ b/ar.po
@@ -13,6 +13,7 @@
 # ButterflyOfFire, 2018
 # 0xidz , 2014
 # lamine Kacimi , 2015
+# Khaled Hosny , 2018
 # Matt Santy , 2013
 # stayanonymous, 2015
 # Mohammed ALDOUB , 2013
@@ -27,8 +28,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2018-03-12 19:03+0100\n"
-"PO-Revision-Date: 2018-05-27 01:50+\n"
-"Last-Translator: abidin toumi \n"
+"PO-Revision-Date: 2018-07-03 14:27+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -42,7 +43,7 @@ msgstr "تور جاهز للإقلاع"
 
 #: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:40
 msgid "You can now access the Internet."
-msgstr "يمكنك الأن تصفح الأنترنت."
+msgstr "يمكنك الآن تصفح الإنترنت."
 
 #: config/chroot_local-includes/etc/whisperback/config.py:65
 #, python-format
@@ -59,7 +60,7 @@ msgid ""
 "an opportunity for eavesdroppers, like your email or Internet provider, to\n"
 "confirm that you are using Tails.\n"
 "\n"
-msgstr "ساعدنا لإصلاح المشكلة!\nاقرأ الإرشادات الخاصة بالتبليغ عن 
الأخطاء.\nلحماية خصوصيتك، قم 
بتعبئة البيانات المطلوبة فقط 
لاغير!\n\nتوضيح حول تزويدنا بعنوان 
بريدك الالكتروني\n\nسنقوم باستخدام 
بريدك الالكتروني للتواصل معك من أجل 
استيضاح المشكلة بشكل أفضل، وهو مطلوب لأغلب 
تقارير الأخطاء حيث أنه من غير الممكن متابعة 
تقارير الأخطاء التي ترسل من دون أية معلومات 
اتصال.\nمن ناحية أخرى، يجب التنويه بأن تضمين 
البريد الالكتروني يسمح لبعض الجهات تأكيد 
استخدامك لـ تيلز، كمزود خدمة البريد 
الالكتروني أو مزود خدمة الانتر
 نت على سبيل المثال. \n\n\n"
+msgstr "ساعدنا لإصلاح المشكلة!\nاقرأ الإرشادات الخاصة بالتبليغ عن 
الأخطاء.\nلحماية خصوصيتك، املأ 
البيانات المطلوبة فقط لا 
غير!\nتوضيح حول إعطائنا عنوان 
بريدك الإلكتروني\n\nسنستخدم بريدك 
الإلكتروني للتواصل معك لاستيضاح المشكلة 
بشكل أفضل، وهو مطلوب لأغلب تقارير الأخطاء 
حيث أنه من غير الممكن متابعة تقارير الأخطاء 
التي ترسل من دون أية معلومات اتصال.\nمن 
ناحية أخرى، يجب التنويه بأن تضمين البريد 
الإلكتروني يسمح للمتنصتين، كمزود خدمة 
البريد الإلكتروني أو مزود خدمة الإنترنت، 
التأكد من استخدامك لـتيلز . \n\n"
 
 #: config/chroot_local-includes/usr/local/bin/electrum:57
 msgid "Persistence is disabled for Electrum"
@@ -88,11 +89,11 @@ msgstr "_Exit"
 
 #: 
config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-hel...@tails.boum.org/extension.js:75
 msgid "Restart"
-msgstr "إعادة تشغيل"
+msgstr "أعد التشغيل"
 
 #: 
config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-hel...@tails.boum.org/extension.js:78
 msgid "Lock screen"
-msgstr ""
+msgstr "أوصد الشاشة"
 
 #: 
config/chroot_local-includes/usr/share/gnome-shell/extensions/status-menu-hel...@tails.boum.org/extension.js:81
 msgid "Power Off"
@@ -125,7 +126,7 @@ msgstr "غير متاح"
 
 #: config/chroot_local-includes/usr/local/sbin/tails-additional-software:170
 msgid "Your additional software installation failed"
-msgstr ""
+msgstr "فشل تنصيب البرمجيات الإضافية"
 
 #: config/chroot_local-includes/usr/local/sbin/tails-additional-software:171
 msgid ""

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui_completed] Update translations for mat-gui_completed

2018-07-03 Thread translation
commit 60b158655bd29666eebd7401f6d823adeecc8374
Author: Translation commit bot 
Date:   Tue Jul 3 15:16:20 2018 +

Update translations for mat-gui_completed
---
 ar.po | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ar.po b/ar.po
index 17e4d8caa..0ba405bbb 100644
--- a/ar.po
+++ b/ar.po
@@ -17,7 +17,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2018-07-03 13:37+\n"
+"PO-Revision-Date: 2018-07-03 14:18+\n"
 "Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
@@ -98,19 +98,19 @@ msgstr "غير مدعوم"
 
 #: mat-gui:339
 msgid "Harmless fileformat"
-msgstr "صيغة الملف غير مؤذية"
+msgstr "صيغة ملف غير مؤذية"
 
 #: mat-gui:341
 msgid "Cant read file"
-msgstr "لايمكن قرائه الملف"
+msgstr "تعذّر قراءة الملف"
 
 #: mat-gui:343
 msgid "Fileformat not supported"
-msgstr "صيغة الملف غير مدعمة"
+msgstr "صيغة الملف غير مدعومة"
 
 #: mat-gui:346
 msgid "These files can not be processed:"
-msgstr "لا يمكن معالجة هذه الملفات:"
+msgstr "تعذّر معالجة هذه الملفات:"
 
 #: mat-gui:351 mat-gui:380 data/mat.glade:239
 msgid "Filename"
@@ -122,16 +122,16 @@ msgstr "السبب"
 
 #: mat-gui:365
 msgid "Non-supported files in archive"
-msgstr "الملفات في الأرشيف غير مدعمة"
+msgstr "ملفات غير مدعومة في الأرشيف"
 
 #: mat-gui:379
 msgid "Include"
-msgstr "أدمِج"
+msgstr "ادمِج"
 
 #: mat-gui:397
 #, python-format
 msgid "MAT is not able to clean the following files, found in the %s archive"
-msgstr "لم يستطع MAT تنظيف الملفات التالية الم
وجودة في الأرشيف %s"
+msgstr "تعذّر على MAT تنظيف الملفات التالية الم
وجودة في الأرشيف %s"
 
 #: mat-gui:413
 #, python-format
@@ -169,7 +169,7 @@ msgstr "البيانات الوصفية"
 
 #: data/mat.glade:354
 msgid "Name"
-msgstr "الإسم"
+msgstr "الاسم"
 
 #: data/mat.glade:368
 msgid "Content"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui] Update translations for mat-gui

2018-07-03 Thread translation
commit 13b3b43f1f4f1c06912da2b25571b93e325a2509
Author: Translation commit bot 
Date:   Tue Jul 3 15:16:15 2018 +

Update translations for mat-gui
---
 ar.po | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ar.po b/ar.po
index 17e4d8caa..0ba405bbb 100644
--- a/ar.po
+++ b/ar.po
@@ -17,7 +17,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2018-07-03 13:37+\n"
+"PO-Revision-Date: 2018-07-03 14:18+\n"
 "Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
@@ -98,19 +98,19 @@ msgstr "غير مدعوم"
 
 #: mat-gui:339
 msgid "Harmless fileformat"
-msgstr "صيغة الملف غير مؤذية"
+msgstr "صيغة ملف غير مؤذية"
 
 #: mat-gui:341
 msgid "Cant read file"
-msgstr "لايمكن قرائه الملف"
+msgstr "تعذّر قراءة الملف"
 
 #: mat-gui:343
 msgid "Fileformat not supported"
-msgstr "صيغة الملف غير مدعمة"
+msgstr "صيغة الملف غير مدعومة"
 
 #: mat-gui:346
 msgid "These files can not be processed:"
-msgstr "لا يمكن معالجة هذه الملفات:"
+msgstr "تعذّر معالجة هذه الملفات:"
 
 #: mat-gui:351 mat-gui:380 data/mat.glade:239
 msgid "Filename"
@@ -122,16 +122,16 @@ msgstr "السبب"
 
 #: mat-gui:365
 msgid "Non-supported files in archive"
-msgstr "الملفات في الأرشيف غير مدعمة"
+msgstr "ملفات غير مدعومة في الأرشيف"
 
 #: mat-gui:379
 msgid "Include"
-msgstr "أدمِج"
+msgstr "ادمِج"
 
 #: mat-gui:397
 #, python-format
 msgid "MAT is not able to clean the following files, found in the %s archive"
-msgstr "لم يستطع MAT تنظيف الملفات التالية الم
وجودة في الأرشيف %s"
+msgstr "تعذّر على MAT تنظيف الملفات التالية الم
وجودة في الأرشيف %s"
 
 #: mat-gui:413
 #, python-format
@@ -169,7 +169,7 @@ msgstr "البيانات الوصفية"
 
 #: data/mat.glade:354
 msgid "Name"
-msgstr "الإسم"
+msgstr "الاسم"
 
 #: data/mat.glade:368
 msgid "Content"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'github/shrink_or_h_more'

2018-07-03 Thread nickm
commit 77e678c20daf8633ce1904dd1df28398d820f7c0
Merge: a01b4d7f8 518ebe14d
Author: Nick Mathewson 
Date:   Tue Jul 3 11:09:54 2018 -0400

Merge remote-tracking branch 'github/shrink_or_h_more'

 src/lib/compress/compress.h   |4 +-
 src/lib/crypt_ops/crypto_curve25519.h |   11 +-
 src/lib/crypt_ops/crypto_dh.c |4 +-
 src/lib/crypt_ops/crypto_dh.h |5 +-
 src/lib/crypt_ops/crypto_ed25519.h|   14 +-
 src/lib/crypt_ops/crypto_format.h |   20 +-
 src/lib/defs/dh_sizes.h   |   13 +
 src/lib/defs/include.am   |6 +-
 src/lib/defs/x25519_sizes.h   |   27 +
 src/or/addr_policy_st.h   |   46 +
 src/or/addressmap.c   |4 +-
 src/or/bridges.h  |4 +-
 src/or/cell_queue_st.h|3 +-
 src/or/channel.c  |2 +-
 src/or/channel.h  |  158 ++-
 src/or/channelpadding.c   |2 +-
 src/or/channeltls.c   |3 +-
 src/or/channeltls.h   |6 +-
 src/or/circpathbias.h |3 +-
 src/or/circuit_st.h   |   14 +-
 src/or/circuitbuild.h |   14 +-
 src/or/circuitlist.c  |4 +-
 src/or/circuitlist.h  |  142 +-
 src/or/circuitmux_ewma.c  |2 +-
 src/or/circuitstats.c |2 +
 src/or/circuitstats.h |   87 +-
 src/or/config.c   |   14 +
 src/or/config.h   |   20 +-
 src/or/confparse.c|1 +
 src/or/confparse.h|   11 +-
 src/or/connection.c   |   10 +
 src/or/connection.h   |   89 +-
 src/or/connection_edge.c  |2 +-
 src/or/connection_edge.h  |   49 +-
 src/or/connection_or.c|5 +-
 src/or/connection_or.h|   56 +-
 src/or/connection_st.h|   18 +
 src/or/conscache.c|2 +-
 src/or/conscache.h|9 +-
 src/or/consdiffmgr.c  |4 +-
 src/or/consdiffmgr.h  |7 +-
 src/or/control.c  |   10 +-
 src/or/control.h  |   91 +-
 src/or/crypt_path_st.h|   18 +-
 src/or/desc_store_st.h|7 +-
 src/or/dir_connection_st.h|5 +-
 src/or/dirauth/dirvote.c  |2 +
 src/or/dirauth/shared_random_state.c  |4 +-
 src/or/dirauth/shared_random_state.h  |7 +-
 src/or/directory.c|   13 +-
 src/or/directory.h|   88 +-
 src/or/dirserv.c  |3 +
 src/or/dirserv.h  |   20 +-
 src/or/dns.c  |6 +-
 src/or/dnsserv.c  |2 +-
 src/or/dos.c  |2 +-
 src/or/entrynodes.c   |2 +
 src/or/entrynodes.h   |3 +-
 src/or/ext_orport.h   |   20 +-
 src/or/extend_info_st.h   |4 +-
 src/or/geoip.h|   59 +-
 src/or/hibernate.c|7 +-
 src/or/hs_cache.c |2 +-
 src/or/hs_cache.h |   24 +-
 src/or/hs_circuit.c   |   12 +-
 src/or/hs_circuitmap.c|1 -
 src/or/hs_circuitmap.h|5 +-
 src/or/hs_client.c|3 +-
 src/or/hs_common.c|1 -
 src/or/hs_common.h|   34 +-
 src/or/hs_config.c|3 +-
 src/or/hs_control.c   |2 +-
 src/or/hs_descriptor.c|3 +-
 src/or/hs_descriptor.h|4 -
 src/or/hs_intropoint.c|2 +-
 src/or/hs_ntor.c  |3 +-
 src/or/hs_ntor.h  |   44 +-
 src/or/hs_service.c   |   12 +-
 src/or/include.am |5 +-
 src/or/main.c |9 +
 src/or/main.h |7 +-
 src/or/microdesc.c|7 +
 src/or/microdesc_st.h |   13 +-
 src/or/networkstatus.c|6 +-
 src/or/networkstatus_st.h |8 +-
 src/or/node_st.h  |2 +-
 src/or/nodelist.h |   15 +-
 src/or/ntmain.c   |1 +
 src/or/onion.c|6 +-
 src/or/onion.h|   11 +-
 src/or/onion_fast.c   |2 +-
 src/or/onion_ntor.c   |2 +-
 src/or/onion_ntor.h   |   22 +-
 src/or/onion_tap.c|   20 +-
 src/or/onion_tap.h|   18 +-
 src/or/or.h   | 2315 +
 src/or/or_connection_st.h |6 +-
 src/or/or_handshake_certs_st.h  

[tor-commits] [tor/master] fixup! Remove system headers from or.h

2018-07-03 Thread nickm
commit 8d562c040ff46da0b05df9aff7294e854238b263
Author: Nick Mathewson 
Date:   Sun Jul 1 15:31:18 2018 -0400

fixup! Remove system headers from or.h
---
 src/or/microdesc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index a0ee4ba5f..a0e95b66b 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -33,6 +33,9 @@
 #ifdef HAVE_FCNTL_H
 #include 
 #endif
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
 
 /** A data structure to hold a bunch of cached microdescriptors.  There are
  * two active files in the cache: a "cache file" that we mmap, and a "journal



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Remove system headers from or.h

2018-07-03 Thread nickm
commit 6c440da9260b6f8fffca7cb95ed6e51f55c71b14
Author: Nick Mathewson 
Date:   Sun Jul 1 15:02:01 2018 -0400

Remove system headers from or.h
---
 src/or/config.c   |  9 +
 src/or/connection.c   |  7 +++
 src/or/control.c  |  7 +++
 src/or/dns.c  |  4 
 src/or/hibernate.c|  4 
 src/or/hs_service.c   |  7 +++
 src/or/main.c |  4 
 src/or/microdesc.c|  4 
 src/or/networkstatus.c|  4 
 src/or/or.h   | 43 +--
 src/or/rendservice.c  | 10 ++
 src/or/rephist.c  |  4 
 src/or/routerkeys.c   |  4 
 src/or/routerlist.c   |  4 
 src/or/routerparse.c  |  3 +++
 src/or/scheduler_kist.c   |  4 
 src/or/statefile.c|  4 
 src/test/test_addr.c  |  5 -
 src/test/test_bt_cl.c |  5 -
 src/test/test_checkdir.c  |  5 -
 src/test/test_config.c|  7 +++
 src/test/test_crypto.c|  7 +++
 src/test/test_dir.c   |  4 
 src/test/test_extorport.c |  5 -
 src/test/test_hs.c|  4 
 src/test/test_logging.c   |  4 
 src/test/test_microdesc.c |  5 -
 src/test/test_routerkeys.c|  7 +++
 src/test/test_shared_random.c |  4 
 src/test/test_switch_id.c |  3 +++
 src/test/test_util.c  | 10 ++
 src/test/testing_common.c |  6 ++
 32 files changed, 160 insertions(+), 47 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index 0507c4312..a29958c57 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -110,6 +110,15 @@
 #ifdef _WIN32
 #include 
 #endif
+#ifdef HAVE_FCNTL_H
+#include 
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
 
 #include "lib/meminfo/meminfo.h"
 #include "lib/osinfo/uname.h"
diff --git a/src/or/connection.c b/src/or/connection.c
index e42288579..66ccc51b5 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -112,6 +112,13 @@
 #include 
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
+
 #ifdef HAVE_SYS_UN_H
 #include 
 #include 
diff --git a/src/or/control.c b/src/or/control.c
index 35e8cacd8..67d1a0c68 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -100,6 +100,13 @@
 #include "or/routerlist_st.h"
 #include "or/socks_request_st.h"
 
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
+
 #ifndef _WIN32
 #include 
 #include 
diff --git a/src/or/dns.c b/src/or/dns.c
index 08a55170e..45c4384eb 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -69,6 +69,10 @@
 #include "or/edge_connection_st.h"
 #include "or/or_circuit_st.h"
 
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
+
 #include 
 #include 
 
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index f98ada02d..c44e974fc 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -46,6 +46,10 @@ hibernating, phase 2:
 #include "or/or_connection_st.h"
 #include "or/or_state_st.h"
 
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+
 /** Are we currently awake, asleep, running out of bandwidth, or shutting
  * down? */
 static hibernate_state_t hibernate_state = HIBERNATE_STATE_INITIAL;
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index b651f1e27..6cb01b57c 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -56,6 +56,13 @@
 #include "trunnel/hs/cell_common.h"
 #include "trunnel/hs/cell_establish_intro.h"
 
+#ifdef HAVE_SYS_STAT_H
+#include 
+#endif
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+
 /* Helper macro. Iterate over every service in the global map. The var is the
  * name of the service pointer. */
 #define FOR_EACH_SERVICE_BEGIN(var)  \
diff --git a/src/or/main.c b/src/or/main.c
index 9851cdb57..b48c0b813 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -136,6 +136,10 @@
 #include "or/routerinfo_st.h"
 #include "or/socks_request_st.h"
 
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+
 #ifdef HAVE_SYSTEMD
 #   if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
 /* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 838c966a2..a0ee4ba5f 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -30,6 +30,10 @@
 #include "or/node_st.h"
 #include "or/routerstatus_st.h"
 
+#ifdef HAVE_FCNTL_H
+#include 
+#endif
+
 /** A data structure to hold a bunch of cached microdescriptors.  There are
  * two active files in the cache: a "cache file" that we mmap, and a "journal
  * file" that we append to.  Periodically, we rebuild the cache file to hold
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 133ab84b3..f91e46cdd 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -88,6 +88,10 @@
 #include "or/vote_microdesc_hash_st.h"
 #include "or/vote_routerstatus_st.h"
 

[tor-commits] [tor/master] Extract or_options_t from or.h

2018-07-03 Thread nickm
commit 13116378b1a8118e277320e377a691064e54983a
Author: Nick Mathewson 
Date:   Sun Jul 1 14:58:29 2018 -0400

Extract or_options_t from or.h

I decided to have this file included from config.h, though, since it
is used nearly everywhere.
---
 src/or/circuitmux_ewma.c |2 +-
 src/or/config.h  |1 +
 src/or/control.h |1 +
 src/or/hs_config.c   |1 +
 src/or/or.h  | 1062 +
 src/or/or_options_st.h   | 1077 ++
 src/or/policies.h|1 +
 src/or/rendservice.h |1 +
 8 files changed, 1084 insertions(+), 1062 deletions(-)

diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
index 1ee5f1f62..d600602a7 100644
--- a/src/or/circuitmux_ewma.c
+++ b/src/or/circuitmux_ewma.c
@@ -39,6 +39,7 @@
 #include "or/circuitmux_ewma.h"
 #include "lib/crypt_ops/crypto_rand.h"
 #include "or/networkstatus.h"
+#include "or/or_options_st.h"
 
 /*** EWMA parameter #defines ***/
 
@@ -826,4 +827,3 @@ circuitmux_ewma_free_all(void)
 {
   ewma_ticks_initialized = 0;
 }
-
diff --git a/src/or/config.h b/src/or/config.h
index 869499582..5fdf7862e 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -12,6 +12,7 @@
 #ifndef TOR_CONFIG_H
 #define TOR_CONFIG_H
 
+#include "or/or_options_st.h"
 #include "lib/testsupport/testsupport.h"
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(DARWIN)
diff --git a/src/or/control.h b/src/or/control.h
index 53ac87107..5c5fe8a91 100644
--- a/src/or/control.h
+++ b/src/or/control.h
@@ -184,6 +184,7 @@ int control_event_signal(uintptr_t signal);
 
 int init_control_cookie_authentication(int enabled);
 char *get_controller_cookie_file_name(void);
+struct config_line_t;
 smartlist_t *decode_hashed_passwords(struct config_line_t *passwords);
 void disable_control_logging(void);
 void enable_control_logging(void);
diff --git a/src/or/hs_config.c b/src/or/hs_config.c
index 603cd6e74..cb55faa9d 100644
--- a/src/or/hs_config.c
+++ b/src/or/hs_config.c
@@ -30,6 +30,7 @@
 #include "or/hs_service.h"
 #include "or/rendservice.h"
 #include "lib/encoding/confline.h"
+#include "or/or_options_st.h"
 
 /* Using the given list of services, stage them into our global state. Every
  * service version are handled. This function can remove entries in the given
diff --git a/src/or/or.h b/src/or/or.h
index 0886517dd..4ed774389 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -981,1067 +981,7 @@ typedef struct routerset_t routerset_t;
  * to pick its own port. */
 #define CFG_AUTO_PORT 0xc4005e
 
-/** Enumeration of outbound address configuration types:
- * Exit-only, OR-only, or both */
-typedef enum {OUTBOUND_ADDR_EXIT, OUTBOUND_ADDR_OR,
-  OUTBOUND_ADDR_EXIT_AND_OR,
-  OUTBOUND_ADDR_MAX} outbound_addr_t;
-
-struct config_line_t;
-
-/** Configuration options for a Tor process. */
-typedef struct {
-  uint32_t magic_;
-
-  /** What should the tor process actually do? */
-  enum {
-CMD_RUN_TOR=0, CMD_LIST_FINGERPRINT, CMD_HASH_PASSWORD,
-CMD_VERIFY_CONFIG, CMD_RUN_UNITTESTS, CMD_DUMP_CONFIG,
-CMD_KEYGEN,
-CMD_KEY_EXPIRATION,
-  } command;
-  char *command_arg; /**< Argument for command-line option. */
-
-  struct config_line_t *Logs; /**< New-style list of configuration lines
-* for logs */
-  int LogTimeGranularity; /**< Log resolution in milliseconds. */
-
-  int LogMessageDomains; /**< Boolean: Should we log the domain(s) in which
-  * each log message occurs? */
-  int TruncateLogFile; /**< Boolean: Should we truncate the log file
-before we start writing? */
-  char *SyslogIdentityTag; /**< Identity tag to add for syslog logging. */
-  char *AndroidIdentityTag; /**< Identity tag to add for Android logging. */
-
-  char *DebugLogFile; /**< Where to send verbose log messages. */
-  char *DataDirectory_option; /**< Where to store long-term data, as
-   * configured by the user. */
-  char *DataDirectory; /**< Where to store long-term data, as modified. */
-  int DataDirectoryGroupReadable; /**< Boolean: Is the DataDirectory g+r? */
-
-  char *KeyDirectory_option; /**< Where to store keys, as
-   * configured by the user. */
-  char *KeyDirectory; /**< Where to store keys data, as modified. */
-  int KeyDirectoryGroupReadable; /**< Boolean: Is the KeyDirectory g+r? */
-
-  char *CacheDirectory_option; /**< Where to store cached data, as
-   * configured by the user. */
-  char *CacheDirectory; /**< Where to store cached data, as modified. */
-  int CacheDirectoryGroupReadable; /**< Boolean: Is the CacheDirectory g+r? */
-
-  char *Nickname; /**< OR only: nickname of this onion router. */
-  char *Address; /**< OR only: configured address for this onion router. */
-  char *PidFile; /**< Where to store PID of Tor process. */
-
-  routerset_t 

[tor-commits] [tor/master] Extract more constants from or.h

2018-07-03 Thread nickm
commit 49f88e77e5f9dec60e2409e1f6d3e3935c5eab69
Author: Nick Mathewson 
Date:   Sun Jul 1 14:16:25 2018 -0400

Extract more constants from or.h
---
 src/or/circuit_st.h   |   9 +
 src/or/circuitlist.h  | 142 +-
 src/or/circuitstats.h |  87 +-
 src/or/config.c   |   4 +
 src/or/connection.h   |  65 +
 src/or/connection_edge.h  |  49 +++-
 src/or/connection_or.h|  27 ++
 src/or/connection_st.h|  18 ++
 src/or/control.h  |  15 +
 src/or/directory.c|   9 +
 src/or/directory.h|  73 +
 src/or/dos.c  |   2 +-
 src/or/ext_orport.h   |  20 +-
 src/or/networkstatus.c|   2 +-
 src/or/or.h   | 559 --
 src/or/proto_socks.c  |   2 +-
 src/or/proto_socks.h  |   1 -
 src/or/routerlist.h   |  29 ++
 src/or/socks_request_st.h |  18 +-
 src/or/transports.c   |   1 +
 src/test/bench.c  |   1 +
 src/test/test_channeltls.c|   2 +-
 src/test/test_circuitbuild.c  |   2 +-
 src/test/test_controller_events.c |   2 +-
 src/test/test_dir.c   |   1 +
 src/test/test_dns.c   |   2 +-
 src/test/test_hs_client.c |   1 +
 src/test/test_oos.c   |   2 +-
 src/test/test_relay.c |   2 +-
 src/test/test_socks.c |   1 +
 30 files changed, 574 insertions(+), 574 deletions(-)

diff --git a/src/or/circuit_st.h b/src/or/circuit_st.h
index e53e5bf3e..8453efa63 100644
--- a/src/or/circuit_st.h
+++ b/src/or/circuit_st.h
@@ -13,6 +13,15 @@
 
 struct hs_token_t;
 
+/** "magic" value for an origin_circuit_t */
+#define ORIGIN_CIRCUIT_MAGIC 0x35315243u
+/** "magic" value for an or_circuit_t */
+#define OR_CIRCUIT_MAGIC 0x98ABC04Fu
+/** "magic" value for a circuit that would have been freed by circuit_free,
+ * but which we're keeping around until a cpuworker reply arrives.  See
+ * circuit_free() for more documentation. */
+#define DEAD_CIRCUIT_MAGIC 0xdeadc14c
+
 /**
  * A circuit is a path over the onion routing
  * network. Applications can connect to one end of the circuit, and can
diff --git a/src/or/circuitlist.h b/src/or/circuitlist.h
index 8b41424ee..7c9bc0199 100644
--- a/src/or/circuitlist.h
+++ b/src/or/circuitlist.h
@@ -15,6 +15,147 @@
 #include "lib/testsupport/testsupport.h"
 #include "or/hs_ident.h"
 
+/** Circuit state: I'm the origin, still haven't done all my handshakes. */
+#define CIRCUIT_STATE_BUILDING 0
+/** Circuit state: Waiting to process the onionskin. */
+#define CIRCUIT_STATE_ONIONSKIN_PENDING 1
+/** Circuit state: I'd like to deliver a create, but my n_chan is still
+ * connecting. */
+#define CIRCUIT_STATE_CHAN_WAIT 2
+/** Circuit state: the circuit is open but we don't want to actually use it
+ * until we find out if a better guard will be available.
+ */
+#define CIRCUIT_STATE_GUARD_WAIT 3
+/** Circuit state: onionskin(s) processed, ready to send/receive cells. */
+#define CIRCUIT_STATE_OPEN 4
+
+#define CIRCUIT_PURPOSE_MIN_ 1
+
+/* these circuits were initiated elsewhere */
+#define CIRCUIT_PURPOSE_OR_MIN_ 1
+/** OR-side circuit purpose: normal circuit, at OR. */
+#define CIRCUIT_PURPOSE_OR 1
+/** OR-side circuit purpose: At OR, from the service, waiting for intro from
+ * clients. */
+#define CIRCUIT_PURPOSE_INTRO_POINT 2
+/** OR-side circuit purpose: At OR, from the client, waiting for the service.
+ */
+#define CIRCUIT_PURPOSE_REND_POINT_WAITING 3
+/** OR-side circuit purpose: At OR, both circuits have this purpose. */
+#define CIRCUIT_PURPOSE_REND_ESTABLISHED 4
+#define CIRCUIT_PURPOSE_OR_MAX_ 4
+
+/* these circuits originate at this node */
+
+/* here's how circ client-side purposes work:
+ *   normal circuits are C_GENERAL.
+ *   circuits that are c_introducing are either on their way to
+ * becoming open, or they are open and waiting for a
+ * suitable rendcirc before they send the intro.
+ *   circuits that are c_introduce_ack_wait have sent the intro,
+ * but haven't gotten a response yet.
+ *   circuits that are c_establish_rend are either on their way
+ * to becoming open, or they are open and have sent the
+ * establish_rendezvous cell but haven't received an ack.
+ *   circuits that are c_rend_ready are open and have received a
+ * rend ack, but haven't heard from the service yet. if they have a
+ * buildstate->pending_final_cpath then they're expecting a
+ * cell from the service, else they're not.
+ *   circuits that are c_rend_ready_intro_acked are open, and
+ * some intro circ has sent its intro and received an ack.
+ *   circuits that are c_rend_joined are open, have heard from
+ * the service, and are talking to it.
+ */
+/** Client-side circuit purpose: Normal circuit, with cpath. */
+#define CIRCUIT_PURPOSE_C_GENERAL 5
+#define 

[tor-commits] [tor/master] fixup! Extract or_options_t from or.h

2018-07-03 Thread nickm
commit 518ebe14dcc7568da353c4c517039d0c621deb28
Author: Nick Mathewson 
Date:   Sun Jul 1 16:02:33 2018 -0400

fixup! Extract or_options_t from or.h
---
 src/or/include.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/or/include.am b/src/or/include.am
index 5475ea17e..9b5f7c1f6 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -275,6 +275,7 @@ ORHEADERS = \
src/or/or_connection_st.h   \
src/or/or_handshake_certs_st.h  \
src/or/or_handshake_state_st.h  \
+   src/or/or_options_st.h  \
src/or/or_state_st.h\
src/or/origin_circuit_st.h  \
src/or/transports.h \



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Extract addr_policy_t into a new header.

2018-07-03 Thread nickm
commit f54a5cbfb6d58399ee152306fcd7e0c55292a173
Author: Nick Mathewson 
Date:   Sun Jul 1 14:00:37 2018 -0400

Extract addr_policy_t into a new header.
---
 src/or/addr_policy_st.h   | 46 ++
 src/or/include.am |  1 +
 src/or/or.h   | 33 +
 src/or/policies.c |  1 +
 src/or/routerparse.c  |  1 +
 src/or/routerset.c|  1 +
 src/test/test_dir.c   |  1 +
 src/test/test_policy.c|  1 +
 src/test/test_routerset.c |  2 +-
 9 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/src/or/addr_policy_st.h b/src/or/addr_policy_st.h
new file mode 100644
index 0..be3e9d8f0
--- /dev/null
+++ b/src/or/addr_policy_st.h
@@ -0,0 +1,46 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_ADDR_POLICY_ST_H
+#define TOR_ADDR_POLICY_ST_H
+
+#include "lib/cc/torint.h"
+#include "lib/net/address.h"
+
+/** What action type does an address policy indicate: accept or reject? */
+typedef enum {
+  ADDR_POLICY_ACCEPT=1,
+  ADDR_POLICY_REJECT=2,
+} addr_policy_action_t;
+#define addr_policy_action_bitfield_t ENUM_BF(addr_policy_action_t)
+
+/** A reference-counted address policy rule. */
+typedef struct addr_policy_t {
+  int refcnt; /**< Reference count */
+  /** What to do when the policy matches.*/
+  addr_policy_action_bitfield_t policy_type:2;
+  unsigned int is_private:1; /**< True iff this is the pseudo-address,
+  * "private". */
+  unsigned int is_canonical:1; /**< True iff this policy is the canonical
+* copy (stored in a hash table to avoid
+* duplication of common policies) */
+  maskbits_t maskbits; /**< Accept/reject all addresses a such that the
+ * first maskbits bits of a match
+ * addr. */
+  /** Base address to accept or reject.
+   *
+   * Note that wildcards are treated
+   * differntly depending on address family. An AF_UNSPEC address means
+   * "All addresses, IPv4 or IPv6." An AF_INET address with maskbits==0 means
+   * "All IPv4 addresses" and an AF_INET6 address with maskbits == 0 means
+   * "All IPv6 addresses".
+  **/
+  tor_addr_t addr;
+  uint16_t prt_min; /**< Lowest port number to accept/reject. */
+  uint16_t prt_max; /**< Highest port number to accept/reject. */
+} addr_policy_t;
+
+#endif
diff --git a/src/or/include.am b/src/or/include.am
index 491341374..ce195c92e 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -180,6 +180,7 @@ endif
 
 ORHEADERS = \
src/or/addressmap.h \
+   src/or/addr_policy_st.h \
src/or/authority_cert_st.h  \
src/or/auth_dirs.inc\
src/or/bridges.h\
diff --git a/src/or/or.h b/src/or/or.h
index e18726cd7..1a24ef1b7 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1152,38 +1152,7 @@ typedef struct or_connection_t or_connection_t;
 /** Cast a entry_connection_t subtype pointer to a connection_t **/
 #define ENTRY_TO_CONN(c) (TO_CONN(ENTRY_TO_EDGE_CONN(c)))
 
-/** What action type does an address policy indicate: accept or reject? */
-typedef enum {
-  ADDR_POLICY_ACCEPT=1,
-  ADDR_POLICY_REJECT=2,
-} addr_policy_action_t;
-#define addr_policy_action_bitfield_t ENUM_BF(addr_policy_action_t)
-
-/** A reference-counted address policy rule. */
-typedef struct addr_policy_t {
-  int refcnt; /**< Reference count */
-  /** What to do when the policy matches.*/
-  addr_policy_action_bitfield_t policy_type:2;
-  unsigned int is_private:1; /**< True iff this is the pseudo-address,
-  * "private". */
-  unsigned int is_canonical:1; /**< True iff this policy is the canonical
-* copy (stored in a hash table to avoid
-* duplication of common policies) */
-  maskbits_t maskbits; /**< Accept/reject all addresses a such that the
- * first maskbits bits of a match
- * addr. */
-  /** Base address to accept or reject.
-   *
-   * Note that wildcards are treated
-   * differntly depending on address family. An AF_UNSPEC address means
-   * "All addresses, IPv4 or IPv6." An AF_INET address with maskbits==0 means
-   * "All IPv4 addresses" and an AF_INET6 address with maskbits == 0 means
-   * "All IPv6 addresses".
-  **/
-  tor_addr_t addr;
-  uint16_t prt_min; /**< Lowest port number to accept/reject. */
-  uint16_t prt_max; /**< Highest port number to accept/reject. */
-} addr_policy_t;
+typedef struct addr_policy_t addr_policy_t;
 
 typedef struct cached_dir_t cached_dir_t;
 
diff --git a/src/or/policies.c b/src/or/policies.c
index 

[tor-commits] [tor/master] Extract or_state_t to its own header.

2018-07-03 Thread nickm
commit 986d761510c4e5070cbdf8879f49342b7b1350c1
Author: Nick Mathewson 
Date:   Sun Jul 1 14:51:53 2018 -0400

Extract or_state_t to its own header.

Fewer modules needed this than I had expected.
---
 src/or/circuitstats.c|  1 +
 src/or/connection_or.c   |  1 +
 src/or/dirauth/shared_random_state.c |  2 +
 src/or/entrynodes.c  |  1 +
 src/or/hibernate.c   |  1 +
 src/or/hs_service.c  |  1 +
 src/or/include.am|  3 +-
 src/or/main.c|  1 +
 src/or/or.h  | 73 +-
 src/or/or_state_st.h | 86 
 src/or/rephist.c |  1 +
 src/or/router.c  |  1 +
 src/or/statefile.c   |  2 +
 src/or/status.c  |  1 +
 src/test/test.c  |  2 +
 src/test/test_accounting.c   |  3 +-
 src/test/test_entrynodes.c   |  1 +
 src/test/test_hs_common.c|  1 +
 src/test/test_hs_service.c   |  1 +
 src/test/test_pt.c   |  2 +
 src/test/test_routerlist.c   |  1 +
 src/test/test_shared_random.c|  2 +-
 src/test/test_status.c   |  1 +
 src/test/test_tortls.c   |  1 +
 24 files changed, 115 insertions(+), 75 deletions(-)

diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index c090a1e7a..32584c26d 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -46,6 +46,7 @@
 
 #include "or/crypt_path_st.h"
 #include "or/origin_circuit_st.h"
+#include "or/or_state_st.h"
 
 #undef log
 #include 
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 41ec7e8bc..b3021edf1 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -66,6 +66,7 @@
 #include "or/or_connection_st.h"
 #include "or/or_handshake_certs_st.h"
 #include "or/or_handshake_state_st.h"
+#include "or/or_state_st.h"
 #include "or/routerinfo_st.h"
 #include "or/var_cell_st.h"
 #include "lib/crypt_ops/crypto_format.h"
diff --git a/src/or/dirauth/shared_random_state.c 
b/src/or/dirauth/shared_random_state.c
index 85c02887d..87ddcc073 100644
--- a/src/or/dirauth/shared_random_state.c
+++ b/src/or/dirauth/shared_random_state.c
@@ -23,6 +23,8 @@
 #include "or/voting_schedule.h"
 #include "lib/encoding/confline.h"
 
+#include "or/or_state_st.h"
+
 /* Default filename of the shared random state on disk. */
 static const char default_fname[] = "sr-state";
 
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 2ed2bc904..ba9c30f8b 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -143,6 +143,7 @@
 
 #include "or/node_st.h"
 #include "or/origin_circuit_st.h"
+#include "or/or_state_st.h"
 
 #include "lib/crypt_ops/digestset.h"
 
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 2c43e0f99..f98ada02d 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -44,6 +44,7 @@ hibernating, phase 2:
 #include "common/compat_libevent.h"
 
 #include "or/or_connection_st.h"
+#include "or/or_state_st.h"
 
 /** Are we currently awake, asleep, running out of bandwidth, or shutting
  * down? */
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 6c134136f..b651f1e27 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -45,6 +45,7 @@
 #include "or/networkstatus_st.h"
 #include "or/node_st.h"
 #include "or/origin_circuit_st.h"
+#include "or/or_state_st.h"
 #include "or/routerstatus_st.h"
 
 #include "lib/encoding/confline.h"
diff --git a/src/or/include.am b/src/or/include.am
index ce195c92e..5475ea17e 100644
--- a/src/or/include.am
+++ b/src/or/include.am
@@ -75,7 +75,7 @@ LIBTOR_APP_A_SOURCES = \
src/or/onion_fast.c \
src/or/onion_tap.c  \
src/or/transports.c \
-   src/or/parsecommon.c\
+   src/or/parsecommon.c\
src/or/periodic.c   \
src/or/protover.c   \
src/or/protover_rust.c  \
@@ -275,6 +275,7 @@ ORHEADERS = \
src/or/or_connection_st.h   \
src/or/or_handshake_certs_st.h  \
src/or/or_handshake_state_st.h  \
+   src/or/or_state_st.h\
src/or/origin_circuit_st.h  \
src/or/transports.h \
src/or/parsecommon.h\
diff --git a/src/or/main.c b/src/or/main.c
index 19b30f725..9851cdb57 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -131,6 +131,7 @@
 #include "or/entry_connection_st.h"
 #include "or/networkstatus_st.h"
 #include "or/or_connection_st.h"
+#include "or/or_state_st.h"
 #include "or/port_cfg_st.h"
 #include "or/routerinfo_st.h"
 #include 

[tor-commits] [tor/master] Pull a couple more enums from or.h

2018-07-03 Thread nickm
commit f75357ec355e4e716321417e562526ce77f4f931
Author: Nick Mathewson 
Date:   Sun Jul 1 14:44:04 2018 -0400

Pull a couple more enums from or.h
---
 src/or/circpathbias.h  |  3 +-
 src/or/crypt_path_st.h | 14 +
 src/or/desc_store_st.h |  7 -
 src/or/or.h| 77 ++
 src/or/origin_circuit_st.h | 57 +-
 5 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/src/or/circpathbias.h b/src/or/circpathbias.h
index 09162c40e..c99d1277b 100644
--- a/src/or/circpathbias.h
+++ b/src/or/circpathbias.h
@@ -23,7 +23,6 @@ int pathbias_check_probe_response(circuit_t *circ, const 
cell_t *cell);
 void pathbias_count_use_attempt(origin_circuit_t *circ);
 void pathbias_mark_use_success(origin_circuit_t *circ);
 void pathbias_mark_use_rollback(origin_circuit_t *circ);
-const char *pathbias_state_to_string(path_state_t state);
+const char *pathbias_state_to_string(enum path_state_t state);
 
 #endif /* !defined(TOR_CIRCPATHBIAS_H) */
-
diff --git a/src/or/crypt_path_st.h b/src/or/crypt_path_st.h
index 7d38c7375..0fde1fab0 100644
--- a/src/or/crypt_path_st.h
+++ b/src/or/crypt_path_st.h
@@ -10,6 +10,20 @@
 #include "or/relay_crypto_st.h"
 struct crypto_dh_t;
 
+#define CRYPT_PATH_MAGIC 0x70127012u
+
+struct fast_handshake_state_t;
+struct ntor_handshake_state_t;
+struct crypto_dh_t;
+struct onion_handshake_state_t {
+  uint16_t tag;
+  union {
+struct fast_handshake_state_t *fast;
+struct crypto_dh_t *tap;
+struct ntor_handshake_state_t *ntor;
+  } u;
+};
+
 /** Holds accounting information for a single step in the layered encryption
  * performed by a circuit.  Used only at the client edge of a circuit. */
 struct crypt_path_t {
diff --git a/src/or/desc_store_st.h b/src/or/desc_store_st.h
index c070e354c..168a83b23 100644
--- a/src/or/desc_store_st.h
+++ b/src/or/desc_store_st.h
@@ -7,6 +7,12 @@
 #ifndef DESC_STORE_ST_H
 #define DESC_STORE_ST_H
 
+/** Allowable types of desc_store_t. */
+typedef enum store_type_t {
+  ROUTER_STORE = 0,
+  EXTRAINFO_STORE = 1
+} store_type_t;
+
 /** A 'store' is a set of descriptors saved on disk, with accompanying
  * journal, mmaped as needed, rebuilt as needed. */
 struct desc_store_t {
@@ -31,4 +37,3 @@ struct desc_store_t {
 };
 
 #endif
-
diff --git a/src/or/or.h b/src/or/or.h
index c38b8d750..1221084af 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -862,13 +862,6 @@ typedef enum {
 
 typedef struct networkstatus_t networkstatus_t;
 typedef struct ns_detached_signatures_t ns_detached_signatures_t;
-
-/** Allowable types of desc_store_t. */
-typedef enum store_type_t {
-  ROUTER_STORE = 0,
-  EXTRAINFO_STORE = 1
-} store_type_t;
-
 typedef struct desc_store_t desc_store_t;
 typedef struct routerlist_t routerlist_t;
 typedef struct extend_info_t extend_info_t;
@@ -897,24 +890,12 @@ typedef enum {
 
 #define ALL_DIRINFO ((dirinfo_type_t)((1<<7)-1))
 
-#define CRYPT_PATH_MAGIC 0x70127012u
-
-struct fast_handshake_state_t;
-struct ntor_handshake_state_t;
-struct crypto_dh_t;
 #define ONION_HANDSHAKE_TYPE_TAP  0x
 #define ONION_HANDSHAKE_TYPE_FAST 0x0001
 #define ONION_HANDSHAKE_TYPE_NTOR 0x0002
 #define MAX_ONION_HANDSHAKE_TYPE 0x0002
-typedef struct {
-  uint16_t tag;
-  union {
-struct fast_handshake_state_t *fast;
-struct crypto_dh_t *tap;
-struct ntor_handshake_state_t *ntor;
-  } u;
-} onion_handshake_state_t;
 
+typedef struct onion_handshake_state_t onion_handshake_state_t;
 typedef struct relay_crypto_t relay_crypto_t;
 typedef struct crypt_path_t crypt_path_t;
 typedef struct crypt_path_reference_t crypt_path_reference_t;
@@ -946,61 +927,7 @@ typedef struct or_circuit_t or_circuit_t;
  * circuit. */
 #define MAX_RELAY_EARLY_CELLS_PER_CIRCUIT 8
 
-/**
- * Describes the circuit building process in simplified terms based
- * on the path bias accounting state for a circuit.
- *
- * NOTE: These state values are enumerated in the order for which we
- * expect circuits to transition through them. If you add states,
- * you need to preserve this overall ordering. The various pathbias
- * state transition and accounting functions (pathbias_mark_* and
- * pathbias_count_*) contain ordinal comparisons to enforce proper
- * state transitions for corrections.
- *
- * This state machine and the associated logic was created to prevent
- * miscounting due to unknown cases of circuit reuse. See also tickets
- * #6475 and #7802.
- */
-typedef enum {
-/** This circuit is "new". It has not yet completed a first hop
- * or been counted by the path bias code. */
-PATH_STATE_NEW_CIRC = 0,
-/** This circuit has completed one/two hops, and has been counted by
- * the path bias logic. */
-PATH_STATE_BUILD_ATTEMPTED = 1,
-/** This circuit has been completely built */
-PATH_STATE_BUILD_SUCCEEDED = 2,
-/** Did we try to attach any SOCKS streams or hidserv introductions to
-  * this circuit?
-  *
-  * Note: If we 

[tor-commits] [tor/master] Move ext_or_cmd_t to proto_ext_or

2018-07-03 Thread nickm
commit 6ccd98f93e733e39dcd460860aeead017b1b5a4f
Author: Nick Mathewson 
Date:   Sun Jul 1 14:34:52 2018 -0400

Move ext_or_cmd_t to proto_ext_or
---
 src/or/or.h   | 8 +---
 src/or/proto_ext_or.h | 9 +++--
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/or/or.h b/src/or/or.h
index be1f61edf..c38b8d750 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -624,13 +624,7 @@ typedef struct packed_cell_t packed_cell_t;
 typedef struct cell_queue_t cell_queue_t;
 typedef struct destroy_cell_t destroy_cell_t;
 typedef struct destroy_cell_queue_t destroy_cell_queue_t;
-
-/** A parsed Extended ORPort message. */
-typedef struct ext_or_cmd_t {
-  uint16_t cmd; /** Command type */
-  uint16_t len; /** Body length */
-  char body[FLEXIBLE_ARRAY_MEMBER]; /** Message body */
-} ext_or_cmd_t;
+typedef struct ext_or_cmd_t ext_or_cmd_t;
 
 /** Beginning of a RELAY cell payload. */
 typedef struct {
diff --git a/src/or/proto_ext_or.h b/src/or/proto_ext_or.h
index 5366ec447..708a45974 100644
--- a/src/or/proto_ext_or.h
+++ b/src/or/proto_ext_or.h
@@ -8,10 +8,15 @@
 #define TOR_PROTO_EXT_OR_H
 
 struct buf_t;
-struct ext_or_cmt_t;
+
+/** A parsed Extended ORPort message. */
+typedef struct ext_or_cmd_t {
+  uint16_t cmd; /** Command type */
+  uint16_t len; /** Body length */
+  char body[FLEXIBLE_ARRAY_MEMBER]; /** Message body */
+} ext_or_cmd_t;
 
 int fetch_ext_or_command_from_buf(struct buf_t *buf,
   struct ext_or_cmd_t **out);
 
 #endif /* !defined(TOR_PROTO_EXT_OR_H) */
-



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Remove other needless includes include from or/*.h

2018-07-03 Thread nickm
commit 500826479aaf7d398f576fabbfdf34b17604f646
Author: Nick Mathewson 
Date:   Sun Jul 1 12:06:52 2018 -0400

Remove other needless includes include from or/*.h
---
 src/or/channel.c   |  2 +-
 src/or/channel.h   |  7 +--
 src/or/channelpadding.c|  2 +-
 src/or/circuitlist.c   |  1 +
 src/or/connection.h|  6 ++
 src/or/hs_circuit.c|  1 +
 src/or/hs_descriptor.c |  2 +-
 src/or/hs_descriptor.h |  4 
 src/or/main.c  |  1 +
 src/or/onion_ntor.c|  2 +-
 src/or/onion_ntor.h|  6 +++---
 src/or/parsecommon.c   |  2 ++
 src/or/parsecommon.h   | 11 ++-
 src/or/rendservice.c   |  1 +
 src/or/rendservice.h   |  5 ++---
 src/test/test_channelpadding.c |  2 ++
 src/test/test_routerlist.c |  1 +
 17 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/src/or/channel.c b/src/or/channel.c
index ac1960ae0..981f9aecf 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -79,6 +79,7 @@
 #include "lib/time/compat_time.h"
 #include "or/networkstatus.h"
 #include "or/rendservice.h"
+#include "common/timers.h"
 
 #include "or/cell_queue_st.h"
 
@@ -3477,4 +3478,3 @@ channel_update_bad_for_new_circs(const char *digest, int 
force)
 channel_rsa_id_group_set_badness(&(*iter)->channel_list, force);
   }
 }
-
diff --git a/src/or/channel.h b/src/or/channel.h
index 6a7b0e7b8..cbcc13cc5 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -11,11 +11,13 @@
 
 #include "or/or.h"
 #include "or/circuitmux.h"
-#include "common/timers.h"
 #include "common/handles.h"
 
 #include "tor_queue.h"
 
+#define tor_timer_t timeout
+struct tor_timer_t;
+
 /* Channel handler function pointer typedefs */
 typedef void (*channel_listener_fn_ptr)(channel_listener_t *, channel_t *);
 typedef void (*channel_cell_handler_fn_ptr)(channel_t *, cell_t *);
@@ -94,7 +96,7 @@ struct channel_s {
   monotime_coarse_t next_padding_time;
 
   /** The callback pointer for the padding callbacks */
-  tor_timer_t *padding_timer;
+  struct tor_timer_t *padding_timer;
   /** The handle to this channel (to free on canceled timers) */
   struct channel_handle_t *timer_handle;
 
@@ -637,5 +639,6 @@ int packed_cell_is_destroy(channel_t *chan,
 HANDLE_DECL(channel, channel_s,)
 #define channel_handle_free(h)\
   FREE_AND_NULL(channel_handle_t, channel_handle_free_, (h))
+#undef tor_timer_t
 
 #endif /* !defined(TOR_CHANNEL_H) */
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index 6bef4d8b3..fa957c6c6 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -22,6 +22,7 @@
 #include "or/router.h"
 #include "lib/time/compat_time.h"
 #include "or/rendservice.h"
+#include "common/timers.h"
 
 #include "or/cell_st.h"
 #include "or/or_connection_st.h"
@@ -797,4 +798,3 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
 return CHANNELPADDING_PADLATER;
   }
 }
-
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 441855271..f0a7446c9 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -91,6 +91,7 @@
 #include "lib/compress/compress_lzma.h"
 #include "lib/compress/compress_zlib.h"
 #include "lib/compress/compress_zstd.h"
+#include "lib/container/buffers.h"
 
 #include "ht.h"
 
diff --git a/src/or/connection.h b/src/or/connection.h
index 1bbe17bff..75198ed06 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -14,8 +14,7 @@
 
 listener_connection_t *TO_LISTENER_CONN(connection_t *);
 
-/*  For buf_datalen in inline function */
-#include "lib/container/buffers.h"
+struct buf_t;
 
 const char *conn_type_to_string(int type);
 const char *conn_state_to_string(int type, int state);
@@ -159,7 +158,7 @@ connection_buf_add(const char *string, size_t len, 
connection_t *conn)
 }
 void connection_buf_add_compress(const char *string, size_t len,
  dir_connection_t *conn, int done);
-void connection_buf_add_buf(connection_t *conn, buf_t *buf);
+void connection_buf_add_buf(connection_t *conn, struct buf_t *buf);
 
 size_t connection_get_inbuf_len(connection_t *conn);
 size_t connection_get_outbuf_len(connection_t *conn);
@@ -259,4 +258,3 @@ MOCK_DECL(STATIC smartlist_t *, pick_oos_victims, (int n));
 #endif /* defined(CONNECTION_PRIVATE) */
 
 #endif /* !defined(TOR_CONNECTION_H) */
-
diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index 044ff2bbc..5a2c7e4e4 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -13,6 +13,7 @@
 #include "or/circuitlist.h"
 #include "or/circuituse.h"
 #include "or/config.h"
+#include "lib/crypt_ops/crypto_dh.h"
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/crypt_ops/crypto_util.h"
 #include "or/nodelist.h"
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 8971ec59f..f436c6615 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -66,6 +66,7 @@
 #include "or/hs_cache.h"
 #include "or/hs_config.h"
 #include 

[tor-commits] [tor/master] Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.

2018-07-03 Thread nickm
commit 7a61a92870df84c37bacd9d065e0c8df2b938d37
Author: Nick Mathewson 
Date:   Sun Jul 1 11:25:29 2018 -0400

Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.
---
 src/lib/crypt_ops/crypto_dh.c |  4 +--
 src/lib/crypt_ops/crypto_dh.h |  4 +--
 src/lib/defs/dh_sizes.h   | 13 +++
 src/lib/defs/include.am   |  3 +-
 src/or/hs_circuit.c   | 10 +++---
 src/or/hs_common.h|  2 +-
 src/or/onion.c|  4 +--
 src/or/onion_tap.c| 18 +-
 src/or/onion_tap.h|  4 +--
 src/or/or.h   |  2 --
 src/or/rendclient.c   |  6 ++--
 src/or/rendmid.c  |  4 +--
 src/or/rendservice.c  | 16 -
 src/or/rendservice.h  |  2 +-
 src/test/bench.c  | 10 +++---
 src/test/test.c   |  3 +-
 src/test/test_crypto.c| 83 ---
 src/test/test_hs_client.c |  6 ++--
 18 files changed, 107 insertions(+), 87 deletions(-)

diff --git a/src/lib/crypt_ops/crypto_dh.c b/src/lib/crypt_ops/crypto_dh.c
index a2622cfc2..c37e286da 100644
--- a/src/lib/crypt_ops/crypto_dh.c
+++ b/src/lib/crypt_ops/crypto_dh.c
@@ -344,7 +344,7 @@ crypto_dh_generate_public(crypto_dh_t *dh)
 
 /** Generate g^x as necessary, and write the g^x for the key exchange
  * as a pubkey_len-byte value into pubkey. Return 0 on
- * success, -1 on failure.  pubkey_len must be \>= DH_BYTES.
+ * success, -1 on failure.  pubkey_len must be \>= DH1024_KEY_LEN.
  */
 int
 crypto_dh_get_public(crypto_dh_t *dh, char *pubkey, size_t pubkey_len)
@@ -378,7 +378,7 @@ crypto_dh_get_public(crypto_dh_t *dh, char *pubkey, size_t 
pubkey_len)
   tor_assert(bytes >= 0);
   if (pubkey_len < (size_t)bytes) {
 log_warn(LD_CRYPTO,
- "Weird! pubkey_len (%d) was smaller than DH_BYTES (%d)",
+ "Weird! pubkey_len (%d) was smaller than DH1024_KEY_LEN (%d)",
  (int) pubkey_len, bytes);
 return -1;
   }
diff --git a/src/lib/crypt_ops/crypto_dh.h b/src/lib/crypt_ops/crypto_dh.h
index 7b03e128a..73a7bcb52 100644
--- a/src/lib/crypt_ops/crypto_dh.h
+++ b/src/lib/crypt_ops/crypto_dh.h
@@ -14,9 +14,7 @@
 #define TOR_CRYPTO_DH_H
 
 #include "orconfig.h"
-
-/** Length of our DH keys. */
-#define DH_BYTES (1024/8)
+#include "lib/defs/dh_sizes.h"
 
 typedef struct crypto_dh_t crypto_dh_t;
 
diff --git a/src/lib/defs/dh_sizes.h b/src/lib/defs/dh_sizes.h
new file mode 100644
index 0..b60957281
--- /dev/null
+++ b/src/lib/defs/dh_sizes.h
@@ -0,0 +1,13 @@
+/* Copyright (c) 2001, Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_DH_SIZES_H
+#define TOR_DH_SIZES_H
+
+/** Length of our legacy DH keys. */
+#define DH1024_KEY_LEN (1024/8)
+
+#endif
diff --git a/src/lib/defs/include.am b/src/lib/defs/include.am
index ff48cff07..b54bac555 100644
--- a/src/lib/defs/include.am
+++ b/src/lib/defs/include.am
@@ -1,3 +1,4 @@
 
-noinst_HEADERS += \
+noinst_HEADERS +=  \
+   src/lib/defs/dh_sizes.h \
src/lib/defs/digest_sizes.h
diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index 9fcb30ecc..853669846 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -102,7 +102,8 @@ create_rend_cpath(const uint8_t *ntor_key_seed, size_t 
seed_len,
 /* We are a v2 legacy HS client: Create and return a crypt path for the hidden
  * service on the other side of the rendezvous circuit circ. Initialize
  * the crypt path crypto using the body of the RENDEZVOUS1 cell at
- * rend_cell_body (which must be at least DH_KEY_LEN+DIGEST_LEN bytes).
+ * rend_cell_body (which must be at least DH1024_KEY_LEN+DIGEST_LEN
+ * bytes).
  */
 static crypt_path_t *
 create_rend_cpath_legacy(origin_circuit_t *circ, const uint8_t *rend_cell_body)
@@ -110,7 +111,7 @@ create_rend_cpath_legacy(origin_circuit_t *circ, const 
uint8_t *rend_cell_body)
   crypt_path_t *hop = NULL;
   char keys[DIGEST_LEN+CPATH_KEY_MATERIAL_LEN];
 
-  /* first DH_KEY_LEN bytes are g^y from the service. Finish the dh
+  /* first DH1024_KEY_LEN bytes are g^y from the service. Finish the dh
* handshake...*/
   tor_assert(circ->build_state);
   tor_assert(circ->build_state->pending_final_cpath);
@@ -118,7 +119,7 @@ create_rend_cpath_legacy(origin_circuit_t *circ, const 
uint8_t *rend_cell_body)
 
   tor_assert(hop->rend_dh_handshake_state);
   if (crypto_dh_compute_secret(LOG_PROTOCOL_WARN, hop->rend_dh_handshake_state,
-   (char*)rend_cell_body, DH_KEY_LEN,
+   (char*)rend_cell_body, DH1024_KEY_LEN,
keys, DIGEST_LEN+CPATH_KEY_MATERIAL_LEN)<0) {
 log_warn(LD_GENERAL, "Couldn't complete DH handshake.");
 goto err;
@@ -130,7 +131,7 @@ create_rend_cpath_legacy(origin_circuit_t *circ, const 
uint8_t 

[tor-commits] [tor/master] Extract various enums and tiny structs from or.h

2018-07-03 Thread nickm
commit 6da0311d2cc71d6d0732c8432eea38cd1819aa86
Author: Nick Mathewson 
Date:   Sun Jul 1 13:43:11 2018 -0400

Extract various enums and tiny structs from or.h

These all have a logical header to go in.
---
 src/or/channel.h   | 135 +
 src/or/circuitbuild.h  |   6 +-
 src/or/config.h|   9 +
 src/or/connection.h|  18 ++
 src/or/control.h   |  70 +++
 src/or/dirserv.h   |  15 ++
 src/or/geoip.h |  59 +-
 src/or/microdesc_st.h  |   5 +-
 src/or/networkstatus_st.h  |   8 +-
 src/or/or.h| 438 +
 src/or/policies.h  |  33 
 src/or/reasons.c   |   1 +
 src/or/reasons.h   |   1 +
 src/or/routerlist.h|  56 +-
 src/or/routerparse.h   |  21 +-
 src/test/fuzz/fuzz_consensus.c |   1 +
 src/test/test_hs.c |   2 +-
 17 files changed, 430 insertions(+), 448 deletions(-)

diff --git a/src/or/channel.h b/src/or/channel.h
index e732acec5..010a8aa5b 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -35,6 +35,141 @@ typedef enum {
 CHANNEL_USED_FOR_USER_TRAFFIC,
 } channel_usage_info_t;
 
+/** Possible rules for generating circuit IDs on an OR connection. */
+typedef enum {
+  CIRC_ID_TYPE_LOWER=0, /**< Pick from 0..1<<15-1. */
+  CIRC_ID_TYPE_HIGHER=1, /**< Pick from 1<<15..1<<16-1. */
+  /** The other side of a connection is an OP: never create circuits to it,
+   * and let it use any circuit ID it wants. */
+  CIRC_ID_TYPE_NEITHER=2
+} circ_id_type_t;
+#define circ_id_type_bitfield_t ENUM_BF(circ_id_type_t)
+
+/* channel states for channel_t */
+
+typedef enum {
+  /*
+   * Closed state - channel is inactive
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_CLOSING
+   * Permitted transitions to:
+   *   - CHANNEL_STATE_OPENING
+   */
+  CHANNEL_STATE_CLOSED = 0,
+  /*
+   * Opening state - channel is trying to connect
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_CLOSED
+   * Permitted transitions to:
+   *   - CHANNEL_STATE_CLOSING
+   *   - CHANNEL_STATE_ERROR
+   *   - CHANNEL_STATE_OPEN
+   */
+  CHANNEL_STATE_OPENING,
+  /*
+   * Open state - channel is active and ready for use
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_MAINT
+   *   - CHANNEL_STATE_OPENING
+   * Permitted transitions to:
+   *   - CHANNEL_STATE_CLOSING
+   *   - CHANNEL_STATE_ERROR
+   *   - CHANNEL_STATE_MAINT
+   */
+  CHANNEL_STATE_OPEN,
+  /*
+   * Maintenance state - channel is temporarily offline for subclass specific
+   *   maintenance activities such as TLS renegotiation.
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_OPEN
+   * Permitted transitions to:
+   *   - CHANNEL_STATE_CLOSING
+   *   - CHANNEL_STATE_ERROR
+   *   - CHANNEL_STATE_OPEN
+   */
+  CHANNEL_STATE_MAINT,
+  /*
+   * Closing state - channel is shutting down
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_MAINT
+   *   - CHANNEL_STATE_OPEN
+   * Permitted transitions to:
+   *   - CHANNEL_STATE_CLOSED,
+   *   - CHANNEL_STATE_ERROR
+   */
+  CHANNEL_STATE_CLOSING,
+  /*
+   * Error state - channel has experienced a permanent error
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_CLOSING
+   *   - CHANNEL_STATE_MAINT
+   *   - CHANNEL_STATE_OPENING
+   *   - CHANNEL_STATE_OPEN
+   * Permitted transitions to:
+   *   - None
+   */
+  CHANNEL_STATE_ERROR,
+  /*
+   * Placeholder for maximum state value
+   */
+  CHANNEL_STATE_LAST
+} channel_state_t;
+
+/* channel listener states for channel_listener_t */
+
+typedef enum {
+  /*
+   * Closed state - channel listener is inactive
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_LISTENER_STATE_CLOSING
+   * Permitted transitions to:
+   *   - CHANNEL_LISTENER_STATE_LISTENING
+   */
+  CHANNEL_LISTENER_STATE_CLOSED = 0,
+  /*
+   * Listening state - channel listener is listening for incoming
+   * connections
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_LISTENER_STATE_CLOSED
+   * Permitted transitions to:
+   *   - CHANNEL_LISTENER_STATE_CLOSING
+   *   - CHANNEL_LISTENER_STATE_ERROR
+   */
+  CHANNEL_LISTENER_STATE_LISTENING,
+  /*
+   * Closing state - channel listener is shutting down
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_LISTENER_STATE_LISTENING
+   * Permitted transitions to:
+   *   - CHANNEL_LISTENER_STATE_CLOSED,
+   *   - CHANNEL_LISTENER_STATE_ERROR
+   */
+  CHANNEL_LISTENER_STATE_CLOSING,
+  /*
+   * Error state - channel listener has experienced a permanent error
+   *
+   * Permitted transitions from:
+   *   - CHANNEL_STATE_CLOSING
+   *   - CHANNEL_STATE_LISTENING
+   * Permitted transitions to:
+   *   - None
+   */
+  CHANNEL_LISTENER_STATE_ERROR,
+  /*
+   * Placeholder for maximum state value
+   */
+  CHANNEL_LISTENER_STATE_LAST
+} channel_listener_state_t;
+
 /**
  * Channel struct; see the 

[tor-commits] [tor/master] Remove needless includes from or.h

2018-07-03 Thread nickm
commit 471104eaa5e7fbe1b5a32b8be388daae328abd4a
Author: Nick Mathewson 
Date:   Sun Jul 1 11:32:11 2018 -0400

Remove needless includes from or.h

or.h should really include only the minimum of stuff from or/*,
common/*, and lib/*.
---
 src/lib/compress/compress.h  |   4 +-
 src/lib/crypt_ops/crypto_dh.h|   1 +
 src/or/addressmap.c  |   4 +-
 src/or/cell_queue_st.h   |   3 +-
 src/or/channel.h |   3 +-
 src/or/channeltls.c  |   3 +-
 src/or/circuit_st.h  |   5 +-
 src/or/circuitlist.c |   3 +-
 src/or/circuitstats.c|   1 +
 src/or/config.c  |   1 +
 src/or/config.h  |  10 +--
 src/or/confparse.c   |   1 +
 src/or/confparse.h   |  11 ++-
 src/or/connection.c  |   3 +
 src/or/connection_edge.c |   2 +-
 src/or/connection_or.c   |   3 +-
 src/or/conscache.c   |   2 +-
 src/or/conscache.h   |   9 +--
 src/or/consdiffmgr.c |   4 +-
 src/or/consdiffmgr.h |   7 +-
 src/or/control.c |   3 +-
 src/or/control.h |   3 +-
 src/or/crypt_path_st.h   |   4 +-
 src/or/dir_connection_st.h   |   5 +-
 src/or/dirauth/dirvote.c |   1 +
 src/or/dirauth/shared_random_state.c |   2 +-
 src/or/dirauth/shared_random_state.h |   7 +-
 src/or/directory.c   |   3 +-
 src/or/directory.h   |  15 ++--
 src/or/dirserv.c |   2 +
 src/or/dns.c |   2 +-
 src/or/dnsserv.c |   2 +-
 src/or/entrynodes.c  |   1 +
 src/or/hibernate.c   |   2 +-
 src/or/hs_circuit.c  |   1 +
 src/or/hs_circuitmap.c   |   1 -
 src/or/hs_circuitmap.h   |   5 +-
 src/or/hs_client.c   |   2 +-
 src/or/hs_config.c   |   2 +-
 src/or/hs_service.c  |   3 +-
 src/or/main.c|   3 +
 src/or/main.h|   7 +-
 src/or/ntmain.c  |   1 +
 src/or/onion.c   |   2 +-
 src/or/onion_fast.c  |   2 +-
 src/or/onion_tap.c   |   2 +-
 src/or/onion_tap.h   |  14 ++--
 src/or/or.h  | 140 +--
 src/or/or_connection_st.h|   6 +-
 src/or/or_handshake_certs_st.h   |   9 ++-
 src/or/periodic.c|   2 +-
 src/or/policies.c|   2 +-
 src/or/policies.h|   3 +-
 src/or/reasons.c |   2 +-
 src/or/relay_crypto.c|   2 +-
 src/or/relay_crypto_st.h |  14 ++--
 src/or/rend_intro_point_st.h |  10 ++-
 src/or/rendclient.c  |   3 +-
 src/or/rendcommon.c  |   2 +-
 src/or/rendservice.c |   2 +-
 src/or/rendservice.h |   4 +-
 src/or/replaycache.h |   5 +-
 src/or/router.c  |   2 +
 src/or/routerkeys.c  |   6 +-
 src/or/scheduler.c   |   2 +-
 src/or/statefile.c   |   2 +-
 src/or/statefile.h   |   4 +-
 src/or/status.c  |   2 +-
 src/or/torcert.c |   2 +-
 src/or/torcert.h |   9 ++-
 src/test/bench.c |   2 +
 src/test/fuzz/fuzzing_common.c   |   2 +-
 src/test/test.c  |   1 +
 src/test/test_buffers.c  |   3 +-
 src/test/test_cell_formats.c |   1 -
 src/test/test_channelpadding.c   |   2 +-
 src/test/test_config.c   |   1 +
 src/test/test_conscache.c|   2 +-
 src/test/test_consdiffmgr.c  |   3 +-
 src/test/test_crypto.c   |   2 +
 src/test/test_dir.c  |   1 +
 src/test/test_entryconn.c|   3 +-
 src/test/test_entrynodes.c   |   1 +
 src/test/test_helpers.c  |   2 +-
 src/test/test_hs_client.c|   3 +-
 src/test/test_hs_service.c   |   2 +-
 src/test/test_link_handshake.c   |   2 +
 src/test/test_options.c  |   1 +
 src/test/test_policy.c   |   2 +-
 src/test/test_pt.c   |   1 +
 src/test/test_routerlist.c   |   3 +-
 src/test/test_status.c   |   2 +-
 src/test/test_storagedir.c   |   2 +-
 src/test/test_util.c |   2 +
 src/test/testing_common.c|   3 +
 95 files changed, 261 insertions(+), 200 deletions(-)

diff --git a/src/lib/compress/compress.h b/src/lib/compress/compress.h
index ae98e1aae..4466e27c4 100644
--- a/src/lib/compress/compress.h
+++ b/src/lib/compress/compress.h
@@ -18,7 +18,7 @@
  * 

[tor-commits] [tor/master] Minimize headers that include crypto_formats and x25519 stuff

2018-07-03 Thread nickm
commit 1743dac078f2e060f3f6c7194deae90a2175fe92
Author: Nick Mathewson 
Date:   Sun Jul 1 13:04:21 2018 -0400

Minimize headers that include crypto_formats and x25519 stuff
---
 src/lib/crypt_ops/crypto_curve25519.h | 11 +
 src/lib/crypt_ops/crypto_ed25519.h| 14 ---
 src/lib/crypt_ops/crypto_format.h | 20 +++-
 src/lib/defs/include.am   |  3 ++-
 src/lib/defs/x25519_sizes.h   | 27 +
 src/or/bridges.h  |  4 ++--
 src/or/channel.h  | 13 ++-
 src/or/channeltls.h   |  6 +++--
 src/or/circuitbuild.h |  8 ---
 src/or/connection_or.c|  1 +
 src/or/connection_or.h| 29 ---
 src/or/control.h  |  2 ++
 src/or/dirauth/dirvote.c  |  1 +
 src/or/directory.c|  1 +
 src/or/dirserv.c  |  1 +
 src/or/dirserv.h  |  5 ++--
 src/or/entrynodes.h   |  3 ++-
 src/or/extend_info_st.h   |  4 +++-
 src/or/hs_cache.c |  2 +-
 src/or/hs_cache.h | 24 ++-
 src/or/hs_client.c|  1 +
 src/or/hs_common.c|  1 -
 src/or/hs_common.h| 32 ++---
 src/or/hs_control.c   |  2 +-
 src/or/hs_descriptor.c|  1 +
 src/or/hs_intropoint.c|  2 +-
 src/or/hs_ntor.c  |  3 ++-
 src/or/hs_ntor.h  | 44 ++-
 src/or/hs_service.c   |  1 +
 src/or/microdesc_st.h |  8 ---
 src/or/node_st.h  |  2 +-
 src/or/nodelist.h | 15 +++-
 src/or/onion.h| 11 +
 src/or/onion_ntor.h   | 18 +++---
 src/or/or.h   |  4 +++-
 src/or/router.c   |  1 +
 src/or/router.h   | 14 ++-
 src/or/routerinfo_st.h|  5 ++--
 src/or/routerkeys.c   |  1 +
 src/or/routerlist.c   |  2 +-
 src/or/routerparse.c  |  1 +
 src/or/vote_routerstatus_st.h |  2 +-
 src/test/fuzz/fuzz_consensus.c|  2 +-
 src/test/fuzz/fuzz_hsdescv2.c |  2 +-
 src/test/fuzz/fuzz_iptsv2.c   |  2 +-
 src/test/fuzz/fuzz_microdesc.c|  3 ++-
 src/test/fuzz/fuzz_vrs.c  |  2 +-
 src/test/test_controller.c|  2 +-
 src/test/test_crypto.c|  1 +
 src/test/test_crypto_slow.c   |  3 ++-
 src/test/test_dir.c   |  1 +
 src/test/test_hs_cache.c  |  2 +-
 src/test/test_hs_common.c |  2 +-
 src/test/test_hs_control.c|  2 +-
 src/test/test_hs_descriptor.c |  2 +-
 src/test/test_hs_ntor.c   |  3 ++-
 src/test/test_hs_ntor_cl.c|  3 ++-
 src/test/test_routerkeys.c|  2 +-
 src/test/test_util.c  |  1 +
 src/test/testing_common.c |  1 +
 60 files changed, 227 insertions(+), 159 deletions(-)

diff --git a/src/lib/crypt_ops/crypto_curve25519.h 
b/src/lib/crypt_ops/crypto_curve25519.h
index 2e614848e..acb36fde3 100644
--- a/src/lib/crypt_ops/crypto_curve25519.h
+++ b/src/lib/crypt_ops/crypto_curve25519.h
@@ -8,13 +8,7 @@
 #include "lib/cc/torint.h"
 #include "lib/crypt_ops/crypto_digest.h"
 #include "lib/crypt_ops/crypto_openssl_mgt.h"
-
-/** Length of a curve25519 public key when encoded. */
-#define CURVE25519_PUBKEY_LEN 32
-/** Length of a curve25519 secret key when encoded. */
-#define CURVE25519_SECKEY_LEN 32
-/** Length of the result of a curve25519 handshake. */
-#define CURVE25519_OUTPUT_LEN 32
+#include "lib/defs/x25519_sizes.h"
 
 /** Wrapper type for a curve25519 public key.
  *
@@ -75,8 +69,6 @@ STATIC int curve25519_impl(uint8_t *output, const uint8_t 
*secret,
 STATIC int curve25519_basepoint_impl(uint8_t *output, const uint8_t *secret);
 #endif /* defined(CRYPTO_CURVE25519_PRIVATE) */
 
-#define CURVE25519_BASE64_PADDED_LEN 44
-
 int curve25519_public_from_base64(curve25519_public_key_t *pkey,
   const char *input);
 int curve25519_public_to_base64(char *output,
@@ -86,4 +78,3 @@ void curve25519_set_impl_params(int use_ed);
 void curve25519_init(void);
 
 #endif /* !defined(TOR_CRYPTO_CURVE25519_H) */
-
diff --git a/src/lib/crypt_ops/crypto_ed25519.h 
b/src/lib/crypt_ops/crypto_ed25519.h
index 7255a3ec9..5ecd4530d 100644
--- a/src/lib/crypt_ops/crypto_ed25519.h
+++ b/src/lib/crypt_ops/crypto_ed25519.h
@@ -7,24 +7,20 @@
 #include "lib/testsupport/testsupport.h"
 #include "lib/cc/torint.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
-
-#define ED25519_PUBKEY_LEN 32
-#define ED25519_SECKEY_LEN 64
-#define ED25519_SECKEY_SEED_LEN 32
-#define 

[tor-commits] [tor/master] Remove ATTR_NONNULL macro

2018-07-03 Thread nickm
commit fedb3e46ec39e2e980eb1ae25138e9e0b310d084
Author: rl1987 
Date:   Tue Jul 3 12:33:09 2018 +0300

Remove ATTR_NONNULL macro
---
 changes/ticket26527|  3 +++
 src/lib/cc/compat_compiler.h   | 11 ---
 src/lib/fs/mmap.h  |  4 ++--
 src/lib/malloc/util_malloc.h   |  8 
 src/lib/string/compat_string.h |  4 ++--
 src/lib/string/printf.h|  4 ++--
 src/lib/string/util_string.h   | 24 
 7 files changed, 25 insertions(+), 33 deletions(-)

diff --git a/changes/ticket26527 b/changes/ticket26527
new file mode 100644
index 0..ea1d650fe
--- /dev/null
+++ b/changes/ticket26527
@@ -0,0 +1,3 @@
+  o Code simplification and refactoring:
+- Remove ATTR_NONNULL macro from codebase. Resolves
+  ticket 26527.
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h
index c631a7e82..084923eb0 100644
--- a/src/lib/cc/compat_compiler.h
+++ b/src/lib/cc/compat_compiler.h
@@ -125,16 +125,6 @@
 #define ATTR_MALLOC __attribute__((malloc))
 #define ATTR_NORETURN __attribute__((noreturn))
 #define ATTR_WUR __attribute__((warn_unused_result))
-/* Alas, nonnull is not at present a good idea for us.  We'd like to get
- * warnings when we pass NULL where we shouldn't (which nonnull does, albeit
- * spottily), but we don't want to tell the compiler to make optimizations
- * with the assumption that the argument can't be NULL (since this would make
- * many of our checks go away, and make our code less robust against
- * programming errors).  Unfortunately, nonnull currently does both of these
- * things, and there's no good way to split them up.
- *
- * #define ATTR_NONNULL(x) __attribute__((nonnull x)) */
-#define ATTR_NONNULL(x)
 #define ATTR_UNUSED __attribute__ ((unused))
 
 /** Macro: Evaluates to exp and hints the compiler that the value
@@ -158,7 +148,6 @@
 #define ATTR_CONST
 #define ATTR_MALLOC
 #define ATTR_NORETURN
-#define ATTR_NONNULL(x)
 #define ATTR_UNUSED
 #define ATTR_WUR
 #define PREDICT_LIKELY(exp) (exp)
diff --git a/src/lib/fs/mmap.h b/src/lib/fs/mmap.h
index 125f36880..8d6ca9a0e 100644
--- a/src/lib/fs/mmap.h
+++ b/src/lib/fs/mmap.h
@@ -35,7 +35,7 @@ typedef struct tor_mmap_t {
 
 } tor_mmap_t;
 
-tor_mmap_t *tor_mmap_file(const char *filename) ATTR_NONNULL((1));
-int tor_munmap_file(tor_mmap_t *handle) ATTR_NONNULL((1));
+tor_mmap_t *tor_mmap_file(const char *filename);
+int tor_munmap_file(tor_mmap_t *handle);
 
 #endif
diff --git a/src/lib/malloc/util_malloc.h b/src/lib/malloc/util_malloc.h
index 88ecc0453..a1e953117 100644
--- a/src/lib/malloc/util_malloc.h
+++ b/src/lib/malloc/util_malloc.h
@@ -21,13 +21,13 @@ void *tor_malloc_zero_(size_t size) ATTR_MALLOC;
 void *tor_calloc_(size_t nmemb, size_t size) ATTR_MALLOC;
 void *tor_realloc_(void *ptr, size_t size);
 void *tor_reallocarray_(void *ptr, size_t size1, size_t size2);
-char *tor_strdup_(const char *s) ATTR_MALLOC ATTR_NONNULL((1));
+char *tor_strdup_(const char *s) ATTR_MALLOC;
 char *tor_strndup_(const char *s, size_t n)
-  ATTR_MALLOC ATTR_NONNULL((1));
+  ATTR_MALLOC;
 void *tor_memdup_(const void *mem, size_t len)
-  ATTR_MALLOC ATTR_NONNULL((1));
+  ATTR_MALLOC;
 void *tor_memdup_nulterm_(const void *mem, size_t len)
-  ATTR_MALLOC ATTR_NONNULL((1));
+  ATTR_MALLOC;
 void tor_free_(void *mem);
 
 /** Release memory allocated by tor_malloc, tor_realloc, tor_strdup,
diff --git a/src/lib/string/compat_string.h b/src/lib/string/compat_string.h
index 0a4ce0175..34490bce0 100644
--- a/src/lib/string/compat_string.h
+++ b/src/lib/string/compat_string.h
@@ -41,10 +41,10 @@ static inline int strcasecmp(const char *a, const char *b, 
size_t n) {
 #endif /* defined __APPLE__ */
 
 #ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2));
+size_t strlcat(char *dst, const char *src, size_t siz);
 #endif
 #ifndef HAVE_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2));
+size_t strlcpy(char *dst, const char *src, size_t siz);
 #endif
 
 char *tor_strtok_r_impl(char *str, const char *sep, char **lasts);
diff --git a/src/lib/string/printf.h b/src/lib/string/printf.h
index 2f4620654..69b724379 100644
--- a/src/lib/string/printf.h
+++ b/src/lib/string/printf.h
@@ -13,9 +13,9 @@
 #include 
 
 int tor_snprintf(char *str, size_t size, const char *format, ...)
-  CHECK_PRINTF(3,4) ATTR_NONNULL((1,3));
+  CHECK_PRINTF(3,4);
 int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
-  CHECK_PRINTF(3,0) ATTR_NONNULL((1,3));
+  CHECK_PRINTF(3,0);
 
 int tor_asprintf(char **strp, const char *fmt, ...)
   CHECK_PRINTF(2,3);
diff --git a/src/lib/string/util_string.h b/src/lib/string/util_string.h
index bdc2e77ce..75407d5ff 100644
--- a/src/lib/string/util_string.h
+++ b/src/lib/string/util_string.h
@@ -12,29 +12,29 @@
 #include 
 
 const void *tor_memmem(const void *haystack, size_t hlen, const void *needle,
-   size_t nlen) ATTR_NONNULL((1,3));
+  

[tor-commits] [tor/master] Merge remote-tracking branch 'rl1987/ticket26527'

2018-07-03 Thread nickm
commit a01b4d7f87f2217f55f5c5113fe19a2d3081a44c
Merge: 228d25ddf fedb3e46e
Author: Nick Mathewson 
Date:   Tue Jul 3 09:53:46 2018 -0400

Merge remote-tracking branch 'rl1987/ticket26527'

 changes/ticket26527|  3 +++
 src/lib/cc/compat_compiler.h   | 11 ---
 src/lib/fs/mmap.h  |  4 ++--
 src/lib/malloc/util_malloc.h   |  8 
 src/lib/string/compat_string.h |  4 ++--
 src/lib/string/printf.h|  4 ++--
 src/lib/string/util_string.h   | 24 
 7 files changed, 25 insertions(+), 33 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-onioncircuits_completed] Update translations for tails-onioncircuits_completed

2018-07-03 Thread translation
commit c4f8e8e322c2129033803a39411c2d75bea18ae6
Author: Translation commit bot 
Date:   Tue Jul 3 13:48:32 2018 +

Update translations for tails-onioncircuits_completed
---
 ar/onioncircuits.pot | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/ar/onioncircuits.pot b/ar/onioncircuits.pot
index 7f6a8f0ae..fa1552371 100644
--- a/ar/onioncircuits.pot
+++ b/ar/onioncircuits.pot
@@ -6,14 +6,15 @@
 # Ahmed Alhammadi <66222...@gmail.com>, 2016
 # ButterflyOfFire, 2018
 # crash x , 2016
+# Khaled Hosny , 2018
 # Singapore Goldindor, 2016
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-08-03 13:00+\n"
-"PO-Revision-Date: 2018-05-27 20:34+\n"
-"Last-Translator: abidin toumi \n"
+"PO-Revision-Date: 2018-07-03 13:30+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -23,11 +24,11 @@ msgstr ""
 
 #: ../onioncircuits:81
 msgid "You are not connected to Tor yet..."
-msgstr "إنك غير متصل بعدُ بشبكة تور …"
+msgstr "لست متصلا بعدُ بشبكة تور…"
 
 #: ../onioncircuits:95
 msgid "Onion Circuits"
-msgstr "دائرة اونيون"
+msgstr "دوائر البصلة"
 
 #: ../onioncircuits:125
 msgid "Circuit"
@@ -35,7 +36,7 @@ msgstr "دائرة"
 
 #: ../onioncircuits:126
 msgid "Status"
-msgstr "الحاﻻت"
+msgstr "الحالة"
 
 #: ../onioncircuits:142
 msgid "Click on a circuit for more detail about its Tor relays."
@@ -43,7 +44,7 @@ msgstr "انقر على دائرة لمزيد من 
التفاصيل حول تح
 
 #: ../onioncircuits:221
 msgid "The connection to Tor was lost..."
-msgstr "فقد الاتصال بتور"
+msgstr "فقد الاتصال بتور…"
 
 #: ../onioncircuits:317
 msgid "..."
@@ -56,7 +57,7 @@ msgstr "%s: %s"
 
 #: ../onioncircuits:554
 msgid "GeoIP database unavailable. No country information will be displayed."
-msgstr "قاعدة بيانات GeoIP غير متوفرة. لن يتم عرض 
أي معلومة خاصة بموقع البلدان."
+msgstr "قاعدة بيانات GeoIP غير متوفرة. لن تعرض أي 
معلومة عن البلدان."
 
 #: ../onioncircuits:585
 #, c-format
@@ -66,7 +67,7 @@ msgstr "%s (%s)"
 #: ../onioncircuits:590
 #, c-format
 msgid "%.2f Mb/s"
-msgstr "%.2f ميجابايت/ثا"
+msgstr "%.2f ميجابايت/ثانية"
 
 #: ../onioncircuits:592 ../onioncircuits:593 ../onioncircuits:594
 msgid "Unknown"
@@ -74,16 +75,16 @@ msgstr "غير معروف"
 
 #: ../onioncircuits:607
 msgid "Fingerprint:"
-msgstr "البصمة :"
+msgstr "البصمة:"
 
 #: ../onioncircuits:608
 msgid "Published:"
-msgstr "نُشِر:"
+msgstr "نُشِر في:"
 
 #: ../onioncircuits:609
 msgid "IP:"
-msgstr "عنوان الأي بي:"
+msgstr "عنوان الإنترنت (IP):"
 
 #: ../onioncircuits:610
 msgid "Bandwidth:"
-msgstr "عرض الحزمة:"
+msgstr "سرعة الإنترنت:"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'maint-0.3.4' into release-0.3.4

2018-07-03 Thread nickm
commit 9b060547ce3dec290ce4a02f9aa54d11b0939e0b
Merge: 788c44308 d38e47495
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.4' into release-0.3.4

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-onioncircuits] Update translations for tails-onioncircuits

2018-07-03 Thread translation
commit dfaf4b30167a24b29180d1b6ecb6d2eaae7e445d
Author: Translation commit bot 
Date:   Tue Jul 3 13:48:27 2018 +

Update translations for tails-onioncircuits
---
 ar/onioncircuits.pot | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/ar/onioncircuits.pot b/ar/onioncircuits.pot
index 7f6a8f0ae..fa1552371 100644
--- a/ar/onioncircuits.pot
+++ b/ar/onioncircuits.pot
@@ -6,14 +6,15 @@
 # Ahmed Alhammadi <66222...@gmail.com>, 2016
 # ButterflyOfFire, 2018
 # crash x , 2016
+# Khaled Hosny , 2018
 # Singapore Goldindor, 2016
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-08-03 13:00+\n"
-"PO-Revision-Date: 2018-05-27 20:34+\n"
-"Last-Translator: abidin toumi \n"
+"PO-Revision-Date: 2018-07-03 13:30+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -23,11 +24,11 @@ msgstr ""
 
 #: ../onioncircuits:81
 msgid "You are not connected to Tor yet..."
-msgstr "إنك غير متصل بعدُ بشبكة تور …"
+msgstr "لست متصلا بعدُ بشبكة تور…"
 
 #: ../onioncircuits:95
 msgid "Onion Circuits"
-msgstr "دائرة اونيون"
+msgstr "دوائر البصلة"
 
 #: ../onioncircuits:125
 msgid "Circuit"
@@ -35,7 +36,7 @@ msgstr "دائرة"
 
 #: ../onioncircuits:126
 msgid "Status"
-msgstr "الحاﻻت"
+msgstr "الحالة"
 
 #: ../onioncircuits:142
 msgid "Click on a circuit for more detail about its Tor relays."
@@ -43,7 +44,7 @@ msgstr "انقر على دائرة لمزيد من 
التفاصيل حول تح
 
 #: ../onioncircuits:221
 msgid "The connection to Tor was lost..."
-msgstr "فقد الاتصال بتور"
+msgstr "فقد الاتصال بتور…"
 
 #: ../onioncircuits:317
 msgid "..."
@@ -56,7 +57,7 @@ msgstr "%s: %s"
 
 #: ../onioncircuits:554
 msgid "GeoIP database unavailable. No country information will be displayed."
-msgstr "قاعدة بيانات GeoIP غير متوفرة. لن يتم عرض 
أي معلومة خاصة بموقع البلدان."
+msgstr "قاعدة بيانات GeoIP غير متوفرة. لن تعرض أي 
معلومة عن البلدان."
 
 #: ../onioncircuits:585
 #, c-format
@@ -66,7 +67,7 @@ msgstr "%s (%s)"
 #: ../onioncircuits:590
 #, c-format
 msgid "%.2f Mb/s"
-msgstr "%.2f ميجابايت/ثا"
+msgstr "%.2f ميجابايت/ثانية"
 
 #: ../onioncircuits:592 ../onioncircuits:593 ../onioncircuits:594
 msgid "Unknown"
@@ -74,16 +75,16 @@ msgstr "غير معروف"
 
 #: ../onioncircuits:607
 msgid "Fingerprint:"
-msgstr "البصمة :"
+msgstr "البصمة:"
 
 #: ../onioncircuits:608
 msgid "Published:"
-msgstr "نُشِر:"
+msgstr "نُشِر في:"
 
 #: ../onioncircuits:609
 msgid "IP:"
-msgstr "عنوان الأي بي:"
+msgstr "عنوان الإنترنت (IP):"
 
 #: ../onioncircuits:610
 msgid "Bandwidth:"
-msgstr "عرض الحزمة:"
+msgstr "سرعة الإنترنت:"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-openpgp-applet] Update translations for tails-openpgp-applet

2018-07-03 Thread translation
commit 0cef8ab25d2f66e5e25f62139de6984cfd2a36fb
Author: Translation commit bot 
Date:   Tue Jul 3 13:48:11 2018 +

Update translations for tails-openpgp-applet
---
 ar/openpgp-applet.pot | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ar/openpgp-applet.pot b/ar/openpgp-applet.pot
index 90b9db9f3..848800151 100644
--- a/ar/openpgp-applet.pot
+++ b/ar/openpgp-applet.pot
@@ -11,8 +11,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: ta...@boum.org\n"
 "POT-Creation-Date: 2017-08-05 15:07-0400\n"
-"PO-Revision-Date: 2018-06-30 20:57+\n"
-"Last-Translator: Rahma Sghaier \n"
+"PO-Revision-Date: 2018-07-03 13:30+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'maint-0.3.3' into maint-0.3.4

2018-07-03 Thread nickm
commit d38e474950ab41ad3593dc94de9a240f02938679
Merge: cd2be4283 4c094436c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-07-03 Thread nickm
commit 4c094436c50a489d2ecdd09b8dfb7dc9a3c97389
Merge: 9aeef05f8 a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.3.3' into release-0.3.3

2018-07-03 Thread nickm
commit b489e8cfeaaf4d66f048e51453873a0357dd2ba3
Merge: b22b60365 4c094436c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.3' into release-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.4] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-07-03 Thread nickm
commit 4c094436c50a489d2ecdd09b8dfb7dc9a3c97389
Merge: 9aeef05f8 a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.3.2' into release-0.3.2

2018-07-03 Thread nickm
commit f141d347999baa525cf5ca2daad1f267cae74414
Merge: 855b27b9e a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into release-0.3.2

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.9' into release-0.2.9

2018-07-03 Thread nickm
commit 3e1717cd0fe6ce45a74d05043dd28dbbeb2e66f3
Merge: 9fa7866c7 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into release-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-07-03 Thread nickm
commit 4c094436c50a489d2ecdd09b8dfb7dc9a3c97389
Merge: 9aeef05f8 a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.4'

2018-07-03 Thread nickm
commit 228d25ddf641f02a38e1cd6386d7e603b9478a9d
Merge: a9628c0c0 d38e47495
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.4'

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.3] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.2] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.2.9] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge branch 'maint-0.3.3' into maint-0.3.4

2018-07-03 Thread nickm
commit d38e474950ab41ad3593dc94de9a240f02938679
Merge: cd2be4283 4c094436c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-07-03 Thread nickm
commit 4c094436c50a489d2ecdd09b8dfb7dc9a3c97389
Merge: 9aeef05f8 a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'maint-0.3.2' into maint-0.3.3

2018-07-03 Thread nickm
commit 4c094436c50a489d2ecdd09b8dfb7dc9a3c97389
Merge: 9aeef05f8 a4e8f9450
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.2' into maint-0.3.3

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.3.3' into maint-0.3.4

2018-07-03 Thread nickm
commit d38e474950ab41ad3593dc94de9a240f02938679
Merge: cd2be4283 4c094436c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.3.3' into maint-0.3.4

 changes/bug26535.029| 5 +
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 src/test/ntor_ref.py| 9 ++---
 4 files changed, 21 insertions(+), 5 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.4] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] Merge branch 'bug26535_032' into maint-0.3.2

2018-07-03 Thread nickm
commit e6366f787c49bebd5faafa1b6f78c81ab463fd08
Merge: 3c97b148a 3baf3d01c
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:00 2018 -0400

Merge branch 'bug26535_032' into maint-0.3.2

 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] hs_ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit 3baf3d01cbf4cca91a8d18f4c86ae5aa05818f8e
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

hs_ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.
---
 changes/bug26535.032| 5 +
 src/test/hs_ntor_ref.py | 7 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/changes/bug26535.032 b/changes/bug26535.032
new file mode 100644
index 0..395d08d81
--- /dev/null
+++ b/changes/bug26535.032
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the hs_ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.3.1.1-alpha.
diff --git a/src/test/hs_ntor_ref.py b/src/test/hs_ntor_ref.py
index 2ed9324e1..542b02d2e 100644
--- a/src/test/hs_ntor_ref.py
+++ b/src/test/hs_ntor_ref.py
@@ -234,8 +234,11 @@ Utilities for communicating with the little-t-tor ntor 
wrapper to conduct the
 integration tests
 """
 
-PROG = b"./src/test/test-hs-ntor-cl"
-enhex=lambda s: binascii.b2a_hex(s)
+PROG = "./src/test/test-hs-ntor-cl"
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
 def tor_client1(intro_auth_pubkey_str, intro_enc_pubkey,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.2.9] Merge branch 'bug26535_029' into maint-0.2.9

2018-07-03 Thread nickm
commit b205714ba8fd65340e6f282db95663390d5d492e
Merge: 1953a7e61 fc5f8b693
Author: Nick Mathewson 
Date:   Tue Jul 3 09:47:41 2018 -0400

Merge branch 'bug26535_029' into maint-0.2.9

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] Merge branch 'maint-0.2.9' into maint-0.3.2

2018-07-03 Thread nickm
commit a4e8f945077b8eebbbd5be85f89b1631305ce1cc
Merge: e6366f787 b205714ba
Author: Nick Mathewson 
Date:   Tue Jul 3 09:48:03 2018 -0400

Merge branch 'maint-0.2.9' into maint-0.3.2

 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.3] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.2] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.2.9] ntor_ref.py: pass only strings to subprocess.Popen

2018-07-03 Thread nickm
commit fc5f8b6931dbbfcf31157cb9e4f68da56b6ff6aa
Author: Nick Mathewson 
Date:   Mon Jul 2 14:04:46 2018 -0400

ntor_ref.py: pass only strings to subprocess.Popen

Recent Python3 versions seem to require this on Windows.

Fixes bug 26535; bug introduced in f4be34f70d6f277a0f3f73e, which
was apparently intended itself as a Python3 workaround.
---
 changes/bug26535.029 | 5 +
 src/test/ntor_ref.py | 9 ++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/changes/bug26535.029 b/changes/bug26535.029
new file mode 100644
index 0..111b539f1
--- /dev/null
+++ b/changes/bug26535.029
@@ -0,0 +1,5 @@
+  o Minor bugfixes (testing, compatibility):
+- When running the ntor_ref.py test, make sure only to pass strings
+  (rather than "bytes" objects) to the Python subprocess module.
+  Python 3 on Windows seems to require this.  Fixes bug 26535; bugfix on
+  0.2.5.5-alpha.
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py
index df065853f..5ec117f2b 100755
--- a/src/test/ntor_ref.py
+++ b/src/test/ntor_ref.py
@@ -336,13 +336,16 @@ def test_tor():
Call the test-ntor-cl command-line program to make sure we can
interoperate with Tor's ntor program
 """
-enhex=lambda s: binascii.b2a_hex(s)
+if sys.version_info[0] >= 3:
+enhex=lambda s: binascii.b2a_hex(s).decode("ascii")
+else:
+enhex=lambda s: binascii.b2a_hex(s)
 dehex=lambda s: binascii.a2b_hex(s.strip())
 
-PROG = b"./src/test/test-ntor-cl"
+PROG = "./src/test/test-ntor-cl"
 def tor_client1(node_id, pubkey_B):
 " returns (msg, state) "
-p = subprocess.Popen([PROG, b"client1", enhex(node_id),
+p = subprocess.Popen([PROG, "client1", enhex(node_id),
   enhex(pubkey_B.serialize())],
  stdout=subprocess.PIPE)
 return map(dehex, p.stdout.readlines())



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui] Update translations for mat-gui

2018-07-03 Thread translation
commit 2f904e885cbbed356d61e7115eb960a67369b21f
Author: Translation commit bot 
Date:   Tue Jul 3 13:46:10 2018 +

Update translations for mat-gui
---
 ar.po | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ar.po b/ar.po
index dcec0210c..17e4d8caa 100644
--- a/ar.po
+++ b/ar.po
@@ -7,6 +7,7 @@
 # Asim Jaweesh , 2013
 # ButterflyOfFire, 2018
 # Fortas Abdeldjalil , 2016
+# Khaled Hosny , 2018
 # Mayalynn , 2014
 # Sherief Alaa , 2013
 # Singapore Goldindor, 2016
@@ -16,8 +17,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2018-05-23 09:52+\n"
-"Last-Translator: e Translators \n"
+"PO-Revision-Date: 2018-07-03 13:37+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -81,11 +82,11 @@ msgstr "قلل جودة وحجم ملف الـPDF الم
نتج"
 
 #: mat-gui:238
 msgid "Remove unsupported file from archives"
-msgstr "حذف الملفات غير المدعومة من الأرشيف"
+msgstr "احذف الملفات غير المدعومة من الأرشيف"
 
 #: mat-gui:241
 msgid "Remove non-supported (and so non-anonymised) file from output archive"
-msgstr "إزالة ملف غير مدعوم (وإذا غير مجهول الم
صدر) من الأرشيف الناتج"
+msgstr "احذف الملف غير المدعومة (وبالتالي غير 
المجهّلة) من الأرشيف الناتج"
 
 #: mat-gui:280
 msgid "Unknown"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/mat-gui_completed] Update translations for mat-gui_completed

2018-07-03 Thread translation
commit 86f06f7a7a0fe49043d0d0a85c98f1576ad276e9
Author: Translation commit bot 
Date:   Tue Jul 3 13:46:15 2018 +

Update translations for mat-gui_completed
---
 ar.po | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ar.po b/ar.po
index dcec0210c..17e4d8caa 100644
--- a/ar.po
+++ b/ar.po
@@ -7,6 +7,7 @@
 # Asim Jaweesh , 2013
 # ButterflyOfFire, 2018
 # Fortas Abdeldjalil , 2016
+# Khaled Hosny , 2018
 # Mayalynn , 2014
 # Sherief Alaa , 2013
 # Singapore Goldindor, 2016
@@ -16,8 +17,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2016-02-10 23:06+0100\n"
-"PO-Revision-Date: 2018-05-23 09:52+\n"
-"Last-Translator: e Translators \n"
+"PO-Revision-Date: 2018-07-03 13:37+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -81,11 +82,11 @@ msgstr "قلل جودة وحجم ملف الـPDF الم
نتج"
 
 #: mat-gui:238
 msgid "Remove unsupported file from archives"
-msgstr "حذف الملفات غير المدعومة من الأرشيف"
+msgstr "احذف الملفات غير المدعومة من الأرشيف"
 
 #: mat-gui:241
 msgid "Remove non-supported (and so non-anonymised) file from output archive"
-msgstr "إزالة ملف غير مدعوم (وإذا غير مجهول الم
صدر) من الأرشيف الناتج"
+msgstr "احذف الملف غير المدعومة (وبالتالي غير 
المجهّلة) من الأرشيف الناتج"
 
 #: mat-gui:280
 msgid "Unknown"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/liveusb-creator] Update translations for liveusb-creator

2018-07-03 Thread translation
commit dbca7b5036735cef9685df8a7683ae091509a17a
Author: Translation commit bot 
Date:   Tue Jul 3 13:45:42 2018 +

Update translations for liveusb-creator
---
 ar/ar.po | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/ar/ar.po b/ar/ar.po
index ad42c9e37..1873cc1c4 100644
--- a/ar/ar.po
+++ b/ar/ar.po
@@ -6,12 +6,13 @@
 # kraim , 2013
 # Abdullah Al Hatim , 2012
 # Amr Syria <3a...@hmamail.com>, 2015
-# ButterflyOfFire , 2018
+# ButterflyOfFire, 2018
 # طاهر , 2014
 # Fadi Mansour , 2012
 # 0xidz , 2014
 # alshara3 , 2013
 # MirahbiRajan, 2018
+# Khaled Hosny , 2018
 # stayanonymous, 2015
 # MirahbiRajan, 2018
 # Mohammed ALDOUB , 2013-2014
@@ -25,8 +26,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-11-10 15:57+0100\n"
-"PO-Revision-Date: 2018-03-15 18:56+\n"
-"Last-Translator: ButterflyOfFire \n"
+"PO-Revision-Date: 2018-07-03 13:33+\n"
+"Last-Translator: Khaled Hosny \n"
 "Language-Team: Arabic 
(http://www.transifex.com/otf/torproject/language/ar/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -36,7 +37,7 @@ msgstr ""
 
 #: ../tails_installer/creator.py:101
 msgid "You must run this application as root"
-msgstr "من الضروري ان يعمل هذا التطبيق 
بصلاحيات حساب رووت"
+msgstr "من الضروري ان يعمل هذا التطبيق 
بصلاحيات حساب الجذر"
 
 #: ../tails_installer/creator.py:147
 msgid "Extracting live image to the target device..."
@@ -45,32 +46,32 @@ msgstr "جاري فك ضغط ملف الأيزو بداخل 
الجهاز الم
 #: ../tails_installer/creator.py:154
 #, python-format
 msgid "Wrote to device at %(speed)d MB/sec"
-msgstr "تمت الكتابة علي الجهاز بسرعة %(speed)d م
يغابايت بالثانية"
+msgstr "تمت الكتابة علي الجهاز بسرعة %(speed)d م
يجابايت بالثانية"
 
 #: ../tails_installer/creator.py:184
 msgid "Setting up OLPC boot file..."
-msgstr "تجهيز ملف الإقلاع \"OLPC\"..."
+msgstr "تجهيز ملف إقلاع OLPC..."
 
 #: ../tails_installer/creator.py:315
 #, python-format
 msgid ""
 "There was a problem executing the following command: `%(command)s`.\n"
 "A more detailed error log has been written to '%(filename)s'."
-msgstr "كان هناك مشكلة في تنفيذ الأمر التالي:  
`%(command)s`.\nتم كتابة الخطأ بالتفصيل في سجل 
'%(filename)s'. "
+msgstr "كان هناك مشكلة في تنفيذ الأمر التالي:  
`%(command)s`.\nكتب الخطأ بالتفصيل في سجل '%(filename)s'. "
 
 #: ../tails_installer/creator.py:334
 msgid "Verifying SHA1 checksum of LiveCD image..."
-msgstr "التحقق من الـSHA1 لملف القرص الحي..."
+msgstr "التحقق من تلبيدة SHA1 لملف القرص الحي..."
 
 #: ../tails_installer/creator.py:338
 msgid "Verifying SHA256 checksum of LiveCD image..."
-msgstr "التحقق من الـSHA256 لملف القرص الحي..."
+msgstr "التحقق من تلبيدة SHA256 لملف القرص الحي..."
 
 #: ../tails_installer/creator.py:354
 msgid ""
 "Error: The SHA1 of your Live CD is invalid.  You can run this program with "
 "the --noverify argument to bypass this verification check."
-msgstr "خطأ: إن الـSHA1 للقرص الحي غير صحيح.  
تستطيع تشغيل هذا البرنامج باستخدام المعطى 
--noverify لتجاوز الفحص."
+msgstr "خطأ: إن تلبيدة SHA1 للقرص الحي غير صحيحة. 
تستطيع تشغيل هذا البرنامج باستخدام المعطى 
--noverify لتجاوز الفحص."
 
 #: ../tails_installer/creator.py:360
 msgid "Unknown ISO, skipping checksum verification"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/torbutton-torbuttonproperties] Update translations for torbutton-torbuttonproperties

2018-07-03 Thread translation
commit 115d1a5b638deedd0e1eb7ba814b793a0c266d0b
Author: Translation commit bot 
Date:   Tue Jul 3 13:17:16 2018 +

Update translations for torbutton-torbuttonproperties
---
 ar/torbutton.properties | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ar/torbutton.properties b/ar/torbutton.properties
index 815004f9e..5dd4c283b 100644
--- a/ar/torbutton.properties
+++ b/ar/torbutton.properties
@@ -54,5 +54,5 @@ profileAccessDenied=لا يمتلك %S الصلاحيات 
المطلوبة لم
 profileMigrationFailed=فشل نقل ملف إعدادات %S الموجود 
إلى الإصدارة الجديدة.\nسيستخدم ملف إعدادات 
جديد.
 
 # .Onion Page Info prompt.  Strings are kept here for ease of translation.
-pageInfo_OnionEncryptionWithBitsAndProtocol=Connection Encrypted (Onion 
Service, %1$S, %2$S bit keys, %3$S)
-pageInfo_OnionEncryption=Connection Encrypted (Onion Service)
+pageInfo_OnionEncryptionWithBitsAndProtocol=الاتصال معمى (خدمة 
بصلة، %1$S، مفاتيح %2$S بتة، %3$S)
+pageInfo_OnionEncryption=الاتصال معمى (خدمة بصلة)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/torbutton-torbuttonproperties_completed] Update translations for torbutton-torbuttonproperties_completed

2018-07-03 Thread translation
commit a182f04b5470bf66f80f6b98048a69b7517701df
Author: Translation commit bot 
Date:   Tue Jul 3 13:17:21 2018 +

Update translations for torbutton-torbuttonproperties_completed
---
 ar/torbutton.properties | 4 
 1 file changed, 4 insertions(+)

diff --git a/ar/torbutton.properties b/ar/torbutton.properties
index afa0b9336..5dd4c283b 100644
--- a/ar/torbutton.properties
+++ b/ar/torbutton.properties
@@ -52,3 +52,7 @@ profileReadOnly=لا يمكنك تشغيل %S من نظام م
لفات خاص ب
 profileReadOnlyMac=لا يمكنك تشغيل %S من نظام ملفات 
خاص بالقراءة فقط.  يرجى نسخ %S إلى سطح المكتب 
أو مجلد التطبيقات قبل محاولة استخدامه.
 profileAccessDenied=لا يمتلك %S الصلاحيات المطلوبة لم
لف إعداداتك. يرجى ضبط صلاحيات نظام الملفات 
ثم إعادة المحاولة.
 profileMigrationFailed=فشل نقل ملف إعدادات %S الموجود 
إلى الإصدارة الجديدة.\nسيستخدم ملف إعدادات 
جديد.
+
+# .Onion Page Info prompt.  Strings are kept here for ease of translation.
+pageInfo_OnionEncryptionWithBitsAndProtocol=الاتصال معمى (خدمة 
بصلة، %1$S، مفاتيح %2$S بتة، %3$S)
+pageInfo_OnionEncryption=الاتصال معمى (خدمة بصلة)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/https_everywhere_completed] Update translations for https_everywhere_completed

2018-07-03 Thread translation
commit d3d6479a640e6e92a0714ce86cc66d850701859d
Author: Translation commit bot 
Date:   Tue Jul 3 13:15:42 2018 +

Update translations for https_everywhere_completed
---
 ar/https-everywhere.dtd | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ar/https-everywhere.dtd b/ar/https-everywhere.dtd
index 2eece7ce5..988b2043f 100644
--- a/ar/https-everywhere.dtd
+++ b/ar/https-everywhere.dtd
@@ -23,6 +23,7 @@
 
 
 
+
 
 
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


  1   2   >