Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key signature error page (#22229) #22231

Merged
merged 2 commits into from
Dec 28, 2022

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Dec 23, 2022

  • Backport of Fix key signature error page #22229
    • When the GPG key contains an error, such as an invalid signature or an email address that does not match the user.A page will be shown that says you must provide a signature for the token.
    • This page had two errors: one had the wrong translation key and the other tried to use an undefined variable .PaddedKeyID, which is a function implemented on the GPGKey struct, given that we don't have that, we use KeyID which is the fingerprint of the publickey and is a valid way for opengpg to refer to a key.

- Backport of go-gitea#22229
  - When the GPG key contains an error, such as an invalid signature or an email address that does not match the user.A page will be shown that says you must provide a signature for the token.
  - This page had two errors: one had the wrong translation key and the other tried to use an undefined variable [`.PaddedKeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/models/asymkey/gpg_key.go#L65-L72), which is a function implemented on the `GPGKey` struct, given that we don't have that, we use [`KeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/routers/web/user/setting/keys.go#L102) which is [the fingerprint of the publickey](https://pkg.go.dev/golang.org/x/crypto/openpgp/packet#PublicKey.KeyIdString) and is a valid way for opengpg to refer to a key.
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 23, 2022
@6543 6543 added the type/bug label Dec 23, 2022
@6543 6543 added this to the 1.17.5 milestone Dec 23, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 28, 2022
@lafriks lafriks merged commit f882747 into go-gitea:release/v1.17 Dec 28, 2022
@lunny
Copy link
Member

lunny commented Dec 30, 2022

Need an extra PR to follow #22229

@Gusted Gusted deleted the backport-22229-117 branch December 30, 2022 02:27
Gusted added a commit to Gusted/gitea that referenced this pull request Dec 30, 2022
- Followup for go-gitea#22231 to follow the frontport.
@Gusted Gusted mentioned this pull request Dec 30, 2022
KN4CK3R pushed a commit that referenced this pull request Jan 2, 2023
- Followup for #22231 to follow the frontport.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants