Skip to content

Commit c78bb67

Browse files
committed
Fix key signature error page (go-gitea#22229)
- 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.
1 parent 4845093 commit c78bb67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: templates/user/settings/keys_gpg.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<p>{{.i18n.Tr "settings.gpg_token_required"}}</p>
1919
</div>
2020
<div class="field">
21-
<label for="token">{{.i18n.Tr "setting.gpg_token"}}
21+
<label for="token">{{.i18n.Tr "settings.gpg_token"}}
2222
<input readonly="" value="{{.TokenToSign}}">
2323
<div class="help">
2424
<p>{{.i18n.Tr "settings.gpg_token_help"}}</p>
25-
<p><code>{{$.i18n.Tr "settings.gpg_token_code" .TokenToSign .PaddedKeyID}}</code></p>
25+
<p><code>{{$.i18n.Tr "settings.gpg_token_code" .TokenToSign .KeyID}}</code></p>
2626
</div>
2727
</div>
2828
<div class="field">

0 commit comments

Comments
 (0)