Project

General

Profile

Bug #26463

Satellite gpg key import removes newline

Added by Tomer Brisker about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Credentials
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1616209

Description of problem:

Satellite gpg key import removes newline.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Get the GPG key for any custom repository. example : wget https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

2. Create a new GPG key in satellite either with hammer or from GUI.

hammer gpg create \
--key ~/VMWARE-PACKAGING-GPG-RSA-KEY.pub \
--name "my_key" \
--organization "Example_Org"

3. Add the GPG key to custom repository.

Content > Products > Custom_product > Custom_repository > Edit GPG key to add "my_key"

4. On the client download the GPG key.

[root@client ~]# wget https://satellite.example.com/katello/api/repositories/repo_id/gpg_key_content

5. Now import the key.

[root@client ~]# rpm --import gpg_key_content

error: gpg_key_content: key 1 not an armored public key.

6. When we take the difference of the actual key and gpg_key_content we get below output.

diff VMWARE-PACKAGING-GPG-RSA-KEY.pub gpg_key_content
< -----END PGP PUBLIC KEY BLOCK-----
---
> -----END PGP PUBLIC KEY BLOCK-----
\ No newline at end of file

Actual results:

[root@client ~]# rpm --import gpg_key_content

error: gpg_key_content: key 1 not an armored public key.

Expected results:

The key should imported as expected.

Additional info:

1. This behaviour is happening on satellite as well.

2. Same steps tried with other key and got the same result.

3. Even if we go to satellite GUI and add a new line to the GPG key it produces the same error while importing.

Associated revisions

Revision 3249b27a (diff)
Added by Tomer Brisker about 2 years ago

Fixes #26463 - Don't strip trailing whitespace for gpg keys

History

#1 Updated by The Foreman Bot about 2 years ago

  • Assignee set to Tomer Brisker
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8044 added

#2 Updated by Andrew Kofink about 2 years ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.12.0

#3 Updated by Anonymous about 2 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF