gitea: WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.

  • Gitea version (or commit ref): 1.14.3
  • Git version: git version 2.31.1.windows.1
  • Operating system: Linux/Docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist: I don’t know how logs would help with this issue but if its necessary i will provide logs.

Description

I added my gpg key and signed a commit with it. Localy i can verify the commit with git verify-commit HEAD but in the webinterface it shows as “WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.”.

Screenshots

Screenshot 2021-07-06 at 00-19-19 Screenshot 2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (7 by maintainers)

Most upvoted comments

Have you looked at 1.15 since #14054 has been merged?

The addresses that the key will validate for are now displayed and you can verify the key to make it work for any activated email address.

There’s a smaller issue about storing all the addresses that a key could verify for - but actually just reimporting the key now it shows what it verifies is probably going to solve that.

Nice. Readding the key would also have worked. @TheBinaryLoop does that solve your problem too?

Yes. I manually updated the db via sql and now it shows correctly in the ui. Thanks guys 😄

Did you add the key before activating the email address? We might have a inconsistent DB here. You can check the output of this SQL and see if it lists the email as not activated.

select key_id, primary_key_id, can_sign, emails from gpg_key;

Does it matter that the email associated with that key is not marked as my primary email in Gitea?

No, not to my knowledge

Hm, looks like logging is not especially verbose in that section of code. 😕

@prologic This occurs for every commit you sign right? For me this just happened occasionally, seemlingly random. So there may be something broken with your setup, not necessarily a bug. So to check up on your setup:

  • Is one of the emails in your gpg key also added to your account AND activated? otherwise the key won’t give a valid signature
  • extremely unlikely, but: are there two keys with conflicting key-IDs registered in gitea?

@prologic That’s my problem as well