Conversation
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
======================================
Coverage ? 2.86%
======================================
Files ? 5
Lines ? 279
Branches ? 0
======================================
Hits ? 8
Misses ? 271
Partials ? 0
Continue to review full report at Codecov.
|
e89b729 to
9b3cc73
Compare
|
Adding my 5 cents: I would not call it "A YubiKey stanza", but instead "P-256" and not even tie it to PIV (= smartcard stuff), because all of the operations are:
|
FYI in case you're not aware, if "compressed encoding" means omitting the |
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
=======================================
+ Coverage 0 3.42% +3.42%
=======================================
Files 0 5 +5
Lines 0 292 +292
=======================================
+ Hits 0 10 +10
- Misses 0 282 +282
Continue to review full report at Codecov.
|
65670c1 to
7f1834e
Compare
|
Now that (unstable) plugin support is merged into @joonas-fi The stanza tag used in the header is going to end up named something like Re: the cost of decompression, it only needs to be paid at recipient parsing time, and we gain more benefit from having shorter recipient strings. I think the current implementation might end up decompressing once per wrapped stanza, but that's easy to fix if it actually proves to be a bottleneck (vs the actual file encryption). |
YubiKeys are managed as age identities via a "stub" that indicates the slot to be used on a particular YubiKey. The stub can be placed alongside any age keys, and tells rage that it should attempt to decrypt matching YubiKey recipient lines.
Generates stubs for existing identities, and new identities for empty slots.
|
I tested this with YubiKey 4 on Mac and it's working very nicely! The only issue I found is I need to enter PIN on every decryption even though the PIN policy has been set to "once" (?). I opened a PR (#3) to address a use case that's important to me (first mentioned here: str4d/rage#25 (comment)). |
|
Hi, thanks for testing! Just FYI, I reworked this branch on a recent Twitch stream, and will shortly be opening new PRs with the improved plugin implementation. Re: always needing a PIN, that's an artifact of plugins being started fresh each time rage runs. This is intentional; plugins are short-lived. The reason I offer a Once policy is because it will be used by an agent plugin. The expectation is that yubikey-agent will add support for this recipient type, and then this plugin will be used for encryption, while the agent can be used for decryption if the user desires. |
|
Cool, I'll update my branch when you post your changes. Fair enough on the PIN prompts, I somehow thought the device kept track of PIN entries and it wasn't per-session. Edit: "kept track" as in "if PIN was entered once since the device has been plugged in then it wouldn't be requested anymore for any app". |
|
PIN entries are only cached per-connection to the YubiKey, so decrypting multiple files with the same YubiKey would leverage a Once policy correctly (not that |
|
Thanks, that's what I figured. You mentioned yubikey-agent, is it about this one? https://github.com/FiloSottile/yubikey-agent If there was a single agent that'd serve both my SSH and (r)age needs it'd be glorious. |
One more question about this: would this reuse the SSH agent protocol and extend it to support decryption or provide a separate protocol for (r)age? Is there an existing discussion of this yubikey-agent extension? I've played around with sshcrypt[1] and yubikey-agent (a version modified by me to get deterministic RSA signatures working instead of ECDSA signatures which are randomized) to get encryption and decryption using SSH keys with agent support but it has a range of downsides (like: encryption requires SSH sign operation with a touch action and requiring signature to encrypt means a third party can't encrypt stuff to me). I had an idea for an age plugin that implements something like that using SSH agent but it'd have the same set of downsides which is a showstopper for me. |
|
Replaced by #8. |
The existing discussion is mostly in @FiloSottile's Twitch streams IIRC, along with he and I chatting about it. I suspect it will be a protocol specific to |
Discuss this draft on the age-dev mailing list thread!
Current draft specification:
https://hackmd.io/@str4d/age-plugin-yubikey