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

Make AuthenticatorAttestationResponseJSON.publicKeyAlgorithm optional #2106

Open
zacknewman opened this issue Jul 27, 2024 · 2 comments
Open

Comments

@zacknewman
Copy link
Contributor

The motivation behind both AuthenticatorAttestationResponseJSON.publicKey and AuthenticatorAttestationResponseJSON.publicKeyAlgorithm is the same: easy access to credential data. For good reason though, AuthenticatorAttestationResponseJSON.publicKey is not required since technically such data exists in the required AuthenticatorAttestationResponseJSON.attestationObject. I believe the same should be true for AuthenticatorAttestationResponseJSON.publicKeyAlgorithm since it doesn't really serve purpose without AuthenticatorAttestationResponseJSON.publicKey also existing.

@zacknewman
Copy link
Contributor Author

zacknewman commented Jul 27, 2024

As stated in the now closed PR, I think a better approach would be to define a dictionary that requires authenticatorData, publicKey, and publicKeyAlgorithm; and an instance of this dictionary would be optional in AuthenticatorAttestationResponseJSON. It seems that it should be an all-or-nothing affair; since as soon as publicKey does not exist, an RP has no choice but to parse the COSE key which defeats the purpose of those fields.

While it would be ideal if one could model the actual requirements in pure IDL, I don't think that is possible here; and frankly much of the spec puts additional requirements on top of the IDL already. In fact in Easily accessing credential data, remarks are made on why one cannot actually require this information: user agents may not understand the public key algorithm. It does require that Ed25519, P-256, and RSASSA-PKCS1-v1_5 with SHA-256 algorithms be supported though. I think that can be improved so that in addition to requiring user agents to support those three algorithms, a user agent MUST provide publicKey when it does understand the public key algorithm. This is the closest way I think one can achieve the desired goal: providing the much more compatible SubjectPublicKeyInfo when possible (i.e., publicKey is populated iff the user agent understands the algorithm).

Of course a problem with this is an RP has two choices: implement a COSE parser as a fallback mechanism when the user agent is not able to provide publicKey or fail anytime publicKey does not exist. The former does not benefit at all from the intended purpose of these fields since the RP is implementing a COSE parser regardless. The latter suffers from the problem that certain user agents will work for users and some won't which has its own problems.

@StemmlerSisters

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants