Ah, sorry, I was too quick with responding. Reading again through RFC 7383, I now seem to figure out what the problem arise from – the Encrypted Fragment payload header is not explicitly defined in RFC 7383 – a real overlook. Thus, some text in Section 2.5 along the following lines would help: “The Encrypted Fragment Payload header consists of the generic payload header followed by the Fragment Number and the Total Fragments fields.” It’s weird, that the Encrypted Payload header is not explicitly defined in RFC 7296 too (as well as in RFC5996 and RFC4306). So, when RFC 5282 refers to “the Payload Header of the Encrypted Payload”, it refers to non-defined thing, but this is mitigated by the clarification in parentheses. Regards, Valery. From: Valery Smyslov <[email protected]> Sent: Thursday, November 5, 2026 11:43 AM To: 'V.K. Uppalapati' <[email protected]>; [email protected] Subject: RE: [IPsec] Encrypted Fragment Payload: AEAD associated data, 32 or 36 octets? Hi Venkata, please see inline. From: V.K. Uppalapati <[email protected]> Sent: Wednesday, November 4, 2026 3:08 AM To: [email protected] Subject: [IPsec] Encrypted Fragment Payload: AEAD associated data, 32 or 36 octets? Hi all,
I think there is an unresolved gap in the specification of the associated data (AD) boundary when an AEAD algorithm protects an Encrypted Fragment Payload (SKF). Implementations appear to agree on one answer; as far as I can tell, no document states it. RFC 7383 Section 2.5 delegates the cryptographic processing of the Encrypted Fragment Payload. It "is identical to that described in Section 3.14 of [RFC7296], as well as documents updating such processing for particular algorithms or modes, such as [RFC5282]." RFC 5282 Section 5.1 fixes the AD as ending at "the last octet of the Payload Header of the Encrypted Payload (i.e., the fourth octet of the Encrypted Payload)". Section 5.2 repeats that parenthetical. For an Encrypted Payload (SK) the two formulations agree. The generic payload header is four octets (RFC 7296 Section 3.2), so AD = 28 octets of fixed IKE header + 4 = 32. For an Encrypted Fragment Payload they do not agree. Its header carries two-octet Fragment Number and Total Fragments fields ahead of the IV. The rule -- through the last octet of the payload header -- gives 36 octets and places both counters under AEAD integrity protection. The parenthetical gloss -- "the fourth octet" -- gives 32 and leaves them unprotected. In my reading, the parenthetical text is just a clarification (especially that is prepended with the “i.e.,” prefix). The rule is that AAD lasts through the last octet of the Payload Header. Note, that it is not the last octet of the generic Payload Header, but the last octet of the specific payload header. In RFC 5282 only the Encrypted payload was considered, since the Encrypted Fragment payload did not yet exist, so the text explicitly refers to it (including the parenthetical text). When RFC 7383 was being developed, the intention was to align its cryptographic processing with such for the Encrypted payload and thus leverage the already existing RFCs defining the processing of the Encrypted Payload. Thus, the text in RFC 7383 is purposely crafted as a generic rule – “reuse what defined for Encrypted payload”. This would also allow to use future RFCs defining new new transforms for the Encrypted payload. Obviously, when applying rules from, say, RFC 5282, to the Encrypted Fragment payload, one should mentally substitute “Encrypted Payload” with the “Encrypted Fragment payload”, since it is the Encrypted Fragment payload that is being processed. It was not explicitly said in the RFC, since it was assumed that this was clear. Both readings are self-consistent and I cannot find a document that resolves which governs. RFC 7383 Section 2.5 lists the counters among the fragment payload's own fields, which makes 36 natural; RFC 7296 Section 3.2 fixes the generic payload header at four octets, which makes 32 literal. The conflict is invisible for the Encrypted Payload, which is presumably why it has gone unremarked: RFC 5282 predates IKEv2 fragmentation, and its Figure 3 draws the boundary on an Encrypted Payload, which has no counters. RFC 5282 does not refer to the generic payload header. It refers to the specific payload header: “the last octet of the Payload Header of the Encrypted Payload”. In case of the Encrypted Fragment payload, the mental substitution would result in “the last octet of the Payload Header of the Encrypted Fragment Payload” (and ignoring the following parenthetical gloss, as it is a clarification for the case of the Encrypted Payload). RFC 9242 Section 3.3.2 looks as though it settles this, and I want to say why I do not think it does. It defines IntAuth*A over a range ending at the last octet of the generic header of the Encrypted payload, and states that this scope "is identical to the scope of Associated Data defined for the use of AEAD algorithms in IKEv2 (see Section 5.1 of [RFC5282])". But the same section requires that a fragmented message "MUST be reconstructed before calculating the prf as if it were received unfragmented". The payload it equates is therefore a reconstructed Encrypted payload, which has no fragment counters -- the payload whose boundary is in question never exists for that mechanism. It also writes the constant out, "the Encrypted payload header (four octets)", for a header the fragment payload extends to eight. RFC 9242 processing never applies to IKE fragments. I have no idea where you saw a processing of IKE fragments in this RFC. All it says is that you should first construct a (fake) unfragmented message from received fragments and then process it as defined. I checked the errata. RFC 7383 has none. Of RFC 5282's three, none concerns Section 5.1. RFC 9242 has two, both in Section 3.3.2 and both editorial. Neither RFC 7383 nor RFC 5282 has an updating or obsoleting document. The two readings are not equally safe. RFC 7296 Section 3.14 scopes the Integrity Checksum Data over "the entire message starting with the Fixed IKE header through the Pad Length", which for a fragment includes the counters, so a non-AEAD SA authenticates them. Choosing 32 would leave an AEAD SA weaker than a non-AEAD one at exactly the fields reassembly depends on: RFC 7383 Section 2.5.2 uses Total Fragments to separate fragment sets across PMTU probes. Empirically, 36 is what is deployed. I tested an IKEv2 implementation of my own against strongSwan 6.0.7 and libreswan built from upstream commit 9f4191bd, and all three use 36. The two kinds of evidence differ and I would rather separate them than average over them. strongSwan logs its derived keys, so its messages can be opened and the boundary checked directly. libreswan exposes only symkey handles, so its agreement is established by interoperation rather than cryptographically: its fragments verify at 36 and it accepts fragments built there. Across 21 captures for which strongSwan logged its keys, 78 encrypted messages were recovered and 76 opened at the boundary above -- 19 Encrypted Fragment payloads at 36 and 57 Encrypted payloads at 32 -with no counterexample. The two that did not open fail at every AD length from 0 to 63 with every logged key, so their keys are absent from the log rather than their boundary in dispute. The captures, the sweep that produced those counts, and a pair of AES-GCM test vectors pinning both boundaries to published bytes are archived at https://doi.org/10.5281/zenodo.23932948. The vectors need none of my code to check: any AES-GCM implementation will do, and each opens at the stated length and no other. This work is to appear at CSET '26. Two questions for the working group. First, is the 36-octet reading agreed? I would value being told I have misread something, and that is the cheaper outcome. This is correct for the case of GCM, CCM (RFC5282) and MGM (RFC9227). This might or might not be correct for other AEAD encryption transforms, should they be defined for IKEv2. What is included in AAD is transform-specific (as well as payload-specific). This is the main reason why the concrete AAD margin was not defined in RFC 7383, since this would make defining AEAD transforms with different AAD requirements (say, include the following IV in AAD) impossible without modifying this RFC Generally, the definition of AEAD transform for IKEv2 must specify what is included in AAD, and ideally this should be defined in a payload-agnostic way (i.e., in terms of some payload that needs protection). This would make is easy to use such transform for both Encrypted and Encrypted Fragment payloads (and for future uses too, like ECERT payload proposed in draft-wang-ipsecme-kem-auth-ikev2). Second, if it is agreed, is it worth recording somewhere normative? An erratum against RFC 5282 looks like the wrong instrument to me -- the text is not in error, it is silent about a payload that did not exist when it was written -- but the gap has a cost. An implementer who reads the parenthetical literally, chooses 32, and tests against nothing but itself will interoperate with no one, and will not be able to name the sentence it violated. Implementers are sometimes very creative when reading documents, but I assume that they are still clever enough not to mix the Encrypted Payload with Encrypted Fragment Payload when they write code for processing the later one (and thus would ignore the parenthetical text as relevant to the Encrypted Payload only). At least with 12 years of deployment of RFC 7383 and several independent implementations we never ran into this problem (to my best knowledge). And obviously, tests against nothing but itself mean nothing. Regards, Valery. Thanks, Venkata Karunakar Uppalapati Independent Researcher
_______________________________________________ IPsec mailing list -- [email protected] To unsubscribe send an email to [email protected]
