This repository was archived by the owner on Nov 9, 2023. It is now read-only.
Conversation
| } catch (CertificateEncodingException e) { | ||
| throw new RuntimeException(); | ||
| } | ||
| this.attestationCert = X509Util.encodeCertArray(tokenData.getAttestationCertificateChain()); |
Contributor
There was a problem hiding this comment.
Nit: this is no longer just a cert. Could you use a longer name, e.g. attestationCertChain? attestationCertOrCertAndChain? Ick.
Notes: * This is completely backward compatible to what U2F does now. * The registration request can now have more than one X.509 certificate. The chain must be DER encoded (basically, the X.509 certs are DER encoded and then concatenated one after anoter. * As noted in many comments, the leaf is in the 0th element of the chain, followed by intermediary certs. * The current code does not yet ship with the final Android attestation root CA, so all Android attestations will have "chain validated: false"
Contributor
Author
|
Ping |
| import com.google.u2f.key.messages.RegisterResponse; | ||
| import com.google.u2f.tools.X509Util; | ||
|
|
||
| import org.bouncycastle.util.Arrays; |
Contributor
There was a problem hiding this comment.
Isn't java.util.Arrays.copyOfRange sufficient? It's in jre7, at least.
| } | ||
|
|
||
| // Now attempt to verify up to one of the roots | ||
| boolean validated = true; |
Contributor
There was a problem hiding this comment.
This default value, combined with the for loop that will not execute for an empty caCerts list, will allow the caller to get validated = true when the caCerts list is empty. Perhaps that's what you mean, but it certainly looks odd.
8590f57 to
14205c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes:
certificate. The chain must be DER encoded (basically, the X.509
certs are DER encoded and then concatenated one after anoter.
chain, followed by intermediary certs.
root CA, so all Android attestations will have "chain validated:
false"