GPG KEY FAILS IF SEC KEY START FROM 0 #4994

Closed
opened 2025-11-02 06:10:24 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @phyr0s on GitHub (Mar 3, 2020).

  • Gitea version (or commit ref):
  • Git version: 1.11.1
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • [X ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [X ] Not relevant

Description

If GPG key starts from 0, gitea doesn't recognize the key. If the key starts from other numbers it works fine, however if key starts from 0 it does not work.

...

Screenshots

Here is the key added in the config options, as you can see start from 0 the key. That key is extracted from --> gpg --list-secret-keys --keyid-format LONG -->

Captura de pantalla 2020-03-03 a las 14 56 05

This is the commit signed, gitea doesn't recognize the key
Captura de pantalla 2020-03-03 a las 15 00 04

I tried same key in GITHUB and GITLAB and woks perfect. It's means that is a bug from gitea

Originally created by @phyr0s on GitHub (Mar 3, 2020). - Gitea version (or commit ref): - Git version: 1.11.1 - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [X ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X ] Not relevant ## Description If GPG key starts from 0, gitea doesn't recognize the key. If the key starts from other numbers it works fine, however if key starts from 0 it does not work. ... ## Screenshots Here is the key added in the config options, as you can see start from 0 the key. That key is extracted from --> `gpg --list-secret-keys --keyid-format LONG` --> <img width="880" alt="Captura de pantalla 2020-03-03 a las 14 56 05" src="https://user-images.githubusercontent.com/11390548/75782678-93baf180-5d5f-11ea-8b9a-aeb810d76513.png"> This is the commit signed, gitea doesn't recognize the key <img width="390" alt="Captura de pantalla 2020-03-03 a las 15 00 04" src="https://user-images.githubusercontent.com/11390548/75782752-b5b47400-5d5f-11ea-974c-627bf0c41bcc.png"> **I tried same key in GITHUB and GITLAB and woks perfect. It's means that is a bug from gitea**
GiteaMirror added the type/bug label 2025-11-02 06:10:24 -06:00
Author
Owner

@sapk commented on GitHub (Mar 3, 2020):

I wonder if this is related to #6778 where we didn't find the root cause but the key fingerprint seems to start with 0.

For this specific case can you provide a generated private/public key pair (not yours) ?
I will add it to the test suite to confirm and maybe fix the case if it is on our side.

@sapk commented on GitHub (Mar 3, 2020): I wonder if this is related to #6778 where we didn't find the root cause but the key fingerprint seems to start with 0. For this specific case can you provide a generated private/public key pair (not yours) ? I will add it to the test suite to confirm and maybe fix the case if it is on our side.
Author
Owner

@phyr0s commented on GitHub (Mar 3, 2020):

@sapk Take it, no password needed
test23.zip

@phyr0s commented on GitHub (Mar 3, 2020): @sapk Take it, no password needed [test23.zip](https://github.com/go-gitea/gitea/files/4282835/test23.zip)
Author
Owner

@zeripath commented on GitHub (Mar 5, 2020):

@videmort so I'm not certain that is necessarily the preceding zero as that should go in to the db without the preceding zero. Could you check if it is in the db with the keyid with/without the preceding the zero?

I wonder if you're being hit with the Timezone bug?

@zeripath commented on GitHub (Mar 5, 2020): @videmort so I'm not certain that is necessarily the preceding zero as that should go in to the db without the preceding zero. Could you check if it is in the db with the keyid with/without the preceding the zero? I wonder if you're being hit with the Timezone bug?
Author
Owner

@zeripath commented on GitHub (May 29, 2020):

Sorry I finally got round to generating a key with a zero leading ID

@zeripath commented on GitHub (May 29, 2020): Sorry I finally got round to generating a key with a zero leading ID
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4994