Release: 1.4.2
Environment
Linux 2.6.12 (Fedora Core, Raw Hide)
Description
When generating keys in batch mode, write_keyblock() iterates through the list of generated packets, passing them to build_packet() one at a time. Because 1.4.2 now has places a deleted PKT_NONE packet at the head of the tree (instead of a deleted PKT_COMMENT packet as earlier versions did), build_packet()'s assertion that the packet contain some kind of data isn't met and gpg aborts.
How To Repeat
Dave Jones actually tripped over this. The contents of his parameter file ("genkey"):
%pubring kernel.pub %secring kernel.sec Key-Type: DSA Key-Length: 512 Name-Real: Red Hat, Inc. Name-Comment: Kernel Module GPG key
gpg --homedir . --batch --debug 15 --gen-key genkey
Fix
Walk the list with walk_kbnode() instead.