#865824 gnupg hangs during import of keys (bis)

#865824#5
Date:
2017-06-25 03:16:22 UTC
From:
To:
Dear Maintainer,

While trying to convert pubring.gpg into pubring.kbx I did the following
$ gpg --import-options import-local-sigs --import /tmp/xxx
# /tmp/xxx being a copy of pubring.gpg
as advised here https://www.gnupg.org/faq/whats-new-in-2.1.html#keybox

I found that the import worked "once at a time", I mean it imports one
signature then hang => ^C and rerun.


Running using --debug-all, I found the following message just before it
hangs:

gpg: DBG: parse_packet(iob=107): type=2 length=79 (parse.../../g10/keydb.c.1177)
gpg: DBG: iobuf-107.0: underflow: buffer size: 8257; still buffered: 0 => space for 8257 bytes
gpg: DBG: iobuf-107.0: close '?

# or during the next run (one sig imported, the next one hanging):
gpg: DBG: parse_packet(iob=468): type=2 length=105 (parse.../../g10/keydb.c.1177)
gpg: DBG: parse_packet(iob=468): type=14 length=269 (parse.../../g10/keydb.c.1177)
gpg: DBG: parse_packet(iob=468): type=2 length=76 (parse.../../g10/keydb.c.1177)
gpg: DBG: iobuf-468.0: underflow: buffer size: 137594; still buffered: 0 => space for 137594 bytes
gpg: DBG: iobuf-468.0: close '?'

# another run (one sig imported, the next one hanging):
gpg: DBG: parse_packet(iob=287): type=14 length=1037 (parse.../../g10/keydb.c.1177)
gpg: DBG: parse_packet(iob=287): type=2 length=76 (parse.../../g10/keydb.c.1177)
gpg: DBG: parse_packet(iob=287): type=2 length=88 (parse.../../g10/keydb.c.1177)
gpg: DBG: iobuf-287.0: underflow: buffer size: 64279; still buffered: 0 => space for 64279 bytes
gpg: DBG: iobuf-287.0: close '?'


Same result when removing gpg.conf or trying various import-options (import-minimal, import-clean)

But --import-options import-export successfully export a GPG traditional pubring file (not a GPG keybox) containing the 124 signatures.


See also: #841103

#865824#10
Date:
2017-06-25 23:13:38 UTC
From:
To:
Hi Raphaël--

I'm not sure what to tell you about this.  It looks to me like something
is wrong with your /tmp/xxx but i don't have a copy of it so i can't
reproduce the behavior you describe.

Have you tried the script /usr/bin/migrate-pubring-from-classic-gpg ? it
is intended specifically for the use case here (converting from
pubring.gpg to pubring.kbx).

have you tried to do this import while working from a clean GNUPGHOME?
Does it still misbehave?

If you'd like to send me a copy of your /tmp/xxx (feel free to encrypt
it to 0x0EE5BE979282D80B9F7540F1CCD2ED94D21739E9 and send it to my
private e-mail if you don't want to publish it) i can try to take a look
at duplicating the problem.

gpg's export functionality has never been intended to export anything
but a sequence of OpenPGP packets.  a keybox is *not* a sequence of
OpenPGP packets, so you shouldn't expect it to be produced by gpg
export.

This was a bug report about dirmngr hanging, which i think was the same
thing as #840680, and should be resolved.  You seem to be implying that
they're the same thing, but i don't understand why.  I don't think
dirmngr is involved at all in gpg --import.  Do you think dirmngr is
involved here?

#865824#17
Date:
2017-12-05 14:49:09 UTC
From:
To:

#865824#22
Date:
2017-12-05 14:49:09 UTC
From:
To: