Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
17
20
22 or_connection_t *conn,
23 const int authtype,
24 const struct ed25519_keypair_t *ed_signing_key,
25 int server);
26
27int authchallenge_type_is_supported(uint16_t challenge_type);
28int authchallenge_type_is_better(uint16_t challenge_type_a,
29 uint16_t challenge_type_b);
30
32 (or_connection_t *conn, int type));
33
34#ifdef TOR_UNIT_TESTS
35extern int certs_cell_ed25519_disabled_for_testing;
36#endif
37#else /* !defined(HAVE_MODULE_RELAY) */
38
39static inline int
41{
42 (void)conn;
44 return -1;
45}
46static inline int
48{
49 (void)conn;
51 return -1;
52}
53
54static inline var_cell_t *
56 or_connection_t *conn,
57 const int authtype,
58 const struct ed25519_keypair_t *ed_signing_key,
59 int server)
60{
61 (void)conn;
62 (void)authtype;
63 (void)ed_signing_key;
64 (void)server;
66 return NULL;
67}
68
69#define authchallenge_type_is_supported(t) (0)
70#define authchallenge_type_is_better(a, b) (0)
71
72static inline int
74{
75 (void)conn;
76 (void)type;
78 return -1;
79}
80
81#ifdef TOR_UNIT_TESTS
82extern int certs_cell_ed25519_disabled_for_testing;
83#endif
84
85#endif /* defined(HAVE_MODULE_RELAY) */
86
87#endif /* !defined(TOR_CORE_OR_RELAY_HANDSHAKE_H) */
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)
var_cell_t * connection_or_compute_authenticate_cell_body(or_connection_t *conn, const int authtype, const ed25519_keypair_t *ed_signing_key, int server)
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:177