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

Allow signature request when public key is not known #405

Open
clehner opened this issue Mar 7, 2022 · 0 comments
Open

Allow signature request when public key is not known #405

clehner opened this issue Mar 7, 2022 · 0 comments
Labels
enhancement New feature or request regression Bugs that returned, and/or functionality that was inadvertently removed

Comments

@clehner
Copy link
Contributor

clehner commented Mar 7, 2022

Re: spruceid/didkit#272
It is supposed to be possible to use prepare and complete functions for signing with external keypairs. This functionality was partially broken in #253. #253 added checks during signing, which in this case happen in prepare, to ensure that the signing public key is valid for the verification method of the VC issuer / VP holder. The check requires the public key to hash and compare to the verification method's blockchainAccountId property. It fails now when the public key's data is missing (e.g. "x" and "y" properties - elliptic curve points - for Secp256k1). In the case of Ethereum wallets, the signing account address (hash of public key) is known but not necessarily the account's public key (until making a signature and then performing EC recovery), so it is desirable to be able to sign without passing the public key. Previously it was allowed to pass a stub public key with the "x" and "y" missing, to the prepare function. The pre-signing checks could be relaxed or modified to re-allow this use.

Stack

let pk = k256::PublicKey::try_from(ec_params)?;

crate::keccak_hash::hash_public_key(jwk)

ssi/src/did.rs

Line 855 in 8278650

account_id.verify(jwk)?;

ssi/src/vc.rs

Line 765 in 8278650

vmm.match_jwk(jwk)?;

ssi/src/ldp.rs

Line 352 in 8278650

crate::vc::ensure_verification_relationship(issuer, proof_purpose, vm_id, key, resolver)

ssi/src/ldp.rs

Line 405 in 8278650

ensure_or_pick_verification_relationship(&mut options, document, public_key, resolver)

@clehner clehner added enhancement New feature or request regression Bugs that returned, and/or functionality that was inadvertently removed labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request regression Bugs that returned, and/or functionality that was inadvertently removed
Projects
None yet
Development

No branches or pull requests

1 participant