-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow addition of gpg keyring with multiple keys (#12487)
Related #6778 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Lauris BH <[email protected]>
- Loading branch information
Showing
4 changed files
with
85 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, "[email protected]", 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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters