saltstack / saltstack/salt

[Bug]: `salt.utils.x509.load_pubkey` param `get_encoding` is a no-op

Open Beginner friendly
#70,046 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

What happened?

salt.utils.x509.load_pubkey does not account for the (thus unused) get_encoding parameter. Unsure why pylint didn't complain, but the parameter is never used internally. It should still be fixed.

See code:

https://github.com/saltstack/salt/blob/f52cedee45d1af57254f88153419ef9b00a9d301/salt/utils/x509.py#L818-L853

Type of salt install

Official deb

Major version

3006.x, 3007.x, 3008.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

ubuntu-24.04

salt --versions-report output
Latest HEAD of 3006.x

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt/utils/x509.py at load_pubkey, using the linked lines, and inspect how the get_encoding parameter is currently handled. Trace the intended encoding behavior from nearby code or callers, then verify that the parameter is no longer a no-op and that the affected x509 behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.