Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_and_trust_key errs with gpg 1.4 #14

Open
symbolboxer opened this issue Apr 30, 2021 · 1 comment
Open

import_and_trust_key errs with gpg 1.4 #14

symbolboxer opened this issue Apr 30, 2021 · 1 comment

Comments

@symbolboxer
Copy link

Environment

  • Ruby 2.4.4p296
  • IOStreams 1.6.1
  • Rails 5.2.3
  • GPG 1.4.16

Expected Behavior

  • A PGP key generated by IOStreams can be passed as an import_and_trust_key option

Actual Behavior

Error is thrown:

IOStreams::Pgp::Failure:
       GPG Failed trusting key: gpg: error in `[stdin]': invalid fingerprint

I suspect that this happens with any key on GPG 1.4.16. The same key, when passed in as import_and_trust_key on GPG 2.2.4, works without incident.

Pull Request

Coming soon!

@symbolboxer
Copy link
Author

I wrote this snippet in order to demonstrate:

key_id = IOStreams::Pgp.generate_key(
  name: 'test key',
  email: 'trust_test@example.com',
  passphrase: 'test'
)
IOStreams::Pgp.set_trust(email: 'trust_test@example.com', key_id: key_id)

But this doesn't appear to work on GPG 2.2.4 because of an unrelated issue where generate_key returns a truncated key ID.

This one, however, works as expected on 2.2.4 and fails on 1.4.16:

email = 'trust_test@example.com'
IOStreams::Pgp.generate_key(
  name: 'test key',
  email: email,
  passphrase: 'test'
)
key_str = IOStreams::Pgp.export(email: email)
IOStreams::Pgp.import_and_trust(key: key_str)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant