Skip to content

PoC: Add vendor command for signing an arbitrary SHA256 hash#397

Open
rgerganov wants to merge 1 commit into
solokeys:masterfrom
rgerganov:sign-hash
Open

PoC: Add vendor command for signing an arbitrary SHA256 hash#397
rgerganov wants to merge 1 commit into
solokeys:masterfrom
rgerganov:sign-hash

Conversation

@rgerganov

Copy link
Copy Markdown

This patch adds new CTAP2 vendor command with command value 0x50. The
command arguments are credentialId and user specified SHA256 hash. It
returns a DER encoded signature of the given hash, using the key
which corresponds to the specified credentialId.

Example request:
{1: <sha256_hash>, 2: {"id": <credential_id>, "type": "public-key"}}

Example response:
{1: <der_signature>}

Issue: #395

@My1

My1 commented Mar 22, 2020

Copy link
Copy Markdown
Contributor

btw I tried this along with solokeys/solo1-cli#67 and it works, pretty neat idea.

@rgerganov

Copy link
Copy Markdown
Author

Rebased the patch and added support for pinAuth

@My1

My1 commented Mar 23, 2020

Copy link
Copy Markdown
Contributor

question is on what base we would run pin, basically force if available, or let the user decide some way on creating the credential or whatever

@rgerganov

Copy link
Copy Markdown
Author

question is on what base we would run pin, basically force if available, or let the user decide some way on creating the credential or whatever

I am trying to mimic the semantics of GetAssertion. If there is a PIN set, then platform needs to send pinAuth. Otherwise, only a button press is needed for signing.

@My1

My1 commented Mar 23, 2020

Copy link
Copy Markdown
Contributor

but get assertion has uv kinda optional as far as I read it in the document, depending on how the options.uv is set and it defaults to false

@My1

My1 commented Mar 27, 2020

Copy link
Copy Markdown
Contributor

okay considering this:
#395 (comment)
it makes totally sense to force pin if set

This patch adds new CTAP2 vendor command with command value 0x50. The
command arguments are credentialId and user specified SHA256 hash. It
returns a DER encoded signature of the given hash, using the key
which corresponds to the specified credentialId.

Example request:
{1: <sha256_hash>,
 2: {"id": <credential_id>, "type": "public-key"},
 3: [pinAuth]}

Example response:
{1: <der_signature>}

Issue: solokeys#395
@rgerganov

Copy link
Copy Markdown
Author

I have rebased the patch on top of master

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