Skip to content

Commit 5f29272

Browse files
committed
WIP openssl
1 parent 726300f commit 5f29272

1 file changed

Lines changed: 52 additions & 15 deletions

File tree

quiche/src/tests.rs

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6793,16 +6793,22 @@ fn validate_peer_sent_ack_range(
67936793

67946794
// Expected pkt counts below reflect the post-handshake state. When the
67956795
// ClientHello spans multiple Initial packets (as with post-quantum
6796-
// keyshares) the handshake exchanges one extra packet per side compared
6797-
// to the classical case, which is why these counts are one higher than
6798-
// they would be for a single-Initial ClientHello.
6799-
let expected_max_active_pkt_sent = 4;
6796+
// keyshares enabled by our BoringSSL build) the handshake exchanges
6797+
// one extra packet per side compared to the classical case, so these
6798+
// counts are one higher than they would be for a single-Initial
6799+
// ClientHello. The `openssl` build doesn't use PQ keyshares.
6800+
let extra = if cfg!(feature = "openssl") { 0 } else { 1 };
6801+
6802+
let expected_max_active_pkt_sent = 3 + extra;
68006803
let recovery = &pipe.server.paths.get_active().unwrap().recovery;
68016804
assert_eq!(
68026805
recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
68036806
expected_max_active_pkt_sent
68046807
);
6805-
assert_eq!(recovery.get_largest_acked_on_epoch(epoch).unwrap(), 4);
6808+
assert_eq!(
6809+
recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6810+
3 + extra
6811+
);
68066812
assert_eq!(recovery.sent_packets_len(epoch), 0);
68076813
// Verify largest sent on the connection
68086814
assert_eq!(
@@ -6821,8 +6827,14 @@ fn validate_peer_sent_ack_range(
68216827
pipe.send_pkt_to_server(pkt_type, &frames, &mut buf)
68226828
.unwrap();
68236829
let recovery = &pipe.server.paths.get_active().unwrap().recovery;
6824-
assert_eq!(recovery.largest_sent_pkt_num_on_path(epoch).unwrap(), 5);
6825-
assert_eq!(recovery.get_largest_acked_on_epoch(epoch).unwrap(), 4);
6830+
assert_eq!(
6831+
recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
6832+
4 + extra
6833+
);
6834+
assert_eq!(
6835+
recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6836+
3 + extra
6837+
);
68266838
assert_eq!(recovery.sent_packets_len(epoch), 1);
68276839

68286840
// Send an invalid ACK range to the server and expect server error
@@ -6881,26 +6893,39 @@ fn validate_peer_sent_ack_range_for_multi_path(
68816893
let epoch = packet::Epoch::Application;
68826894
let pkt_type = Type::Short;
68836895

6896+
// The post-handshake packet number on the active path is one
6897+
// higher when the BoringSSL ClientHello (with PQ keyshares) spans
6898+
// multiple Initial packets. The 1-RTT packet number space is
6899+
// shared across paths, so the non-active path's first probing
6900+
// packet number is also bumped by the same amount.
6901+
let extra = if cfg!(feature = "openssl") { 0 } else { 1 };
6902+
68846903
// active path
6885-
let expected_max_active_pkt_sent = 8;
6904+
let expected_max_active_pkt_sent = 7 + extra;
68866905
let active_path = &pipe.server.paths.get_mut(0).unwrap();
68876906
let p1_recovery = &active_path.recovery;
68886907
assert_eq!(
68896908
p1_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
68906909
expected_max_active_pkt_sent
68916910
);
6892-
assert_eq!(p1_recovery.get_largest_acked_on_epoch(epoch).unwrap(), 7);
6911+
assert_eq!(
6912+
p1_recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6913+
6 + extra
6914+
);
68936915
assert_eq!(p1_recovery.sent_packets_len(epoch), 1);
68946916

68956917
// non-active path
6896-
let expected_max_second_pkt_sent = 6;
6918+
let expected_max_second_pkt_sent = 5 + extra;
68976919
let second_path = &pipe.server.paths.get_mut(probed_pid).unwrap();
68986920
let p2_recovery = &second_path.recovery;
68996921
assert_eq!(
69006922
p2_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
69016923
expected_max_second_pkt_sent
69026924
);
6903-
assert_eq!(p2_recovery.get_largest_acked_on_epoch(epoch).unwrap(), 6);
6925+
assert_eq!(
6926+
p2_recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6927+
5 + extra
6928+
);
69046929
assert_eq!(p2_recovery.sent_packets_len(epoch), 0);
69056930

69066931
// Verify largest sent on the connection is the max of the two paths
@@ -6928,15 +6953,27 @@ fn validate_peer_sent_ack_range_for_multi_path(
69286953
let active_path = &pipe.server.paths.get_mut(0).unwrap();
69296954
assert!(active_path.active());
69306955
let p1_recovery = &active_path.recovery;
6931-
assert_eq!(p1_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(), 8);
6932-
assert_eq!(p1_recovery.get_largest_acked_on_epoch(epoch).unwrap(), 8);
6956+
assert_eq!(
6957+
p1_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
6958+
7 + extra
6959+
);
6960+
assert_eq!(
6961+
p1_recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6962+
7 + extra
6963+
);
69336964
assert_eq!(p1_recovery.sent_packets_len(epoch), 0);
69346965

69356966
// non-active path
69366967
let second_path = &pipe.server.paths.get_mut(probed_pid).unwrap();
69376968
let p2_recovery = &second_path.recovery;
6938-
assert_eq!(p2_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(), 6);
6939-
assert_eq!(p2_recovery.get_largest_acked_on_epoch(epoch).unwrap(), 6);
6969+
assert_eq!(
6970+
p2_recovery.largest_sent_pkt_num_on_path(epoch).unwrap(),
6971+
5 + extra
6972+
);
6973+
assert_eq!(
6974+
p2_recovery.get_largest_acked_on_epoch(epoch).unwrap(),
6975+
5 + extra
6976+
);
69406977
assert_eq!(p2_recovery.sent_packets_len(epoch), 0);
69416978

69426979
// Send a large invalid ACK range to the server. Range is not inclusive so

0 commit comments

Comments
 (0)