Repository navigation
Handle invalid peer keys in ECDH key agreement - #848
Merged
Merged
Conversation
Wasefire's Public::import stores peer coordinates without validating that the point lies on P-256 and defers validation to Shared::new. Because SecretKey::diffie_hellman unwrapped Shared::new, an off-curve ClientPIN or hmac-secret key agreement key panicked the authenticator instead of returning CTAP1_ERR_INVALID_PARAMETER. Make ecdh::SecretKey::diffie_hellman return Option<Self::SharedSecret>, propagate Shared::new errors as None in the Wasefire environment, and map None to CTAP1_ERR_INVALID_PARAMETER in PinProtocol::decapsulate.
ia0
approved these changes
Nov 27, 2026
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.
Wasefire's Public::import stores peer coordinates without validating that the point lies on P-256 and defers validation to Shared::new. Because SecretKey::diffie_hellman unwrapped Shared::new, an off-curve ClientPIN or hmac-secret key agreement key panicked the authenticator instead of returning CTAP1_ERR_INVALID_PARAMETER.
Make ecdh::SecretKey::diffie_hellman return OptionSelf::SharedSecret, propagate Shared::new errors as None in the Wasefire environment, and map None to CTAP1_ERR_INVALID_PARAMETER in PinProtocol::decapsulate.
Fix for issue reported by chyanju as an advisory:
https://github.com/google/OpenSK/security/advisories/GHSA-fwjg-q5cg-9pfw