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

rework key attestation key comparison #11

Merged
merged 4 commits into from
Aug 23, 2024
Merged

rework key attestation key comparison #11

merged 4 commits into from
Aug 23, 2024

Conversation

JesusMcCloud
Copy link
Collaborator

@tlenz this should be interesting for you too

@JesusMcCloud JesusMcCloud requested a review from nodh August 8, 2024 14:36
@JesusMcCloud JesusMcCloud self-assigned this Aug 8, 2024
Copy link
Contributor

@nodh nodh left a 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?

@JesusMcCloud JesusMcCloud requested a review from nodh August 22, 2024 18:50
cause = AttException.Content.Android(
it,
AttestationValueException(
it,
Copy link
Contributor

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)
Copy link
Contributor

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

@nodh
Copy link
Contributor

nodh commented Aug 23, 2024

Proposing refactorings in 0223716, merge at your discretion

@JesusMcCloud JesusMcCloud merged commit 169297a into main Aug 23, 2024
1 check passed
@JesusMcCloud JesusMcCloud deleted the fix/keyEncoding branch August 23, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants