LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-07-2024, 05:37 AM   #1
murdo
Member
 
Registered: Aug 2021
Location: Scotland
Distribution: Slackware64-Current
Posts: 91

Rep: Reputation: 28
gnupg updates: cannot sign git commits: "signing failed: No secret key"


After yesterday's gnupg updates, I can no longer sign my git commits. When I try to make a commit, I get the following output:

Code:
error: gpg failed to sign the data:
gpg: skipped " [ removed in case of sensitivity ] ": No secret key
[GNUPG:] INV_SGNR 9 [ removed in case of sensitivity ]
[GNUPG:] FAILURE sign 17
gpg: signing failed: No secret key

fatal: failed to write commit object
And the commit doesn't go through. Trying gpg --list-keys and gpg2 --list-keys suggests I now have no keys. Did the update erase them?
 
Old 03-07-2024, 07:04 AM   #2
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,975

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
All keys under both my user and root accounts are still present.
 
Old 03-07-2024, 07:18 AM   #3
murdo
Member
 
Registered: Aug 2021
Location: Scotland
Distribution: Slackware64-Current
Posts: 91

Original Poster
Rep: Reputation: 28
I didn't think about checking root keys. They all seem to be there, although I think they're all the keys for my slackpkgplus repositories. Looking in ~/.gnupg for my user, pubring.gpg and secring.gpg both still exist, last modified in late 2022, but for some reason gpg doesn't seem to find them?
 
Old 03-07-2024, 07:53 AM   #4
paolo27957
LQ Newbie
 
Registered: Aug 2010
Location: Roma, Italy
Distribution: slackware
Posts: 27

Rep: Reputation: 10
I had a problem with gpg during the update which stopped generating an error. Looking at the ChangeLog.txt I saw that gpg has been renamed to gpg1 and that /usr/bin/gpg is now a link to the new /usr/bin/gpg2. It was enough for me to manually create this link for everything to work again
 
4 members found this post helpful.
Old 03-07-2024, 08:00 AM   #5
murdo
Member
 
Registered: Aug 2021
Location: Scotland
Distribution: Slackware64-Current
Posts: 91

Original Poster
Rep: Reputation: 28
Ah, I solved it. If I run gpg1 --list-keys it finds the keys. Does anyone know if there's a way I can set up gpg2 to find them? /usr/bin/gpg is already a link to /usr/bin/gpg2 on my system; running either finds none of the keys that gpg1 finds.

In the meantime, I was able to solve the git commit issue by setting:

Code:
git config --global gpg.program "/usr/bin/gpg1"
 
1 members found this post helpful.
Old 03-07-2024, 08:32 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Both gpg1 and gpg2 share the same public keyring (~/.gnupg/pubring.gpg). Both gpg1 --list-keys and gpg2 --list-keys should show the same public keys.

However, from gnupg 2.1 onwards, storage of private keys were moved to individual files in ~/.gnupg/private-keys-v1.d/ rather than ~/.gnupg/secring.gpg.

if you run gpg1 --list-secret-keys or gpg2 --list-secret-keys you'll possibly get different results.

Now, the first time you run gpg2 it'll check for the existence of a file ~/.gnupg/.gpg-v21-migrated, if that file doesn't exist it will copy all the secret keys in secring.gpg into the private-keys-v1.d/ directory and create that file. gpg2 will use this new directory from now on. Now, the awkward bit is that gpg1 will continue to use the old copy in secring.gpg and as this 'migration' is a one time only event, any key changes you make with one version or the other will cause them to diverge.

This is why I suggest using one version or the other and never both.

Theoretically removing the .gnupg-v21-migrated checkfile should allow one to force a re-migration, but you'll likely lose any changes made with gpgv2 and it might be better just exporting and reimporting your keys manually.

Last edited by GazL; 03-07-2024 at 08:38 AM.
 
4 members found this post helpful.
Old 03-07-2024, 08:43 AM   #7
murdo
Member
 
Registered: Aug 2021
Location: Scotland
Distribution: Slackware64-Current
Posts: 91

