comparison quic_ciphers.t @ 1916:6ab08c255dd3

Tests: removed quic_ciphers.t TODO, CCM cipher now supported. While here, refined test comments.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 21 Jun 2023 17:18:09 +0400
parents f61d1b4ac638
children 161dc73812b3
comparison
equal deleted inserted replaced
1915:15131dd931a0 1916:6ab08c255dd3
84 84
85 # TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256 85 # TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
86 86
87 is(get("\x13\x02\x13\x01"), 'TLS_AES_256_GCM_SHA384', 'ciphers many'); 87 is(get("\x13\x02\x13\x01"), 'TLS_AES_256_GCM_SHA384', 'ciphers many');
88 88
89 # prefer TLS_AES_128_CCM_SHA256 and fail gracefully as we are not there yet, 89 # prefer TLS_AES_128_CCM_SHA256 with fallback to GCM,
90 # the cipher might be patched to be enabled by default in certain distributions 90 # the cipher is enabled by default in some distributions
91 91
92 my $s = Test::Nginx::HTTP3->new(8980, ciphers => "\x13\x04\x13\x01"); 92 like(get("\x13\x04\x13\x01"), qr/TLS_AES_128_[GC]CM_SHA256/,
93
94 TODO: {
95 todo_skip 'not yet', 1 unless $s;
96
97 like(get("\x13\x04\x13\x01", $s), qr/TLS_AES_128_[GC]CM_SHA256/,
98 'TLS_AES_128_CCM_SHA256'); 93 'TLS_AES_128_CCM_SHA256');
99
100 }
101 94
102 ############################################################################### 95 ###############################################################################
103 96
104 sub get { 97 sub get {
105 my ($ciphers, $sock) = @_; 98 my ($ciphers) = @_;
106 my $s = Test::Nginx::HTTP3->new(8980, ciphers => $ciphers, 99 my $s = Test::Nginx::HTTP3->new(8980, ciphers => $ciphers);
107 socket => $sock) or return;
108 my $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]); 100 my $frames = $s->read(all => [{ sid => $s->new_stream(), fin => 1 }]);
109 101
110 my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; 102 my ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
111 return $frame->{headers}->{'x-cipher'}; 103 return $frame->{headers}->{'x-cipher'};
112 } 104 }