FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
quic_crypto.c File Reference
+ Include dependency graph for quic_crypto.c:

Go to the source code of this file.

Data Structures

struct  cipher_context_t
 
struct  aead_crypto_context_t
 

Macros

#define QUICLY_EPOCH_1RTT   3
 

Functions

quic_ctx_tquic_get_conn_ctx (quicly_conn_t *conn)
 
static int quic_crypto_setup_cipher (quicly_crypto_engine_t *engine, quicly_conn_t *conn, size_t epoch, int is_enc, ptls_cipher_context_t **header_protect_ctx, ptls_aead_context_t **packet_protect_ctx, ptls_aead_algorithm_t *aead, ptls_hash_algorithm_t *hash, const void *secret)
 
static size_t quic_crypto_aead_decrypt (quic_ctx_t *qctx, ptls_aead_context_t *_ctx, void *_output, const void *input, size_t inlen, uint64_t decrypted_pn, const void *aad, size_t aadlen)
 
void quic_crypto_decrypt_packet (quic_ctx_t *qctx, quic_rx_packet_ctx_t *pctx)
 
void quic_crypto_encrypt_packet (struct st_quicly_crypto_engine_t *engine, quicly_conn_t *conn, ptls_cipher_context_t *header_protect_ctx, ptls_aead_context_t *packet_protect_ctx, ptls_iovec_t datagram, size_t first_byte_at, size_t payload_from, uint64_t packet_number, int coalesced)
 
static int quic_crypto_cipher_setup_crypto (ptls_cipher_context_t *_ctx, int is_enc, const void *key, const EVP_CIPHER *cipher)
 
static int quic_crypto_aes128ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
static int quic_crypto_aes256ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
static int quic_crypto_aead_setup_crypto (ptls_aead_context_t *_ctx, int is_enc, const void *key, const void *iv, const EVP_CIPHER *cipher)
 
static int quic_crypto_aead_aes128gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
 
static int quic_crypto_aead_aes256gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
 
int quic_encrypt_ticket_cb (ptls_encrypt_ticket_t *_self, ptls_t *tls, int is_encrypt, ptls_buffer_t *dst, ptls_iovec_t src)
 

Variables

quic_main_t quic_main
 
vnet_crypto_main_tcm = &crypto_main
 
ptls_cipher_algorithm_t quic_crypto_aes128ctr
 
ptls_cipher_algorithm_t quic_crypto_aes256ctr
 
ptls_aead_algorithm_t quic_crypto_aes128gcm
 
ptls_aead_algorithm_t quic_crypto_aes256gcm
 
ptls_cipher_suite_t quic_crypto_aes128gcmsha256
 
ptls_cipher_suite_t quic_crypto_aes256gcmsha384
 
ptls_cipher_suite_t * quic_crypto_cipher_suites []
 
quicly_crypto_engine_t quic_crypto_engine
 

Macro Definition Documentation

◆ QUICLY_EPOCH_1RTT

#define QUICLY_EPOCH_1RTT   3

Definition at line 22 of file quic_crypto.c.

Function Documentation

◆ quic_crypto_aead_aes128gcm_setup_crypto()

static int quic_crypto_aead_aes128gcm_setup_crypto ( ptls_aead_context_t *  ctx,
int  is_enc,
const void *  key,
const void *  iv 
)
static

Definition at line 396 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aead_aes256gcm_setup_crypto()

static int quic_crypto_aead_aes256gcm_setup_crypto ( ptls_aead_context_t *  ctx,
int  is_enc,
const void *  key,
const void *  iv 
)
static

Definition at line 404 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aead_decrypt()

static size_t quic_crypto_aead_decrypt ( quic_ctx_t qctx,
ptls_aead_context_t *  _ctx,
void *  _output,
const void *  input,
size_t  inlen,
uint64_t  decrypted_pn,
const void *  aad,
size_t  aadlen 
)
static

Definition at line 118 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quic_crypto_aead_setup_crypto()

static int quic_crypto_aead_setup_crypto ( ptls_aead_context_t *  _ctx,
int  is_enc,
const void *  key,
const void *  iv,
const EVP_CIPHER *  cipher 
)
static

Definition at line 353 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quic_crypto_aes128ctr_setup_crypto()

static int quic_crypto_aes128ctr_setup_crypto ( ptls_cipher_context_t *  ctx,
int  is_enc,
const void *  key 
)
static

Definition at line 339 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aes256ctr_setup_crypto()

static int quic_crypto_aes256ctr_setup_crypto ( ptls_cipher_context_t *  ctx,
int  is_enc,
const void *  key 
)
static

Definition at line 346 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_cipher_setup_crypto()

static int quic_crypto_cipher_setup_crypto ( ptls_cipher_context_t *  _ctx,
int  is_enc,
const void *  key,
const EVP_CIPHER *  cipher 
)
static

Definition at line 299 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quic_crypto_decrypt_packet()

void quic_crypto_decrypt_packet ( quic_ctx_t qctx,
quic_rx_packet_ctx_t pctx 
)

Definition at line 146 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quic_crypto_encrypt_packet()

void quic_crypto_encrypt_packet ( struct st_quicly_crypto_engine_t *  engine,
quicly_conn_t *  conn,
ptls_cipher_context_t *  header_protect_ctx,
ptls_aead_context_t *  packet_protect_ctx,
ptls_iovec_t  datagram,
size_t  first_byte_at,
size_t  payload_from,
uint64_t  packet_number,
int  coalesced 
)

Definition at line 234 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_setup_cipher()

static int quic_crypto_setup_cipher ( quicly_crypto_engine_t *  engine,
quicly_conn_t *  conn,
size_t  epoch,
int  is_enc,
ptls_cipher_context_t **  header_protect_ctx,
ptls_aead_context_t **  packet_protect_ctx,
ptls_aead_algorithm_t *  aead,
ptls_hash_algorithm_t *  hash,
const void *  secret 
)
static