Original Poster
Rep: Reputation: 28
Looks like that was the problem; the .gpg-v21-migrated file existed but nothing had been migrated into private-keys-v1.d. I hadn't made any changes with gpg2, so I removed that file and the re-migration worked. Thanks for the help!
 
1 members found this post helpful.
Old 03-07-2024, 12:13 PM   #8
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 780

Rep: Reputation: 248Reputation: 248Reputation: 248
Is there any real reason to have both gpg2 and gpg1 around? I only use gpg2 and am thinking of uninstalling gpg1.
 
Old 03-07-2024, 12:27 PM   #9
dr.s
Member
 
Registered: Feb 2010
Distribution: Slackware64-current
Posts: 339

Rep: Reputation: 156Reputation: 156
Quote:
Originally Posted by paolo27957 View Post
I had a problem with gpg during the update which stopped generating an error. Looking at the ChangeLog.txt I saw that gpg has been renamed to gpg1 and that /usr/bin/gpg is now a link to the new /usr/bin/gpg2. It was enough for me to manually create this link for everything to work again
Update doesn't seem to create the symlink.

Quote:
Wed Mar 6 21:30:27 UTC 2024
...
n/gnupg-1.4.23-x86_64-6.txz: Rebuilt.
Renamed binaries and manpages to end in 1, and renamed internally to gnupg1.
Thanks to Lockywolf.
n/gnupg2-2.4.4-x86_64-2.txz: Rebuilt.
Make a gpg -> gpg2 symlink if it doesn't exist. Thanks to Lockywolf.
 
2 members found this post helpful.
Old 03-07-2024, 01:32 PM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by jayjwa View Post
Is there any real reason to have both gpg2 and gpg1 around? I only use gpg2 and am thinking of uninstalling gpg1.
Not really no.
 
Old 03-07-2024, 02:44 PM   #11
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 92

Rep: Reputation: 161Reputation: 161
Quote:
Originally Posted by jayjwa View Post
Is there any real reason to have both gpg2 and gpg1 around? I only use gpg2 and am thinking of uninstalling gpg1.
About the only reason I can think of is if you still need to decrypt (very) old files or emails, that were encrypted to (very) old keys that GnuPG2 does not support anymore.

When I say “(very) old keys”, I mean the kind of keys produced by PGP 2.x, in the middle of the 90s.

If you do have such files or emails around, the best thing to do would be to use gpg1 once to decrypt them, and then re-encrypt them with a modern key.
 
2 members found this post helpful.
Old 04-08-2024, 04:14 AM   #12
SkyeDixon
LQ Newbie
 
Registered: Mar 2024
Posts: 1

Rep: Reputation: 0
I am facing some problems. Can I ask a question? Is there anyone who can help me complete my thesis? But I have found the answer to this; it is a website called Academicized. They are a writing help https://academized.com/pay-for-thesis website. They help us with our writing work. I have used them to write my thesis; they helped me so well, and the price was also very affordable. If you also need someone whom you can pay for your thesis, you can get their help.

Last edited by SkyeDixon; 04-21-2024 at 08:10 PM.
 
Old 04-08-2024, 02:32 PM   #13
murdo
Member
 
Registered: Aug 2021
Location: Scotland
Distribution: Slackware64-Current
Posts: 91

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by SkyeDixon View Post
I am facing some problems, can I ask a question?
There's never anything wrong with asking a question, it's one of the things forums are for. :-)

If your issue isn't exactly the same as this one, though, you might find more interaction by starting a new thread; I imagine people are less inclined to click on one marked 'solved'.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Signing Git Commits LXer Syndicated Linux News 0 05-17-2019 01:03 AM
Is it feasible to sign RPM/Deb using a cert issued by Trusted CA or signing with a GPG Key Pair Signed by a Trusted CA ktalinki Linux - Security 1 07-12-2018 07:46 PM
DKIM signing using OpenDKIM not signing all emails Matt Penfold Linux - Server 0 05-13-2018 08:45 PM
What is the purpose of "prologue" field used by kernel module signing script "sign-file" manisha.jnu08 Linux - Kernel 1 12-13-2017 09:48 AM
LXer: Dell's "secret Linux fling" not so secret LXer Syndicated Linux News 0 01-11-2007 09:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration