Skip to content

[Bug]: x509_v2.certificate_managed can be non-idempotent with PKCS#7 #69893

Closed

Description

@lkubb

What happened?

PKCS#7 stores certificates in a SET, not a SEQUENCE. The current certificate loading logic in salt.utils.x509.load_cert assumes that the format is ordered though, which means it can return a chain certificate as the leaf. This can result in unnecessary changes when the encoded order does not match the expected one by chance. The test suite does not catch it because of this chance.

Reproduction in PR.

Type of salt install

Official deb

Major version

3006.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

Current HEAD of `3006.x` branch

Activity

  1. added
    bug
    on Jul 28, 2026
  2. added a commit that references this issue on Oct 1, 2026
  3. dwoz commented on Oct 16, 2026

    @dwoz
    Contributor

    This was fixed in v3006.28 and v3007.15. If you can still reproduce it on either release, please comment and we'll reopen.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions