Expand description
Security key (FIDO2) PINs for ssh runs that have no terminal.
OpenSSH asks for a key’s PIN through askpass. A background run answers it from a PIN typed in the TUI, carried in environment variables for that one run. A wrong PIN costs an attempt on the key, so every run that carried PINs records a refusal. askpass reads that record before it hands the PIN out again.
Structs§
- PinPrompt
- The parts of OpenSSH’s
Enter PIN for <type> key <path>:prompt. - Refusal
Scan - Passes ssh’s stderr through and records a refusal of a key the run carried a PIN for the moment its line arrives. A jump host that refused the PIN is then on record before the target asks for it.
- Security
KeyPin - A PIN typed for one key file.
- Security
KeyRun - The PINs one ssh run may hand out, plus the flow that asks for a missing one. Runs without a flow (containers, snippets) only reuse PINs.
- Sign
Failure - A security key file ssh failed to sign with.
Enums§
- PinFlow
- A flow that can ask for a missing PIN and run again with it.
- Refusal
Reason - Why a security key did not sign.
Constants§
- PIN_
MAX_ BYTES - Longest PIN CTAP2 accepts, in bytes.
- PIN_
MIN_ CHARS - Shortest PIN CTAP2 accepts. A shorter one can never be right and would still cost an attempt on the key.
Statics§
- NO_
SECURITY_ KEY - A run that carries no PIN and asks for none.
Functions§
- clear_
refusal - Forget a refusal, because the user typed a new PIN for the key.
- note_
refusal - Record that the key refused. askpass hands out no PIN for it until a new one is typed.
- parse_
pin_ prompt - Recognize the PIN prompt ssh shows for a FIDO2 key file. Anchored at the
start: a keyboard-interactive prompt begins with
(user@host)and the agent’s own prompt names a fingerprint, so neither matches. - parse_
sign_ failure - Read one
sign_and_send_pubkey: signing failed for <type> "<path>": <why>line. Only security key files count. A key held by an agent is the agent’s business. - refusal_
for - Why the key refused the PIN purple last handed out for it, if it did.
- sign_
failures - Every security key signing failure in an ssh run’s stderr.
- ssh_
version_ allows_ pins - True when
ssh -Vnames an OpenSSH that cannot pass a server prompt off as a PIN prompt. Unknown versions count as too old. - take_
handed_ out_ keys - Take the key paths whose PIN went out to a run for
alias. - take_
pin_ request - Take the key path a run of
flowforaliasasked a PIN for.