Commit baaabb50 authored by Nick Mathewson's avatar Nick Mathewson 🥔 Committed by Mike Perry
Browse files

Use protover to signal support for ntor3 + congestion control.

parent bd2e9a44
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2462,7 +2462,8 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
                                          digest,
                                          NULL, /* Ed25519 ID */
                                          NULL, NULL, /* onion keys */
                                          &addr, conn->socks_request->port);
                                          &addr, conn->socks_request->port,
                                          NULL);
          } else { /* ! (want_onehop && conn->chosen_exit_name[0] == '$') */
            /* We will need an onion key for the router, and we
             * don't have one. Refuse or relax requirements. */
+10 −4
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ extend_info_new(const char *nickname,
                const ed25519_public_key_t *ed_id,
                crypto_pk_t *onion_key,
                const curve25519_public_key_t *ntor_key,
                const tor_addr_t *addr, uint16_t port)
                const tor_addr_t *addr, uint16_t port,
                const protover_summary_flags_t *pv)
{
  extend_info_t *info = tor_malloc_zero(sizeof(extend_info_t));
  if (rsa_id_digest)
@@ -57,7 +58,10 @@ extend_info_new(const char *nickname,
    extend_info_add_orport(info, addr, port);
  }

  info->supports_ntor3_and_param_negotiation = false; // TODO: set this.
  if (pv) {
    info->supports_ntor3_and_param_negotiation =
      pv->supports_ntor3_and_param_negotiation;
  }

  return info;
}
@@ -152,7 +156,8 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
                           rsa_pubkey,
                           curve_pubkey,
                           &ap.addr,
                           ap.port);
                           ap.port,
                           &node->ri->pv);
  } else if (valid_addr && node->rs && node->md) {
    info = extend_info_new(node->rs->nickname,
                           node->identity,
@@ -160,7 +165,8 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
                           rsa_pubkey,
                           curve_pubkey,
                           &ap.addr,
                           ap.port);
                           ap.port,
                           &node->rs->pv);
  }

  crypto_pk_free(rsa_pubkey);
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@ extend_info_t *extend_info_new(const char *nickname,
                               const struct ed25519_public_key_t *ed_id,
                               crypto_pk_t *onion_key,
                               const struct curve25519_public_key_t *ntor_key,
                               const tor_addr_t *addr, uint16_t port);
                               const tor_addr_t *addr, uint16_t port,
                               const struct protover_summary_flags_t *pv);
extend_info_t *extend_info_from_node(const node_t *r, int for_direct_connect);
extend_info_t *extend_info_dup(extend_info_t *info);
void extend_info_free_(extend_info_t *info);
+4 −0
Original line number Diff line number Diff line
@@ -732,6 +732,10 @@ typedef struct protover_summary_flags_t {
   * negotiate hs circuit setup padding. Requires Padding=2. */
  unsigned int supports_hs_setup_padding : 1;

  /** True iff this router supports ntor3 _and_ supports negotiating
   * additional circuit parameters via the handshake used in ntor3.
   */
  unsigned int supports_ntor3_and_param_negotiation : 1;
} protover_summary_flags_t;

typedef struct routerinfo_t routerinfo_t;
+2 −0
Original line number Diff line number Diff line
@@ -430,6 +430,8 @@ protover_get_supported_protocols(void)
   * XXX: WARNING!
   */

  /* TODO: Add a new Relay=* and a new FlowCtrl=* version to indicate support
   * for Ntorv3 and prop324.  Make sure they get into the spec. */
  return
    "Cons=1-2 "
    "Desc=1-2 "
Loading