[api] Socket Options: do not allow AES GCM if TSBPD is disabled. #2573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The AES-GCM mode cannot be used at the moment if TSBPD is disabled.
The main reason is the different handling of the 'timestamp' field of a data packet (see #2337).
When TSPBD is disabled, the timestamp is set at the time of sending, unique for every retransmission. The timestamp field is included in the associated data for integrity check, while encryption happens only the first time a packet is sent. Using the AES-GCM would fail on a retransmitted packet.
This PR restricts using AES-GCM without TSBPD until a further decision is taken to either exclude the 'timestamp' field from the integrity check when TSBPD is disabled or (preferably) use the same timestamping rule in any mode.