gpg --generate-key --batch prompt with SIGINT breaks shell

Bug #1846155 reported by dundir
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnupg2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Description:
An unusual password prompt appears when passing --batch during key generation. Using control+c to break to the shell, breaks the shell environment completely.

Steps to replicate:

As a root user:
#> gpg --batch --gen-key temp.batch

Please enter the pass phrase to protect your new key

Passphrase: ________________________________
 <Ok> | <Cancel>

Ctrl-C (SIGINT) breaks to the shell, and the shell becomes completely unstable/unusable after this point. Input is varied with some key presses writing to the prompt, and others causing the screen to loop back to the previous prompt displayed above. Options are no longer able to be selected to cleanly close.

> ~/.gnupg/gpg.conf
cert-digest-algo SHA256
digest-algo SHA256

# Generates batch instructions
cat > temp.batch << EOF
%echo Generating a standard key
Key-Type: RSA
Key-Length: 4096
Subkey-Length: 4096
Name-Real: temp
Name-Email: <email address hidden>
Expire-Date: 0
%pubring temp.pub
%secring temp.key
# commit needed to echo
%commit
%echo done

#> gpg --version

gpg (GnuPG) 2.2.4
libgcrypt 1.8.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /root/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Does reset fix the terminal?

Thanks

Changed in gnupg2 (Ubuntu):
status: New → Incomplete
Revision history for this message
dundir (dundir) wrote :

Reset cannot be typed into the terminal, it doesn't appear to be a functioning bash shell.

I've included an OBS recording of the prompt as an attachment showing the problem.

Its necessary to forcibly close and restart the shell.

I haven't tested it in a true tty, I'm used a stander pts pseudo shell with bash.

Also, the gpg process appears to close as its no longer listed by ps -a from a separate prompt.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnupg2 (Ubuntu) because there has been no activity for 60 days.]

Changed in gnupg2 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
dundir (dundir) wrote :

ping

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.