Skip to content

Fix/68930 gen signature clean key#68934

Open
lubinatien wants to merge 2 commits intosaltstack:3006.xfrom
lubinatien:fix/68930-gen-signature-clean-key
Open

Fix/68930 gen signature clean key#68934
lubinatien wants to merge 2 commits intosaltstack:3006.xfrom
lubinatien:fix/68930-gen-signature-clean-key

Conversation

@lubinatien
Copy link
Copy Markdown

What does this PR do?

Applies clean_key() to the pub key content in gen_signature() before signing, so the signature matches what get_pub_str() sends to minions.

What issues does this PR fix or reference?

Fixes #68930

Previous Behavior

gen_signature() signed the raw pub key file content (which includes a trailing newline from PEM encoding). Meanwhile, get_pub_str() sends clean_key(pub) to minions. When minions called verify_pubkey_sig(), the signature never matched the received content, causing master_use_pubkey_signature: True to always fail verification.

New Behavior

gen_signature() now applies clean_key() to the file content before signing. The signed content matches what minions receive via get_pub_str(), so verify_pubkey_sig() succeeds.

This is the same pattern applied in #66153 for the minion key auth path in salt/channel/server.py.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Sébastien Lemercier added 2 commits April 13, 2026 17:06
gen_signature() was signing the raw pub key file content (which includes
a trailing newline), but get_pub_str() sends clean_key(pub) to minions.
This mismatch caused verify_pubkey_sig() to always fail when
master_use_pubkey_signature was enabled.

Apply clean_key() to the file content before signing so the signature
matches what minions receive and verify against.

Fixes: saltstack#68930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants