Skip to content

Commit 1c2c9ce

Browse files
committed
fix
1 parent 2cc65e3 commit 1c2c9ce

File tree

11 files changed

+21
-29
lines changed

11 files changed

+21
-29
lines changed

assets/go-licenses.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ require (
7878
github.com/jhillyerd/enmime v1.3.0
7979
github.com/json-iterator/go v1.1.12
8080
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
81-
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
8281
github.com/klauspost/compress v1.17.11
8382
github.com/klauspost/cpuid/v2 v2.2.8
8483
github.com/lib/pq v1.10.9

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,6 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU
506506
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
507507
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
508508
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
509-
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4 h1:cTxwSmnaqLoo+4tLukHoB9iqHOu3LmLhRmgUxZo6Vp4=
510-
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M=
511509
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
512510
github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
513511
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=

models/asymkey/gpg_key.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
user_model "code.gitea.io/gitea/models/user"
1414
"code.gitea.io/gitea/modules/timeutil"
1515

16-
"github.com/keybase/go-crypto/openpgp"
17-
"github.com/keybase/go-crypto/openpgp/packet"
16+
"github.com/ProtonMail/go-crypto/openpgp"
17+
"github.com/ProtonMail/go-crypto/openpgp/packet"
1818
"xorm.io/builder"
1919
)
2020

@@ -156,7 +156,7 @@ func parseGPGKey(ctx context.Context, ownerID int64, e *openpgp.Entity, verified
156156

157157
emails := make([]*user_model.EmailAddress, 0, len(e.Identities))
158158
for _, ident := range e.Identities {
159-
if ident.Revocation != nil {
159+
if ident.Revoked(time.Now()) {
160160
continue
161161
}
162162
email := strings.ToLower(strings.TrimSpace(ident.UserId.Email))

models/asymkey/gpg_key_add.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"code.gitea.io/gitea/models/db"
1111
"code.gitea.io/gitea/modules/log"
1212

13-
"github.com/keybase/go-crypto/openpgp"
13+
"github.com/ProtonMail/go-crypto/openpgp"
1414
)
1515

1616
// __________________ ________ ____ __.
@@ -83,12 +83,12 @@ func AddGPGKey(ctx context.Context, ownerID int64, content, token, signature str
8383
verified := false
8484
// Handle provided signature
8585
if signature != "" {
86-
signer, err := openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token), strings.NewReader(signature))
86+
signer, err := openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token), strings.NewReader(signature), nil)
8787
if err != nil {
88-
signer, err = openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token+"\n"), strings.NewReader(signature))
88+
signer, err = openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token+"\n"), strings.NewReader(signature), nil)
8989
}
9090
if err != nil {
91-
signer, err = openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token+"\r\n"), strings.NewReader(signature))
91+
signer, err = openpgp.CheckArmoredDetachedSignature(ekeys, strings.NewReader(token+"\r\n"), strings.NewReader(signature), nil)
9292
}
9393
if err != nil {
9494
log.Error("Unable to validate token signature. Error: %v", err)

models/asymkey/gpg_key_commit_verification.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"code.gitea.io/gitea/modules/log"
1717
"code.gitea.io/gitea/modules/setting"
1818

19-
"github.com/keybase/go-crypto/openpgp/packet"
19+
"github.com/ProtonMail/go-crypto/openpgp/packet"
2020
)
2121

2222
// __________________ ________ ____ __.

models/asymkey/gpg_key_common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/keybase/go-crypto/openpgp"
17-
"github.com/keybase/go-crypto/openpgp/armor"
18-
"github.com/keybase/go-crypto/openpgp/packet"
16+
"github.com/ProtonMail/go-crypto/openpgp"
17+
"github.com/ProtonMail/go-crypto/openpgp/armor"
18+
"github.com/ProtonMail/go-crypto/openpgp/packet"
1919
)
2020

2121
// __________________ ________ ____ __.

models/asymkey/gpg_key_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"code.gitea.io/gitea/modules/timeutil"
1414
"code.gitea.io/gitea/modules/util"
1515

16-
"github.com/keybase/go-crypto/openpgp/packet"
16+
"github.com/ProtonMail/go-crypto/openpgp/packet"
1717
"github.com/stretchr/testify/assert"
1818
"github.com/stretchr/testify/require"
1919
)

routers/web/user/home.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ import (
4141
issue_service "code.gitea.io/gitea/services/issue"
4242
pull_service "code.gitea.io/gitea/services/pull"
4343

44-
"github.com/keybase/go-crypto/openpgp"
45-
"github.com/keybase/go-crypto/openpgp/armor"
44+
"github.com/ProtonMail/go-crypto/openpgp"
45+
"github.com/ProtonMail/go-crypto/openpgp/armor"
4646
"xorm.io/builder"
4747
)
4848

services/packages/arch/repository.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
"code.gitea.io/gitea/modules/util"
2727
packages_service "code.gitea.io/gitea/services/packages"
2828

29-
"github.com/keybase/go-crypto/openpgp"
30-
"github.com/keybase/go-crypto/openpgp/armor"
31-
"github.com/keybase/go-crypto/openpgp/packet"
29+
"github.com/ProtonMail/go-crypto/openpgp"
30+
"github.com/ProtonMail/go-crypto/openpgp/armor"
31+
"github.com/ProtonMail/go-crypto/openpgp/packet"
3232
)
3333

3434
const (

0 commit comments

Comments
 (0)