FD.io VPP  v21.10.1-2-g0a485f517
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  crypto_key_
 
struct  cipher_context_t
 
struct  aead_crypto_context_t
 

Macros

#define QUICLY_EPOCH_1RTT   3
 

Typedefs

typedef struct crypto_key_ crypto_key_t
 

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 u32 quic_crypto_set_key (crypto_key_t *key)
 
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 24 of file quic_crypto.c.

Typedef Documentation

◆ crypto_key_t

typedef struct crypto_key_ crypto_key_t

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 431 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 439 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 151 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 388 of file quic_crypto.c.

+ 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 374 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 381 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 333 of file quic_crypto.c.

+ 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 179 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 267 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_set_key()

static u32 quic_crypto_set_key ( crypto_key_t key)
static

Definition at line 128 of file quic_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller 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 58 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 447 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 28 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 489 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 507 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 533 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 498 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 520 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 538 of file quic_crypto.c.

◆ quic_crypto_cipher_suites

ptls_cipher_suite_t* quic_crypto_cipher_suites[]
Initial value:

Definition at line 543 of file quic_crypto.c.

◆ quic_crypto_engine

quicly_crypto_engine_t quic_crypto_engine
Initial value:

Definition at line 547 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:507
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:381
quic_crypto_aes256gcmsha384
ptls_cipher_suite_t quic_crypto_aes256gcmsha384
Definition: quic_crypto.c:538
quic_crypto_aes256ctr
ptls_cipher_algorithm_t quic_crypto_aes256ctr
Definition: quic_crypto.c:498
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:374
quic_crypto_aes128ctr
ptls_cipher_algorithm_t quic_crypto_aes128ctr
Definition: quic_crypto.c:489
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:58
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:431
aead_crypto_context_t
Definition: quic_crypto.c:45
cipher_context_t
Definition: quic_crypto.c:37
quic_crypto_aes256gcm
ptls_aead_algorithm_t quic_crypto_aes256gcm
Definition: quic_crypto.c:520
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:439
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:267
quic_crypto_aes128gcmsha256
ptls_cipher_suite_t quic_crypto_aes128gcmsha256
Definition: quic_crypto.c:533