Skip to content

Deleting a private key on macOS Big Sur hangs  #145

Description

@dvkch

I've encountered an issue where deleting a key would hang forever, using the following code:

GPGME::Key.find(:public, key_id).each { |k| k.delete!(true) }

# or
GPGME::Key.find(:private key_id).each { |k| k.delete!(true) }
�(B�(B�(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk�(B�(B�(0x�(B Do you really want to permanently delete the OpenPGP secret key: �(0x�(B�(B�(0x�(B "EnsoTest <test@example.com>"�(0x�(B�(B�(0x�(B 2048-bit RSA key, ID 0FDD92544BA73B80,�(0x�(B�(B�(0x�(B created 2020-08-25.�(0x�(B�(B�(0x�(B ?�(0x�(B�(B�(0x�(B�(B�(0x�(B�(B�(0x�(B     �(B<Delete key>�(B

If the key is a public key with no associated private key it works fine. If this is a public key with an associated private key, or if it is a private key itself, it will hang for around 2 minutes.

I have been able to reproduce this every time when running rspec on a Rails 6.0 project; the key was generated once and is re-added to the my test env using:

private_key = IO.read('spec/support/test_gpg')
key_id = GPGME::Key.import(private_key).imports.map(&:fpr)

Maybe there is an additional argument or configuration that is missing to prevent user confirmation via STDIN ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions