* b4 crashes due to type error when signing with gpg key
@ 2024-10-10 12:44 Christian Heusel
2024-10-10 13:40 ` Konstantin Ryabitsev
2024-10-10 13:45 ` Bugspray Bot
0 siblings, 2 replies; 7+ messages in thread
From: Christian Heusel @ 2024-10-10 12:44 UTC (permalink / raw)
To: tools
[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]
Hello everyone,
today I wanted to check out b4 for sending patches again (I used git
send-email so far) and noticed what I think might be a bug. After b4
first complained that I had no signing method available I configured my
gpg key via user.signingkey and then got the following error on dry-run:
$ b4 send -o /tmp/presend
Converted the branch to 1 messages
Will write out messages into /tmp/presend
Traceback (most recent call last):
File "/sbin/b4", line 8, in <module>
sys.exit(cmd())
^^^^^
File "/usr/lib/python3.12/site-packages/b4/command.py", line 417, in cmd
cmdargs.func(cmdargs)
File "/usr/lib/python3.12/site-packages/b4/command.py", line 93, in cmd_send
b4.ez.cmd_send(cmdargs)
File "/usr/lib/python3.12/site-packages/b4/ez.py", line 2111, in cmd_send
sent = b4.send_mail(smtp, send_msgs, fromaddr=fromaddr, patatt_sign=sign,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/b4/__init__.py", line 3978, in send_mail
bdata = patatt.rfc2822_sign(bdata)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 1002, in rfc2822_sign
pm.sign(algo, keydata, identity=config.get('identity'), selector=config.get('selector'))
File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 580, in sign
idata.append(b'fpr=%s' % pkinfo)
~~~~~~~~~~^~~~~~~~
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
I can't really judge if this is an issue with patatt or b4, so I thought
this list would be a good first contact.
Further debugging information:
- b4 version: 0.14.2
- patatt version: 0.6.3
- output of `git config user.signingkey`: christian@heusel.eu
- git version: 2.47.0
I have also quickly skimmed the commits for 0.14.2-post but didn't find
anything that looks relevant at first glance.
Cheers,
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 12:44 b4 crashes due to type error when signing with gpg key Christian Heusel
@ 2024-10-10 13:40 ` Konstantin Ryabitsev
2024-10-10 13:51 ` Christian Heusel
2024-10-10 13:45 ` Bugspray Bot
1 sibling, 1 reply; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-10-10 13:40 UTC (permalink / raw)
To: Christian Heusel; +Cc: tools
On Thu, Oct 10, 2024 at 02:44:11PM GMT, Christian Heusel wrote:
> $ b4 send -o /tmp/presend
> Converted the branch to 1 messages
> Will write out messages into /tmp/presend
> Traceback (most recent call last):
> File "/sbin/b4", line 8, in <module>
> sys.exit(cmd())
> ^^^^^
> File "/usr/lib/python3.12/site-packages/b4/command.py", line 417, in cmd
> cmdargs.func(cmdargs)
> File "/usr/lib/python3.12/site-packages/b4/command.py", line 93, in cmd_send
> b4.ez.cmd_send(cmdargs)
> File "/usr/lib/python3.12/site-packages/b4/ez.py", line 2111, in cmd_send
> sent = b4.send_mail(smtp, send_msgs, fromaddr=fromaddr, patatt_sign=sign,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/lib/python3.12/site-packages/b4/__init__.py", line 3978, in send_mail
> bdata = patatt.rfc2822_sign(bdata)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 1002, in rfc2822_sign
> pm.sign(algo, keydata, identity=config.get('identity'), selector=config.get('selector'))
> File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 580, in sign
> idata.append(b'fpr=%s' % pkinfo)
> ~~~~~~~~~~^~~~~~~~
> TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Can you give me the output of the following:
git config --get user.signingkey
and:
gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
-K
bugspray tag me
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 12:44 b4 crashes due to type error when signing with gpg key Christian Heusel
2024-10-10 13:40 ` Konstantin Ryabitsev
@ 2024-10-10 13:45 ` Bugspray Bot
1 sibling, 0 replies; 7+ messages in thread
From: Bugspray Bot @ 2024-10-10 13:45 UTC (permalink / raw)
To: christian, tools
Hello:
This conversation is now tracked by Kernel.org Bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=219374
There is no need to do anything else, just keep talking.
--
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 13:40 ` Konstantin Ryabitsev
@ 2024-10-10 13:51 ` Christian Heusel
2024-10-10 14:08 ` Konstantin Ryabitsev
0 siblings, 1 reply; 7+ messages in thread
From: Christian Heusel @ 2024-10-10 13:51 UTC (permalink / raw)
To: Konstantin Ryabitsev; +Cc: tools
[-- Attachment #1: Type: text/plain, Size: 2934 bytes --]
On 24/10/10 09:40AM, Konstantin Ryabitsev wrote:
> On Thu, Oct 10, 2024 at 02:44:11PM GMT, Christian Heusel wrote:
> > $ b4 send -o /tmp/presend
> > Converted the branch to 1 messages
> > Will write out messages into /tmp/presend
> > Traceback (most recent call last):
> > File "/sbin/b4", line 8, in <module>
> > sys.exit(cmd())
> > ^^^^^
> > File "/usr/lib/python3.12/site-packages/b4/command.py", line 417, in cmd
> > cmdargs.func(cmdargs)
> > File "/usr/lib/python3.12/site-packages/b4/command.py", line 93, in cmd_send
> > b4.ez.cmd_send(cmdargs)
> > File "/usr/lib/python3.12/site-packages/b4/ez.py", line 2111, in cmd_send
> > sent = b4.send_mail(smtp, send_msgs, fromaddr=fromaddr, patatt_sign=sign,
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "/usr/lib/python3.12/site-packages/b4/__init__.py", line 3978, in send_mail
> > bdata = patatt.rfc2822_sign(bdata)
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^
> > File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 1002, in rfc2822_sign
> > pm.sign(algo, keydata, identity=config.get('identity'), selector=config.get('selector'))
> > File "/usr/lib/python3.12/site-packages/patatt/__init__.py", line 580, in sign
> > idata.append(b'fpr=%s' % pkinfo)
> > ~~~~~~~~~~^~~~~~~~
> > TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
>
> Can you give me the output of the following:
Sure, here you go:
> git config --get user.signingkey
$ git config --get user.signingkey
christian@heusel.eu
(this was already in my initial mail)
>
> and:
>
> gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
>
> -K
$ gpg --with-colons --fingerprint -K "$(git config --get user.signingkey)"
sec:u:4096:1:C047D4F328B52585:1634302979:::u:::scESC:::+:::23::0:
fpr:::::::::6F779ADE247A6B8A0F72CC13C047D4F328B52585:
grp:::::::::CE4A84D00DCBC94B028BE392A718A13B143CD8B6:
uid:u::::1634303292::EC73D33378091A6E253D239CCE7A85F5DB161CA5::Christian Heusel <christian@heusel.eu>::::::::::0:
uid:u::::1634303162::48746678F1EAE23BDDAC4B526F5C571FAA987931::Christian Heusel <c.heusel@stud.uni-heidelberg.de>::::::::::0:
uid:u::::1634303192::8DA8B6040D8A9417FC1D97826EDC7C33981A9B6C::Christian Heusel <chris@mathphys.stura.uni-heidelberg.de>::::::::::0:
ssb:u:4096:1:B5CACC35EF9F1204:1634302979::::::e:::+:::23:
fpr:::::::::BF020F0DAD135CC6C0237F6CB5CACC35EF9F1204:
grp:::::::::CE06F15FFCB96F00727234AACAE1A7D0C0ABCD7E:
Note that I have moved the "-K" forward, since in the order you sent it
it just printed all the keys.
I can provide further debugging output or test patches as needed!
Cheers,
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 13:51 ` Christian Heusel
@ 2024-10-10 14:08 ` Konstantin Ryabitsev
2024-10-10 14:22 ` Christian Heusel
0 siblings, 1 reply; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-10-10 14:08 UTC (permalink / raw)
To: Christian Heusel; +Cc: tools
On Thu, Oct 10, 2024 at 03:51:03PM GMT, Christian Heusel wrote:
> Note that I have moved the "-K" forward, since in the order you sent it
> it just printed all the keys.
Woops, -K is just my signature, not a PGP flag. ;)
Can you please rerun with just:
gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
Regards,
-K
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 14:08 ` Konstantin Ryabitsev
@ 2024-10-10 14:22 ` Christian Heusel
2024-10-10 14:38 ` Konstantin Ryabitsev
0 siblings, 1 reply; 7+ messages in thread
From: Christian Heusel @ 2024-10-10 14:22 UTC (permalink / raw)
To: Konstantin Ryabitsev; +Cc: tools
[-- Attachment #1: Type: text/plain, Size: 3472 bytes --]
On 24/10/10 10:08AM, Konstantin Ryabitsev wrote:
> On Thu, Oct 10, 2024 at 03:51:03PM GMT, Christian Heusel wrote:
> > Note that I have moved the "-K" forward, since in the order you sent it
> > it just printed all the keys.
>
> Woops, -K is just my signature, not a PGP flag. ;)
Ah sorry for missreading that, I thought it had wrapped around due to
line length ... :p (also -K/--list-secret-keys is a pgp flag that would
have made sense in this context, hence the extra confusion)
> Can you please rerun with just:
>
> gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
>
$ gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
tru::1:1727197441:1804773157:3:1:5
pub:r:4096:1:A3AA55C37A759E7C:1476016014:1633696014::-:::sca::::::23::0:
fpr:::::::::801158F31949757E4E59526AA3AA55C37A759E7C:
uid:r::::1506954544::EC73D33378091A6E253D239CCE7A85F5DB161CA5::Christian Heusel <christian@heusel.eu>::::::::::0:
uid:r::::1506954594::48746678F1EAE23BDDAC4B526F5C571FAA987931::Christian Heusel <c.heusel@stud.uni-heidelberg.de>::::::::::0:
uid:r::::1513380925::8DA8B6040D8A9417FC1D97826EDC7C33981A9B6C::Christian Heusel <chris@mathphys.stura.uni-heidelberg.de>::::::::::0:
uat:r::::1523546931::2C6D4374116128B02AD6A5A9625F638A62F5DD6D::1 15135::::::::::0:
sub:r:4096:1:52D3F824EBE5D7B1:1476016014:1633696014:::::e::::::23:
fpr:::::::::5CA51C3E7BCD44EE60708A0852D3F824EBE5D7B1:
pub:u:4096:1:C047D4F328B52585:1634302979:::u:::scESC::::::23::0:
fpr:::::::::6F779ADE247A6B8A0F72CC13C047D4F328B52585:
uid:u::::1634303292::EC73D33378091A6E253D239CCE7A85F5DB161CA5::Christian Heusel <christian@heusel.eu>::::::::::0:
uid:u::::1634303162::48746678F1EAE23BDDAC4B526F5C571FAA987931::Christian Heusel <c.heusel@stud.uni-heidelberg.de>::::::::::0:
uid:u::::1634303192::8DA8B6040D8A9417FC1D97826EDC7C33981A9B6C::Christian Heusel <chris@mathphys.stura.uni-heidelberg.de>::::::::::0:
sub:u:4096:1:B5CACC35EF9F1204:1634302979::::::e::::::23:
fpr:::::::::BF020F0DAD135CC6C0237F6CB5CACC35EF9F1204:
pub:e:4096:1:28A14EA281DF9942:1536070753:1567606753::-:::sc::::::23::0:
fpr:::::::::E2E738B0FFB722FAF6C4778228A14EA281DF9942:
uid:e::::1536070753::AF046BCD7ECC0B0900111A39598B4D9C5D606127::Chris Heusel (...) <christian@heusel.eu>::::::::::0:
sub:e:4096:1:2FB2A750FEFA2501:1536070753:1567606753:::::e::::::23:
fpr:::::::::CF75FB07012CAB2A59461A262FB2A750FEFA2501:
pub:f:4096:1:F75B286A54AA66AF:1647093157:1804773157::-:::scESC::::::23::0:
fpr:::::::::3A7C7BA0DD0BE85C3DB780D4F75B286A54AA66AF:
uid:f::::1647093157::8624E6F0D640CCCF15937933B05ADD7B7EF1FE2C::Christian Heusel (...) <christian@heusel.eu>::::::::::0:
sub:f:4096:1:387ED3A6376A9A78:1647093157:1804773157:::::e::::::23:
fpr:::::::::16781FFFA95F93D62A0C0916387ED3A6376A9A78:
pub:f:4096:1:B4DF3F75F61EE435:1653307717:1810987717::-:::scESC::::::23::0:
fpr:::::::::815B81F48EA4B3DF6325D58BB4DF3F75F61EE435:
uid:f::::1653307717::DEEBD4AD13E776531A2FE81454A96307A9EBE5A8::Christian Heusel (...) <christian@heusel.eu>::::::::::0:
sub:f:4096:1:7B4E9D4DCCB22DB6:1653307717:1810987717:::::e::::::23:
fpr:::::::::40019994F70C3AB367D7E6537B4E9D4DCCB22DB6:
After thinking about it for a moment I have replaced my email in the
value of user.signingkey with the gpg key ID which makes the problem go
away. So probably an extra safeguard to detect situations like this one
wouldn't hurt, but the issue is fixed for me.
> Regards,
> -K
Regards,
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: b4 crashes due to type error when signing with gpg key
2024-10-10 14:22 ` Christian Heusel
@ 2024-10-10 14:38 ` Konstantin Ryabitsev
0 siblings, 0 replies; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-10-10 14:38 UTC (permalink / raw)
To: Christian Heusel; +Cc: tools
On Thu, Oct 10, 2024 at 04:22:54PM GMT, Christian Heusel wrote:
> > Can you please rerun with just:
> >
> > gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
> >
>
> $ gpg --with-colons --fingerprint "$(git config --get user.signingkey)"
> tru::1:1727197441:1804773157:3:1:5
> pub:r:4096:1:A3AA55C37A759E7C:1476016014:1633696014::-:::sca::::::23::0:
Yes, this helps, thank you. For the record, we don't currently expect the
command to return multiple keys, because we assume that signingKey would be
pointing at a keyid, not at a uid that can return multiple unrelated keys.
When we try to look up the fingerprint for the key that did the signing, we
come up with the wrong result because the first key returned by the
--fingerprint command is the revoked key.
I'll keep this bug open as a reminder to fix it in patatt.
Thanks for the report,
-K
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-10 14:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 12:44 b4 crashes due to type error when signing with gpg key Christian Heusel
2024-10-10 13:40 ` Konstantin Ryabitsev
2024-10-10 13:51 ` Christian Heusel
2024-10-10 14:08 ` Konstantin Ryabitsev
2024-10-10 14:22 ` Christian Heusel
2024-10-10 14:38 ` Konstantin Ryabitsev
2024-10-10 13:45 ` Bugspray Bot
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 NNTP newsgroup(s).