mirror of
https://github.com/nginx/nginx.git
synced 2025-06-22 22:10:45 +08:00
Initial packets are protected with AEAD_AES_128_GCM.
This commit is contained in:
parent
b0f1302e7d
commit
ed0533c2c2
@ -634,6 +634,7 @@ ngx_quic_create_long_packet(ngx_connection_t *c, ngx_ssl_conn_t *ssl_conn,
|
||||
|
||||
ngx_quic_hexdump0(c->log, "ad", ad.data, ad.len);
|
||||
|
||||
if (pkt->level != ssl_encryption_initial) {
|
||||
switch (SSL_CIPHER_get_id(SSL_get_current_cipher(ssl_conn)) & 0xffff) {
|
||||
|
||||
case NGX_AES_128_GCM_SHA256:
|
||||
@ -648,6 +649,10 @@ ngx_quic_create_long_packet(ngx_connection_t *c, ngx_ssl_conn_t *ssl_conn,
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
} else {
|
||||
cipher = EVP_aes_128_gcm();
|
||||
}
|
||||
|
||||
nonce = ngx_pstrdup(c->pool, &pkt->secret->iv);
|
||||
if (pkt->level == ssl_encryption_handshake) {
|
||||
nonce[11] ^= (*pkt->number - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user