Definition at line 48 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_encrypt_ticket_cb()

int quic_encrypt_ticket_cb ( ptls_encrypt_ticket_t *  _self,
ptls_t *  tls,
int  is_encrypt,
ptls_buffer_t *  dst,
ptls_iovec_t  src 
)

Definition at line 412 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quic_get_conn_ctx()

quic_ctx_t* quic_get_conn_ctx ( quicly_conn_t *  conn)

Definition at line 427 of file quic.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ cm

Definition at line 26 of file quic_crypto.c.

◆ quic_crypto_aes128ctr

ptls_cipher_algorithm_t quic_crypto_aes128ctr
Initial value:
= {
"AES128-CTR",
PTLS_AES128_KEY_SIZE,
1,
PTLS_AES_IV_SIZE,
sizeof (struct cipher_context_t),
}

Definition at line 454 of file quic_crypto.c.

◆ quic_crypto_aes128gcm

ptls_aead_algorithm_t quic_crypto_aes128gcm
Initial value:
= {
"AES128-GCM",
PTLS_AESGCM_CONFIDENTIALITY_LIMIT,
PTLS_AESGCM_INTEGRITY_LIMIT,
&ptls_openssl_aes128ecb,
PTLS_AES128_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct aead_crypto_context_t),
}

Definition at line 472 of file quic_crypto.c.

◆ quic_crypto_aes128gcmsha256

ptls_cipher_suite_t quic_crypto_aes128gcmsha256
Initial value:
= {
PTLS_CIPHER_SUITE_AES_128_GCM_SHA256,
&quic_crypto_aes128gcm, &ptls_openssl_sha256
}

Definition at line 498 of file quic_crypto.c.

◆ quic_crypto_aes256ctr

ptls_cipher_algorithm_t quic_crypto_aes256ctr
Initial value:
= {
"AES256-CTR",
PTLS_AES256_KEY_SIZE,
1 ,
PTLS_AES_IV_SIZE,
sizeof (struct cipher_context_t),
}

Definition at line 463 of file quic_crypto.c.

◆ quic_crypto_aes256gcm

ptls_aead_algorithm_t quic_crypto_aes256gcm
Initial value:
= {
"AES256-GCM",
PTLS_AESGCM_CONFIDENTIALITY_LIMIT,
PTLS_AESGCM_INTEGRITY_LIMIT,
&ptls_openssl_aes256ecb,
PTLS_AES256_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct aead_crypto_context_t),
}

Definition at line 485 of file quic_crypto.c.

◆ quic_crypto_aes256gcmsha384

ptls_cipher_suite_t quic_crypto_aes256gcmsha384
Initial value:
= {
PTLS_CIPHER_SUITE_AES_256_GCM_SHA384,
&quic_crypto_aes256gcm, &ptls_openssl_sha384
}

Definition at line 503 of file quic_crypto.c.

◆ quic_crypto_cipher_suites

ptls_cipher_suite_t* quic_crypto_cipher_suites[]
Initial value:

Definition at line 508 of file quic_crypto.c.

◆ quic_crypto_engine

quicly_crypto_engine_t quic_crypto_engine
Initial value:

Definition at line 512 of file quic_crypto.c.

◆ quic_main

quic_main_t quic_main

Definition at line 46 of file quic.c.

quic_crypto_aes128gcm
ptls_aead_algorithm_t quic_crypto_aes128gcm
Definition: quic_crypto.c:472
quic_crypto_aes256ctr_setup_crypto
static int quic_crypto_aes256ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:346
quic_crypto_aes256gcmsha384
ptls_cipher_suite_t quic_crypto_aes256gcmsha384
Definition: quic_crypto.c:503
quic_crypto_aes256ctr
ptls_cipher_algorithm_t quic_crypto_aes256ctr
Definition: quic_crypto.c:463
quic_crypto_aes128ctr_setup_crypto
static int quic_crypto_aes128ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:339
quic_crypto_aes128ctr
ptls_cipher_algorithm_t quic_crypto_aes128ctr
Definition: quic_crypto.c:454
quic_crypto_setup_cipher
static int quic_crypto_setup_cipher(quicly_crypto_engine_t *engine, quicly_conn_t *conn, size_t epoch, int is_enc, ptls_cipher_context_t **header_protect_ctx, ptls_aead_context_t **packet_protect_ctx, ptls_aead_algorithm_t *aead, ptls_hash_algorithm_t *hash, const void *secret)
Definition: quic_crypto.c:48
quic_crypto_aead_aes128gcm_setup_crypto
static int quic_crypto_aead_aes128gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
Definition: quic_crypto.c:396
aead_crypto_context_t
Definition: quic_crypto.c:36
cipher_context_t
Definition: quic_crypto.c:28
quic_crypto_aes256gcm
ptls_aead_algorithm_t quic_crypto_aes256gcm
Definition: quic_crypto.c:485
quic_crypto_aead_aes256gcm_setup_crypto
static int quic_crypto_aead_aes256gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
Definition: quic_crypto.c:404
quic_crypto_encrypt_packet
void quic_crypto_encrypt_packet(struct st_quicly_crypto_engine_t *engine, quicly_conn_t *conn, ptls_cipher_context_t *header_protect_ctx, ptls_aead_context_t *packet_protect_ctx, ptls_iovec_t datagram, size_t first_byte_at, size_t payload_from, uint64_t packet_number, int coalesced)
Definition: quic_crypto.c:234
quic_crypto_aes128gcmsha256
ptls_cipher_suite_t quic_crypto_aes128gcmsha256
Definition: quic_crypto.c:498