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 host checkup panic #1866

Merged
merged 1 commit into from
Sep 13, 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
10 changes: 10 additions & 0 deletions ee/secureenclavesigner/secureenclavesigner_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ func (ses *secureEnclaveSigner) Public() crypto.PublicKey {
return nil
}

// currentConsoleUserKey may return no error and a nil pointer where the inability
// to get the key is expected (see logic around calling firstConsoleUser). In this case,
// k will be a "typed" nil, as an uninitialized pointer to a ecdsa.PublicKey. We're returning
// this typed nil assigned as the crypto.PublicKey interface. This means that the interface's value
// will be nil, but it's underlying type will not be - so it will pass nil checks but panic
// when typecasted later. Explicitly return an untyped nil in this case to prevent confusion and panics later
if k == nil {
return nil
}

return k
}

Expand Down
Loading