Skip to content

[BUG] salt.utils.crypt can use wrong crypto library #60215

Closed

Description

@dwoz

Description

In the salt.crypt module we use some logic to determine which crypto library we are using. The logic tries M2Crypto, PyCryptodomex, then PyCrypto. The imports in salt.utils.crypt do not try to import M2Crypto or PyCryptodomex. This can have negative side effects. I observed code in the salt.utils.vt.Terminal stuck after forking because it was calling Crypto.Random.reinit via the salt.utils.crypt.reinit_crypto even though PyCryptodomex is installed (PyCryptodomex's version of this method is a no-op).

Setup

Install both PyCryptdomex and PyCrypto on the same system. Run cloud deployments.

Expected behavior

salt.utils.crypto sould not try to import PyCrypto when PyCryptodomex is installed.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

This was observed on 3002.5

This is related to #59903

Activity

  1. added
    bug
    Silicon v3004.0
    severity-high
    and removed on May 19, 2021
  2. added this to the Silicon milestone on May 19, 2021
  3. added
    bugfix-bckport
    and removed
    Silicon v3004.0
    on Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugbugfix-bckportseverity-high

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions