Handle incompatibility between parameters and unique in TPublic#41
Merged
nicolastemciuc merged 3 commits intocedarcode:masterfrom Feb 5, 2025
nicolastemciuc:nt--invalid-public-area-edge-cases
Merged
Handle incompatibility between parameters and unique in TPublic#41nicolastemciuc merged 3 commits intocedarcode:masterfrom nicolastemciuc:nt--invalid-public-area-edge-cases
parameters and unique in TPublic#41nicolastemciuc merged 3 commits intocedarcode:masterfrom
nicolastemciuc:nt--invalid-public-area-edge-cases
Conversation
curve_id differs from key curve_idcurve_id mismatch in KeyAttestation
Member
Author
|
It's worth discussing (and perhaps checking the Previously, tpm-key_attestation/lib/tpm/key_attestation.rb Lines 46 to 48 in c92d696 |
curve_id mismatch in KeyAttestationparameters and unique in TPublic
santiagorodriguez96
approved these changes
Feb 5, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR addresses an issue where the
t_public.parametersandt_public.uniqueare incompatible by preventing the gem from raising an exception when this happens and just returningnilas result ofTPM:KeyAttestation#key.Why?
We discovered this issue after upgrading
tpm-key_attestationto0.13.1in cedarcode/webauthn-ruby#449. During this upgrade, a test failure in theWebAuthntest suite revealed an unsupported edge case: calling thekeymethod ofKeyAttestationraises an exception whent_public.parametersandt_public.uniqueare incompatible.The exception occurs in the following code:
tpm-key_attestation/lib/tpm/t_public.rb
Lines 82 to 85 in 8ea5976
This issue went unnoticed before because
key_attestation.valid?used to returnfalse(because it failed to validate the signature), preventingkey_attestation.keyfrom being called. However, after changes to the signature validation process in #29,valid?now returnstruefor this scenario, which led the test to fail because thepubAreafor this scenario was set up with incompatibleparametersanduniqueattributes (because the coordinatesxandyare inconsistent with itscurve).Although we haven’t encountered this scenario in real-world applications, the
WebAuthntest suite helped uncover this validation gap.