[nginx] QUIC: cleaned up now unused ngx_quic_ciphers() calls.

Sergey Kandaurov pluknet at nginx.com
Fri Oct 20 14:42:33 UTC 2023


details:   https://hg.nginx.org/nginx/rev/f7c9cd726298
branches:  
changeset: 9175:f7c9cd726298
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Fri Oct 20 18:05:07 2023 +0400
description:
QUIC: cleaned up now unused ngx_quic_ciphers() calls.

diffstat:

 src/event/quic/ngx_event_quic_openssl_compat.c |  12 ++------
 src/event/quic/ngx_event_quic_protection.c     |  38 ++++++++-----------------
 2 files changed, 16 insertions(+), 34 deletions(-)

diffs (91 lines):

diff -r 31702c53d2db -r f7c9cd726298 src/event/quic/ngx_event_quic_openssl_compat.c
--- a/src/event/quic/ngx_event_quic_openssl_compat.c	Fri Oct 20 18:05:07 2023 +0400
+++ b/src/event/quic/ngx_event_quic_openssl_compat.c	Fri Oct 20 18:05:07 2023 +0400
@@ -582,10 +582,9 @@ ngx_quic_compat_create_header(ngx_quic_c
 static ngx_int_t
 ngx_quic_compat_create_record(ngx_quic_compat_record_t *rec, ngx_str_t *res)
 {
-    ngx_str_t            ad, out;
-    ngx_quic_secret_t   *secret;
-    ngx_quic_ciphers_t   ciphers;
-    u_char               nonce[NGX_QUIC_IV_LEN];
+    ngx_str_t           ad, out;
+    ngx_quic_secret_t  *secret;
+    u_char              nonce[NGX_QUIC_IV_LEN];
 
     ad.data = res->data;
     ad.len = ngx_quic_compat_create_header(rec, ad.data, 0);
@@ -598,11 +597,6 @@ ngx_quic_compat_create_record(ngx_quic_c
                    "quic compat ad len:%uz %xV", ad.len, &ad);
 #endif
 
-    if (ngx_quic_ciphers(rec->keys->cipher, &ciphers, rec->level) == NGX_ERROR)
-    {
-        return NGX_ERROR;
-    }
-
     secret = &rec->keys->secret;
 
     ngx_memcpy(nonce, secret->iv.data, secret->iv.len);
diff -r 31702c53d2db -r f7c9cd726298 src/event/quic/ngx_event_quic_protection.c
--- a/src/event/quic/ngx_event_quic_protection.c	Fri Oct 20 18:05:07 2023 +0400
+++ b/src/event/quic/ngx_event_quic_protection.c	Fri Oct 20 18:05:07 2023 +0400
@@ -855,12 +855,11 @@ ngx_quic_keys_cleanup(ngx_quic_keys_t *k
 static ngx_int_t
 ngx_quic_create_packet(ngx_quic_header_t *pkt, ngx_str_t *res)
 {
-    u_char              *pnp, *sample;
-    ngx_str_t            ad, out;
-    ngx_uint_t           i;
-    ngx_quic_secret_t   *secret;
-    ngx_quic_ciphers_t   ciphers;
-    u_char               nonce[NGX_QUIC_IV_LEN], mask[NGX_QUIC_HP_LEN];
+    u_char             *pnp, *sample;
+    ngx_str_t           ad, out;
+    ngx_uint_t          i;
+    ngx_quic_secret_t  *secret;
+    u_char              nonce[NGX_QUIC_IV_LEN], mask[NGX_QUIC_HP_LEN];
 
     ad.data = res->data;
     ad.len = ngx_quic_create_header(pkt, ad.data, &pnp);
@@ -873,11 +872,6 @@ ngx_quic_create_packet(ngx_quic_header_t
                    "quic ad len:%uz %xV", ad.len, &ad);
 #endif
 
-    if (ngx_quic_ciphers(pkt->keys->cipher, &ciphers, pkt->level) == NGX_ERROR)
-    {
-        return NGX_ERROR;
-    }
-
     secret = &pkt->keys->secrets[pkt->level].server;
 
     ngx_memcpy(nonce, secret->iv.data, secret->iv.len);
@@ -1081,20 +1075,14 @@ ngx_quic_encrypt(ngx_quic_header_t *pkt,
 ngx_int_t
 ngx_quic_decrypt(ngx_quic_header_t *pkt, uint64_t *largest_pn)
 {
-    u_char              *p, *sample;
-    size_t               len;
-    uint64_t             pn, lpn;
-    ngx_int_t            pnl;
-    ngx_str_t            in, ad;
-    ngx_uint_t           key_phase;
-    ngx_quic_secret_t   *secret;
-    ngx_quic_ciphers_t   ciphers;
-    uint8_t              nonce[NGX_QUIC_IV_LEN], mask[NGX_QUIC_HP_LEN];
-
-    if (ngx_quic_ciphers(pkt->keys->cipher, &ciphers, pkt->level) == NGX_ERROR)
-    {
-        return NGX_ERROR;
-    }
+    u_char             *p, *sample;
+    size_t              len;
+    uint64_t            pn, lpn;
+    ngx_int_t           pnl;
+    ngx_str_t           in, ad;
+    ngx_uint_t          key_phase;
+    ngx_quic_secret_t  *secret;
+    uint8_t             nonce[NGX_QUIC_IV_LEN], mask[NGX_QUIC_HP_LEN];
 
     secret = &pkt->keys->secrets[pkt->level].client;
 


More information about the nginx-devel mailing list