Codeberg/Community
54
325
Fork
You've already forked Community
12

SSH key should be matched based on signature #2186

Open
opened 2025年10月25日 21:36:53 +02:00 by iacore · 10 comments

Comment

I have a SSH key added for signing. It is verified in the Codeberg UI. git log --show-signature shows the same signature as it is shown in the UI.

However, Codeberg can't verify the commit for signing.

image

I assume that Codeberg isn't using email to match user, right? Each SSH public key has a unique signature by itself. Please use that and only that to identify which key to use.

### Comment I have a SSH key added for signing. It is verified in the Codeberg UI. `git log --show-signature` shows the same signature as it is shown in the UI. However, Codeberg can't verify the commit for signing. ![image](/attachments/afd5cb3c-c261-4a18-a6f7-cba43f1db6c1) I assume that Codeberg isn't using email to match user, right? Each SSH public key has a unique signature by itself. Please use that and only that to identify which key to use.

If it didn't use the email, couldn't you just sign a commit for someone else?

If it didn't use the email, couldn't you just sign a commit for someone else?
Author
Copy link

SSH keys are verified in the settings.

SSH keys are **verified** in the settings.

The email used to commit has to be linked to your account. Otherwise Codeberg doesn't know that it's your commit.

The email used to commit has to be linked to your account. Otherwise Codeberg doesn't know that it's your commit.
Author
Copy link

Codeberg know my SSH keys. SSH keys are unique.

For some reason I can't verify the email in git commits.

Codeberg know my SSH keys. SSH keys are unique. For some reason I can't verify the email in git commits.
Member
Copy link

The email address you are using to author your commits (configured by git config --global user.email) is not recognized as a verified email address for your account by Forgejo. You must add and verify this email address at https://codeberg.org/user/settings/account so Forgejo knows which account it should be verifying the signed commits for.

A commit cannot be identified by SSH key because it is typically only used to give you read/write access to the git server. While you can use an SSH key to sign commits, this only works as an alternative to using a GPG key to sign your commits. The actual data of the commits are generated on your computer and the server cannot rewrite them when you push, plus the ability to push commits authored and/or signed by other users is an intended feature, so Forgejo needs to use the email address to tie each commit to a user.

The email address you are using to author your commits (configured by `git config --global user.email`) is not recognized as a verified email address for your account by Forgejo. You must add and verify this email address at https://codeberg.org/user/settings/account so Forgejo knows which account it should be verifying the signed commits for. A commit cannot be identified by SSH key because it is typically only used to give you read/write access to the git server. While you can use an SSH key to sign commits, this only works as an alternative to using a GPG key to sign your commits. The actual data of the commits are generated on your computer and the server cannot rewrite them when you push, plus the ability to push commits authored and/or signed by other users is an intended feature, so Forgejo needs to use the email address to tie each commit to a user.
Member
Copy link

(削除) Actually, if your commits are signed correctly and your signature is verified correctly, Forgejo should still recognize you as the signer of the commit even if it does not recognize you as the committer. In this case, the actual problem is that your commits are not signed. Where the signature should be, instead I see error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification (削除ここまで)

(削除) Sorry, I got that message because my client was configured incorrectly. After configuring my client with your keys that I downloaded from Codeberg, I got the following error (削除ここまで)

Sorry, my client was still misconfigured, it says your signature is valid for one of the keys in your account but I have no way of checking if that key is verified. I have only used GPG commit signing, which works fine for me, so I'm not sure what's going on here.

~~Actually, if your commits are signed correctly and your signature is verified correctly, Forgejo should still recognize you as the signer of the commit even if it does not recognize you as the committer. In this case, the actual problem is that your commits are not signed. Where the signature should be, instead I see `error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification`~~ ~~Sorry, I got that message because my client was configured incorrectly. After configuring my client with your keys that I downloaded from Codeberg, I got the following error~~ Sorry, my client was _still_ misconfigured, it says your signature is valid for one of the keys in your account but I have no way of checking if that key is verified. I have only used GPG commit signing, which works fine for me, so I'm not sure what's going on here.
Author
Copy link

but I have no way of checking if that key is verified.

As I said, Codeberg knows. The SHA256: section is enough to help lookup that this key belong to this account.

https://codeberg.org/user/settings/keys

image

> but I have no way of checking if that key is verified. As I said, Codeberg knows. The SHA256: section is enough to help lookup that this key belong to this account. https://codeberg.org/user/settings/keys ![image](/attachments/d293f9c7-9858-4c05-bf9e-e77050a152ba)
Author
Copy link

How do I patch Codeberg to do this?

How do I patch Codeberg to do this?

Verifying the email address is required to prevent you from impersonating someone else.

It would be very bad if an attacker made a commit impersonating someone else, signed it with the attacker's key, and it showed up as verified on Codeberg.

Verifying the email address is required to prevent *you* from impersonating someone else. It would be very bad if an attacker made a commit impersonating someone else, signed it with the attacker's key, and it showed up as verified on Codeberg.
Author
Copy link

Verifying the email address is required to prevent you from impersonating someone else.

i did.

> Verifying the email address is required to prevent you from impersonating someone else. i did.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2186
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?