diff options
author | Johan Fleury <jfleury+github@arcaik.net> | 2021-04-06 04:58:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 10:58:10 +0200 |
commit | bd662b091fad176e225b39e7f05b73ecba37cd72 (patch) | |
tree | 06c08a7a32d641462f39804fae1549b69301364c | |
parent | d5ed15d99d9b5c375dc15b0a009c915ac4edc6f7 (diff) | |
download | go-git-bd662b091fad176e225b39e7f05b73ecba37cd72.tar.gz |
*: replace golang.org/x/crypto/openpgp by github.com/ProtonMail/go-crypto/openpgp (#283)
-rw-r--r-- | go.mod | 1 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | options.go | 2 | ||||
-rw-r--r-- | plumbing/object/commit.go | 4 | ||||
-rw-r--r-- | plumbing/object/commit_test.go | 69 | ||||
-rw-r--r-- | plumbing/object/tag.go | 4 | ||||
-rw-r--r-- | plumbing/object/tag_test.go | 59 | ||||
-rw-r--r-- | repository.go | 2 | ||||
-rw-r--r-- | repository_test.go | 6 | ||||
-rw-r--r-- | worktree_commit.go | 2 | ||||
-rw-r--r-- | worktree_commit_test.go | 6 |
11 files changed, 61 insertions, 98 deletions
@@ -2,6 +2,7 @@ module github.com/go-git/go-git/v5 require ( github.com/Microsoft/go-winio v0.4.16 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20210329181949-3900d675f39b github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/emirpasic/gods v1.12.0 @@ -1,6 +1,8 @@ github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/ProtonMail/go-crypto v0.0.0-20210329181949-3900d675f39b h1:E0jcApeWTn0zEUOANmwLg2k3IfTIyX4ffz2l95AEIBk= +github.com/ProtonMail/go-crypto v0.0.0-20210329181949-3900d675f39b/go.mod h1:HTM9X7e9oLwn7RiqLG0UVwVRJenLs3wN+tQ0NPAfwMQ= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= @@ -92,12 +94,14 @@ golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -7,12 +7,12 @@ import ( "strings" "time" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" "github.com/go-git/go-git/v5/plumbing/transport" - "golang.org/x/crypto/openpgp" ) // SubmoduleRescursivity defines how depth will affect any submodule recursive diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go index 98664a1..7a1b8e5 100644 --- a/plumbing/object/commit.go +++ b/plumbing/object/commit.go @@ -9,7 +9,7 @@ import ( "io" "strings" - "golang.org/x/crypto/openpgp" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/storer" @@ -374,7 +374,7 @@ func (c *Commit) Verify(armoredKeyRing string) (*openpgp.Entity, error) { return nil, err } - return openpgp.CheckArmoredDetachedSignature(keyring, er, signature) + return openpgp.CheckArmoredDetachedSignature(keyring, er, signature, nil) } func indent(t string) string { diff --git a/plumbing/object/commit_test.go b/plumbing/object/commit_test.go index e260a7f..468a751 100644 --- a/plumbing/object/commit_test.go +++ b/plumbing/object/commit_test.go @@ -411,27 +411,23 @@ func (s *SuiteCommit) TestStat(c *C) { } func (s *SuiteCommit) TestVerify(c *C) { - ts := time.Unix(1511197315, 0) - loc, _ := time.LoadLocation("Asia/Kolkata") + ts := time.Unix(1617402711, 0) + loc, _ := time.LoadLocation("UTC") commit := &Commit{ - Hash: plumbing.NewHash("8a9cea36fe052711fbc42b86e1f99a4fa0065deb"), - Author: Signature{Name: "Sunny", Email: "me@darkowlzz.space", When: ts.In(loc)}, - Committer: Signature{Name: "Sunny", Email: "me@darkowlzz.space", When: ts.In(loc)}, - Message: `status: simplify template command selection + Hash: plumbing.NewHash("1eca38290a3131d0c90709496a9b2207a872631e"), + Author: Signature{Name: "go-git", Email: "go-git@example.com", When: ts.In(loc)}, + Committer: Signature{Name: "go-git", Email: "go-git@example.com", When: ts.In(loc)}, + Message: `test `, - TreeHash: plumbing.NewHash("6572ba6df4f1fb323c8aaa24ce07bca0648b161e"), - ParentHashes: []plumbing.Hash{plumbing.NewHash("ede5f57ea1280a0065beec96d3e1a3453d010dbd")}, + TreeHash: plumbing.NewHash("52a266a58f2c028ad7de4dfd3a72fdf76b0d4e24"), + ParentHashes: []plumbing.Hash{plumbing.NewHash("e4fbb611cd14149c7a78e9c08425f59f4b736a9a")}, PGPSignature: ` -----BEGIN PGP SIGNATURE----- -iQFHBAABCAAxFiEEoRt6IzxHaZkkUslhQyLeMqcmyU4FAloTCrsTHG1lQGRhcmtv -d2x6ei5zcGFjZQAKCRBDIt4ypybJTul5CADmVxB4kqlqRZ9fAcSU5LKva3GRXx0+ -leX6vbzoyQztSWYgl7zALh4kB3a3t2C9EnnM6uehlgaORNigyMArCSY1ivWVviCT -BvldSVi8f8OvnqwbWX0I/5a8KmItthDf5WqZRFjhcRlY1AK5Bo2hUGVRq71euf8F -rE6wNhDoyBCEpftXuXbq8duD7D6qJ7QiOS4m5+ej1UCssS2WQ60yta7q57odduHY -+txqTKI8MQUpBgoTqh+V4lOkwQQxLiz7hIQ/ZYLUcnp6fan7/kY/G7YoLt9pOG1Y -vLzAWdidLH2P+EUOqlNMuVScHYWD1FZB0/L5LJ8no5pTowQd2Z+Nggxl -=0uC8 +iHUEABYKAB0WIQTMqU0ycQ3f6g3PMoWMmmmF4LuV8QUCYGebVwAKCRCMmmmF4LuV +8VtyAP9LbuXAhtK6FQqOjKybBwlV70rLcXVP24ubDuz88VVwSgD+LuObsasWq6/U +TssDKHUR2taa53bQYjkZQBpvvwOrLgc= +=YQUf -----END PGP SIGNATURE----- `, } @@ -439,40 +435,23 @@ vLzAWdidLH2P+EUOqlNMuVScHYWD1FZB0/L5LJ8no5pTowQd2Z+Nggxl armoredKeyRing := ` -----BEGIN PGP PUBLIC KEY BLOCK----- -mQENBFmtHgABCADnfThM7q8D4pgUub9jMppSpgFh3ev84g3Csc3yQUlszEOVgXmu -YiSWP1oAiWFQ8ahCydh3LT8TnEB2QvoRNiExUI5XlXFwVfKW3cpDu8gdhtufs90Q -NvpaHOgTqRf/texGEKwXi6fvS47fpyaQ9BKNdN52LeaaHzDDZkVsAFmroE+7MMvj -P4Mq8qDn2WcWnX9zheQKYrX6Cs48Tx80eehHor4f/XnuaP8DLmPQx7URdJ0Igckh -N+i91Qv2ujin8zxUwhkfus66EZS9lQ4qR9iVHs4WHOs3j7whsejd4VhajonilVHj -uqTtqHmpN/4njbIKb8q8uQkS26VQYoSYm2UvABEBAAG0GlN1bm55IDxtZUBkYXJr -b3dsenouc3BhY2U+iQFUBBMBCAA+FiEEoRt6IzxHaZkkUslhQyLeMqcmyU4FAlmt -HgACGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQQyLeMqcmyU7V -nAf+J5BYu26B2i+iwctOzDRFcPwCLka9cBwe5wcDvoF2qL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9RfOnw/KUFAQbdtvLx3ikODQC+D3KBtuKI9ISHQfgw== -=FPev +mDMEYGeSihYJKwYBBAHaRw8BAQdAIs9A3YD/EghhAOkHDkxlUkpqYrXUXebLfmmX ++pdEK6C0D2dvLWdpdCB0ZXN0IGtleYiPBBMWCgA3FiEEzKlNMnEN3+oNzzKFjJpp +heC7lfEFAmBnkooCGyMECwkIBwUVCgkICwUWAwIBAAIeAQIXgAAKCRCMmmmF4LuV +8a3jAQCi4hSqjj6J3ch290FvQaYPGwR+EMQTMBG54t+NN6sDfgD/aZy41+0dnFKl +qM/wLW5Wr9XvwH+1zXXbuSvfxasHowq4OARgZ5KKEgorBgEEAZdVAQUBAQdAXoQz +VTYug16SisAoSrxFnOmxmFu6efYgCAwXu0ZuvzsDAQgHiHgEGBYKACAWIQTMqU0y +cQ3f6g3PMoWMmmmF4LuV8QUCYGeSigIbDAAKCRCMmmmF4LuV8Q4QAQCKW5FnEdWW +lHYKeByw3JugnlZ0U3V/R20bCwDglst5UQEAtkN2iZkHtkPly9xapsfNqnrt2gTt +YIefGtzXfldDxg4= +=Psht -----END PGP PUBLIC KEY BLOCK----- ` e, err := commit.Verify(armoredKeyRing) - c.Assert(err, IsNil) + c.Assert(err, IsNil) - _, ok := e.Identities["Sunny <me@darkowlzz.space>"] + _, ok := e.Identities["go-git test key"] c.Assert(ok, Equals, true) } diff --git a/plumbing/object/tag.go b/plumbing/object/tag.go index 4641658..216010d 100644 --- a/plumbing/object/tag.go +++ b/plumbing/object/tag.go @@ -8,7 +8,7 @@ import ( stdioutil "io/ioutil" "strings" - "golang.org/x/crypto/openpgp" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/storer" @@ -304,7 +304,7 @@ func (t *Tag) Verify(armoredKeyRing string) (*openpgp.Entity, error) { return nil, err } - return openpgp.CheckArmoredDetachedSignature(keyring, er, signature) + return openpgp.CheckArmoredDetachedSignature(keyring, er, signature, nil) } // TagIter provides an iterator for a set of tags. diff --git a/plumbing/object/tag_test.go b/plumbing/object/tag_test.go index e3f3dca..3dffc12 100644 --- a/plumbing/object/tag_test.go +++ b/plumbing/object/tag_test.go @@ -313,26 +313,22 @@ RUysgqjcpT8+iQM1PblGfHR4XAhuOqN5Fx06PSaFZhqvWFezJ28/CLyX5q+oIVk= } func (s *TagSuite) TestVerify(c *C) { - ts := time.Unix(1511524851, 0) - loc, _ := time.LoadLocation("Asia/Kolkata") + ts := time.Unix(1617403017, 0) + loc, _ := time.LoadLocation("UTC") tag := &Tag{ Name: "v0.2", - Tagger: Signature{Name: "Sunny", Email: "me@darkowlzz.space", When: ts.In(loc)}, + Tagger: Signature{Name: "go-git", Email: "go-git@example.com", When: ts.In(loc)}, Message: `This is a signed tag `, TargetType: plumbing.CommitObject, - Target: plumbing.NewHash("064f92fe00e70e6b64cb358a65039daa4b6ae8d2"), + Target: plumbing.NewHash("1eca38290a3131d0c90709496a9b2207a872631e"), PGPSignature: ` -----BEGIN PGP SIGNATURE----- -iQFHBAABCAAxFiEEoRt6IzxHaZkkUslhQyLeMqcmyU4FAloYCg8THG1lQGRhcmtv -d2x6ei5zcGFjZQAKCRBDIt4ypybJTs0cCACjQZe2610t3gfbUPbgQiWDL9uvlCeb -sNSeTC6hLAFSvHTMqLr/6RpiLlfQXyATD7TZUH0DUSLsERLheG82OgVxkOTzPCpy -GL6iGKeZ4eZ1KiV+SBPjqizC9ShhGooPUw9oUSVdj4jsaHDdDHtY63Pjl0KvJmms -OVi9SSxjeMbmaC81C8r0ZuOLTXJh/JRKh2BsehdcnK3736BK+16YRD7ugXLpkQ5d -nsCFVbuYYoLMoJL5NmEun0pbUrpY+MI8VPK0f9HV5NeaC4NksC+ke/xYMT+P2lRL -CN+9zcCIU+mXr2fCl1xOQcnQzwOElObDxpDcPcxVn0X+AhmPc+uj0mqD -=l75D +iHUEABYKAB0WIQTMqU0ycQ3f6g3PMoWMmmmF4LuV8QUCYGeciQAKCRCMmmmF4LuV +8ZoDAP4j9msumYymfHgS3y7jpxPcSyiOMlXjipr2upspvXJ6ewD+K+OPC4pGW7Aq +8UDK8r6qhaloxATcV/LUrvAW2yz4PwM= +=PD+s -----END PGP SIGNATURE----- `, } @@ -340,40 +336,23 @@ CN+9zcCIU+mXr2fCl1xOQcnQzwOElObDxpDcPcxVn0X+AhmPc+uj0mqD armoredKeyRing := ` -----BEGIN PGP PUBLIC KEY BLOCK----- -mQENBFmtHgABCADnfThM7q8D4pgUub9jMppSpgFh3ev84g3Csc3yQUlszEOVgXmu -YiSWP1oAiWFQ8ahCydh3LT8TnEB2QvoRNiExUI5XlXFwVfKW3cpDu8gdhtufs90Q -NvpaHOgTqRf/texGEKwXi6fvS47fpyaQ9BKNdN52LeaaHzDDZkVsAFmroE+7MMvj -P4Mq8qDn2WcWnX9zheQKYrX6Cs48Tx80eehHor4f/XnuaP8DLmPQx7URdJ0Igckh -N+i91Qv2ujin8zxUwhkfus66EZS9lQ4qR9iVHs4WHOs3j7whsejd4VhajonilVHj -uqTtqHmpN/4njbIKb8q8uQkS26VQYoSYm2UvABEBAAG0GlN1bm55IDxtZUBkYXJr -b3dsenouc3BhY2U+iQFUBBMBCAA+FiEEoRt6IzxHaZkkUslhQyLeMqcmyU4FAlmt -HgACGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQQyLeMqcmyU7V -nAf+J5BYu26B2i+iwctOzDRFcPwCLka9cBwe5wcDvoF2qL8QRo8NPWBBH4zWHa/k -BthtGo1b89a53I2hnTwTQ0NOtAUNV+Vvu6nOHJd9Segsx3E1nM43bd2bUfGJ1eeO -jDOlOvtP4ozuV6Ej+0Ln2ouMOc87yAwbAzTfQ9axU6CKUbqy0/t2dW1jdKntGH+t -VPeFxJHL2gXjP89skCSPYA7yKqqyJRPFvC+7rde1OLdCmZi4VwghUiNbh3s1+xM3 -gfr2ahsRDTN2SQzwuHu4y1EgZgPtuWfRxzHqduoRoSgfOfFr9H9Il3UMHf2Et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TMBG54t+NN6sDfgD/aZy41+0dnFKl +qM/wLW5Wr9XvwH+1zXXbuSvfxasHowq4OARgZ5KKEgorBgEEAZdVAQUBAQdAXoQz +VTYug16SisAoSrxFnOmxmFu6efYgCAwXu0ZuvzsDAQgHiHgEGBYKACAWIQTMqU0y +cQ3f6g3PMoWMmmmF4LuV8QUCYGeSigIbDAAKCRCMmmmF4LuV8Q4QAQCKW5FnEdWW +lHYKeByw3JugnlZ0U3V/R20bCwDglst5UQEAtkN2iZkHtkPly9xapsfNqnrt2gTt +YIefGtzXfldDxg4= +=Psht -----END PGP PUBLIC KEY BLOCK----- ` e, err := tag.Verify(armoredKeyRing) c.Assert(err, IsNil) - _, ok := e.Identities["Sunny <me@darkowlzz.space>"] + _, ok := e.Identities["go-git test key"] c.Assert(ok, Equals, true) } diff --git a/repository.go b/repository.go index cc487d4..6c504fd 100644 --- a/repository.go +++ b/repository.go @@ -16,6 +16,7 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem/dotgit" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/internal/revision" "github.com/go-git/go-git/v5/plumbing" @@ -27,7 +28,6 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem" "github.com/go-git/go-git/v5/utils/ioutil" "github.com/imdario/mergo" - "golang.org/x/crypto/openpgp" "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/osfs" diff --git a/repository_test.go b/repository_test.go index 0239a2b..0dd9f2d 100644 --- a/repository_test.go +++ b/repository_test.go @@ -17,9 +17,9 @@ import ( fixtures "github.com/go-git/go-git-fixtures/v4" - "golang.org/x/crypto/openpgp" - "golang.org/x/crypto/openpgp/armor" - openpgperr "golang.org/x/crypto/openpgp/errors" + "github.com/ProtonMail/go-crypto/openpgp" + "github.com/ProtonMail/go-crypto/openpgp/armor" + openpgperr "github.com/ProtonMail/go-crypto/openpgp/errors" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" diff --git a/worktree_commit.go b/worktree_commit.go index a5779fc..dc79569 100644 --- a/worktree_commit.go +++ b/worktree_commit.go @@ -12,8 +12,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/storage" + "github.com/ProtonMail/go-crypto/openpgp" "github.com/go-git/go-billy/v5" - "golang.org/x/crypto/openpgp" ) // Commit stores the current contents of the index in a new commit along with diff --git a/worktree_commit_test.go b/worktree_commit_test.go index f6a4e71..97b158d 100644 --- a/worktree_commit_test.go +++ b/worktree_commit_test.go @@ -18,12 +18,12 @@ import ( "github.com/go-git/go-git/v5/storage/filesystem" "github.com/go-git/go-git/v5/storage/memory" + "github.com/ProtonMail/go-crypto/openpgp" + "github.com/ProtonMail/go-crypto/openpgp/armor" + "github.com/ProtonMail/go-crypto/openpgp/errors" "github.com/go-git/go-billy/v5/memfs" "github.com/go-git/go-billy/v5/osfs" "github.com/go-git/go-billy/v5/util" - "golang.org/x/crypto/openpgp" - "golang.org/x/crypto/openpgp/armor" - "golang.org/x/crypto/openpgp/errors" . "gopkg.in/check.v1" ) |