Tor  0.4.7.0-alpha-dev
relay_handshake.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file relay_handshake.h
9  * @brief Header for feature/relay/relay_handshake.c
10  **/
11 
12 #ifndef TOR_CORE_OR_RELAY_HANDSHAKE_H
13 #define TOR_CORE_OR_RELAY_HANDSHAKE_H
14 
15 #ifdef HAVE_MODULE_RELAY
16 struct ed25519_keypair_t;
17 
20 
22  or_connection_t *conn,
23  const int authtype,
24  crypto_pk_t *signing_key,
25  const struct ed25519_keypair_t *ed_signing_key,
26  int server);
27 
28 int authchallenge_type_is_supported(uint16_t challenge_type);
29 int authchallenge_type_is_better(uint16_t challenge_type_a,
30  uint16_t challenge_type_b);
31 
33  (or_connection_t *conn, int type));
34 
35 #ifdef TOR_UNIT_TESTS
36 extern int certs_cell_ed25519_disabled_for_testing;
37 #endif
38 #else /* !defined(HAVE_MODULE_RELAY) */
39 
40 static inline int
42 {
43  (void)conn;
45  return -1;
46 }
47 static inline int
49 {
50  (void)conn;
52  return -1;
53 }
54 
55 static inline var_cell_t *
57  or_connection_t *conn,
58  const int authtype,
59  crypto_pk_t *signing_key,
60  const struct ed25519_keypair_t *ed_signing_key,
61  int server)
62 {
63  (void)conn;
64  (void)authtype;
65  (void)signing_key;
66  (void)ed_signing_key;
67  (void)server;
69  return NULL;
70 }
71 
72 #define authchallenge_type_is_supported(t) (0)
73 #define authchallenge_type_is_better(a, b) (0)
74 
75 static inline int
77 {
78  (void)conn;
79  (void)type;
81  return -1;
82 }
83 
84 #ifdef TOR_UNIT_TESTS
85 extern int certs_cell_ed25519_disabled_for_testing;
86 #endif
87 
88 #endif /* defined(HAVE_MODULE_RELAY) */
89 
90 #endif /* !defined(TOR_CORE_OR_RELAY_HANDSHAKE_H) */
var_cell_t * connection_or_compute_authenticate_cell_body(or_connection_t *conn, const int authtype, crypto_pk_t *signing_key, const ed25519_keypair_t *ed_signing_key, int server)
int authchallenge_type_is_better(uint16_t challenge_type_a, uint16_t challenge_type_b)
int connection_or_send_certs_cell(or_connection_t *conn)
int authchallenge_type_is_supported(uint16_t challenge_type)
int connection_or_send_authenticate_cell(or_connection_t *conn, int authtype)
int connection_or_send_auth_challenge_cell(or_connection_t *conn)
#define MOCK_DECL(rv, funcname, arglist)
Definition: testsupport.h:127
#define tor_assert_nonfatal_unreached()
Definition: util_bug.h:176