-
Notifications
You must be signed in to change notification settings - Fork 2
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
rework key attestation key comparison #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is good, but reading the code is quite hard. Maybe split up verifyKeyAttestation
into smaller chunks helps?
cause = AttException.Content.Android( | ||
it, | ||
AttestationValueException( | ||
it, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, but this still seems off, because not every parameter is using the parameter name, and it takes up 14 lines to create the result
if (CryptoPublicKey.fromJcaPublicKey(keyToBeAttested) == CryptoPublicKey.fromJcaPublicKey( | ||
firstTry.attestationCertificate.publicKey | ||
) | ||
) KeyAttestation(keyToBeAttested, firstTry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would also refactor this, because it's not clear what's compared to what, and the if
block has no curly braces, but the else
block does, although it's also only one statement
Proposing refactorings in 0223716, merge at your discretion |
@tlenz this should be interesting for you too