nghttpx: Rename generate_encrypted_quic_connection_id to generate_quic_connection_id

This commit is contained in:
Tatsuhiro Tsujikawa 2021-09-21 23:07:34 +09:00
parent 80cc623eb2
commit 1c7a4ecc7f
3 changed files with 6 additions and 8 deletions

View File

@ -221,7 +221,7 @@ int get_new_connection_id(ngtcp2_conn *conn, ngtcp2_cid *cid, uint8_t *token,
auto config = get_config(); auto config = get_config();
auto &quicconf = config->quic; auto &quicconf = config->quic;
if (generate_encrypted_quic_connection_id( if (generate_quic_connection_id(
*cid, cidlen, worker->get_cid_prefix(), *cid, cidlen, worker->get_cid_prefix(),
quicconf.upstream.cid_encryption_key.data()) != 0) { quicconf.upstream.cid_encryption_key.data()) != 0) {
return NGTCP2_ERR_CALLBACK_FAILURE; return NGTCP2_ERR_CALLBACK_FAILURE;
@ -559,7 +559,7 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr,
ngtcp2_cid scid; ngtcp2_cid scid;
if (generate_encrypted_quic_connection_id( if (generate_quic_connection_id(
scid, SHRPX_QUIC_SCIDLEN, worker->get_cid_prefix(), scid, SHRPX_QUIC_SCIDLEN, worker->get_cid_prefix(),
quicconf.upstream.cid_encryption_key.data()) != 0) { quicconf.upstream.cid_encryption_key.data()) != 0) {
return -1; return -1;

View File

@ -161,9 +161,8 @@ int generate_quic_retry_connection_id(ngtcp2_cid &cid, size_t cidlen,
return encrypt_quic_connection_id(p, p, key); return encrypt_quic_connection_id(p, p, key);
} }
int generate_encrypted_quic_connection_id(ngtcp2_cid &cid, size_t cidlen, int generate_quic_connection_id(ngtcp2_cid &cid, size_t cidlen,
const uint8_t *cid_prefix, const uint8_t *cid_prefix, const uint8_t *key) {
const uint8_t *key) {
assert(cidlen == SHRPX_QUIC_SCIDLEN); assert(cidlen == SHRPX_QUIC_SCIDLEN);
if (RAND_bytes(cid.data, cidlen) != 1) { if (RAND_bytes(cid.data, cidlen) != 1) {

View File

@ -85,9 +85,8 @@ int generate_quic_retry_connection_id(ngtcp2_cid &cid, size_t cidlen,
const uint8_t *server_id, const uint8_t *server_id,
const uint8_t *key); const uint8_t *key);
int generate_encrypted_quic_connection_id(ngtcp2_cid &cid, size_t cidlen, int generate_quic_connection_id(ngtcp2_cid &cid, size_t cidlen,
const uint8_t *cid_prefix, const uint8_t *cid_prefix, const uint8_t *key);
const uint8_t *key);
int encrypt_quic_connection_id(uint8_t *dest, const uint8_t *src, int encrypt_quic_connection_id(uint8_t *dest, const uint8_t *src,
const uint8_t *key); const uint8_t *key);