From lee.yanzhe at yanzhe.org Sun Sep 2 05:09:14 2018 From: lee.yanzhe at yanzhe.org (Yanzhe Lee) Date: Sun, 2 Sep 2018 11:09:14 +0800 Subject: "gpg: signing failed: Invalid length" when use brainpool512r1 keys to sign things Message-ID: Hello, Recently I come across this error "gpg: signing failed: Invalid length" when use brainpool512r1 keys to do sign operations, such as --sign-key, --lsign-key or even generate a brainpool512r1 key. All keys except Brainpool P-384 and Brainpool P-512 work fine. I tried to generate Brainpool P-256, it's fine. Strange thing is that I use brainpool512r1 before, and no error occurred. The error just shows recently, maybe it is a configuration error? ? - Version gpg (GnuPG) 2.2.4/2.2.9 both tried libgcrypt 1.8.1 Ubuntu 18.04 LTS/MacOS 10.13.6 both tried - steps to reproduce this error: gpg --expert --full-gen-key gpg (GnuPG) 2.2.4; Copyright (C) 2017 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: ?? (1) RSA and RSA (default) ?? (2) DSA and Elgamal ?? (3) DSA (sign only) ?? (4) RSA (sign only) ?? (7) DSA (set your own capabilities) ?? (8) RSA (set your own capabilities) ?? (9) ECC and ECC ? (10) ECC (sign only) ? (11) ECC (set your own capabilities) ? (13) Existing key Your selection? 11 Possible actions for a ECDSA/EdDSA key: Sign Certify Authenticate Current allowed actions: Sign Certify ?? (S) Toggle the sign capability ?? (A) Toggle the authenticate capability ?? (Q) Finished Your selection? a Possible actions for a ECDSA/EdDSA key: Sign Certify Authenticate Current allowed actions: Sign Certify Authenticate ?? (S) Toggle the sign capability ?? (A) Toggle the authenticate capability ?? (Q) Finished Your selection? q Please select which elliptic curve you want: ?? (1) Curve 25519 ?? (3) NIST P-256 ?? (4) NIST P-384 ?? (5) NIST P-521 ?? (6) Brainpool P-256 ?? (7) Brainpool P-384 ?? (8) Brainpool P-512 ?? (9) secp256k1 Your selection? 8 Please specify how long the key should be valid. ???????? 0 = key does not expire ????? ? = key expires in n days ????? w = key expires in n weeks ????? m = key expires in n months ????? y = key expires in n years Key is valid for? (0) 1d Key expires at Mon 03 Sep 2018 10:39:53 AM CST Is this correct? (y/N) y GnuPG needs to construct a user ID to identify your key. Real name: test2 Email address: test2 Comment: You selected this USER-ID: ??? "test2 " Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. gpg: signing failed: Invalid length gpg: make_keysig_packet failed: Invalid length Key generation failed: Invalid length Best regards, Yanzhe Lee -------------- next part -------------- A non-text attachment was scrubbed... Name: 0x3EA647C79FDA9CD1.asc Type: application/pgp-keys Size: 10394 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 313 bytes Desc: OpenPGP digital signature URL: From mlnl at mailbox.org Sun Sep 2 14:38:07 2018 From: mlnl at mailbox.org (mlnl) Date: Sun, 2 Sep 2018 14:38:07 +0200 Subject: "gpg: signing failed: Invalid length" when use brainpool512r1 keys to sign things In-Reply-To: References: Message-ID: <1d49e271-a328-7203-3457-7f1f7f5da007@mailbox.org> Hi, > gpg: signing failed: Invalid length > gpg: make_keysig_packet failed: Invalid length > Key generation failed: Invalid length tested & confirmed with GnuPG 2.2.10, libgcrypt 1.8.3 Debian Stretch 9.5 -- mlnl From gniibe at fsij.org Mon Sep 3 08:36:33 2018 From: gniibe at fsij.org (NIIBE Yutaka) Date: Mon, 03 Sep 2018 15:36:33 +0900 Subject: "gpg: signing failed: Invalid length" when use brainpool512r1 keys to sign things In-Reply-To: <1d49e271-a328-7203-3457-7f1f7f5da007@mailbox.org> References: <1d49e271-a328-7203-3457-7f1f7f5da007@mailbox.org> Message-ID: <878t4jw0i6.fsf@fsij.org> mlnl wrote: >> gpg: signing failed: Invalid length >> gpg: make_keysig_packet failed: Invalid length >> Key generation failed: Invalid length > > tested & confirmed with GnuPG 2.2.10, libgcrypt 1.8.3 Debian Stretch 9.5 Not reproducible here (similar on Debian Stretch). I tested with no configuration. Is it reproducible under no configuration? I tested with: $ export GNUPGHOME=/tmp/g; mkdir -m=0700 $GNUPGHOME -- From kristian.fiskerstrand at sumptuouscapital.com Mon Sep 3 09:58:24 2018 From: kristian.fiskerstrand at sumptuouscapital.com (Kristian Fiskerstrand) Date: Mon, 3 Sep 2018 09:58:24 +0200 Subject: Issue with pinentry GUI agent In-Reply-To: <4b4d861e-33c6-b3eb-e17f-8f69818ef486@sumptuouscapital.com> References: <20180825081848.43e260fa@black> <87mut65p22.fsf@fifthhorseman.net> <4b4d861e-33c6-b3eb-e17f-8f69818ef486@sumptuouscapital.com> Message-ID: On 08/29/2018 12:41 AM, Kristian Fiskerstrand wrote: > On 08/28/2018 08:22 PM, Daniel Kahn Gillmor wrote: >> On Sat 2018-08-25 08:18:48 +0200, sunrises at gmx.com wrote: >>> Hi all, since some days I'm having an issue with pinentry, I've set the default agent as pinentry-qt4 >>> from update-alternatives (I've also tried pinentry-qt and pinentry-gnome) but when I run gpg --decrypt file >>> it's always falling on the cli for prompting the password. In .gnupg/gpg-agent.conf as the first line I have >>> pinentry-program /usr/bin/pinentry-qt4 as well, but I don't get why it's ignoring it. >>> There's a way to debug what's going on? >> >> can you give a little bit more information about your system (OS, >> version, version of gpg, version of pinentry, etc), and how you're >> accessing it (e.g. via ssh, via a graphical environment, etc)? >> >> have you terminated your gpg-agent program ("gpgconf --kill gpg-agent") >> after updating your settings in ~/.gnupg/gpg-agent.conf so that the >> settings would take effect? > > Not sure if it is related, but I'm currently also investigating an issue > with the qt pinentry for Gentoo installations. no similar issues for the > other ones.. I'm able to reproduce failures with the auto-spawned > gpg-agent though, that doesn't materialize when calling the pinentry > application directly in an environment. > > In this case the gtk2 pinentry works as expected though... but something > is possibly off with the handling of DISPLAY (as far as I've gotten in > my debugging that is the only diff in the env vars between the direct > invocation and the bash propmpted one, it might not be ultimately relevant) > Just to have it mentioned, turned out this was an issue with missing keep-display in gpg-agent.conf, without this the Qt4/5 pinentry fail (although I've been told it is not an issue in KDE environment). gpg-agent without keep-display still seems to send display as argument in --display :0 style, but this does not seem to be honored. -- ---------------------------- Kristian Fiskerstrand Blog: https://blog.sumptuouscapital.com Twitter: @krifisk ---------------------------- Public OpenPGP keyblock at hkp://pool.sks-keyservers.net fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3 ---------------------------- "Strength lies in differences, not in similarities." (Stephen Covey) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From mlnl at mailbox.org Mon Sep 3 17:40:57 2018 From: mlnl at mailbox.org (mlnl) Date: Mon, 3 Sep 2018 17:40:57 +0200 Subject: "gpg: signing failed: Invalid length" when use brainpool512r1 keys to sign things In-Reply-To: <878t4jw0i6.fsf@fsij.org> References: <1d49e271-a328-7203-3457-7f1f7f5da007@mailbox.org> <878t4jw0i6.fsf@fsij.org> Message-ID: Hi, >> tested & confirmed with GnuPG 2.2.10, libgcrypt 1.8.3 Debian Stretch 9.5 > > Not reproducible here (similar on Debian Stretch). > > I tested with no configuration. > > Is it reproducible under no configuration? > > I tested with: > > $ export GNUPGHOME=/tmp/g; mkdir -m=0700 $GNUPGHOME I have looked at my gpg.conf and found a commented hint for myself ;): # cert-digest-algo SHA512 for ECC >= 512-bit Tested again with cert-digest-algo SHA512 without problems: pub brainpoolP512r1/0D9032C369992D8E 2018-09-03 [SCA] [verf?llt: 2019-09-03] Schl.-Fingerabdruck = 2601 6E4C BA25 2686 EEC1 EBB8 0D90 32C3 6999 2D8E Keygrip = 985D56A2FE62C404CC0382815C391E01B5769F58 uid testbp512 -- mlnl From Siemons at CleanFuels.nl Mon Sep 3 17:03:19 2018 From: Siemons at CleanFuels.nl (Roland Siemons (P)) Date: Mon, 3 Sep 2018 17:03:19 +0200 Subject: revocation troubles & smartcard troubles Message-ID: <66ac615c-11d8-2cc2-4016-fc2a3e02fcd9@CleanFuels.nl> Dear GnuPG, I am already using GnuPG for a long time. But try to improve my understanding of and working with it. I became a member of Free Software Foundation Europe, and got a smartcard. I wanted to use it. And that is where the trouble started: I intended to copy all my personal keys to the smart card. In Kleopatra, I selected "Tools/Manage smartcards" Then I selected "Import a certificate from a file", and selected files from my laptop. I was under the impression that I was copying files to the smartcard. By doing so, I not only selected my private key but also my revocation key (because, why should I enable a thief of my laptop to revoke my key?). And then it appeared that I had revoked my entire key pair. Unintended! Apparently, under smartcard management, I was not at all copying files to the smartcard. Apparently, I was doing something else. Did I at all copy files to the smartcard? Questions: Can I UNrevoke that key? How can I see what is on the smartcard? How can I copy files to the smartcard? I studied the GnuPG Smartcard How-To (www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is entirely linux oriented. I am working on a win7 system. Can anyone help me further? Thanks! Roland -------------- next part -------------- A non-text attachment was scrubbed... Name: 0xAEEC5E2ED87628F5.asc Type: application/pgp-keys Size: 8477 bytes Desc: not available URL: From dirk.gottschalk1980 at googlemail.com Mon Sep 3 18:41:29 2018 From: dirk.gottschalk1980 at googlemail.com (Dirk Gottschalk) Date: Mon, 03 Sep 2018 18:41:29 +0200 Subject: revocation troubles & smartcard troubles In-Reply-To: <66ac615c-11d8-2cc2-4016-fc2a3e02fcd9@CleanFuels.nl> References: <66ac615c-11d8-2cc2-4016-fc2a3e02fcd9@CleanFuels.nl> Message-ID: As long as you did not publish reports revocation, delete the key and re-import it without the revocation cert. Am 3. September 2018 17:03:19 MESZ schrieb "Roland Siemons (P)" : >Dear GnuPG, > >I am already using GnuPG for a long time. But try to improve my >understanding of and working with it. >I became a member of Free Software Foundation Europe, and got a >smartcard. I wanted to use it. > >And that is where the trouble started: >I intended to copy all my personal keys to the smart card. >In Kleopatra, I selected "Tools/Manage smartcards" >Then I selected "Import a certificate from a file", and selected files >from my laptop. >I was under the impression that I was copying files to the smartcard. >By doing so, I not only selected my private key but also my revocation >key (because, why should I enable a thief of my laptop to revoke my >key?). >And then it appeared that I had revoked my entire key pair. Unintended! >Apparently, under smartcard management, I was not at all copying files >to the smartcard. Apparently, I was doing something else. Did I at all >copy files to the smartcard? > >Questions: >Can I UNrevoke that key? >How can I see what is on the smartcard? >How can I copy files to the smartcard? > >I studied the GnuPG Smartcard How-To >(www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is >entirely linux oriented. >I am working on a win7 system. > >Can anyone help me further? > >Thanks! > >Roland -- Diese Nachricht wurde von meinem Android-Ger?t mit K-9 Mail gesendet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Roman.Fiedler at ait.ac.at Mon Sep 3 18:56:41 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Mon, 3 Sep 2018 16:56:41 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <874899396fd84b039af389d00ac65fb4@ait.ac.at> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> Message-ID: Hello List, Just for the records: a gnupg2 "ERROR key_generate 33554531" is fixed by sending " %no-protection" via the command-fd. It seems that a password-less key was generated with gpg1 just by not setting a password. With gnupg2 this command is needed. @Devs: It would be really nice to issue a message like "Refusing to create unprotected key, use %no-protection if you know what you are doing". Would have helped saving quite some time. Just to continue the gpg1 -> gpg2 migration error message guessing game: what might be the issue with this command? /usr/bin/gpg --no-options --batch --no-default-keyring --homedir [some-home] --keyring key.pub --lock-never --trust-model always --status-fd 2 --verify 4b7b830243078d63.gpg [GNUPG:] UNEXPECTED 0 gpg: verify signatures failed: Unexpected error [GNUPG:] FAILURE verify 38 With gpg1 a similar command should have verified, that the signature is exactly from the single public key stored in "key.pub". Best regards, Roman > Von: Gnupg-users [mailto:gnupg-users-bounces at gnupg.org] Im Auftrag von > > Hello list, > > I am attempting to upgrade software to use gpg2 instead of gpg. After fixing > the usual "Inappropriate ioctl for device" and "Sorry, we are in batchmode - > can't get input" messages and applying all the gpg_agent security > workarounds, I am now stuck at this sequence: > > The key generation command > > ['/usr/bin/gpg', '--homedir', '/tmp/tmp-3abk6l8', '--with-colons', '--status-fd', > '2', '--pinentry-mode', 'loopback', '--batch', '--gen-key', '--command-fd', '0'] > > with the security-sensitive passphrase-input via the command-fd > > b'%echo Generating key\nKey-Type: RSA\nKey-Length: 1024\nSubkey-Type: > ELG-E\nSubkey-Length: 1024\nName-Real: AutomationKey\nExpire-Date: > 0\n%commit\n', > > will generate following output: > > gpg: keybox '/tmp/tmp-3abk6l8/pubring.kbx' created > gpg: Generating key > [GNUPG:] INQUIRE_MAXLEN 100 > [GNUPG:] GET_HIDDEN passphrase.enter > [GNUPG:] GOT_IT > gpg: agent_genkey failed: Operation cancelled > gpg: key generation failed: Operation cancelled > [GNUPG:] ERROR key_generate 33554531 > [GNUPG:] KEY_NOT_CREATED > > It seems that agent and gpg are going through some "brain-split" episode as > the errors seem to indicate, that everyone is thinking the other party > canceled the transfer. The strace indicates, that gnupg itself sends the > "cancel" request to the agent and is astonished by the result - it cannot even > give a meaningful error message about the current condition. As there is no > other syscall activity, all the reasons for have to be in gpg2. > > 2138 write(2, "[GNUPG:] INQUIRE_MAXLEN 100", 27) = 27 > 2138 write(2, "\n", 1) = 1 > 2138 write(2, "[GNUPG:] GET_HIDDEN passphrase.enter", 36) = 36 > 2138 write(2, "\n", 1) = 1 > 2138 read(0, "", 1) = 0 > 2138 write(2, "[GNUPG:] GOT_IT", 15) = 15 --- not knowing what gnupg > successfully got here as there is no passphrase to read > 2138 write(2, "\n", 1) = 1 > 2138 write(3, "CAN", 3) = 3 --- Gnupg sending cancel > 2138 write(3, "\n", 1) = 1 > 2138 read(3, > 2142 read(9, "CAN\n", 1002) = 4 --- Agent reading cancel > 2142 getpid() = 2141 > 2142 write(2, "gpg-agent[2141]: command 'GENKEY' failed: IPC call has been > cancelled", 69) = 69 > 2142 write(2, "\n", 1) = 1 > 2142 write(9, "ERR 67109141 IPC call has been cancelled ", 52) > = 52 --- Agent telling gnupg about cancel > 2138 <... read resumed> "ERR 67109141 IPC call has been cancelled Agent>", 1002) = 52 -- gpg reading cancel > 2138 read(3, > 2142 write(9, "\n", 1) = 1 > 2138 <... read resumed> "\n", 950) = 1 > 2138 write(2, "gpg: agent_genkey failed: Operation cancelled", 45) = 45 > 2138 write(2, "\n", 1) = 1 > 2138 write(2, "gpg: key generation failed: Operation cancelled", 47) = 47 > 2138 write(2, "\n", 1) = 1 > 2138 write(2, "[GNUPG:] ERROR key_generate 33554531", 36) = 36 > 2138 write(2, "\n", 1) = 1 > 2138 write(2, "[GNUPG:] KEY_NOT_CREATED ", 25) = 25 > 2138 write(2, "\n", 1) = 1 > 2138 read(0, "", 8192) = 0 > 2138 munmap(0x7faad0a44000, 65536) = 0 > 2138 exit_group(2) = ? > 2138 +++ exited with 2 +++ > > Does someone know how to fix that? > > LG Roman From peter at digitalbrains.com Mon Sep 3 19:25:10 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Mon, 3 Sep 2018 19:25:10 +0200 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> Message-ID: <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> On 03/09/18 18:56, Fiedler Roman wrote: > With gpg1 a similar command should have verified, that the signature > is exactly from the single public key stored in "key.pub". This has never been a supported use of gpg, it just happened to work because GnuPG 1.4 happened to use a bunch of exported OpenPGP certificates as the format of its public keyring. This was an implementation detail which enabled you to do this. Just because you can use the rear side of a screwdriver to hammer in a small nail doesn't mean you're meant to do carpentry that way ;-). In GnuPG, the homedir is pretty much not part of the interface, it is internal with some exceptions like .conf-files and being able to retrieve revocation certificates from it. The keyring format has changed and GnuPG also expects a lot of other different things in its homedir. So it no longer works. It could be that recently an option was added to check a signature by a certificate in a file, but in general you need to import a certificate before you can do verifications. I didn't see the new option in the few announcements I read. Either it was discussed and not done or discussed and implemented, can't recall. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From wk at gnupg.org Tue Sep 4 07:55:20 2018 From: wk at gnupg.org (Werner Koch) Date: Tue, 04 Sep 2018 07:55:20 +0200 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> (Peter Lebbing's message of "Mon, 3 Sep 2018 19:25:10 +0200") References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> Message-ID: <87bm9dg62f.fsf@wheatstone.g10code.de> On Mon, 3 Sep 2018 19:25, peter at digitalbrains.com said: > It could be that recently an option was added to check a signature by a > certificate in a file, but in general you need to import a certificate No, that is nlot the case. We only added the option -f to encrypt to a key taken from a file. For verification against a single key or a set of keys use the gpgv tool: gpgv --keyring FILEWITHKEYS FILETOCHECK [DATAFILE] Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From Roman.Fiedler at ait.ac.at Tue Sep 4 09:52:33 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Tue, 4 Sep 2018 07:52:33 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" Message-ID: <2669076f402241d6be36b5605049c8f4@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > > On 03/09/18 18:56, Fiedler Roman wrote: > > With gpg1 a similar command should have verified, that the signature > > is exactly from the single public key stored in "key.pub". > > This has never been a supported use of gpg, it just happened to work > because GnuPG 1.4 happened to use a bunch of exported OpenPGP > certificates as the format of its public keyring. This was an > implementation detail which enabled you to do this. Just because you can > use the rear side of a screwdriver to hammer in a small nail doesn't > mean you're meant to do carpentry that way ;-). Maybe the current hammer documentation should be updated, to remove the "--use-as-hammer" options? Or at least declare, that they shall not be used that way. See: https://www.gnupg.org/gph/en/manual/r1606.html https://www.gnupg.org/gph/en/manual/r1574.html Without that, what should be the purpose of the "--no-default-keyring" except to flush all default keys and operate only on the ones given via the "--keyring" option? > In GnuPG, the homedir is > pretty much not part of the interface, it is internal with some > exceptions like .conf-files and being able to retrieve revocation > certificates from it. The keyring format has changed and GnuPG also > expects a lot of other different things in its homedir. So it no longer > works. Maybe the "--no-default-keyring" should return something like "obsolete gnupg file API used" instead of "[GNUPG:] UNEXPECTED 0"? > It could be that recently an option was added to check a signature by a > certificate in a file, but in general you need to import a certificate > before you can do verifications. I didn't see the new option in the few > announcements I read. Either it was discussed and not done or discussed > and implemented, can't recall. Werner gave a good solution in another followup message. May I recommend updating the online docu/man page for "--verify" with something like this? """For automated verification against a single public key, the gpgv tool may better suit you needs""" Or could I submit patches to documentation and source code (error handling) myself? I did not find a "contribute" section on the gnupg website at a first glance (menus/FAQs), but could look into it deeper, if helpful. Regards, Roman From Roman.Fiedler at ait.ac.at Tue Sep 4 10:08:48 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Tue, 4 Sep 2018 08:08:48 +0000 Subject: AW: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <87bm9dg62f.fsf@wheatstone.g10code.de> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> Message-ID: <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> > Von: Werner Koch [mailto:wk at gnupg.org] > > On Mon, 3 Sep 2018 19:25, peter at digitalbrains.com said: > > > It could be that recently an option was added to check a signature by a > > certificate in a file, but in general you need to import a certificate > > No, that is nlot the case. We only added the option -f to encrypt to a > key taken from a file. > > For verification against a single key or a set of keys use the gpgv > tool: > > gpgv --keyring FILEWITHKEYS FILETOCHECK [DATAFILE] Thanks for your helpful reply, that seems to be exactly the command I should use. But it seems it is suffering from the same "[GNUPG:] UNEXPECTED 0" issue. /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring key.pub data.gpg [GNUPG:] UNEXPECTED 0 gpgv: verify signatures failed: Unexpected error Could it be, that "--throw-keyids" at signature creation to then avoid XKeyscore-traffic-analysis [1] is not compatible with signature verification? I would have expected to work exactly the same way as with "--decrypt": without a key-ID all keys are tested. Regards, Roman [1] https://motherboard.vice.com/en_us/article/ezpxan/pssst-your-pgp-is-leaking From andrewg at andrewg.com Tue Sep 4 10:11:55 2018 From: andrewg at andrewg.com (Andrew Gallagher) Date: Tue, 4 Sep 2018 09:11:55 +0100 Subject: First smartcard operation always fails Message-ID: <7560326c-9cc5-1cb7-a6f0-749128911335@andrewg.com> Hi, all. I've had a pgp smartcard v2.1 for years now (two, actually), and I've noticed that no matter what operation I perform, the first attempt after inserting the card, or waking from sleep with the card inserted, fails. Example: ``` andrewg at fred:~$ ssh my.server sign_and_send_pubkey: signing failed: agent refused operation andrewg at my.server's password: ^C andrewg at fred:~$ ssh my.server Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-92-lowlatency x86_64) ``` A similar thing happens with signing emails, and my signing and authentication subkeys are distinct. This has been bugging me for as long as I can remember, across different machines, different software versions and OSes (Linux and Mac), and using both smartcards. Does anyone have any idea what's going on? -- Andrew Gallagher -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 862 bytes Desc: OpenPGP digital signature URL: From andrewg at andrewg.com Tue Sep 4 10:17:49 2018 From: andrewg at andrewg.com (Andrew Gallagher) Date: Tue, 4 Sep 2018 09:17:49 +0100 Subject: First smartcard operation always fails In-Reply-To: <7560326c-9cc5-1cb7-a6f0-749128911335@andrewg.com> References: <7560326c-9cc5-1cb7-a6f0-749128911335@andrewg.com> Message-ID: <63e6787f-12cb-350d-ed65-7f28a4cbc5e1@andrewg.com> On 04/09/18 09:11, Andrew Gallagher wrote: > Hi, all. > > I've had a pgp smartcard v2.1 for years now (two, actually), and I've > noticed that no matter what operation I perform, the first attempt after > inserting the card, or waking from sleep with the card inserted, fails. And I have just confirmed (by sending that mail) that both the first auth operation AND the first signing operation fail, separately. -- Andrew Gallagher -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 862 bytes Desc: OpenPGP digital signature URL: From Siemons at CleanFuels.nl Tue Sep 4 10:29:20 2018 From: Siemons at CleanFuels.nl (Roland Siemons (P)) Date: Tue, 4 Sep 2018 10:29:20 +0200 Subject: Gnupg-users Digest, Vol 180, Issue 3 In-Reply-To: References: Message-ID: <9ea1bffb-cd6c-c2f3-ac5d-d5938d960c85@CleanFuels.nl> @ Dirk Gottschalk: Thanks for very effective response to my first question! Remains: How can I see what is on the smartcard? How can I copy files to the smartcard? I studied the GnuPG Smartcard How-To (www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is entirely linux oriented. Whereas I am working on a win7 system. HOWEVER, by trial and error, I found out that the same commands work on the command line terminal of Win7. I shall test it further. Best regards, Roland On 04/09/2018 09:52, gnupg-users-request at gnupg.org wrote: > Send Gnupg-users mailing list submissions to > gnupg-users at gnupg.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.gnupg.org/mailman/listinfo/gnupg-users > or, via email, send a message with subject or body 'help' to > gnupg-users-request at gnupg.org > > You can reach the person managing the list at > gnupg-users-owner at gnupg.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Gnupg-users digest..." > > > Today's Topics: > > 1. Re: revocation troubles & smartcard troubles (Dirk Gottschalk) > 2. AW: How to fix "ERROR key_generate 3355453" / "GENKEY' > failed: IPC call has been cancelled" (Fiedler Roman) > 3. Re: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' > failed: IPC call has been cancelled" (Peter Lebbing) > 4. Re: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' > failed: IPC call has been cancelled" (Werner Koch) > 5. AW: How to fix "ERROR key_generate 3355453" / "GENKEY' > failed: IPC call has been cancelled" (Fiedler Roman) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 03 Sep 2018 18:41:29 +0200 > From: Dirk Gottschalk > To: gnupg-users at gnupg.org > Subject: Re: revocation troubles & smartcard troubles > Message-ID: > Content-Type: text/plain; charset="utf-8" > > As long as you did not publish reports revocation, delete the key and re-import it without the revocation cert. > > Am 3. September 2018 17:03:19 MESZ schrieb "Roland Siemons (P)" : >> Dear GnuPG, >> >> I am already using GnuPG for a long time. But try to improve my >> understanding of and working with it. >> I became a member of Free Software Foundation Europe, and got a >> smartcard. I wanted to use it. >> >> And that is where the trouble started: >> I intended to copy all my personal keys to the smart card. >> In Kleopatra, I selected "Tools/Manage smartcards" >> Then I selected "Import a certificate from a file", and selected files > >from my laptop. >> I was under the impression that I was copying files to the smartcard. >> By doing so, I not only selected my private key but also my revocation >> key (because, why should I enable a thief of my laptop to revoke my >> key?). >> And then it appeared that I had revoked my entire key pair. Unintended! >> Apparently, under smartcard management, I was not at all copying files >> to the smartcard. Apparently, I was doing something else. Did I at all >> copy files to the smartcard? >> >> Questions: >> Can I UNrevoke that key? >> How can I see what is on the smartcard? >> How can I copy files to the smartcard? >> >> I studied the GnuPG Smartcard How-To >> (www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is >> entirely linux oriented. >> I am working on a win7 system. >> >> Can anyone help me further? >> >> Thanks! >> >> Roland > -------------- next part -------------- A non-text attachment was scrubbed... Name: 0xAEEC5E2ED87628F5.asc Type: application/pgp-keys Size: 6344 bytes Desc: not available URL: From Siemons at CleanFuels.nl Tue Sep 4 10:31:59 2018 From: Siemons at CleanFuels.nl (Roland Siemons (P)) Date: Tue, 4 Sep 2018 10:31:59 +0200 Subject: Subkeys In-Reply-To: References: Message-ID: Dear GnuPG As a user of GPG4Win, is there any explanation in the compendium about the meaning and use of subkeys (I cannot find anything about that matter in the The Gpg4win Compendium 3.0.0) Best regards, -- Roland Siemons -------------- next part -------------- A non-text attachment was scrubbed... Name: 0xAEEC5E2ED87628F5.asc Type: application/pgp-keys Size: 6344 bytes Desc: not available URL: From peter at digitalbrains.com Tue Sep 4 11:57:51 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 11:57:51 +0200 Subject: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <2669076f402241d6be36b5605049c8f4@ait.ac.at> References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> Message-ID: On 04/09/18 09:52, Fiedler Roman wrote: > Maybe the current hammer documentation should be updated, to remove > the "--use-as-hammer" options? Or at least declare, that they shall not > be used that way. See: > > https://www.gnupg.org/gph/en/manual/r1606.html > https://www.gnupg.org/gph/en/manual/r1574.html Ah, but you didn't pass it a keyring, did you? You passed it an exported OpenPGP key, which is no longer the format of a keyring! :-) > Werner gave a good solution in another followup message. Yes, the new option to *encrypt* to a key in a file made me forget about the age-old gpgv :-). I got it mixed up. > Or could I submit patches to documentation and source code (error handling) > myself? I did not find a "contribute" section on the gnupg website at a first glance > (menus/FAQs), but could look into it deeper, if helpful. I'd say: definitely. I'm not a GnuPG dev, though. I think for instance the git repository with the man page can be reached through the web on [1]. Note that if you were to carefully read the long table of contents of the "GnuPG manual"[2], you'd stumble upon these entries: > 8 Helper Tools > [...] > 8.2 Verify OpenPGP signatures I think your addition to the man page would be helpful, but a balance has to be struck between documenting what something does and what it does not. Writing good, clear documentation is hard. I don't think the current documentation is as good as it could be. The fact that there are so many options and commands makes it very hard to do right. In the current state of the documentation, I think your addition is a good one. More in general, I think there should be documentation that users read which means they wouldn't end up at the man page for the gpg command-line tool at all, but they would immediately have chosen gpgv in the first place. I hope I'm succeeding in getting my intention across, I'm having some trouble putting it in words :-). man pages are reference works, not user guides. You already know how to use something, but the details elude you for a moment? You grab a reference. You can't learn English from a dictionary, and you can't efficiently look up the spelling of a word in an English course. In this particular case, what set you off in the wrong direction was that you were doing something which was never *intended* to work, it just did. Worse, people have been telling other people that this was something you could do. I think it's hard to catch all these things in documentation when at the same time people on the interwebs are saying "oh you should use an exported key as keyring". HTH, Peter. [1] [2] -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From peter at digitalbrains.com Tue Sep 4 12:01:17 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 12:01:17 +0200 Subject: First smartcard operation always fails In-Reply-To: <63e6787f-12cb-350d-ed65-7f28a4cbc5e1@andrewg.com> References: <7560326c-9cc5-1cb7-a6f0-749128911335@andrewg.com> <63e6787f-12cb-350d-ed65-7f28a4cbc5e1@andrewg.com> Message-ID: <406d828f-88fd-a8b5-0f27-0098ea4371c7@digitalbrains.com> On 04/09/18 10:17, Andrew Gallagher wrote: > And I have just confirmed (by sending that mail) that both the first > auth operation AND the first signing operation fail, separately. I have no idea, it's quite curious. As an added bread crumb to follow: what do the PIN retry counters say after the failure? gpg --card-status. Do you always use the same reader? Perhaps it is the reader. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From wiktor at metacode.biz Tue Sep 4 12:14:18 2018 From: wiktor at metacode.biz (Wiktor Kwapisiewicz) Date: Tue, 4 Sep 2018 12:14:18 +0200 Subject: Subkeys In-Reply-To: References: Message-ID: Hi Roland, I don't know if you have some specific questions but the Debian wiki page about Subkeys is nice: https://wiki.debian.org/Subkeys tl;dr version is primary/subkey setup lets you have your primary key completely offline and use subkeys for daily work. If something bad happens to a subkey (e.g. compromise) you can use primary key to revoke it. There are 4 flags for key usage: C - Certify (for primary keys), S - signing, E - encryption and A - authentication (e.g. SSH). Kind regards, Wiktor > Dear GnuPG > > As a user of GPG4Win, is there any explanation in the compendium about > the meaning and use of subkeys (I cannot find anything about that matter > in the The Gpg4win Compendium 3.0.0) > > Best regards, > > > _______________________________________________ > Gnupg-users mailing list > Gnupg-users at gnupg.org > http://lists.gnupg.org/mailman/listinfo/gnupg-users > -- https://metacode.biz/@wiktor From wiktor at metacode.biz Tue Sep 4 12:15:17 2018 From: wiktor at metacode.biz (Wiktor Kwapisiewicz) Date: Tue, 4 Sep 2018 12:15:17 +0200 Subject: Gnupg-users Digest, Vol 180, Issue 3 In-Reply-To: <9ea1bffb-cd6c-c2f3-ac5d-d5938d960c85@CleanFuels.nl> References: <9ea1bffb-cd6c-c2f3-ac5d-d5938d960c85@CleanFuels.nl> Message-ID: <1017f87b-1aa7-c096-c553-db5507fb0e90@metacode.biz> On 04.09.2018 10:29, Roland Siemons (P) wrote: > Remains: > How can I see what is on the smartcard? gpg --card-status > How can I copy files to the smartcard? You can't copy generic files, smartcard contains only private keys (gpg --edit-key X, keytocard) and a small amount of data objects (gpg --card-edit, admin, url/lang/name). Note that keytocard *moves* key to card, meaning the local copy of the private key will be deleted. If you don't want that (e.g. encryption key) either have a copy or *don't* save after keytocard command. The card can store only 3 keys: one signature, one encryption and one authentication key. Kind regards, Wiktor On 04.09.2018 10:29, Roland Siemons (P) wrote: > @ Dirk Gottschalk: Thanks for very effective response to my first question! > > Remains: > How can I see what is on the smartcard? > How can I copy files to the smartcard? > > I studied the GnuPG Smartcard How-To > (www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is > entirely linux oriented. Whereas I am working on a win7 system. > > HOWEVER, by trial and error, I found out that the same commands work on > the command line terminal of Win7. I shall test it further. > > Best regards, > > Roland > > > On 04/09/2018 09:52, gnupg-users-request at gnupg.org wrote: >> Send Gnupg-users mailing list submissions to >> gnupg-users at gnupg.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://lists.gnupg.org/mailman/listinfo/gnupg-users >> or, via email, send a message with subject or body 'help' to >> gnupg-users-request at gnupg.org >> >> You can reach the person managing the list at >> gnupg-users-owner at gnupg.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of Gnupg-users digest..." >> >> >> Today's Topics: >> >> 1. Re: revocation troubles & smartcard troubles (Dirk Gottschalk) >> 2. AW: How to fix "ERROR key_generate 3355453" / "GENKEY' >> failed: IPC call has been cancelled" (Fiedler Roman) >> 3. Re: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' >> failed: IPC call has been cancelled" (Peter Lebbing) >> 4. Re: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' >> failed: IPC call has been cancelled" (Werner Koch) >> 5. AW: How to fix "ERROR key_generate 3355453" / "GENKEY' >> failed: IPC call has been cancelled" (Fiedler Roman) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 03 Sep 2018 18:41:29 +0200 >> From: Dirk Gottschalk >> To: gnupg-users at gnupg.org >> Subject: Re: revocation troubles & smartcard troubles >> Message-ID: >> Content-Type: text/plain; charset="utf-8" >> >> As long as you did not publish reports revocation, delete the key and re-import it without the revocation cert. >> >> Am 3. September 2018 17:03:19 MESZ schrieb "Roland Siemons (P)" : >>> Dear GnuPG, >>> >>> I am already using GnuPG for a long time. But try to improve my >>> understanding of and working with it. >>> I became a member of Free Software Foundation Europe, and got a >>> smartcard. I wanted to use it. >>> >>> And that is where the trouble started: >>> I intended to copy all my personal keys to the smart card. >>> In Kleopatra, I selected "Tools/Manage smartcards" >>> Then I selected "Import a certificate from a file", and selected files >> >from my laptop. >>> I was under the impression that I was copying files to the smartcard. >>> By doing so, I not only selected my private key but also my revocation >>> key (because, why should I enable a thief of my laptop to revoke my >>> key?). >>> And then it appeared that I had revoked my entire key pair. Unintended! >>> Apparently, under smartcard management, I was not at all copying files >>> to the smartcard. Apparently, I was doing something else. Did I at all >>> copy files to the smartcard? >>> >>> Questions: >>> Can I UNrevoke that key? >>> How can I see what is on the smartcard? >>> How can I copy files to the smartcard? >>> >>> I studied the GnuPG Smartcard How-To >>> (www.gnupg.org/howtos/card-howto/en/smartcard-howto.html), but that is >>> entirely linux oriented. >>> I am working on a win7 system. >>> >>> Can anyone help me further? >>> >>> Thanks! >>> >>> Roland >> >> >> _______________________________________________ >> Gnupg-users mailing list >> Gnupg-users at gnupg.org >> http://lists.gnupg.org/mailman/listinfo/gnupg-users -- https://metacode.biz/@wiktor From Roman.Fiedler at ait.ac.at Tue Sep 4 13:55:01 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Tue, 4 Sep 2018 11:55:01 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> Message-ID: <86b846d748cc4a8498567c6d814fb713@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > > On 04/09/18 09:52, Fiedler Roman wrote: > > Maybe the current hammer documentation should be updated, to remove > > the "--use-as-hammer" options? Or at least declare, that they shall not > > be used that way. See: > > > > https://www.gnupg.org/gph/en/manual/r1606.html > > https://www.gnupg.org/gph/en/manual/r1574.html > > Ah, but you didn't pass it a keyring, did you? You passed it an exported > OpenPGP key, which is no longer the format of a keyring! :-) This might be an issue, but now I tried also with the "pubring.kbx" file from the key used to create the signature (without exporting anything) and the error message stays completely the same. The message is quite similar to starting gpgv without any keyring at all: # /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent data.gpg gpgv: unknown type of key resource 'trustedkeys.kbx' gpgv: keyblock resource '/proc/self/fd/nonexistent/trustedkeys.kbx': General error [GNUPG:] ERROR add_keyblock_resource 33554433 [GNUPG:] UNEXPECTED 0 gpgv: verify signatures failed: Unexpected error So maybe the "GNUPG:] UNEXPECTED 0" (last two lines) are not related to the keyring at all (the first three lines are related). BTW: what would be the recommended/most secure way to create a keyring file with a single public key, probably without all the gpg2 overhead of creating home directory, searching proc to kill gpg-agent afterwards and cleaning up the home directory in secure way afterwards? After trying to get gnupg2 working for more than a day now, but always managing to get only from one undocumented error message to the next, one undocumented argument behavior to the next, I will downgrade to gnupg1. In my opinion, next migration attempt should be started with next Ubuntu LTS 2020 earliest. > > Werner gave a good solution in another followup message. > > Yes, the new option to *encrypt* to a key in a file made me forget about > the age-old gpgv :-). I got it mixed up. > > > Or could I submit patches to documentation and source code (error > handling) > > myself? I did not find a "contribute" section on the gnupg website at a first > glance > > (menus/FAQs), but could look into it deeper, if helpful. > > I'd say: definitely. I'm not a GnuPG dev, though. I think for instance > the git repository with the man page can be reached through the web on [1]. Thanks for the reference, I will try to figure out, how gnupg development is structured, e.g. if patches have to be submitted to gnupg-dev first .... > Note that if you were to carefully read the long table of contents of > the "GnuPG manual"[2], you'd stumble upon these entries: > > > 8 Helper Tools > > [...] > > 8.2 Verify OpenPGP signatures > > I think your addition to the man page would be helpful, but a balance > has to be struck between documenting what something does and what it > does not. Writing good, clear documentation is hard. I don't think the > current documentation is as good as it could be. The fact that there are > so many options and commands makes it very hard to do right. In the > current state of the documentation, I think your addition is a good one. > More in general, I think there should be documentation that users read > which means they wouldn't end up at the man page for the gpg > command-line tool at all, but they would immediately have chosen gpgv in > the first place. I hope I'm succeeding in getting my intention across, > I'm having some trouble putting it in words :-). > > man pages are reference works, not user guides. You already know how to > use something, but the details elude you for a moment? You grab a > reference. You can't learn English from a dictionary, and you can't > efficiently look up the spelling of a word in an English course. > > In this particular case, what set you off in the wrong direction was > that you were doing something which was never *intended* to work, it > just did. Worse, people have been telling other people that this was > something you could do. I think it's hard to catch all these things in > documentation when at the same time people on the interwebs are saying > "oh you should use an exported key as keyring". Fully agree here. There is something important in the documentation missing. I already offered once to contribute to that part of documentation, but there was dispute with other gnupg mailing list folks, that had quite different understanding of engineering-, design- and end user documentation for security critical software. From my point of view following structure would improve the whole process: 1) have use-case documentation describing scenarios where gpg should be used. Make them as distinct as possible to use-cases where gpg should NOT be used. One use case group could be "fully automated en/decrypt and verify on devices without permanent storage", another one "Embedded gpg for e-mail decryption" or "gpg for command line e-mail/file encryption" .... 2) For designing GPG, derive software requirements from all usecases 3) for end user documentation, give recommended gpg configuration, command line, reference output (for debugging) for each set of use-cases. The end user has then to decide which set of use-cases is closest to the one he wants to use to find the most appropriate gpg calls/config. While documentation is structured that way, do you have to add anything to an intermediate docu patch for [1], e.g.: --- gpg.texi 2018-09-04 11:31:35.654503169 +0000 +++ gpg.texi 2018-09-04 11:34:42.337194756 +0000 @@ -1,5 +1,5 @@ @c Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - at c 2008, 2009, 2010 Free Software Foundation, Inc. + at c 2008, 2009, 2010, 2018 Free Software Foundation, Inc. @c This is part of the GnuPG manual. @c For copying conditions, see the file gnupg.texi. @@ -1449,11 +1449,14 @@ Note that this adds a keyring to the current list. If the intent is to use the specified keyring alone, use @option{--keyring} along with - at option{--no-default-keyring}. + at option{--no-default-keyring}. To verify a signature against only +keys from a single keyring file "gpgv" might better suit your needs. If the option @option{--no-keyring} has been used no keyrings will be used at all. +Bear in mind that valid keyring files should be created using + at option(--import) on an empty @option(--primary-keyring) file. @item --secret-keyring @var{file} @opindex secret-keyring > [1] > [2] From peter at digitalbrains.com Tue Sep 4 15:22:57 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 15:22:57 +0200 Subject: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <86b846d748cc4a8498567c6d814fb713@ait.ac.at> References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> <86b846d748cc4a8498567c6d814fb713@ait.ac.at> Message-ID: <2d8ce8a7-2c57-2716-0890-5682c672a874@digitalbrains.com> On 04/09/18 13:55, Fiedler Roman wrote: > This might be an issue, but now I tried also with the "pubring.kbx" file > from the key used to create the signature (without exporting anything) > and the error message stays completely the same. I don't understand, could you give commands, expected behaviour and actual output? > BTW: what would be the recommended/most secure way to create a keyring > file with a single public key For gpgv, I'd just use an exported single public key like you tried to do with gpg. gpgv has no problems with that. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From peter at digitalbrains.com Tue Sep 4 15:39:12 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 15:39:12 +0200 Subject: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> Message-ID: On 04/09/18 10:08, Fiedler Roman wrote: > /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring key.pub data.gpg This would open /proc/self/fd/nonexistent/key.pub as the keyring. From the man page of gpgv: > Add file to the list of keyrings. If file begins with a tilde > and a slash, these are replaced by the HOME directory. If the > filename does not contain a slash, it is assumed to be in the > home-directory ("~/.gnupg" if --homedir is not used). What works for me is: $ gpgv --keyring ./key.gpg data.gpg HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From peter at digitalbrains.com Tue Sep 4 15:41:40 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 15:41:40 +0200 Subject: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <2d8ce8a7-2c57-2716-0890-5682c672a874@digitalbrains.com> References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> <86b846d748cc4a8498567c6d814fb713@ait.ac.at> <2d8ce8a7-2c57-2716-0890-5682c672a874@digitalbrains.com> Message-ID: <21a3d9ad-cb53-7925-ba59-1e25c8dbcd0b@digitalbrains.com> On 04/09/18 15:22, Peter Lebbing wrote: > I don't understand, could you give commands, expected behaviour and > actual output? To clarify, I thought you were giving an example of "starting gpgv without any keyring at all", because you gave it a non-existing homedir. Only on re-reading your other mail did I understand this was an example of how you were actually trying to do it. Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From Roman.Fiedler at ait.ac.at Tue Sep 4 16:08:08 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Tue, 4 Sep 2018 14:08:08 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <21a3d9ad-cb53-7925-ba59-1e25c8dbcd0b@digitalbrains.com> References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> <86b846d748cc4a8498567c6d814fb713@ait.ac.at> <2d8ce8a7-2c57-2716-0890-5682c672a874@digitalbrains.com> <21a3d9ad-cb53-7925-ba59-1e25c8dbcd0b@digitalbrains.com> Message-ID: <5cee0503e32049259f36faaf2d62dfd7@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > > On 04/09/18 15:22, Peter Lebbing wrote: > > I don't understand, could you give commands, expected behaviour and > > actual output? > > To clarify, I thought you were giving an example of "starting gpgv > without any keyring at all", because you gave it a non-existing homedir. > Only on re-reading your other mail did I understand this was an example > of how you were actually trying to do it. Sorry about being inprecise in my reply. Yes, you are completely right: no matter which command line used, the "[GNUPG:] UNEXPECTED 0 gpgv: verify signatures failed: Unexpected error" error from gpgv or plain gpg does not vanish, only additional error messages can be added depending on the keyrings used. Using the /proc/self/fd/nonexistent as home directory should only serve the purpose, that it is much harder for an attacker to create that path than one where the parent directory is a writable file system. I just removed the executable bit from "gpg2" binary and are now isolating all gpg calls in a clean wrapper library to invoke "gpg1". When all use-cases work with gpg1 and there is still some time, I will try to implement also a gpg2 wrapper to start another gpg1->gpg2 migration attempt. But that will be end of September earliest. From wk at gnupg.org Tue Sep 4 15:12:30 2018 From: wk at gnupg.org (Werner Koch) Date: Tue, 04 Sep 2018 15:12:30 +0200 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <2669076f402241d6be36b5605049c8f4@ait.ac.at> (Fiedler Roman's message of "Tue, 4 Sep 2018 07:52:33 +0000") References: <2669076f402241d6be36b5605049c8f4@ait.ac.at> Message-ID: <87ftypcsox.fsf@wheatstone.g10code.de> On Tue, 4 Sep 2018 09:52, Roman.Fiedler at ait.ac.at said: > Werner gave a good solution in another followup message. May I recommend > updating the online docu/man page for "--verify" with something like this? we have Note: Sometimes the use of the @command{gpgv} tool is easier than using the full-fledged @command{gpg} with this option. @command{gpgv} is designed to compare signed data against a list of trusted keys and returns with success only for a good signature. It has its own manual page. in the docs since 2.1.18 or .19 (January 2017) Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From wk at gnupg.org Tue Sep 4 15:07:30 2018 From: wk at gnupg.org (Werner Koch) Date: Tue, 04 Sep 2018 15:07:30 +0200 Subject: AW: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> (Fiedler Roman's message of "Tue, 4 Sep 2018 08:08:48 +0000") References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> Message-ID: <87k1o1csx9.fsf@wheatstone.g10code.de> On Tue, 4 Sep 2018 10:08, Roman.Fiedler at ait.ac.at said: > [GNUPG:] UNEXPECTED 0 The signature is corrupted in that it has a packet which is expected only in a key. Or the provided key has a data signature packet etc. How did you create the keyfile and the signature? > Could it be, that "--throw-keyids" at signature creation to then avoid > XKeyscore-traffic-analysis [1] is not compatible with signature > verification? No. The keyid (or the fingerprint in newer version) is mandatory for a signature packet. Leaving this out would not help because it is easy to figure out the key by trial verification against all known keys. And traffic analysis can be done without crypto operations. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From dkg at fifthhorseman.net Tue Sep 4 18:10:23 2018 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 04 Sep 2018 12:10:23 -0400 Subject: Issue with pinentry GUI agent In-Reply-To: References: <20180825081848.43e260fa@black> <87mut65p22.fsf@fifthhorseman.net> <4b4d861e-33c6-b3eb-e17f-8f69818ef486@sumptuouscapital.com> Message-ID: <87tvn5z1jk.fsf@fifthhorseman.net> On Mon 2018-09-03 09:58:24 +0200, Kristian Fiskerstrand wrote: > Just to have it mentioned, turned out this was an issue with missing > keep-display in gpg-agent.conf, without this the Qt4/5 pinentry fail > (although I've been told it is not an issue in KDE environment). to be clear, keep-display means that all requests made to the agent that require interaction with X11 will show up on the original display that the agent was started with. This isn't desirable in all cases (e.g. where an agent is shared across multiple X11 displays) > gpg-agent without keep-display still seems to send display as argument > in --display :0 style, but this does not seem to be honored. i think you're saying that "pinentry-qt --display :124" doesn't honor the "--display :124" argument, but that doesn't seem to be true to me with pinentry 1.1.0: 0 dkg at alice:~$ pinentry-qt --display :124 qt.qpa.screen: QXcbConnection: Could not connect to display :124 Could not connect to any X display. 1 dkg at alice:~$ or do you mean something else? --dkg From Roman.Fiedler at ait.ac.at Tue Sep 4 18:31:25 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Tue, 4 Sep 2018 16:31:25 +0000 Subject: AW: AW: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <87k1o1csx9.fsf@wheatstone.g10code.de> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> Message-ID: > Von: Werner Koch [mailto:wk at gnupg.org] > > On Tue, 4 Sep 2018 10:08, Roman.Fiedler at ait.ac.at said: > > > [GNUPG:] UNEXPECTED 0 > > The signature is corrupted in that it has a packet which is expected > only in a key. Or the provided key has a data signature packet etc. I hope not :-) If any of those assumptions above is true, then the current gpg behaviour might be a massive security problem as gpg1 can be tricked into verifying a signature, that should not be there. This command decrypts the data and claims to see a valid signature (both commands get input to decrypt from stdin): /usr/bin/gpg1 --no-options --homedir decrypt-key --no-default-keyring --keyring sign.pub --lock-never --trust-model always --batch --display-charset utf-8 --status-fd 2 --decrypt --try-all-secrets "[GNUPG:] GOODSIG AAAAAA....[keyid] " While gpgv (from gpg2 package) does not: /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring sign.pub /proc/self/fd/0 "[GNUPG:] UNEXPECTED 0" Remember, that similar gpg2 call also returned the same error, so I changed it to use "gpgv" according to your recommendation (see mail list archive). But that did not help getting rid of the error. > How did you create the keyfile and the signature? Keyfile: gpg2 --no-options --homedir [home] --lock-never --trust-model always --export [identifier] Signature: gpg1 --no-options --homedir [somedir] --keyring [remote.pub] --lock-never --trust-model always --sign --local-user [user-id] --encrypt --throw-keyids --hidden-recipient > > Could it be, that "--throw-keyids" at signature creation to then avoid > > XKeyscore-traffic-analysis [1] is not compatible with signature > > verification? > > No. The keyid (or the fingerprint in newer version) is mandatory for a > signature packet. OK, I have to check that. I assumed "--throw-keyids" would put me on the safe side... Splitting up the message gives me 000001-001.pk_enc 000002-018.encrypted_mdc Which of the files contains the problematic signature key ID? At least the encryption key hing in pk.enc is zeroed out, as expected: 00000000: 8502 0e03 0000 0000 0000 0000 1008 00a9 ................ At which byte offset should I find the signer key fingerprint? > Leaving this out would not help because it is easy to > figure out the key by trial verification against all known keys. Well, that would be all keys in the 2^2048 key space, so the problem should be as hard to solve as factorization itself. As keys are never transmitted unencrypted, the attacker has no chance to know a single one. > And traffic analysis can be done without crypto operations. But it is much more convenient: * key IDs included: get unique number of recipients at each endpoint, detect each new recipient as soon as it is addressed for the first time ... * key IDs missing: get frequency/size of cryptograms (size is always the same) and try to estimate the number of distinct recipients. From peter at digitalbrains.com Tue Sep 4 22:56:28 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Tue, 4 Sep 2018 22:56:28 +0200 Subject: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> Message-ID: <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> On 04/09/18 18:31, Fiedler Roman wrote: > /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring sign.pub /proc/self/fd/0 You missed my point. You are not including a slash in the keyring argument, so gpgv is looking for it in the homedir. To quote the gpgv man page again: > --keyring file > Add file to the list of keyrings. If file begins with a tilde > and a slash, these are replaced by the HOME directory. If the > filename does not contain a slash, it is assumed to be in the > home-directory ("~/.gnupg" if --homedir is not used). And this works: $ gpgv --keyring ./key.gpg data.gpg > Splitting up the message gives me > > 000001-001.pk_enc > 000002-018.encrypted_mdc This is an encrypted message. gpgv can't do anything with it. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From kristian.fiskerstrand at sumptuouscapital.com Wed Sep 5 09:39:31 2018 From: kristian.fiskerstrand at sumptuouscapital.com (Kristian Fiskerstrand) Date: Wed, 5 Sep 2018 09:39:31 +0200 Subject: Issue with pinentry GUI agent In-Reply-To: <87tvn5z1jk.fsf@fifthhorseman.net> References: <20180825081848.43e260fa@black> <87mut65p22.fsf@fifthhorseman.net> <4b4d861e-33c6-b3eb-e17f-8f69818ef486@sumptuouscapital.com> <87tvn5z1jk.fsf@fifthhorseman.net> Message-ID: <17e0732c-1f9e-bcaa-dd24-b9a75d33df92@sumptuouscapital.com> On 9/4/18 6:10 PM, Daniel Kahn Gillmor wrote: > or do you mean something else? without DISPLAY env var, qt version automatically falls back to curses variant despite the argument kristianf at ares ~ $ unset DISPLAY kristianf at ares ~ $ /usr/bin/pinentry-qt4 --display :0 (pinentry-qt4:6370): Gtk-WARNING **: 09:31:41.576: cannot open display: kristianf at ares ~ $ export DISPLAY=:0 kristianf at ares ~ $ /usr/bin/pinentry-qt4 --display :0 OK Pleased to meet you throwing in a simple wrapper around pinentry, #!/bin/bash env > /tmp/pinentry-log.txt echo "$@" >> /tmp/pinentry-log.txt exec /usr/bin/pinentry-qt "$@" and diffing the log between keep-display, shows that the difference is +DISPLAY=:0 btw, you say started, but this should also be updated when issuing UPDATESTARTUPTTY shouldn't it? In any case, it solved the issue for the user and I replicated it also on pinentry 1.1.0 on gnupg 2.2.10 -- ---------------------------- Kristian Fiskerstrand Blog: https://blog.sumptuouscapital.com Twitter: @krifisk ---------------------------- Public OpenPGP keyblock at hkp://pool.sks-keyservers.net fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3 ---------------------------- Credo quia absurdum I believe it because it is absurd -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From Roman.Fiedler at ait.ac.at Wed Sep 5 10:01:40 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Wed, 5 Sep 2018 08:01:40 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> Message-ID: <22ebf717f819499c9a18cfa4ce505fd2@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > > On 04/09/18 18:31, Fiedler Roman wrote: > > /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring > sign.pub /proc/self/fd/0 > > You missed my point. You are not including a slash in the keyring > argument, so gpgv is looking for it in the homedir. Sorry, this is an error copying the command to the mail. In fact, the "gpgv" call is and was always done with a long, absolute pathname I do not want to disclose to the list. Therefore I just forgot the fact of the special pathname behaviour immediately after reading it. > And this works: > > $ gpgv --keyring ./key.gpg data.gpg > > > Splitting up the message gives me > > > > 000001-001.pk_enc > > 000002-018.encrypted_mdc > > This is an encrypted message. gpgv can't do anything with it. Then why does gpg1 verify claim to see a valid signature on the very same file if there isn't even a signature included? I will analyze it deeper but that will take time. From Roman.Fiedler at ait.ac.at Wed Sep 5 10:45:02 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Wed, 5 Sep 2018 08:45:02 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> Message-ID: <49dd5f90a8d04a218c1b20fc7e743ec0@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > ... > $ gpgv --keyring ./key.gpg data.gpg > > > Splitting up the message gives me > > > > 000001-001.pk_enc > > 000002-018.encrypted_mdc > > This is an encrypted message. gpgv can't do anything with it. No, this is a signed AND encrypted message. Can gpgv only be used to verify signatures on signed-only but not signed AND encrypted messages, maybe due to encrypt AFTER sign scheme? If so update of the manual pages and a more talkative error message instead of "gpgv: verify signatures failed: Unexpected error" would be really nice. Test trail: * Prepare: Remove standard GPG homedir to detect any access to it by error (should never happen). rm -rf -- "${HOME}/.gnupg" testDir="$(mktemp -d)" cd -- "${testDir}" * Generate receiver key: mkdir --mode=0700 -- Receiver cat < Receiver/ReceiverKey.pub * Generate sender key: mkdir --mode=0700 -- Sender /usr/bin/gpg1 --homedir Sender --batch --command-fd 0 --status-fd 1 --gen-key < Sender/SenderKey.pub * Generate message: /usr/bin/gpg1 --no-options --homedir Sender --keyring Receiver/ReceiverKey.pub --lock-never --trust-model always --sign --local-user "Sender Key" --encrypt --throw-keyids --hidden-recipient "Receiver Key" < Sender/OutgoingMessage.gpg Secret message EOF * Decrypt and verify with gpg1 on receiver side: /usr/bin/gpg1 --no-options --homedir Receiver --no-default-keyring --keyring Sender/SenderKey.pub --lock-never --trust-model always --batch --display-charset utf-8 --status-fd 2 --decrypt --try-all-secrets < Sender/OutgoingMessage.gpg gpg: Good signature from "Sender Key" [GNUPG:] VALIDSIG 7C8D39EA43614F2266EBD8F52A1DF9C596868A14 2018-09-05 1536135808 0 4 0 1 8 00 7C8D39EA43614F2266EBD8F52A1DF9C596868A14 * Verify only with gpgv (from gnupg2): Not clear from documentation, if gpgv could verify signed AND encrypted messages. Use absolute path for sure as relative pathnames will be handled differently. /usr/bin/gpgv --status-fd 2 --homedir /proc/self/fd/nonexistent --keyring "${testDir}/Sender/SenderKey.pub" /proc/self/fd/0 < Sender/OutgoingMessage.gpg [GNUPG:] UNEXPECTED 0 gpgv: verify signatures failed: Unexpected error * Final checks: Ensure default homedir was not created due to error in testing protocol: ls -al -- "${HOME}/.gnupg" From wk at gnupg.org Wed Sep 5 10:59:13 2018 From: wk at gnupg.org (Werner Koch) Date: Wed, 05 Sep 2018 10:59:13 +0200 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <49dd5f90a8d04a218c1b20fc7e743ec0@ait.ac.at> (Fiedler Roman's message of "Wed, 5 Sep 2018 08:45:02 +0000") References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> <49dd5f90a8d04a218c1b20fc7e743ec0@ait.ac.at> Message-ID: <8736uo9v6m.fsf@wheatstone.g10code.de> On Wed, 5 Sep 2018 10:45, Roman.Fiedler at ait.ac.at said: > No, this is a signed AND encrypted message. Can gpgv only be > used to verify signatures on signed-only but not signed AND > encrypted messages, maybe due to encrypt AFTER sign scheme? Correct. The signature is encrypted and thus it needs to be decrypted before the signature can be checked. gpgv is only for checking signature becuase it is designed to work without private keys. Salam-Shalom, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From wk at gnupg.org Wed Sep 5 11:02:43 2018 From: wk at gnupg.org (Werner Koch) Date: Wed, 05 Sep 2018 11:02:43 +0200 Subject: AW: AW: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: (Fiedler Roman's message of "Tue, 4 Sep 2018 16:31:25 +0000") References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> Message-ID: <87y3cg8ggc.fsf@wheatstone.g10code.de> On Tue, 4 Sep 2018 18:31, Roman.Fiedler at ait.ac.at said: > At which byte offset should I find the signer key fingerprint? That is an encrypted message and thus can you seen the the signature. >> Leaving this out would not help because it is easy to >> figure out the key by trial verification against all known keys. > > Well, that would be all keys in the 2^2048 key space, so the problem > should be as hard to solve as factorization itself. As keys are never > transmitted unencrypted, the attacker has no chance to know a single Nope. Public keys, which are required to check a signature, are, as the name says, public and availabale from several sources, for example the key servers. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From Roman.Fiedler at ait.ac.at Wed Sep 5 11:27:52 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Wed, 5 Sep 2018 09:27:52 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" Message-ID: > Von: Werner Koch [mailto:wk at gnupg.org] > > On Tue, 4 Sep 2018 18:31, Roman.Fiedler at ait.ac.at said: > > > At which byte offset should I find the signer key fingerprint? > > That is an encrypted message and thus can you seen the the signature. That is good, one more issue not having to care about. > >> Leaving this out would not help because it is easy to > >> figure out the key by trial verification against all known keys. > > > > Well, that would be all keys in the 2^2048 key space, so the problem > > should be as hard to solve as factorization itself. As keys are never > > transmitted unencrypted, the attacker has no chance to know a single > > Nope. Public keys, which are required to check a signature, are, as the > name says, public and availabale from several sources, for example the > key servers. Sorry, but you are completely off here. You might also publish your public keys world wide. But they may also be known only to a closed user group to avoid traffic analysis, user enumeration, factorization attacks if poor generators were used, .. If you do not believe me, just search your key servers for NSA, BND, ... public keys. I am sure, they use public key cryptography in many domains and have very little of their public keys published. The real topic of this discussion might be more if gnupg is a generic public key cryptography security solution (where hiding keys might make sense, thus software should be able to help fulfilling that goal) or if gnupg should only be used for desktop e-mail encryption, where all those issues are much less pressing as security requirements are much lower. Regards, Roman From Roman.Fiedler at ait.ac.at Wed Sep 5 11:35:34 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Wed, 5 Sep 2018 09:35:34 +0000 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" Message-ID: <69689f064e324421b7f5c9f7e8b7172d@ait.ac.at> > Von: Werner Koch [mailto:wk at gnupg.org] > > On Wed, 5 Sep 2018 10:45, Roman.Fiedler at ait.ac.at said: > > > No, this is a signed AND encrypted message. Can gpgv only be > > used to verify signatures on signed-only but not signed AND > > encrypted messages, maybe due to encrypt AFTER sign scheme? > > Correct. The signature is encrypted and thus it needs to be decrypted > before the signature can be checked. gpgv is only for checking > signature becuase it is designed to work without private keys. Could you please update the documentation and the error messages from gpg1/gpg2/gpgv to be more helpful? Now I can also reproduce with gpg1/gpg2 verify on encrypted messages, gpg1 reports "unexpected data", which is a little more helpful than "unexpected error" from gpg2. Regards, Roman From peter at digitalbrains.com Wed Sep 5 12:18:06 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Wed, 5 Sep 2018 12:18:06 +0200 Subject: Hiding signature identification (was: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled") In-Reply-To: References: Message-ID: <41cc1c2f-7cd8-a7a2-9c5d-5686e669adc3@digitalbrains.com> On 05/09/18 11:27, Fiedler Roman wrote: > Sorry, but you are completely off here. If there are six people I am actually interested in, and I know all their public keys, checking if one of them signed a message with a hypothetical "throw-keyid" takes me at most six trial verifications, using their public keys in turn. Now when you say that you could find the signer by brute-forcing "all keys in the 2^2048 key space", that seems to miss a vital step. Let's suppose you did this massive brute force, the universe still exists, and you found that the RSA key with keygrip 8FE036329129F568D5B58A88F6F8580A064E4887 has signed the message. Back to your goal. Who signed the message? You don't know. You know what the RSA modulus of the key of this person is, but you don't know their identity, because your brute-force search did not produce an identity, it produced an RSA modulus and exponent. So: to know who signed a message, you need their public key. So to check a random signature without identification, you try all the public keys you have at your disposal (perhaps ignoring the ones you know are uninteresting). So your search space is your collection of public keys. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From kristian.fiskerstrand at sumptuouscapital.com Wed Sep 5 12:33:37 2018 From: kristian.fiskerstrand at sumptuouscapital.com (Kristian Fiskerstrand) Date: Wed, 5 Sep 2018 12:33:37 +0200 Subject: Issue with pinentry GUI agent In-Reply-To: <17e0732c-1f9e-bcaa-dd24-b9a75d33df92@sumptuouscapital.com> References: <20180825081848.43e260fa@black> <87mut65p22.fsf@fifthhorseman.net> <4b4d861e-33c6-b3eb-e17f-8f69818ef486@sumptuouscapital.com> <87tvn5z1jk.fsf@fifthhorseman.net> <17e0732c-1f9e-bcaa-dd24-b9a75d33df92@sumptuouscapital.com> Message-ID: <020fa8c0-4659-5ac8-147e-8b76706df65f@sumptuouscapital.com> On 9/5/18 9:39 AM, Kristian Fiskerstrand wrote: > without DISPLAY env var, qt version automatically falls back to curses > variant despite the argument Wrote too quickly there; This is actually wrong, it never actually falls back to curses, it just fails. -- ---------------------------- Kristian Fiskerstrand Blog: https://blog.sumptuouscapital.com Twitter: @krifisk ---------------------------- Public OpenPGP keyblock at hkp://pool.sks-keyservers.net fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3 ---------------------------- Quidquid latine dictum sit, altum videtur. Anything said in Latin sounds profound -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From Roman.Fiedler at ait.ac.at Wed Sep 5 13:00:34 2018 From: Roman.Fiedler at ait.ac.at (Fiedler Roman) Date: Wed, 5 Sep 2018 11:00:34 +0000 Subject: AW: Hiding signature identification (was: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled") In-Reply-To: <41cc1c2f-7cd8-a7a2-9c5d-5686e669adc3@digitalbrains.com> References: <41cc1c2f-7cd8-a7a2-9c5d-5686e669adc3@digitalbrains.com> Message-ID: <0e99692c439d4defafdd7fb0b12fe6b3@ait.ac.at> > Von: Peter Lebbing [mailto:peter at digitalbrains.com] > > On 05/09/18 11:27, Fiedler Roman wrote: > > Sorry, but you are completely off here. > > If there are six people I am actually interested in, and I know all > their public keys, How will you know them? I will not tell you the keys, nor publish them. You will have to steal them or wait for GPG leaking information about them. The later risk is what I want to prevent ... > checking if one of them signed a message with a > hypothetical "throw-keyid" takes me at most six trial verifications, > using their public keys in turn. Nope, because as stated by Werner: signature verification in sign AND encrypt schemes is not possible without decrypting the message. And each message WILL BE encrypted, the sender and receiver key will be stored in a HSM in the end. So I could not even give you a copy of the private key to perform the decryption/signature verification, even if I wanted to. And to make it harder for you to figure out, which HSM to steal if you want to decrypt a given message, the messages must not give you any clue about the sender/receiver. > Now when you say that you could find the signer by brute-forcing "all > keys in the 2^2048 key space", that seems to miss a vital step. Let's > suppose you did this massive brute force, the universe still exists, and > you found that the RSA key with keygrip > 8FE036329129F568D5B58A88F6F8580A064E4887 has signed the message. > Back to your goal. Who signed the message? You don't know. You know what the RSA > modulus of the key of this person is, but you don't know their identity, > because your brute-force search did not produce an identity, it produced > an RSA modulus and exponent. But now I can go through my archive of intercepted messages, where I usually know, where I intercepted them, e.g. at the hacked switch of company X. I will check the timestamps of the messages, try to figure out the originators working hours, check with my surveillance cameras from the other side of the street pointing at the company X parking lot until I am quite sure, which car and hence which person is related to activity with a given key. As soon as I have that information, I guess 40kUSD should be sufficient to have child, wife, whatsoever kidnapped to make the employee turn me over the HSM with his private key plus the HSM password or decrypt messages for me in case of stationary HSMs - thus breaking an "unbreakable" cryptosystem with quite little amount of money (the kidnapping and one year of switch-cyberop plus passive surveillance operation on the parking lot) compared to really factorizing moduli or exploiting crypto software/ hardware bugs. Maybe some criminals or secret services know better ways to perform that task, maybe such operation is much more complicated than I currently envision. At least by best practice use of cryptosystems, I do not want to make them even think about such a scheme to begin with. > So: to know who signed a message, you need their public key. ... and the receiver private key for sign AND encrypt schemes ... > So to check > a random signature without identification, you try all the public keys > you have at your disposal (perhaps ignoring the ones you know are > uninteresting). So your search space is your collection of public keys. The crypto design is done in such a way, so that there is NO easily accessible collection of public keys. I am even trying to extend it in a way, that even have a plaintext list of all relevant remote party public keys - they only can locate a remote party key after receiving a message and decrypting it without verification to do the verification in a second step (that's why my attempt to verify an encrypted message) before crafting a response, encrypting it with the now known public key and forgetting about the key until the next message is received. So without massive theft of multiple physical components plus an intercept of a significant amount of messages, access to the private keys, there is NO WAY to gain any information about the set of used public or private keys. Regards, Roman From peter at digitalbrains.com Wed Sep 5 13:56:21 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Wed, 5 Sep 2018 13:56:21 +0200 Subject: Hiding signature identification In-Reply-To: <0e99692c439d4defafdd7fb0b12fe6b3@ait.ac.at> References: <41cc1c2f-7cd8-a7a2-9c5d-5686e669adc3@digitalbrains.com> <0e99692c439d4defafdd7fb0b12fe6b3@ait.ac.at> Message-ID: <3a7feef3-ee2c-6826-55ed-cd7a7dce7f66@digitalbrains.com> What does an unencrypted, signed message mean to you? Because when we're talking about the benefits or operation model of a hypothetical "throw-keyid" option for signatures, that's what we are discussing. Anything about encrypted messages is not relevant, since the signature is inside the encryption as you noted. So the actual content of the data is already deemed not to be sensitive knowledge, it just needs to be authenticated. Your method of correlating key ID's to out-of-band data like spying on people's movements is something I had not considered, but the key ID is just a bit of extra data; you could also simply correlate the production of *an* OpenPGP signed message to the person in question and attack them. Who cares what key they used when you can determine they are the person who's always behind their keyboard when that interesting signed message appears. Furthermore, note that the design of OpenPGP assumes the data it calls "public" is indeed public. You could try to retrofit OpenPGP into some role where a public key is not public, but it is dangerous to use a crypto ecosystem for something else than it was designed for. It seems to me asking for a "throw-keyid" for signatures is exactly that, and maybe you need to look for something else than OpenPGP if public data is no longer public.[1] As soon as the public key is indeed public, you've just reduced the search space to all public keys rather than all possible public keys. I don't particularly care if there is a meaningful user ID on the key, that's up to the creator of the key, but it is relevant that the actual modulus is indeed public knowledge. HTH, Peter. [1] I made a typo and wrote "and pubic data is no longer public". My pubic data would be among the least public data about me, thank you very much :-). -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From peter at digitalbrains.com Wed Sep 5 14:38:38 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Wed, 5 Sep 2018 14:38:38 +0200 Subject: AW: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled" In-Reply-To: <49dd5f90a8d04a218c1b20fc7e743ec0@ait.ac.at> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> <3d3aeb04-20d4-0b5c-602f-ce7e498ada0c@digitalbrains.com> <87bm9dg62f.fsf@wheatstone.g10code.de> <12fdd8ecaf8c4a169fd96440676dd05b@ait.ac.at> <87k1o1csx9.fsf@wheatstone.g10code.de> <95abe967-dd48-6b21-dd44-76fa814a234b@digitalbrains.com> <49dd5f90a8d04a218c1b20fc7e743ec0@ait.ac.at> Message-ID: <7f65628d-88a9-17ec-538b-f25eed0d3274@digitalbrains.com> On 05/09/18 10:45, Fiedler Roman wrote: > * Decrypt and verify with gpg1 on receiver side: > > /usr/bin/gpg1 --no-options --homedir Receiver --no-default-keyring --keyring Sender/SenderKey.pub --lock-never --trust-model always --batch --display-charset utf-8 --status-fd 2 --decrypt --try-all-secrets < Sender/OutgoingMessage.gpg If you want to know which of the public keys you have signed a particular message, instead of restricting your "keyring" to a single, desired key, you can scan the status-fd for [GNUPG:] GOODSIG In this case, just keep your keyring as it normally is, containing all public keys. You might then also reach a situation where you can meaningfully use a trust model, instead of your --trust-model always. status-fd is documented in doc/DETAILS. HTH, Peter. -- I use the GNU Privacy Guard (GnuPG) in combination with Enigmail. You can send me encrypted mail if you want some privacy. My key is available at -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From peter at digitalbrains.com Wed Sep 5 15:20:30 2018 From: peter at digitalbrains.com (Peter Lebbing) Date: Wed, 5 Sep 2018 15:20:30 +0200 Subject: Both correct and surprising non-interactive gen-key (was: How to fix "ERROR key_generate 3355453" / "GENKEY' failed: IPC call has been cancelled") In-Reply-To: <874899396fd84b039af389d00ac65fb4@ait.ac.at> References: <874899396fd84b039af389d00ac65fb4@ait.ac.at> Message-ID: <37a21c51-7885-64d8-ae29-4e5c13dc4048@digitalbrains.com> On 31/08/18 19:11, Fiedler Roman wrote: > ['/usr/bin/gpg', '--homedir', '/tmp/tmp-3abk6l8', '--with-colons', '--status-fd', '2', '--pinentry-mode', 'loopback', '--batch', '--gen-key', '--command-fd', '0'] It is unclear where the passphrase is supposed to come from... so I think it's correct that GnuPG CANcels. Oh, by the way, commands should come last for robustness. I discovered something odd though: --8<---------------cut here---------------start------------->8--- $ cat passphrase my_passphrase $ cat template %echo Generating key Key-Type: RSA Key-Length: 1024 Subkey-Type: ELG-E Subkey-Length: 1024 Name-Real: AutomationKey Expire-Date: 0 %commit $ exec 3<&- 38--- That works, with passphrase on fd 3 and command on fd 0. I should delete it though, "ultimately trusted" no thanks. But: --8<---------------cut here---------------start------------->8--- $ exec 3<&- 3