Skip to content

age-plugin-openpgp-card identity file does not try multiple identities — waits for first card #8

@r08l

Description

@r08l

summary
When I put multiple card identity entries (stubs/public keys) into the identity.txt file produced by age-plugin-openpgp-card, the plugin prompts only for the first card it finds in the file and blocks waiting for that card. It does not advance to the next entry if the first card is not present. This makes decrypting files with multiple possible hardware keys inconvenient.


commands

Encrypting (works fine):

age -r agepublickey1 -r agepublickey2 file.pdf > encrypted_file.pdf.age

Generate the identity file from the plugin:

$ age-plugin-openpgp-card | tee identity.txt
# Card ident 0006:15422467
# age1dkfzfyk58yvkf07n32nygkyuqxtnq2am427sy79gjkh6krf96frsucn0me
AGE-PLUGIN-OPENPGP-CARD-1XQCRQD36XY6NGV3JXSMRWAN88PC

Decrypt with the identity file:

age -d -i identity.txt encrypted_file.pdf.age > file.pdf

Example identity.txt with multiple entries (what I tried)

# Card ident 0006:30244371
# age1gh3xvmc8a72rzzzhpa52psn7vsmwx75fkj3v9420frg8qsea8cwsvnqmd2
AGE-PLUGIN-OPENPGP-CARD-111111116XVCRYDP5XVMNZYWMYAY

# Card ident 0011:76170487
# age1nleyug8an5gamrhw3lg0mtxzjnlw8uc9qskg5g5luse74e33cv5q2lj38e
AGE-PLUGIN-OPENPGP-CARD-111111116XUMRZDESXSURW30J9T2

Actual behavior

When running age -d -i identity.txt ... the plugin prints:

Please insert card 0006:30244371 (press enter for "OK")

and waits for that specific card to be inserted. It ignores the second (or any subsequent) entries in identity.txt and does not attempt them automatically.


Expected behavior

age-plugin-openpgp-card should try identities in identity.txt in sequence (or otherwise attempt to match any identity present) instead of blocking indefinitely on the first entry.
This change would let users keep a single identity.txt that contains stubs for several hardware devices and decrypt with whichever device they currently have inserted, without editing the file each time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions