Skip to content

fix(kerberos): handle KDC_ERR_ETYPE_NOSUPP as KDC_ERR_PREAUTH_REQUIRED for smart card AS exchange - #790

Open
Rostyslav Romanets (Rozerchik) wants to merge 1 commit into
Devolutions:masterfrom
Rozerchik:fix/windows-server-2016-as-exchange
Open

Rostyslav Romanets (Rozerchik) wants to merge 1 commit into
Devolutions:masterfrom
Rozerchik:fix/windows-server-2016-as-exchange

Conversation

@Rozerchik

@Rozerchik Rostyslav Romanets (Rozerchik) commented Nov 3, 2026 •

Copy link
Copy Markdown

Problem

The KDC on Windows Server 2016 responds to the initial AS-REQ (without pre-authentication data) with KDC_ERR_ETYPE_NOSUPP instead of expected KDC_ERR_PREAUTH_REQUIRED.

This error is misleading. If we ignore it and proceed with the next AS-REQ, including PA-PK-AS-REQ and the default salt, the KDC successfully processes the request and returns a AS-REP.

Root cause

This issue was introduced in a738671 when IAKERB support was added.
The change restricted the accepted KDC error codes to KDC_ERR_PREAUTH_REQUIRED. As a result, any other error code causes the failure.

Previously, KDC_ERR_ETYPE_NOSUPP was effectively ignored, so this behavior did not cause a failure before the IAKERB implementation.

Fix

This PR adds workaround to accept KDC_ERR_ETYPE_NOSUPP when smart card credentials are used, so that Kerberos authentication flow can proceed.

…D for smart card AS exchange

This is workaround for the Windows Server 2016 KDC behavior. It answers a smart card AS-REQ without pre-authentication data with `KDC_ERR_ETYPE_NOSUPP` instead of `KDC_ERR_PREAUTH_REQUIRED`. The error is misleading, since the subsequent AS-REQ offers the same encryption types along with pre-authentication data and succeeds.
@Rozerchik
Rostyslav Romanets (Rozerchik) marked this pull request as ready for review November 3, 2026 22:04
Copilot AI balanced review requested due to automatic review settings November 3, 2026 22:04

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants