Skip to content

docs: clarify integrity protection requirements for connection serialization#5782

Merged
CarolYeh910 merged 1 commit intomainfrom
WesleyRosenblum/serializedocs
Mar 19, 2026
Merged

docs: clarify integrity protection requirements for connection serialization#5782
CarolYeh910 merged 1 commit intomainfrom
WesleyRosenblum/serializedocs

Conversation

@WesleyRosenblum
Copy link
Copy Markdown
Contributor

Goal

Strengthen the documentation around connection serialization to make the lack of built-in integrity protection explicit and actionable.

Why

The serialized connection blob contains cryptographic secrets and security-critical parameters (cipher suite, sequence numbers, protocol version) but does not include a MAC or signature. The existing documentation mentioned that users should "MAC and encrypt" the blob, but did not explain why integrity protection matters or what happens when it's missing. This could lead users to overlook the integrity requirement, especially if they only read one of the three documentation surfaces (usage guide, serialize API doc, or deserialize API doc).

How

  • docs/usage-guide/topics/ch14-connection-serialization.md: Rewrote the warning block as a single cohesive piece that explains what the blob contains, that it has no MAC or signature, and that users must provide both secrecy and integrity.
  • api/s2n.h (s2n_connection_serialize and s2n_connection_deserialize): Updated the warning to note that the blob has no MAC or signature and that a modified buffer will be deserialized as-is. Upgraded the recommendation from "it is recommended" to "callers MUST" to match the serialize doc's tone. Added encrypt-then-MAC as the recommended approach.
  • tls/s2n_connection_serialize.c: Added a brief comment at the s2n_connection_deserialize entry point noting the trust assumption and pointing to the API docs.

Testing

Documentation-only change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Mar 11, 2026
* are trusted after basic format validation. Callers must verify the integrity of the
* buffer before calling this function. See the s2n_connection_deserialize API docs.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move above the function definition to highlight it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got the main comment on the function declaration in s2n.h for users actually integrating with it, this one is more for those poking around inside the implementation so I think its ok here

@WesleyRosenblum WesleyRosenblum added this pull request to the merge queue Mar 18, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 18, 2026
@CarolYeh910 CarolYeh910 added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit c5d80a0 Mar 19, 2026
58 checks passed
@CarolYeh910 CarolYeh910 deleted the WesleyRosenblum/serializedocs branch March 19, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants