Skip to content

handle SET_ERROR_INFO_PDU and add timeout in capability exchange#44

Open
Marshall-Hallenbeck wants to merge 1 commit into
skelsec:mainfrom
Marshall-Hallenbeck:fix/capability-exchange-timeout
Open

handle SET_ERROR_INFO_PDU and add timeout in capability exchange#44
Marshall-Hallenbeck wants to merge 1 commit into
skelsec:mainfrom
Marshall-Hallenbeck:fix/capability-exchange-timeout

Conversation

@Marshall-Hallenbeck
Copy link
Copy Markdown

Some misconfigured RDS Session Hosts (expired licensing grace period, Connection Broker rejection) never send DEMANDACTIVEPDU during the capability exchange. They either respond with SET_ERROR_INFO_PDU (e.g. ERRINFO_CB_CONNECTION_CANCELLED) or nothing at all. Without a sub-timeout on the MCS queue read, connect() hangs until the caller's outer timeout fires, masking the server's actual error.

Adds:

  • A sub-timeout on the MCS queue read (half of target.timeout, minimum 1s) so a useful error is surfaced before any outer wait_for can mask it.
  • Detection of SET_ERROR_INFO_PDU at the capability exchange stage, matching the existing handling in __confirm_active_pdu so the server's error code and name are surfaced to the caller.

Resolves #43.

DISCLAIMER: I used Claude Opus 4.7 to help with developing this, as you can probably tell because of the comments it put, but I actually think they're useful this time (usually they're garbage).

Some misconfigured RDS Session Hosts (expired licensing grace period,
Connection Broker rejection) never send DEMANDACTIVEPDU during the
capability exchange. They either respond with SET_ERROR_INFO_PDU (e.g.
ERRINFO_CB_CONNECTION_CANCELLED) or nothing at all. Without a sub-timeout
on the MCS queue read, connect() hangs until the caller's outer timeout
fires, masking the server's actual error.

Adds:
- A sub-timeout on the MCS queue read (half of target.timeout, minimum 1s)
  so a useful error is surfaced before any outer wait_for can mask it.
- Detection of SET_ERROR_INFO_PDU at the capability exchange stage,
  matching the existing handling in __confirm_active_pdu so the server's
  error code and name are surfaced to the caller.

Resolves skelsec#43.
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.

Incorrect PDU parsing leads to unresponsive connections

1 participant