Skip to content

Cannot verify GPG key. Armored GPG signature not accepted #30189

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

Closed
ligaard opened this issue Mar 30, 2024 · 2 comments · Fixed by #30193
Closed

Cannot verify GPG key. Armored GPG signature not accepted #30189

ligaard opened this issue Mar 30, 2024 · 2 comments · Fixed by #30193
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@ligaard
Copy link

ligaard commented Mar 30, 2024

Description

I am trying to set up GPG key on my account. I have successfully added a GPG key, but when I want to verify it, it fails with a red banner stating "The provided GPG key, signature and token do not match or token is out-of-date."

Steps to reproduce (also cf. screenshot below):
0. Go to URL path: user/settings/keys

  1. Click the "Verify" button next to a GPG key.
  2. execute the command line command shown below the Token input field.
  3. Copy paste from the terminal to the Armored GPG signature field.
  4. Click Verify and see it fail with the red banner up top.

When step 4 happens, the following log line message is printed twice:
...ey/gpg_key_verify.go:84:VerifyGPGKey() [E] Unable to validate token signature. Error:

My GPG key has been set up with a subkey (as described in https://mikeross.xyz/create-gpg-key-pair-with-subkeys/).

A related issue, but for SSH instead of GPG, is in issue #29903.

Gitea Version

1.23.0+dev-13-gb6a3cd4b8

Can you reproduce the bug on the Gitea demo site?

I do not have login to Gitea demo site and thus have not tried to reproduce there.

Log Gist

...ey/gpg_key_verify.go:84:VerifyGPGKey() [E] Unable to validate token signature. Error:

Screenshots

image

Git Version

2.43.0

Operating System

Linux (docker desktop on MacOS)

How are you running Gitea?

I am running Gitea from nightly docker hub image, via Docker Desktop on MacOS.

Database

SQLite

@KN4CK3R
Copy link
Member

KN4CK3R commented Mar 30, 2024

To reproduce the added key must have two subkeys. Generating it with gpg --full-generate-key produces a key with one subkey. Verify works with this key. Then after adding a second subkey the verification fails.

@KN4CK3R KN4CK3R added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Mar 30, 2024
@KN4CK3R
Copy link
Member

KN4CK3R commented Mar 30, 2024

Fixed in #30193.

lafriks pushed a commit that referenced this issue Mar 31, 2024
Fixes #30189

Can't verify subkeys if they are not loaded.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 31, 2024
Fixes go-gitea#30189

Can't verify subkeys if they are not loaded.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 31, 2024
Fixes go-gitea#30189

Can't verify subkeys if they are not loaded.
lafriks pushed a commit that referenced this issue Mar 31, 2024
Backport #30193 by @KN4CK3R

Fixes #30189

Can't verify subkeys if they are not loaded.

Co-authored-by: KN4CK3R <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 29, 2024
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
Backport go-gitea#30193 by @KN4CK3R

Fixes go-gitea#30189

Can't verify subkeys if they are not loaded.

Co-authored-by: KN4CK3R <[email protected]>
(cherry picked from commit e581efe)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants