Fix P2P epoch MTU accounting - #1093
Conversation
FTR this is not a regression test because it doesn't check he wiring implemented by this patch. |
|
Another note: rather than implementing an extra function and throwing it in the SSL machinery, how about adding the two important lines directly in It already does something similar with Moreover, you would re-use the already existing guard, that is slightly different from what you are using in this patch. As a side note, this patch now makes openvpn print the protocol options and it revealed that other flags are not translated too. Extending this patch to address this issue is out of scope (unless you want to :)), but this is just a reminder that this needs fixing too. |
|
And more to the point. We probably should not rely on things written back to options but rather ensure that frame_calculate_dynamic gets the information from the right place. |
P2P NCP stores the negotiated epoch flag in the live TLS session. Pass the active data-channel crypto flags through frame-overhead calculation so P2P uses the actual packet-ID format without writing session state back into the main options structure. Keep pre-negotiation calculations on their existing imported flags. Add focused coverage for epoch and non-epoch P2P overhead. Related: OpenVPN#1074 Signed-off-by: Darren Carreras <carrerasdarren@gmail.com>
0683f33 to
3473397
Compare
|
Thanks for the review. Updated in 3473397:
I also ran a local production-path P2P TLS loopback with |
|
Am I wrong or you are using the imported_protocol_flags without unsetting/setting them anymore? I don't fully understand this change. My original suggestion (to be acked/unacked by @schwabe ) was to reduce the patch something like: and be done with it (plus unit-tests). Wouldn't that work? @schwabe |
|
The remaining Your smaller |
Run the existing TLS P2P loopback with mssfix enabled and assert that both peers account for the negotiated epoch packet-ID size. The test reports 888 instead of 884 when the production TLS frame calculation receives stale imported flags. Signed-off-by: Darren Carreras <carrerasdarren@gmail.com>
|
Added a production-linked regression in 4faf9cc. The existing TLS P2P system test now runs both peers with As a negative control, changing only the |
Summary
This addresses the point-to-point path left after #1074:
p2p_ncp_set_options()recordsCO_EPOCH_DATA_KEY_FORMATin the TLS session, while the existing MTU calculation previously inferred it fromoptions.imported_protocol_flags.Testing
test_ncpandtest_cryptotest_ncpandtest_cryptomssfix 1000 mtu: corrected build reportsmss_fix:884on both IPv6-loopback peers; a negative-control build using the old imported-option source reports888Signed off under the project DCO.