Do not launch pluggable transport plugins when DisableNetwork is set.

When DisableNetwork is set, do not launch pluggable transport plugins,
and if any are running already, terminate the existing instances.
Resolves ticket 13213.
Improving error message.
Stop signed left shifts overflowing in ed25519: Macros

The macros let us use unsigned types for potentially overflowing left
shifts. Create SHL32() and SHL64() and SHL8() macros for convenience.
Use SHL{8,32,64} in ed25519/ref10 to avoid left-shifting negative values

This helps us avoid undefined behavior. It's based on a patch from teor,
except that I wrote a perl script to regenerate the patch:

  #!/usr/bin/perl -p -w -i

  BEGIN { %vartypes = (); }

  if (/^[{}]/) {
      %vartypes = ();
  }

  if (/^ *crypto_int(\d+) +([a-zA-Z_][_a-zA-Z0-9]*)/) {
      $vartypes{$2} = $1;
  } elsif (/^ *(?:signed +)char +([a-zA-Z_][_a-zA-Z0-9]*)/) {
      $vartypes{$1} = '8';
  }

  # This fixes at most one shift per line. But that's all the code does.
  if (/([a-zA-Z_][a-zA-Z_0-9]*) *<< *(\d+)/) {
      $v = $1;
      if (exists $vartypes{$v}) {
  	s/$v *<< *(\d+)/SHL$vartypes{$v}($v,$1)/;
      }
  }

  # remove extra parenthesis
  s/\(SHL64\((.*)\)\)/SHL64\($1\)/;
  s/\(SHL32\((.*)\)\)/SHL32\($1\)/;
  s/\(SHL8\((.*)\)\)/SHL8\($1\)/;
Stop ed25519 8-bit signed left shift overflowing

Standardise usage in ge_scalarmult_base.c for 1 new fix.
Stop spurious clang shallow analysis null pointer errors

Avoid 4 null pointer errors under clang shallow analysis (the default when
building under Xcode) by using tor_assert() to prove that the pointers
aren't null. Resolves issue 13284 via minor code refactoring.
Merge branch 'bug13280'
Stop test & bench build failures with --disable-curve25519

Ensure test & bench code that references curve25519 is disabled by the
appropriate macros. tor now builds with and without --disable-curve25519.
Avoid division by zero in circuitstats pareto

In circuit_build_times_calculate_timeout() in circuitstats.c, avoid dividing
by zero in the pareto calculations.

If either the alpha or p parameters are 0, we would divide by zero, yielding
an infinite result; which would be clamped to INT32_MAX anyway. So rather
than dividing by zero, we just skip the offending calculation(s), and
use INT32_MAX for the result.

Division by zero traps under clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error.
Whitespace fixes
Merge remote-tracking branch 'rl1987/bug13228'
Merge remote-tracking branch 'yawning/bug13213'
Add an "AccountingRule" feature to permit limiting bw usage by read+write

Patch from "chobe".  Closes ticket 961.
Avoid frequent strcmp() calls for AccountingRule

Generally, we don't like to parse the same thing over and over; it's
best IMO to do it once at the start of the code.
Changes file for ticket 961
Merge branch 'ticket961_squashed'
Respond with 'Command not supported' SOCKS5 reply message upon reception of unsupported request.
Rename socks5 error code setting function again

I'd prefer not to use the name "send" for any function that doesn't
really send things.
Merge branch 'bug12971_take2_squashed'
Stop spawn test failures due to a race condition with SIGCHLD on process exit

When a spawned process forks, fails, then exits very quickly, (this
typically occurs when exec fails), there is a race condition between the
SIGCHLD handler updating the process_handle's fields, and checking the
process status in those fields. The update can occur before or after the
spawn tests check the process status.

We check whether the process is running or not running (rather than just
checking if it is running) to avoid this issue.