Go to the documentation of this file.
89 #define TLS_CRYPT_TAG_SIZE (256/8)
90 #define TLS_CRYPT_PID_SIZE (sizeof(packet_id_type) + sizeof(net_time_t))
91 #define TLS_CRYPT_BLOCK_SIZE (128/8)
93 #define TLS_CRYPT_OFF_PID (1 + SID_SIZE)
94 #define TLS_CRYPT_OFF_TAG (TLS_CRYPT_OFF_PID + TLS_CRYPT_PID_SIZE)
95 #define TLS_CRYPT_OFF_CT (TLS_CRYPT_OFF_TAG + TLS_CRYPT_TAG_SIZE)
97 #define TLS_CRYPT_V2_MAX_WKC_LEN (1024)
98 #define TLS_CRYPT_V2_CLIENT_KEY_LEN (2048 / 8)
99 #define TLS_CRYPT_V2_SERVER_KEY_LEN (sizeof(struct key))
100 #define TLS_CRYPT_V2_TAG_SIZE (TLS_CRYPT_TAG_SIZE)
101 #define TLS_CRYPT_V2_MAX_METADATA_LEN (unsigned)(TLS_CRYPT_V2_MAX_WKC_LEN \
102 - (TLS_CRYPT_V2_CLIENT_KEY_LEN + TLS_CRYPT_V2_TAG_SIZE \
117 const char *key_file,
bool key_inline,
bool tls_server);
180 const char *key_file,
bool key_inline);
198 struct key2 *original_key,
199 struct buffer *wrapped_key_buf,
200 const char *key_file,
bool key_inline);
234 const char *b64_metadata,
235 const char *key_file,
bool key_inline);
void tls_crypt_v2_init_server_key(struct key_ctx *key_ctx, bool encrypt, const char *key_file, bool key_inline)
Initialize a tls-crypt-v2 server key (used to encrypt/decrypt client keys).
bool tls_crypt_unwrap(const struct buffer *src, struct buffer *dst, struct crypto_options *opt)
Unwrap a control channel packet (decrypts, authenticates and performs replay checks).
void tls_crypt_v2_init_client_key(struct key_ctx_bi *key, struct key2 *original_key, struct buffer *wrapped_key_buf, const char *key_file, bool key_inline)
Initialize a tls-crypt-v2 client key.
void tls_crypt_v2_write_client_key_file(const char *filename, const char *b64_metadata, const char *key_file, bool key_inline)
Generate a tls-crypt-v2 client key, and write to file.
int tls_crypt_buf_overhead(void)
Returns the maximum overhead (in bytes) added to the destination buffer by tls_crypt_wrap().
Security parameter state for a single VPN tunnel.
Container for unidirectional cipher and HMAC key material.
Container for two sets of OpenSSL cipher and/or HMAC contexts for both sending and receiving directio...
Control channel wrapping (–tls-auth/–tls-crypt) context.
bool tls_crypt_wrap(const struct buffer *src, struct buffer *dst, struct crypto_options *opt)
Wrap a control channel packet (both authenticates and encrypts the data).
Container for one set of cipher and/or HMAC contexts.
void tls_crypt_init_key(struct key_ctx_bi *key, struct key2 *keydata, const char *key_file, bool key_inline, bool tls_server)
Initialize a key_ctx_bi structure for use with –tls-crypt.
Wrapper structure for dynamically allocated memory.
Security parameter state of a single session within a VPN tunnel.
bool tls_crypt_v2_extract_client_key(struct buffer *buf, struct tls_wrap_ctx *ctx, const struct tls_options *opt)
Extract a tls-crypt-v2 client key from a P_CONTROL_HARD_RESET_CLIENT_V3 message, and load the key int...
Container for bidirectional cipher and HMAC key material.
bool tls_session_generate_dynamic_tls_crypt_key(struct tls_multi *multi, struct tls_session *session)
Generates a TLS-Crypt key to be used with dynamic tls-crypt using the TLS EKM exporter function.
Security parameter state for processing data channel packets.
void tls_crypt_v2_write_server_key_file(const char *filename)
Generate a tls-crypt-v2 server key, and write to file.