Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid tsh panic on Windows Server 2019 #38444

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/auth/webauthnwin/webauthn_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ func newNativeImpl() *nativeImpl {
Debug("WebAuthnWin: failed to load WebAuthn.dll (it's likely missing)")
return n
}
// Load WebAuthNGetApiVersionNumber explicitly too, it avoids a panic on some
// Windows Server 2019 installs.
if err := procWebAuthNGetApiVersionNumber.Find(); err != nil {
log.
WithError(err).
Debug("WebAuthnWin: failed to load WebAuthNGetApiVersionNumber")
return n
}

v, err := webAuthNGetApiVersionNumber()
if err != nil {
Expand All @@ -70,6 +78,10 @@ func newNativeImpl() *nativeImpl {
n.webauthnAPIVersion = v
n.isAvailable = v > 0

if !n.isAvailable {
return n
}

n.hasPlatformUV, err = isUVPlatformAuthenticatorAvailable()
if err != nil {
// This should not happen if dll exists, however we are fine with
Expand Down
Loading