Allow addition of gpg keyring with multiple keys (#12487)
Related #6778 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@ -102,7 +102,8 @@ Av844q/BfRuVsJsK1NDNG09LC30B0l3LKBqlrRmRTUMHtgchdX2dY+p7GPOoSzlR
|
||||
MkM/fdpyc2hY7Dl/+qFmN5MG5yGmMpQcX+RNNR222ibNC1D3wg==
|
||||
=i9b7
|
||||
-----END PGP PUBLIC KEY BLOCK-----`
|
||||
ekey, err := checkArmoredGPGKeyString(testGPGArmor)
|
||||
keys, err := checkArmoredGPGKeyString(testGPGArmor)
|
||||
ekey := keys[0]
|
||||
assert.NoError(t, err, "Could not parse a valid GPG armored key", ekey)
|
||||
|
||||
pubkey := ekey.PrimaryKey
|
||||
@ -219,9 +220,9 @@ Q0KHb+QcycSgbDx0ZAvdIacuKvBBcbxrsmFUI4LR+oIup0G9gUc0roPvr014jYQL
|
||||
=zHo9
|
||||
-----END PGP PUBLIC KEY BLOCK-----`
|
||||
|
||||
key, err := AddGPGKey(1, testEmailWithUpperCaseLetters)
|
||||
keys, err := AddGPGKey(1, testEmailWithUpperCaseLetters)
|
||||
assert.NoError(t, err)
|
||||
|
||||
key := keys[0]
|
||||
if assert.Len(t, key.Emails, 1) {
|
||||
assert.Equal(t, "user1@example.com", key.Emails[0].Email)
|
||||
}
|
||||
@ -371,8 +372,9 @@ epiDVQ==
|
||||
=VSKJ
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
`
|
||||
ekey, err := checkArmoredGPGKeyString(testIssue6599)
|
||||
keys, err := checkArmoredGPGKeyString(testIssue6599)
|
||||
assert.NoError(t, err)
|
||||
ekey := keys[0]
|
||||
expire := getExpiryTime(ekey)
|
||||
assert.Equal(t, time.Unix(1586105389, 0), expire)
|
||||
}
|
||||
|
Reference in New Issue
Block a user