Skip to content
Snippets Groups Projects
  1. Apr 06, 2017
  2. Apr 03, 2017
  3. Mar 16, 2017
  4. Mar 15, 2017
  5. Dec 14, 2016
  6. Nov 24, 2016
  7. Nov 04, 2016
  8. Nov 03, 2016
    • Nick Mathewson's avatar
      Move unittests' RSA pregen code into a new file, and improve. · acbb60cd
      Nick Mathewson authored
      This patch moves the pregenerated RSA key logic into a new
      testing_rsakeys.c.
      
      Also, it adds support for RSA2048, since the link handshake tests
      want that.
      
      Also, it includes pregenerated keys, rather than trying to actually
      generate the keys at startup, since generating even a small handful
      of RSA2048 keys makes for an annoying delay.
      acbb60cd
  9. Nov 02, 2016
  10. Sep 26, 2016
  11. Sep 09, 2016
  12. Aug 20, 2016
  13. Jul 01, 2016
  14. Jun 11, 2016
    • Nick Mathewson's avatar
      Add -Wmissing-variable-declarations, with attendant fixes · 53a3b39d
      Nick Mathewson authored
      This is a big-ish patch, but it's very straightforward.  Under this
      clang warning, we're not actually allowed to have a global variable
      without a previous extern declaration for it.  The cases where we
      violated this rule fall into three roughly equal groups:
        * Stuff that should have been static.
        * Stuff that was global but where the extern was local to some
          other C file.
        * Stuff that was only global when built for the unit tests, that
          needed a conditional extern in the headers.
      
      The first two were IMO genuine problems; the last is a wart of how
      we build tests.
      53a3b39d
  15. Apr 19, 2016
  16. Feb 27, 2016
  17. Aug 14, 2015
  18. Feb 24, 2015
  19. Jan 14, 2015
  20. Jan 02, 2015
  21. Nov 12, 2014
  22. Oct 28, 2014
  23. Sep 16, 2014
  24. Aug 13, 2014
  25. May 12, 2014
  26. May 08, 2014
  27. Apr 15, 2014
    • dana koch's avatar
      Uplift status.c unit test coverage with new test cases and macros. · 3ce39847
      dana koch authored and Nick Mathewson's avatar Nick Mathewson committed
      A new set of unit test cases are provided, as well as introducing
      an alternative paradigm and macros to support it. Primarily, each test
      case is given its own namespace, in order to isolate tests from each
      other. We do this by in the usual fashion, by appending module and
      submodule names to our symbols. New macros assist by reducing friction
      for this and other tasks, like overriding a function in the global
      namespace with one in the current namespace, or declaring integer
      variables to assist tracking how many times a mock has been called.
      
      A set of tests for a small-scale module has been included in this
      commit, in order to highlight how the paradigm can be used. This
      suite gives 100% coverage to status.c in test execution.
      3ce39847
  28. Mar 06, 2014
  29. Jan 16, 2013
  30. Oct 12, 2012
    • Nick Mathewson's avatar
      Convert all include-guard macros to avoid reserved identifiers. · 0cb921f3
      Nick Mathewson authored
      In C, we technically aren't supposed to define our own things that
      start with an underscore.
      
      This is a purely machine-generated commit.  First, I ran this script
      on all the headers in src/{common,or,test,tools/*}/*.h :
      ==============================
      
      use strict;
      
      my %macros = ();
      my %skipped = ();
      FILE: for my $fn (@ARGV) {
          my $f = $fn;
          if ($fn !~ /^\.\//) {
      	$f = "./$fn";
          }
          $skipped{$fn} = 0;
          open(F, $fn);
          while (<F>) {
      	if (/^#ifndef ([A-Za-z0-9_]+)/) {
      	    $macros{$fn} = $1;
      	    next FILE;
      	}
          }
      }
      
      print "#!/usr/bin/perl -w -i -p\n\n";
      for my $fn (@ARGV) {
          if (! exists $macros{$fn}) {
      	print "# No macro known for $fn!\n" if (!$skipped{$fn});
      	next;
          }
          if ($macros{$fn} !~ /_H_?$/) {
      	print "# Weird macro for $fn...\n";
          }
          my $goodmacro = uc $fn;
          $goodmacro =~ s#.*/##;
          $goodmacro =~ s#[\/\-\.]#_#g;
          print "s/(?<![A-Za-z0-9_])$macros{$fn}(?![A-Za-z0-9_])/TOR_${goodmacro}/g;\n"
      }
      ==============================
      
      It produced the following output, which I then re-ran on those same files:
      
      ==============================
      
      s/(?<![A-Za-z0-9_])_TOR_ADDRESS_H(?![A-Za-z0-9_])/TOR_ADDRESS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_AES_H(?![A-Za-z0-9_])/TOR_AES_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMPAT_H(?![A-Za-z0-9_])/TOR_COMPAT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMPAT_LIBEVENT_H(?![A-Za-z0-9_])/TOR_COMPAT_LIBEVENT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONTAINER_H(?![A-Za-z0-9_])/TOR_CONTAINER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CRYPTO_H(?![A-Za-z0-9_])/TOR_CRYPTO_H/g;
      s/(?<![A-Za-z0-9_])TOR_DI_OPS_H(?![A-Za-z0-9_])/TOR_DI_OPS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MEMAREA_H(?![A-Za-z0-9_])/TOR_MEMAREA_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MEMPOOL_H(?![A-Za-z0-9_])/TOR_MEMPOOL_H/g;
      s/(?<![A-Za-z0-9_])TOR_PROCMON_H(?![A-Za-z0-9_])/TOR_PROCMON_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORGZIP_H(?![A-Za-z0-9_])/TOR_TORGZIP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORINT_H(?![A-Za-z0-9_])/TOR_TORINT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_LOG_H(?![A-Za-z0-9_])/TOR_TORLOG_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TORTLS_H(?![A-Za-z0-9_])/TOR_TORTLS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_UTIL_H(?![A-Za-z0-9_])/TOR_UTIL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_BUFFERS_H(?![A-Za-z0-9_])/TOR_BUFFERS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CHANNEL_H(?![A-Za-z0-9_])/TOR_CHANNEL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CHANNEL_TLS_H(?![A-Za-z0-9_])/TOR_CHANNELTLS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITBUILD_H(?![A-Za-z0-9_])/TOR_CIRCUITBUILD_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITLIST_H(?![A-Za-z0-9_])/TOR_CIRCUITLIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_EWMA_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_EWMA_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITMUX_H(?![A-Za-z0-9_])/TOR_CIRCUITMUX_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CIRCUITUSE_H(?![A-Za-z0-9_])/TOR_CIRCUITUSE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_COMMAND_H(?![A-Za-z0-9_])/TOR_COMMAND_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONFIG_H(?![A-Za-z0-9_])/TOR_CONFIG_H/g;
      s/(?<![A-Za-z0-9_])TOR_CONFPARSE_H(?![A-Za-z0-9_])/TOR_CONFPARSE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_EDGE_H(?![A-Za-z0-9_])/TOR_CONNECTION_EDGE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_H(?![A-Za-z0-9_])/TOR_CONNECTION_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONNECTION_OR_H(?![A-Za-z0-9_])/TOR_CONNECTION_OR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CONTROL_H(?![A-Za-z0-9_])/TOR_CONTROL_H/g;
      s/(?<![A-Za-z0-9_])_TOR_CPUWORKER_H(?![A-Za-z0-9_])/TOR_CPUWORKER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRECTORY_H(?![A-Za-z0-9_])/TOR_DIRECTORY_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRSERV_H(?![A-Za-z0-9_])/TOR_DIRSERV_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DIRVOTE_H(?![A-Za-z0-9_])/TOR_DIRVOTE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DNS_H(?![A-Za-z0-9_])/TOR_DNS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_DNSSERV_H(?![A-Za-z0-9_])/TOR_DNSSERV_H/g;
      s/(?<![A-Za-z0-9_])TOR_EVENTDNS_TOR_H(?![A-Za-z0-9_])/TOR_EVENTDNS_TOR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_GEOIP_H(?![A-Za-z0-9_])/TOR_GEOIP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_HIBERNATE_H(?![A-Za-z0-9_])/TOR_HIBERNATE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MAIN_H(?![A-Za-z0-9_])/TOR_MAIN_H/g;
      s/(?<![A-Za-z0-9_])_TOR_MICRODESC_H(?![A-Za-z0-9_])/TOR_MICRODESC_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NETWORKSTATUS_H(?![A-Za-z0-9_])/TOR_NETWORKSTATUS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NODELIST_H(?![A-Za-z0-9_])/TOR_NODELIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_NTMAIN_H(?![A-Za-z0-9_])/TOR_NTMAIN_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ONION_H(?![A-Za-z0-9_])/TOR_ONION_H/g;
      s/(?<![A-Za-z0-9_])_TOR_OR_H(?![A-Za-z0-9_])/TOR_OR_H/g;
      s/(?<![A-Za-z0-9_])_TOR_POLICIES_H(?![A-Za-z0-9_])/TOR_POLICIES_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REASONS_H(?![A-Za-z0-9_])/TOR_REASONS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RELAY_H(?![A-Za-z0-9_])/TOR_RELAY_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDCLIENT_H(?![A-Za-z0-9_])/TOR_RENDCLIENT_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDCOMMON_H(?![A-Za-z0-9_])/TOR_RENDCOMMON_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDMID_H(?![A-Za-z0-9_])/TOR_RENDMID_H/g;
      s/(?<![A-Za-z0-9_])_TOR_RENDSERVICE_H(?![A-Za-z0-9_])/TOR_RENDSERVICE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REPHIST_H(?![A-Za-z0-9_])/TOR_REPHIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_REPLAYCACHE_H(?![A-Za-z0-9_])/TOR_REPLAYCACHE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTER_H(?![A-Za-z0-9_])/TOR_ROUTER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTERLIST_H(?![A-Za-z0-9_])/TOR_ROUTERLIST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_ROUTERPARSE_H(?![A-Za-z0-9_])/TOR_ROUTERPARSE_H/g;
      s/(?<![A-Za-z0-9_])TOR_ROUTERSET_H(?![A-Za-z0-9_])/TOR_ROUTERSET_H/g;
      s/(?<![A-Za-z0-9_])TOR_STATEFILE_H(?![A-Za-z0-9_])/TOR_STATEFILE_H/g;
      s/(?<![A-Za-z0-9_])_TOR_STATUS_H(?![A-Za-z0-9_])/TOR_STATUS_H/g;
      s/(?<![A-Za-z0-9_])TOR_TRANSPORTS_H(?![A-Za-z0-9_])/TOR_TRANSPORTS_H/g;
      s/(?<![A-Za-z0-9_])_TOR_TEST_H(?![A-Za-z0-9_])/TOR_TEST_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_NATPMP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_NATPMP_H/g;
      s/(?<![A-Za-z0-9_])_TOR_FW_HELPER_UPNP_H(?![A-Za-z0-9_])/TOR_TOR_FW_HELPER_UPNP_H/g;
      ==============================
      0cb921f3
Loading