@@ -759,6 +759,9 @@ struct KeyExchangeResultDecoder {
759
759
760
760
#[ cfg( feature = "nts-pool" ) ]
761
761
keep_alive : bool ,
762
+
763
+ #[ cfg( feature = "nts-pool" ) ]
764
+ supported_protocols : Vec < ( AeadAlgorithm , u16 ) > ,
762
765
}
763
766
764
767
impl KeyExchangeResultDecoder {
@@ -861,9 +864,21 @@ impl KeyExchangeResultDecoder {
861
864
Continue ( state)
862
865
}
863
866
#[ cfg( feature = "nts-pool" ) ]
864
- SupportedProtocolList { .. } => {
865
- // a client should never receive a SupportedProtocolList
866
- tracing:: warn!( "Unexpected supported protocol list" ) ;
867
+ SupportedProtocolList {
868
+ supported_protocols,
869
+ } => {
870
+ use self :: AeadAlgorithm ;
871
+
872
+ let supported_protocols = supported_protocols
873
+ . into_iter ( )
874
+ . filter_map ( |( aead_protocol_id, key_length) | {
875
+ let aead_algorithm = AeadAlgorithm :: try_deserialize ( aead_protocol_id) ?;
876
+ Some ( ( aead_algorithm, key_length) )
877
+ } )
878
+ . collect ( ) ;
879
+
880
+ state. supported_protocols = supported_protocols;
881
+
867
882
Continue ( state)
868
883
}
869
884
#[ cfg( feature = "nts-pool" ) ]
@@ -1044,7 +1059,7 @@ struct KeyExchangeServerDecoder {
1044
1059
#[ cfg( feature = "nts-pool" ) ]
1045
1060
keep_alive : Option < bool > ,
1046
1061
#[ cfg( feature = "nts-pool" ) ]
1047
- supported_protocols : Option < Vec < ( AeadAlgorithm , u16 ) > > ,
1062
+ send_supported_protocols : bool ,
1048
1063
#[ cfg( feature = "nts-pool" ) ]
1049
1064
fixed_key_request : Option < ( Vec < u8 > , Vec < u8 > ) > ,
1050
1065
#[ cfg( feature = "nts-pool" ) ]
@@ -1186,17 +1201,9 @@ impl KeyExchangeServerDecoder {
1186
1201
SupportedProtocolList {
1187
1202
supported_protocols,
1188
1203
} => {
1189
- use self :: AeadAlgorithm ;
1190
-
1191
- let supported_protocols = supported_protocols
1192
- . into_iter ( )
1193
- . filter_map ( |( aead_protocol_id, key_length) | {
1194
- let aead_algorithm = AeadAlgorithm :: try_deserialize ( aead_protocol_id) ?;
1195
- Some ( ( aead_algorithm, key_length) )
1196
- } )
1197
- . collect ( ) ;
1204
+ debug_assert_eq ! ( supported_protocols, & [ ] ) ;
1198
1205
1199
- state. supported_protocols = Some ( supported_protocols ) ;
1206
+ state. send_supported_protocols = true ;
1200
1207
1201
1208
Continue ( state)
1202
1209
}
0 commit comments