Commit Graph

12 Commits

Author SHA1 Message Date
Jack Grigg f5f140d172 Fix various clippy lints 2021-08-20 16:22:22 +01:00
Jack Grigg 2c90195f99 Check PIN policy before requesting PIN
Closes str4d/age-plugin-yubikey#34.
2021-08-20 15:11:39 +01:00
Jack Grigg 30f4d00902 Move verify_pin after Stub::connect
If all we want is to determine the recipient, we don't need to verify
the PIN.

Closes str4d/age-plugin-yubikey#30.
2021-08-20 15:08:14 +01:00
Jack Grigg 7f43d15942 Use CLI error type to render errors from yubikey.verify_pin()
This ensures that the attempts-before-blocked counter is displayed to
users during the plugin protocol.
2021-08-20 13:18:11 +01:00
Jack Grigg f05c635d7b clippy fixes 2021-04-15 22:33:33 +12:00
Jack Grigg dd8589811b Improve UI messages for YubiKey management
In particular, we now print out the candidate management key if setting
it as the PIN-protected management key fails.
2021-04-14 00:51:45 +12:00
Jack Grigg 50b873c89f Reliably ignore PIV devices that are not connected
This is primarily to ignore smart card readers that don't have cards
plugged in.
2021-04-14 00:51:45 +12:00
Jack Grigg 5a85a15341 YubiKey plugin protocol 2021-04-05 23:08:07 +12:00
Jack Grigg f74dd2ec4b Fix clippy lints 2021-04-04 16:55:34 +12:00
Jack Grigg 850f96cd2c Implement --generate command
Includes logic to help users manage their keys:

- If the key is using a default PIN, we require the user to change it.
- We set the PUK equal to the PIN so the user doesn't need to remember
  them separately.
- We migrate the default management key to a new PIN-protected key.
2021-03-29 19:02:32 +13:00
Jack Grigg 50e4fee48c bech32 0.8 2021-03-29 10:43:57 +13:00
Jack Grigg 7a527b2be6 Implement --identity command 2021-01-12 02:29:57 +00:00