]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'ntor-resquashed'
authorNick Mathewson <nickm@torproject.org>
Thu, 3 Jan 2013 16:52:41 +0000 (11:52 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 3 Jan 2013 16:52:41 +0000 (11:52 -0500)
Conflicts:
src/or/cpuworker.c
src/or/or.h
src/test/bench.c

24 files changed:
1  2 
configure.ac
doc/tor.1.txt
src/common/crypto.c
src/or/circuitbuild.c
src/or/circuitbuild.h
src/or/circuitlist.c
src/or/circuituse.c
src/or/config.c
src/or/dirserv.c
src/or/dirvote.c
src/or/entrynodes.c
src/or/microdesc.c
src/or/nodelist.c
src/or/or.h
src/or/relay.c
src/or/rendclient.c
src/or/rendservice.c
src/or/router.c
src/or/routerlist.c
src/or/routerparse.c
src/test/bench.c
src/test/test_containers.c
src/test/test_crypto.c
src/test/test_util.c

diff --cc configure.ac
Simple merge
diff --cc doc/tor.1.txt
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc src/or/config.c
index 60866218c50bcc956537ea6dedf35e8bbdfd8068,979d09c7cd13ee7526aac467a9247820aa52bfcb..9905a94fda67687e4a9931cb08fb5d32de311521
@@@ -388,8 -382,8 +388,9 @@@ static config_var_t option_vars_[] = 
    V(UpdateBridgesFromAuthority,  BOOL,     "0"),
    V(UseBridges,                  BOOL,     "0"),
    V(UseEntryGuards,              BOOL,     "1"),
 +  V(UseEntryGuardsAsDirGuards,   BOOL,     "1"),
    V(UseMicrodescriptors,         AUTOBOOL, "auto"),
+   V(UseNTorHandshake,            AUTOBOOL, "auto"),
    V(User,                        STRING,   NULL),
    V(UserspaceIOCPBuffers,        BOOL,     "0"),
    VAR("V1AuthoritativeDirectory",BOOL, V1AuthoritativeDir,   "0"),
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc src/or/or.h
index bc2cdae6fee58036969302105fca6c4f8113ca1a,b5718a83dc50705d5034169eb74f895e9837839c..7b8ff705a41b92a5ff33b6f403380fbd3f7af118
@@@ -2553,10 -2534,22 +2570,24 @@@ typedef enum 
    MICRODESC_DIRINFO=1 << 6,
  } dirinfo_type_t;
  
 +#define ALL_DIRINFO ((dirinfo_type_t)((1<<7)-1))
 +
  #define CRYPT_PATH_MAGIC 0x70127012u
  
+ struct fast_handshake_state_t;
+ struct ntor_handshake_state_t;
+ #define ONION_HANDSHAKE_TYPE_TAP 0x0000
+ #define ONION_HANDSHAKE_TYPE_FAST 0x0001
+ #define ONION_HANDSHAKE_TYPE_NTOR 0x0002
+ typedef struct {
+   uint16_t tag;
+   union {
+     struct fast_handshake_state_t *fast;
+     crypto_dh_t *tap;
+     struct ntor_handshake_state_t *ntor;
+   } u;
+ } onion_handshake_state_t;
  /** Holds accounting information for a single step in the layered encryption
   * performed by a circuit.  Used only at the client edge of a circuit. */
  typedef struct crypt_path_t {
@@@ -2735,26 -2724,13 +2762,24 @@@ typedef struct circuit_t 
     * more. */
    int deliver_window;
  
-   /** For storage while n_chan is pending
-     * (state CIRCUIT_STATE_CHAN_WAIT). When defined, it is always
-     * length ONIONSKIN_CHALLENGE_LEN. */
-   char *n_chan_onionskin;
+   /** For storage while n_chan is pending (state CIRCUIT_STATE_CHAN_WAIT). */
+   struct create_cell_t *n_chan_create_cell;
  
 -  /** When was this circuit created?  We keep this timestamp with a higher
 -   * resolution than most so that the circuit-build-time tracking code can
 -   * get millisecond resolution. */
 +  /** When did circuit construction actually begin (ie send the
 +   * CREATE cell or begin cannibalization).
 +   *
 +   * Note: This timer will get reset if we decide to cannibalize
 +   * a circuit. It may also get reset during certain phases of hidden
 +   * service circuit use.
 +   *
 +   * We keep this timestamp with a higher resolution than most so that the
 +   * circuit-build-time tracking code can get millisecond resolution.
 +   */
 +  struct timeval timestamp_began;
 +
 +  /** This timestamp marks when the init_circuit_base constructor ran. */
    struct timeval timestamp_created;
 +
    /** When the circuit was first used, or 0 if the circuit is clean.
     *
     * XXXX023 Note that some code will artifically adjust this value backward
@@@ -3875,8 -3802,8 +3901,10 @@@ typedef struct 
  
    int IPv6Exit; /**< Do we support exiting to IPv6 addresses? */
  
 +  char *TLSECGroup; /**< One of "P256", "P224", or nil for auto */
 +
+   /** Autobool: should we use the ntor handshake if we can? */
+   int UseNTorHandshake;
  } or_options_t;
  
  /** Persistent state for an onion router, as saved to disk. */
