diff options
author | zeripath <art27@cantab.net> | 2020-08-21 11:45:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 13:45:50 +0300 |
commit | 7c2cf236f8a54038e1688e6256e6c32b8b4e6913 (patch) | |
tree | 2b91975d306c3de933a2ca949507d5b2f87ce3eb /models/gpg_key_test.go | |
parent | ae23bbdae3102ebc187ff504fe07d75116815ff4 (diff) | |
download | gitea-7c2cf236f8a54038e1688e6256e6c32b8b4e6913.tar.gz gitea-7c2cf236f8a54038e1688e6256e6c32b8b4e6913.zip |
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>
Diffstat (limited to 'models/gpg_key_test.go')
-rw-r--r-- | models/gpg_key_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/models/gpg_key_test.go b/models/gpg_key_test.go index e2f92e7f81..92131f5976 100644 --- a/models/gpg_key_test.go +++ b/models/gpg_key_test.go @@ -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) } |