Skip to content
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

GPGkeys: subkeys are not imported/used #12128

Closed
2 of 7 tasks
Torstein-Eide opened this issue Jul 3, 2020 · 16 comments · Fixed by #12155
Closed
2 of 7 tasks

GPGkeys: subkeys are not imported/used #12128

Torstein-Eide opened this issue Jul 3, 2020 · 16 comments · Fixed by #12155
Labels
Milestone

Comments

@Torstein-Eide
Copy link

Torstein-Eide commented Jul 3, 2020

Description

If you add subkey to a master GPG keyring, the subkey is not picked up by Gitea, this give error "WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS."

To comparison Github correctly sees all keys.

gpg --list-secret-keys --keyid-format LONG
/home/torstein/.gnupg/pubring.kbx
---------------------------------
sec   rsa4096/44196C77FBD6EF95 2020-07-02 [SC] [utgår: 2025-07-01]
      DD88FD4E5E767E7BF8414CF444196C77FBD6EF95
uid                [  fullst.] Torstein Eide (github) <1884894+Eideen@users.noreply.github.com>
uid                [  fullst.] alt <work mail>
uid                [  fullst.] alt3 <...@gmail.com>
ssb   rsa4096/29351BDD6590C2C3 2020-07-02 [E] [utgår: 2025-07-01]
ssb   rsa4096/2A457BC93D9A1F44 2020-07-03 [S]
ssb   rsa4096/AF31EBDABBF1C86B 2020-07-03 [E]
@zeripath
Copy link
Contributor

zeripath commented Jul 4, 2020

Hmm I was sure I'd fixed this recently...

When did you add that key to the database?

I'll take another look though

@Torstein-Eide
Copy link
Author

I test adding the before and after adding doing the commit.

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

Interesting when I add this key on my local testing service this works.

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

That is the key obtained from https://github.com/Eideen.gpg

@Torstein-Eide
Copy link
Author

Interesting when I add this key on my local testing service this works.

I have test now with master, and 12.1 on my local service, and i get the same result. where is maked as SUSPICIOUS.

Is there any other settings related PGP?

That is the key obtained from https://github.com/Eideen.gpg

that key is correct.

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

Have you set the email address as per the key?

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

The user has to have the email address of at least one of the key's email addresses listed as theirs.

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

In that given that that key only has "1884894+eideen@users.noreply.github.com" as an email address you must add that as at least a secondary email address to the user.

@Torstein-Eide
Copy link
Author

Torstein-Eide commented Jul 5, 2020

I test it again with a new key and only using one email.

I work if the main key.

/home/torstein/.gnupg/pubring.kbx
---------------------------------
sec   rsa4096/51BB0AFBAA3C45CC 2020-07-05 [SC]
      E19FF5319D2076A7792BCC4751BB0AFBAA3C45CC
uid                [  fullst.] Torstein Eide <...@gmail.com>
ssb   rsa4096/07869FDB3DB88711 2020-07-05 [E]

but when i add a new ssb key it gives error

/home/torstein/.gnupg/pubring.kbx
---------------------------------
sec   rsa4096/51BB0AFBAA3C45CC 2020-07-05 [SC]
      E19FF5319D2076A7792BCC4751BB0AFBAA3C45CC
uid                [  fullst.] Torstein Eide <...@gmail.com>
ssb   rsa4096/07869FDB3DB88711 2020-07-05 [E]
ssb   rsa4096/1CF209566DC957DE 2020-07-05 [S] [utgår: 2071-01-08]

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

An example would be useful - if only so I can test this.

@Torstein-Eide
Copy link
Author

An example would be useful - if only so I can test this.

https://try.gitea.io/torsteintest/test2/commits/branch/master

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

Screenshot from 2020-07-05 19-00-22
Screenshot from 2020-07-05 19-01-08

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

The key attached to https://try.gitea.io/torsteintest.gpg still has the 1884894+eideen@users.noreply.github.com email address

@Torstein-Eide
Copy link
Author

public key for second test

https://pastebin.com/uQa9jsH4

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

OK I've replicated - Thanks for bearing with this.

@zeripath
Copy link
Contributor

zeripath commented Jul 5, 2020

Figured it out - the problem is that the email checking is attached to the primary key not the subkey.

zeripath added a commit to zeripath/gitea that referenced this issue Jul 5, 2020
When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix go-gitea#12128

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick added a commit that referenced this issue Jul 6, 2020
When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix #12128

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 6, 2020
Backport go-gitea#12155

When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix go-gitea#12128

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@lafriks lafriks added this to the 1.12.2 milestone Jul 6, 2020
techknowlogick added a commit that referenced this issue Jul 7, 2020
Backport #12155

When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix #12128

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
When attempting to verify subkeys the email address verification step
requires checking the emails however, these emails are not stored on
subkeys but instead on the primary key.

This PR will obtain the primaryKey and check against these emails too.

Fix go-gitea#12128

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants