Skip to content

sm: accept Inband-Security-Id=1 when TLS is already established - #242

Merged
fiorix merged 1 commit into
fiorix:mainfrom
tridentsx:fix/236-accept-inband-security-tls
May 1, 2026
Merged

sm: accept Inband-Security-Id=1 when TLS is already established#242
fiorix merged 1 commit into
fiorix:mainfrom
tridentsx:fix/236-accept-inband-security-tls

Conversation

@tridentsx

Copy link
Copy Markdown
Contributor

Per RFC 6733 §5.3.1, a peer may include Inband-Security-Id=1 in CER to declare TLS capability. When the connection is already TLS-secured, this should be accepted rather than rejected with NO_COMMON_SECURITY.

Changes

  • Add ParseWithSecurity(msg, role, tlsActive) to CER parser
  • Existing Parse() preserves backwards-compatible behavior (rejects on plain TCP)
  • Update handleCER to pass c.TLS() != nil to the parser
  • Add two unit tests

RFC Reference

RFC 6733 §5.3.1, §6.2: When TLS is already established on the transport, Inband-Security-Id=1 simply declares the peer's TLS capability — the security requirement is already satisfied.

All existing tests pass (including TestHandleCER_InbandSecurity which verifies rejection on plain TCP).

Fixes #236

Per RFC 6733 §5.3.1, a peer may include Inband-Security-Id=1 in CER
to declare TLS capability. When the connection is already TLS-secured,
this should be accepted (security requirement already satisfied)
rather than rejected with NO_COMMON_SECURITY.

Add ParseWithSecurity() to CER parser that accepts a tlsActive flag.
The existing Parse() method preserves backwards-compatible behavior
(rejects Inband-Security-Id=1 on plain connections).

The server CER handler now passes c.TLS() != nil to the parser.

Fixes fiorix#236
@fiorix

fiorix commented May 1, 2026

Copy link
Copy Markdown
Owner

LGTM. The ParseWithSecurity overload keeps Parse backwards-compatible and the existing TestHandleCER_InbandSecurity (rejection on plain TCP) still passes. Will merge.

@fiorix
fiorix merged commit 5161954 into fiorix:main May 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CER parser rejects Inband-Security-Id=1 (TLS) — violates RFC 6733 §5.3.1

2 participants