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

Attestation cert failure when generating key locally #91

Open
tmb opened this issue Jul 13, 2021 · 2 comments
Open

Attestation cert failure when generating key locally #91

tmb opened this issue Jul 13, 2021 · 2 comments
Labels
upstream This is an issue in piv-go

Comments

@tmb
Copy link

tmb commented Jul 13, 2021

Hey folks,

I generated an ECDSA 256 key + certificate locally and added them to my Yubikey. Now, when trying to use yubikey-agent, I get this error: failed to prepare private key: get attestation cert: data object or application not found

I assume this has something to do with my key not being generated on-device. Is there any way to get around this?

Thanks.

@FiloSottile
Copy link
Owner

The attestation certificate is necessary to extract the PIN policy of the slot. If there is a way to obtain it for imported keys, you should open an issue or PR with piv-go. If not, the best we can do is hardcode it, and it's unclear to what value.

Note that imported keys are not officially supported.

@joeyberkovitz
Copy link

@FiloSottile - would you be open to a command line flag to override the PIN policy? That way if the user imported a key, or is using an old Yubikey where piv-go is forced to assume PINPolicyAlways, the user can specify what the actual PIN policy is.

Based on a quick look through, the only change would be getting the flag value into main.go:signers() under piv.KeyAuth

If you think that's reasonable, I'd be happy to submit a PR for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream This is an issue in piv-go
Projects
None yet
Development

No branches or pull requests

3 participants