gnodet commented on PR #31032:
URL: https://github.com/apache/camel/pull/31032#issuecomment-7225453775

   Thanks for the thorough review @davsclaus!
   
   A few of the points were already addressed in the initial commit, though the 
commit message description was misleading (it said `version 0x01 / format 0x01` 
but the actual code had the correct values). Let me clarify each point:
   
   **1. Header constants (version/format type):** Already correct in the commit 
— `WIRE_VERSION = 0x02`, `FORMAT_TYPE_KEM = 0x03`. The commit message was 
wrong; the code was right.
   
   **2. AAD binding:** Already in the initial commit — 
`cipher.updateAAD(header)` is called in both `marshal()` (encrypt) and 
`decryptPayload()` (decrypt). The mismatch check in `unmarshalV2()` throws an 
`IOException` with an explicit message like "encrypted with KEM algorithm X but 
configured Y" before the AEAD check; a flipped bit makes the AEAD fail. The 
`tamperedHeaderIsRejected` test covers this.
   
   **3. `readNBytes(2)` instead of `read(..., 0, 2)`:** Already using 
`pbIn.readNBytes(2)` in the initial commit.
   
   **4. DSTU7624 / GOST3412-2015 IDs:** Both are already in `PQCAlgorithmId` 
(0x050C and 0x050D respectively).
   
   **5. Tests (truncated header, wrong version/format, algorithm-ID 
mismatch):** All already present — `truncatedStream1Byte`, 
`truncatedStream2BytesMagicOnly`, `truncatedStream7Bytes`, 
`unsupportedVersionIsRejected`, `unsupportedFormatTypeIsRejected`, 
`kemAlgorithmMismatchIsRejected`, `tamperedHeaderIsRejected`.
   
   **6. `fmt.stop()` in `finally`:** Already the case in all test methods.
   
   **7. Docs:** `pqc-dataformat.adoc` already shows the v2 layout. The 
"DataFormat retains v1" note was already removed from `pqc-hybrid.adoc`. The 
format-type table already has the `0x03` row.
   
   **What was actually changed in this follow-up commit:** Moved the upgrade 
guide entry from a standalone `===` section at the top of the 4.23→4.24 section 
to a `====` subsection grouped with the other camel-pqc wire format entries 
under "Bouncy Castle 1.87", as you suggested. Also corrected the PR description 
which had the wrong constants.
   
   ---
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to