diff --cc src/or/relay.c
Simple merge
Simple merge
index e70f969e8f74b9b1d307cadbd511fba9556c5ce3,4f3fdf45ed7b6ae9f303bcba019db347b26441dc..fc76f5654a82d7ea4466eed23ff0662c0568a84a
@@@ -1382,11 -1382,8 +1382,11 @@@ rend_service_introduce(origin_circuit_
    dh = NULL;
    if (circuit_init_cpath_crypto(cpath,keys+DIGEST_LEN,1)<0)
      goto err;
-   memcpy(cpath->handshake_digest, keys, DIGEST_LEN);
+   memcpy(cpath->rend_circ_nonce, keys, DIGEST_LEN);
  
 +  /* For path bias: This intro circuit was used successfully */
 +  circuit->path_state = PATH_STATE_USE_SUCCEEDED;
 +
    goto done;
  
   log_error:
diff --cc src/or/router.c
Simple merge
Simple merge
Simple merge
index da1ae9bc5d964f12faf8f0caa0ed2daca4ede01f,2c40cdf4dc5460092bb6f04298e6c6e4763b8207..8b91b07a479ac86e1cd58d6a8786183cf0558975
@@@ -15,17 -15,15 +15,23 @@@ const char tor_git_revision[] = ""
  #include "orconfig.h"
  
  #define RELAY_PRIVATE
+ #define CONFIG_PRIVATE
  
  #include "or.h"
+ #include "onion_tap.h"
  #include "relay.h"
- #if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,0,0)
 +#include <openssl/opensslv.h>
 +#include <openssl/evp.h>
 +#ifndef OPENSSL_NO_EC
 +#include <openssl/ec.h>
 +#include <openssl/ecdh.h>
 +#include <openssl/obj_mac.h>
 +#endif
++
+ #include "config.h"
+ #ifdef CURVE25519_ENABLED
+ #include "crypto_curve25519.h"
+ #include "onion_ntor.h"
  #endif
  
  #if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID)
@@@ -355,13 -387,12 +480,17 @@@ typedef struct benchmark_t 
  static struct benchmark_t benchmarks[] = {
    ENT(dmap),
    ENT(aes),
+   ENT(onion_TAP),
+ #ifdef CURVE25519_ENABLED
+   ENT(onion_ntor),
+ #endif
    ENT(cell_aes),
    ENT(cell_ops),
 +  ENT(dh),
 +#ifdef HAVE_EC_BENCHMARKS
 +  ENT(ecdh_p256),
 +  ENT(ecdh_p224),
 +#endif
    {NULL,NULL,0}
  };
  
Simple merge
Simple merge
Simple merge