comparison src/event/quic/ngx_event_quic.c @ 9157:daf8f5ba23d8

QUIC: removed use of SSL_quic_read_level and SSL_quic_write_level. As explained in BoringSSL change[1], levels were introduced in the original QUIC API to draw a line between when keys are released and when are active. In the new QUIC API they are released in separate calls when it's needed. BoringSSL has then a consideration to remove levels API, hence the change. If not available e.g. from a QUIC packet header, levels can be taken based on keys availability. The only real use of levels is to prevent using app keys before they are active in QuicTLS that provides the old BoringSSL QUIC API, it is replaced with an equivalent check of c->ssl->handshaked. This change also removes OpenSSL compat shims since they are no longer used. The only exception left is caching write level from the keylog callback in the internal field which is a handy equivalent of checking keys availability. [1] https://boringssl.googlesource.com/boringssl/+/1e859054
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 01 Sep 2023 20:31:46 +0400
parents 36b59521a41c
children ad3d34ddfdcc
comparison
equal deleted inserted replaced
9156:36b59521a41c 9157:daf8f5ba23d8
961 } 961 }
962 962
963 #if !defined (OPENSSL_IS_BORINGSSL) 963 #if !defined (OPENSSL_IS_BORINGSSL)
964 /* OpenSSL provides read keys for an application level before it's ready */ 964 /* OpenSSL provides read keys for an application level before it's ready */
965 965
966 if (pkt->level == ssl_encryption_application 966 if (pkt->level == ssl_encryption_application && !c->ssl->handshaked) {
967 && SSL_quic_read_level(c->ssl->connection)
968 < ssl_encryption_application)
969 {
970 ngx_log_error(NGX_LOG_INFO, c->log, 0, 967 ngx_log_error(NGX_LOG_INFO, c->log, 0,
971 "quic no %s keys ready, ignoring packet", 968 "quic no %s keys ready, ignoring packet",
972 ngx_quic_level_name(pkt->level)); 969 ngx_quic_level_name(pkt->level));
973 return NGX_DECLINED; 970 return NGX_DECLINED;
974 } 971 }