Skip to content

Commit 83dcd44

Browse files
committed
fix: do not throw error when encountering multiple valid stanzas
1 parent fdc9589 commit 83dcd44

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# fido key must have pin 1234
2+
3+
exec age-keygen
4+
cp stdout identity0.txt
5+
6+
ttyin -stdin yes-pin-no-identity
7+
exec age-plugin-fido2-hmac -g
8+
cp stdout identity1.txt
9+
10+
ttyin -stdin no-pin-yes-identity
11+
exec age-plugin-fido2-hmac -g
12+
cp stdout identity2.txt
13+
14+
exec bash -c 'cat identity0.txt identity1.txt identity2.txt | grep -oP "age1.*" > recipients.txt'
15+
16+
exec age -R recipients.txt -o ciphertext plaintext
17+
18+
ttyin -stdin pin
19+
exec age -d -o plaintext1 -i identity1.txt ciphertext
20+
cmp plaintext plaintext1
21+
22+
exec age -d -o plaintext2 -i identity2.txt ciphertext
23+
cmp plaintext plaintext2
24+
25+
-- pin --
26+
1234
27+
-- yes-pin-no-identity --
28+
1234
29+
y
30+
n
31+
32+
-- no-pin-yes-identity --
33+
1234
34+
n
35+
y
36+
37+
-- magic.txt --
38+
AGE-PLUGIN-FIDO2-HMAC-1VE5KGMEJ945X6CTRM2TF76
39+
-- plaintext --
40+
this is the plaintext

pkg/plugin/identity_v1.go

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ func IdentityV1() error {
3737
return false, nil
3838
}
3939

40-
if stanzas != nil {
41-
return false, errors.New("Decrypting multiple stanzas not supported")
42-
}
43-
4440
stanzas = append(stanzas, &age.Stanza{
4541
Type: args[1],
4642
Args: args[2:],

0 commit comments

Comments
 (0)