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

Use new fixture signing key #1424

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Use new fixture signing key #1424

merged 1 commit into from
Nov 22, 2023

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Nov 17, 2023

[noissue]

@lubosmj
Copy link
Member

lubosmj commented Nov 20, 2023

Thanks for opening this PR! You may need to rebase the branch and wait for a pulpcore release to make these changes available: https://github.com/pulp/pulpcore/pull/4731/files.

assert decrypted.username == "Pulp QE"
assert decrypted.username == "pulp-fixture-signing-key"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this will introduce a bad version interdependence issue. If we cannot defer the userid of the key, we should not assert on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is useful for asserting data stored in Pulp. We verify whether we did not change anything along the way while parsing images. Am I reading it correctly that you want to remove this check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the version of pulpcore used, this username will be the new one or the old one. So the best way would be to find a way to get the asserted name from the gpgkey fixture in pulpcore. If that is impossible, i'd really just remove the assertion (or assert only that it's not empty).

Copy link
Contributor Author

@dralley dralley Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixture doesn't provide that information. It does provide the fingerprint, which IMO is good enough and effectively tests the same thing. Also the "key id" is a subset of the fingerprint IIRC, yeah? So we wouldn't need to test both?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's remove it!

@dralley
Copy link
Contributor Author

dralley commented Nov 22, 2023

@lubosmj @mdellweg updated

@@ -73,9 +73,7 @@ def test_assert_signed_image(
decrypted = gpg.decrypt(raw_s)

assert decrypted.key_id == keyid
assert decrypted.fingerprint == fingerprint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fingerprint comes from the bindings. I believe that should be fine. Maybe I'm missing something again.

Copy link
Contributor Author

@dralley dralley Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment, fingerprint and keyid are effectively the same, as one (I believe keyid) is just the last X bits of the other. Realistically just checking one is the same as checking both as they are both meant to be functionally unique values.

Edit: at least for the purposes of this test. Supposedly both fingerprints and particularly keyids are attackable by brute force, but that's a bit beyond the scope of what we're testing.

@dralley dralley closed this Nov 22, 2023
@dralley dralley reopened this Nov 22, 2023
Copy link
Member

@lubosmj lubosmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also fix nightly checks:

>           assert decrypted.username == "Pulp QE"
E           AssertionError: assert 'pulp-fixture...pproject.org>' == 'Pulp QE'
E             - Pulp QE
E             + pulp-fixture-signing-key <[email protected]>

https://github.com/pulp/pulp_container/actions/runs/6952312275/job/18948179340

@lubosmj lubosmj merged commit 0d58df7 into pulp:main Nov 22, 2023
25 of 30 checks passed
Copy link

patchback bot commented Dec 14, 2023

Backport to 2.16: 💚 backport PR created

✅ Backport PR branch: patchback/backports/2.16/0d58df7a151d565309ef8fd02c366d9d9b6f57b8/pr-1424

Backported as #1451

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link

patchback bot commented Jan 8, 2024

Backport to 2.15: 💚 backport PR created

✅ Backport PR branch: patchback/backports/2.15/0d58df7a151d565309ef8fd02c366d9d9b6f57b8/pr-1424

Backported as #1458

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Successfully merging this pull request may close these issues.

3 participants