Skip to content

SSH commit signature not recognised #20597

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
tecosaur opened this issue Aug 1, 2022 · 11 comments
Closed

SSH commit signature not recognised #20597

tecosaur opened this issue Aug 1, 2022 · 11 comments
Labels

Comments

@tecosaur
Copy link

tecosaur commented Aug 1, 2022

Description

Seeing #17743, I get the impression that SSH signed commits should be recognised by Gitea.

I have git set up to sign with my SSH key.

[user]
	name = TEC
	email = [email protected]
	signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOZZqcJOLdN+QFHKyW8ST2zz750+8TdvO9IT5geXpQVt
[commit]
	gpgsign = true
[gpg]
	format = ssh
[gpg "ssh"]
	allowedSignersFile = /home/tec/.ssh/allowed_signers

I made a testing repo on try.gitea.io, and pushed
the SSH signed commit https://try.gitea.io/tecosaur/testing/commit/399bfb.

I know that Gitea is aware of this key, because I used it to push to the repo via an ssh git@... remote path.

This can also be verified by looking at https://try.gitea.io/tecosaur.keys

If I run git log --show-signature I see:

  Good "git" signature for [email protected] with ED25519 key SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1  ftBr6jamutnXc/A

However, in the Gitea UI one sees " No known key found for this signature in database".

This issue was first noticed in my personal Gitea 1.16.9 instance, the issue has persisted after upgrading to 1.17.0, at which point I thought I'd try replicating on try.gitea.io and then making this issue.

Gitea Version

1.16.9 then 1.17.0, and try.gitea.io's version

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image

Git Version

2.34

Operating System

NixOS

How are you running Gitea?

I'm running Gitea on a VM, and also reproduced this behaviour on try.gitea.io.

Database

PostgreSQL

@Gusted
Copy link
Contributor

Gusted commented Aug 1, 2022

Hi @tecosaur!

Do you have your SSH key added to <instance_domain>/user/settings/keys?

@tecosaur
Copy link
Author

tecosaur commented Aug 2, 2022

That's exactly what I have,
image

@Gusted
Copy link
Contributor

Gusted commented Aug 2, 2022

You forgot to verify your SSH key. It's only possible to recognize a SSH signature once the user has verified it's the holder of the SSH key.

@tecosaur
Copy link
Author

tecosaur commented Aug 2, 2022

Ah, I see. That makes sense, it would be a bit more helpful if the message was "the signing key used is unverified" rather than not known at all, but that's a minor thing.

I've given verification a shot, should there be much of a delay in it updating?

image

Currently, I still see "No known key found for this signature in database".

@Gusted
Copy link
Contributor

Gusted commented Aug 2, 2022

Ah, I see. That makes sense, it would be a bit more helpful if the message was "the signing key used is unverified" rather than not known at all, but that's a minor thing.

Seems like a good addition, feel free to create a Feature request for that.

should there be much of a delay in it updating?

Not really, try ctrl + f5 to avoid seeing cached results.

@tecosaur
Copy link
Author

tecosaur commented Aug 2, 2022

I might create an FR for that message then 👍.

With a verified key, my personal 1.17.0 Gitea instance is showing the commits as signed correctly (e.g. https://git.tecosaur.net/tec/golgi/commit/eccd5aa3), but try.gitea.io hasn't updated (see https://try.gitea.io/tecosaur/testing/commit/399bfb5).

@Gusted
Copy link
Contributor

Gusted commented Aug 2, 2022

Hmm, not sure if try.gitea.io employs (commit) caching on the backend. Otherwise it will have a delay.

@tecosaur
Copy link
Author

tecosaur commented Aug 2, 2022

Hmm, still not showing it. I guess check back later and if try.gitea.io has updated then close the issue, if not then maybe it's not picking it up properly?

@tecosaur
Copy link
Author

tecosaur commented Aug 8, 2022

Update: it's still working on my home instance, but in try.gitea.io my SSH key is verified:

image

but the commit still doesn't show it

image

@lunny
Copy link
Member

lunny commented Aug 8, 2022

It depends on the trust model.

@tecosaur
Copy link
Author

tecosaur commented Aug 8, 2022

Ok, so in that case should this be closed if it's just a configuration detail on try.gitea.io ?

@lunny lunny closed this as completed Aug 8, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants