Skip to content

vtls_scache: if using native-ca, use that in key - #23495

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/tls-cache-key
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/tls-cache-key

Conversation

@bagder

@bagder bagder commented Oct 19, 2026

Copy link
Copy Markdown
Member

Instead of CA/CAfile

Assisted-by: stze on hackerone

@bagder
bagder requested a review from icing October 19, 2026 15:22
@bagder bagder added the TLS label Oct 19, 2026
@github-actions github-actions Bot added the tests label Oct 19, 2026

@icing icing left a comment

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.

I don't know. Reusing a session against the same server...only works if it is still the same server which has the proper secrets.

@bagder

bagder commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

Right, but its the CA store change so maybe the server isn't trusted anymore. Shouldn't it require a recheck?

@icing

icing commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Right, but its the CA store change so maybe the server isn't trusted anymore. Shouldn't it require a recheck?

It's not wrong to recheck, yes. But I think in general, we could document that changing trust anchors for transfers sharing a connection pool is undefined behaviour. That includes changing file contents.

@bagder

bagder commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

I like that. Will you do a docs PR for that or shall I?

@bagder
bagder marked this pull request as ready for review October 20, 2026 08:05
@bagder
bagder requested a balanced review from Copilot October 20, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Omitting CA file/path fields can allow session reuse across different trust policies when native trust is additive.

1 open issue
What changed in this PR

This PR makes TLS session-cache keys reflect the effective native CA-store setting.

Changes:

  • Uses a native-CA marker instead of CA file/path fields when native trust is enabled.
  • Adds a unit test distinguishing native-enabled and file-only session keys.
File Description
tests/​unit/​unit3304.c Tests native CA policy separation in session keys.
lib/​vtls/​vtls_scache.c Changes trust-source encoding in session keys.

Review effort: Balanced

Comment thread lib/vtls/vtls_scache.c Resolved
Instead of CA/CAfile

Assisted-by: stze on hackerone

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change preserves trust-path distinctions and error handling, with regression coverage for the added policy distinction.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@bagder bagder closed this in dbb8262 Oct 20, 2026
@bagder
bagder deleted the bagder/tls-cache-key branch October 20, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants