comparison src/event/ngx_event_quic.c @ 8274:ee53bfd8f9ed quic

Added QUIC version check for sending HANDSHAKE_DONE frame.
author Vladimir Homutov <vl@nginx.com>
date Tue, 24 Mar 2020 12:15:39 +0300
parents cb75f194f1f0
children 19660929e8ff
comparison
equal deleted inserted replaced
8273:cb75f194f1f0 8274:ee53bfd8f9ed
965 ngx_quic_crypto_frame_t *f) 965 ngx_quic_crypto_frame_t *f)
966 { 966 {
967 int sslerr; 967 int sslerr;
968 ssize_t n; 968 ssize_t n;
969 ngx_ssl_conn_t *ssl_conn; 969 ngx_ssl_conn_t *ssl_conn;
970 ngx_quic_frame_t *frame;
971 970
972 if (f->offset != 0x0) { 971 if (f->offset != 0x0) {
973 ngx_log_error(NGX_LOG_INFO, c->log, 0, 972 ngx_log_error(NGX_LOG_INFO, c->log, 0,
974 "crypto frame with non-zero offset"); 973 "crypto frame with non-zero offset");
975 // TODO: add support for crypto frames spanning packets 974 // TODO: add support for crypto frames spanning packets
1012 "quic ssl cipher: %s", SSL_get_cipher(ssl_conn)); 1011 "quic ssl cipher: %s", SSL_get_cipher(ssl_conn));
1013 1012
1014 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 1013 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
1015 "handshake completed successfully"); 1014 "handshake completed successfully");
1016 1015
1016 #if (NGX_QUIC_DRAFT_VERSION >= 27)
1017 {
1018 ngx_quic_frame_t *frame;
1019
1017 frame = ngx_pcalloc(c->pool, sizeof(ngx_quic_frame_t)); 1020 frame = ngx_pcalloc(c->pool, sizeof(ngx_quic_frame_t));
1018 if (frame == NULL) { 1021 if (frame == NULL) {
1019 return NGX_ERROR; 1022 return NGX_ERROR;
1020 } 1023 }
1021 1024
1022 /* 12.4 Frames and frame types, figure 8 */ 1025 /* 12.4 Frames and frame types, figure 8 */
1023 frame->level = ssl_encryption_application; 1026 frame->level = ssl_encryption_application;
1024 frame->type = NGX_QUIC_FT_HANDSHAKE_DONE; 1027 frame->type = NGX_QUIC_FT_HANDSHAKE_DONE;
1025 ngx_sprintf(frame->info, "HANDSHAKE DONE on handshake completed"); 1028 ngx_sprintf(frame->info, "HANDSHAKE DONE on handshake completed");
1026 ngx_quic_queue_frame(c->quic, frame); 1029 ngx_quic_queue_frame(c->quic, frame);
1030 }
1031 #endif
1027 } 1032 }
1028 1033
1029 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0, 1034 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
1030 "SSL_quic_read_level: %d, SSL_quic_write_level: %d", 1035 "SSL_quic_read_level: %d, SSL_quic_write_level: %d",
1031 (int) SSL_quic_read_level(ssl_conn), 1036 (int) SSL_quic_read_level(ssl_conn),