Drop the DERIVE_*_REQ_PRESS opcodes; press_required is now ignored - #4
Open
0c-coder wants to merge 2 commits into
Open
Drop the DERIVE_*_REQ_PRESS opcodes; press_required is now ignored#40c-coder wants to merge 2 commits into
0c-coder wants to merge 2 commits into
Conversation
Firmware removed opcodes 3 and 4 and burned the numbers, so sending either now returns CTAP2_ERR_EXTENSION_NOT_SUPPORTED. Always send 1 or 2. press_required is kept in the public API signature so existing callers still parse, but it no longer does anything. Presence is decided by the device from what is being asked for: a public-key derivation never prompts, a shared-secret derivation always does, with no setting to disable it. The suffix had also become a second key domain - the firmware set additional_data[0] = 1 for it, which changes the HKDF salt - so the same label produced two different keys depending on an opcode named after touches. That is how vault.js came to fetch its public key with press_required=false and run its ECDH with press_required=true: its comment explains the choice purely in terms of when a touch is needed, so whoever wrote it did not know the two calls were using different keys. It worked only because both sides were deterministic. One label now means one key. Derived secrets change as a result. Vault entries and anything else derived through the REQ_PRESS path will not reproduce. Pre-release, no migration. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011sMEydE1HrJTCPkJ25RLRY
src/lib/history.js could never have run. It calls
ok.derive_public_key("onlykey-gun", function (error, historyPubkey) {...})
with two arguments against a four-argument signature
(additional_d, keytype, press_required, cb), so `keytype` receives the callback
function, `press_required` and `cb` are undefined, and nothing is ever called
back. Its only reference was plugins-devel.js - it is not in plugins.js, so it
never shipped in a production bundle either.
Found while auditing callers of the derive API for the REQ_PRESS opcode
removal: it was the only other caller, and it turned out not to be one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sMEydE1HrJTCPkJ25RLRY
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.
Pairs with
0c-coder/librariesbranchfix/derived-xwing-spec-keygen, which removesderive opcodes 3 and 4 — sending either now returns
CTAP2_ERR_EXTENSION_NOT_SUPPORTED, so these must merge together.press_requiredstays in the public API signature but is ignored; presence is decided bythe device (public key never prompts, shared secret always does). The suffix had also
become a second key domain, which is why
vault.jswas fetching its public key in onedomain and running its ECDH in the other.
Still outstanding in this repo, not in this PR: derived X-Wing decapsulation must move to
the chunked
OKDECRYPTroute the new firmware expects.🤖 Generated with Claude Code
https://claude.ai/code/session_0159zPxi7DCuucC1ZcqYBB8W