From: Hilton Chain via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 60852@debbugs.gnu.org
Subject: bug#60852: git-authenticate edge case for certain key setup.
Date: Mon, 16 Jan 2023 15:29:40 +0800 [thread overview]
Message-ID: <87lem3kkd7.wl-hako@ultrarare.space> (raw)
I encountered the issue when adding a new key to my Guix channel. Though I
haven't figured out what happened exactly, I'm currently able to reproduce the
issue with the following steps.
1. Generate two keypairs. Key One with the preset "ECC and ECC", Key Two with
"ECC (set your own capabilities)" and only keep the Certify capability, then
add a Sign subkey to Key Two. All Curve 25519.
#+RESULTS:
: /tmp/test/pubring.kbx
: ---------------------
: sec ed25519/676A52381FFD80C5 2023-01-16 [SC]
: Key fingerprint = 21D3 9304 CED7 A5CF 50B6 0B80 676A 5238 1FFD 80C5
: uid [ultimate] Key One
: ssb cv25519/BA35E2E29D6E4CE4 2023-01-16 [E]
: Key fingerprint = 450A DF8C 6FE4 AEFF EC75 EBD9 BA35 E2E2 9D6E 4CE4
:
: sec ed25519/06DE4CED9A91AB7B 2023-01-16 [C]
: Key fingerprint = 4A45 EC76 DA2B 389A FE2F C887 06DE 4CED 9A91 AB7B
: uid [ultimate] Key Two
: ssb ed25519/3BE8CD60E408A705 2023-01-16 [S]
: Key fingerprint = 405C B557 DE1F 1254 B012 640A 3BE8 CD60 E408 A705
2. Create a new git repository, commit public keys of the two to the "keyring"
branch. Then commit file ".guix-authorizations" to the "main" branch with the
following code:
#+begin_src scheme
(authorizations
(version 0)
(("21D3 9304 CED7 A5CF 50B6 0B80 676A 5238 1FFD 80C5"
(name "Key One"))))
#+end_src
Configure git to sign commits with Key One, change the ".guix-authorizations"
file to the following and commit:
#+begin_src scheme
(authorizations
(version 0)
(("21D3 9304 CED7 A5CF 50B6 0B80 676A 5238 1FFD 80C5"
(name "Key One")))
(("405C B557 DE1F 1254 B012 640A 3BE8 CD60 E408 A705"
(name "Key Two"))))
#+end_src
Then change the signing key to Key Two and add a new commit.
Now there're three commits:
#+RESULTS:
: commit 5240baeebc055187fb738e66e7dbfbb57c0aeba3 (HEAD -> main)
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:53:49 2023 +0800
:
: test
:
: commit a6794b64f9dfa828a5721e3f02c27ab74db9a487
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:53:17 2023 +0800
:
: Authorize Key Two.
:
: commit c9476062a2f341e9ee95a60d17cf2233b7c55ff4
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:51:02 2023 +0800
:
: Authorize Key One.
3. Invoke `guix git authenticate`...with error.
#+begin_src shell
guix git authenticate c9476062a2f341e9ee95a60d17cf2233b7c55ff4 "21D3 9304 CED7 A5CF 50B6 0B80 676A 5238 1FFD 80C5"
#+end_src
#+RESULTS:
: Authenticating commits c947606 to 5240bae (1 new commits)...
: [##############################################################################]guix git: error: commit 5240baeebc055187fb738e66e7dbfbb57c0aeba3 not signed by an authorized key: 405C B557 DE1F 1254 B012 640A 3BE8 CD60 E408 A705
4. However, if I swap positions of the two fingerprints, it works.
New ".guix-authorizations" file:
#+begin_src scheme
(authorizations
(version 0)
(("405C B557 DE1F 1254 B012 640A 3BE8 CD60 E408 A705"
(name "Key Two")))
(("21D3 9304 CED7 A5CF 50B6 0B80 676A 5238 1FFD 80C5"
(name "Key One"))))
#+end_src
New commits history:
#+RESULTS:
: commit 7e4d98eea0e89652554d822503096371e5d59f3b (HEAD -> main)
: Author: Test <test@example.com>
: Date: Mon Jan 16 14:52:37 2023 +0800
:
: test
:
: commit a44434b1a9bd955cc897dea4c44abe64d6ab8112
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:53:49 2023 +0800
:
: Swap positions of the two fingerprints.
:
: commit a6794b64f9dfa828a5721e3f02c27ab74db9a487
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:53:17 2023 +0800
:
: Authorize Key Two.
:
: commit c9476062a2f341e9ee95a60d17cf2233b7c55ff4
: Author: Test <test@example.com>
: Date: Mon Jan 16 13:51:02 2023 +0800
:
: Authorize Key One.
And a new `guix git authenticate` result:
#+RESULTS:
: Authenticating commits c947606 to 7e4d98e (2 new commits)...
🥴
next reply other threads:[~2023-01-16 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 7:29 Hilton Chain via Bug reports for GNU Guix [this message]
2023-01-17 15:18 ` bug#60852: git-authenticate edge case for certain key setup Ludovic Courtès
2023-01-25 16:48 ` Hilton Chain via Bug reports for GNU Guix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lem3kkd7.wl-hako@ultrarare.space \
--to=bug-guix@gnu.org \
--cc=60852@debbugs.gnu.org \
--cc=hako@ultrarare.space \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).