Tor
0.4.7.0-alpha-dev
|
Header file for onion_fast.c. More...
Go to the source code of this file.
Data Structures | |
struct | fast_handshake_state_t |
Macros | |
#define | CREATE_FAST_LEN DIGEST_LEN |
#define | CREATED_FAST_LEN (DIGEST_LEN*2) |
#define | fast_handshake_state_free(st) FREE_AND_NULL(fast_handshake_state_t, fast_handshake_state_free_, (st)) |
Functions | |
void | fast_handshake_state_free_ (fast_handshake_state_t *victim) |
int | fast_onionskin_create (fast_handshake_state_t **handshake_state_out, uint8_t *handshake_out) |
int | fast_server_handshake (const uint8_t *message_in, uint8_t *handshake_reply_out, uint8_t *key_out, size_t key_out_len) |
int | fast_client_handshake (const fast_handshake_state_t *handshake_state, const uint8_t *handshake_reply_out, uint8_t *key_out, size_t key_out_len, const char **msg_out) |
Header file for onion_fast.c.
Definition in file onion_fast.h.
int fast_client_handshake | ( | const fast_handshake_state_t * | handshake_state, |
const uint8_t * | handshake_reply_out, | ||
uint8_t * | key_out, | ||
size_t | key_out_len, | ||
const char ** | msg_out | ||
) |
Implement the second half of the client side of the CREATE_FAST handshake. We sent the server handshake_state ("x") already, and the server told us handshake_reply_out (y|H(x|y)). Make sure that the hash is correct, and generate key material in key_out. Return 0 on success, true on failure.
NOTE: The "CREATE_FAST" handshake path is distinguishable from regular "onionskin" handshakes, and is not secure if an adversary can see or modify the messages. Therefore, it should only be used by clients, and only as the first hop of a circuit (since the first hop is already authenticated and protected by TLS).
Definition at line 109 of file onion_fast.c.
void fast_handshake_state_free_ | ( | fast_handshake_state_t * | victim | ) |
Release all state held in victim.
Definition at line 38 of file onion_fast.c.
int fast_onionskin_create | ( | fast_handshake_state_t ** | handshake_state_out, |
uint8_t * | handshake_out | ||
) |
Create the state needed to perform a CREATE_FAST handshake. Return 0 on success, -1 on failure.
Definition at line 49 of file onion_fast.c.
int fast_server_handshake | ( | const uint8_t * | key_in, |
uint8_t * | handshake_reply_out, | ||
uint8_t * | key_out, | ||
size_t | key_out_len | ||
) |
Implement the server side of the CREATE_FAST abbreviated handshake. The client has provided DIGEST_LEN key bytes in key_in ("x"). We generate a reply of DIGEST_LEN*2 bytes in key_out, consisting of a new random "y", followed by H(x|y) to check for correctness. We set key_out_len bytes of key material in key_out. Return 0 on success, <0 on failure.
Definition at line 67 of file onion_fast.c.