Go to the documentation of this file.
38 #define P_KEY_ID_MASK 0x07
39 #define P_OPCODE_SHIFT 3
42 #define P_CONTROL_HARD_RESET_CLIENT_V1 1
43 #define P_CONTROL_HARD_RESET_SERVER_V1 2
44 #define P_CONTROL_SOFT_RESET_V1 3
45 #define P_CONTROL_V1 4
51 #define P_CONTROL_HARD_RESET_CLIENT_V2 7
52 #define P_CONTROL_HARD_RESET_SERVER_V2 8
55 #define P_CONTROL_HARD_RESET_CLIENT_V3 10
59 #define P_CONTROL_WKC_V1 11
64 #define P_FIRST_OPCODE 3
65 #define P_LAST_OPCODE 11
70 #define TLS_RELIABLE_N_SEND_BUFFERS 6
71 #define TLS_RELIABLE_N_REC_BUFFERS 12
154 const struct buffer *buf);
180 int handwindow,
int offset);
231 bool request_resend_wkc);
233 static inline const char *
239 return "P_CONTROL_HARD_RESET_CLIENT_V1";
242 return "P_CONTROL_HARD_RESET_SERVER_V1";
245 return "P_CONTROL_HARD_RESET_CLIENT_V2";
248 return "P_CONTROL_HARD_RESET_SERVER_V2";
251 return "P_CONTROL_HARD_RESET_CLIENT_V3";
254 return "P_CONTROL_SOFT_RESET_V1";
257 return "P_CONTROL_V1";
260 return "P_CONTROL_WKC_V1";
294 return &
session->tls_wrap_reneg;
307 #define EARLY_NEG_MASK 0xff000000
308 #define EARLY_NEG_START 0x0f000000
315 #define TLV_TYPE_EARLY_NEG_FLAGS 0x0001
316 #define EARLY_NEG_FLAG_RESEND_WKC 0x0001
@ VERDICT_VALID_RESET_V2
This packet is a valid reset packet from the peer (all but tls-crypt-v2)
struct buffer tls_reset_standalone(struct tls_wrap_ctx *ctx, struct tls_auth_standalone *tas, struct session_id *own_sid, struct session_id *remote_sid, uint8_t header, bool request_resend_wkc)
This function creates a reset packet using the information from the tls pre decrypt state.
hmac_ctx_t * session_id_hmac_init(void)
@ VERDICT_INVALID
the packet failed on of the various checks
mbedtls_md_context_t hmac_ctx_t
Generic HMAC context.
#define P_CONTROL_HARD_RESET_CLIENT_V1
#define P_CONTROL_HARD_RESET_CLIENT_V2
enum first_packet_verdict tls_pre_decrypt_lite(const struct tls_auth_standalone *tas, struct tls_pre_decrypt_state *state, const struct link_socket_actual *from, const struct buffer *buf)
Inspect an incoming packet for which no VPN tunnel is active, and determine whether a new VPN tunnel ...
@ VERDICT_VALID_CONTROL_V1
This packet is a valid control packet from the peer.
void free_tls_pre_decrypt_state(struct tls_pre_decrypt_state *state)
@ TLS_WRAP_CRYPT
Control channel encryption and authentication.
Packet geometry parameters.
struct session_id server_session_id
Security parameter state of one TLS and data channel key session.
struct tls_wrap_ctx tls_wrap_tmp
void write_control_auth(struct tls_session *session, struct key_state *ks, struct buffer *buf, struct link_socket_actual **to_link_addr, int opcode, int max_ack, bool prepend_ack)
#define P_CONTROL_HARD_RESET_CLIENT_V3
#define P_CONTROL_SOFT_RESET_V1
struct session_id peer_session_id
bool read_control_auth(struct buffer *buf, struct tls_wrap_ctx *ctx, const struct link_socket_actual *from, const struct tls_options *opt)
Control channel wrapping (–tls-auth/–tls-crypt) context.
struct that stores the temporary data for the tls lite decrypt functions
struct session_id calculate_session_id_hmac(struct session_id client_sid, const struct openvpn_sockaddr *from, hmac_ctx_t *hmac, int handwindow, int offset)
Calculates the HMAC based server session id based on a client session id and socket addr.
Wrapper structure for dynamically allocated memory.
bool check_session_id_hmac(struct tls_pre_decrypt_state *state, const struct openvpn_sockaddr *from, hmac_ctx_t *hmac, int handwindow)
Checks if a control packet has a correct HMAC server session id.
Security parameter state of a single session within a VPN tunnel.
struct tls_wrap_ctx tls_wrap
@ VERDICT_VALID_RESET_V3
This is a valid v3 reset (tls-crypt-v2)
static struct tls_wrap_ctx * tls_session_get_tls_wrap(struct tls_session *session, int key_id)
Determines if the current session should use the renegotiation tls wrap struct instead the normal one...
#define P_CONTROL_HARD_RESET_SERVER_V1
@ VERDICT_VALID_ACK_V1
This packet is a valid ACK control packet from the peer, i.e.
@ VERDICT_VALID_WKC_V1
The packet is a valid control packet with appended wrapped client key.
#define P_CONTROL_HARD_RESET_SERVER_V2
static const char * packet_opcode_name(int op)