saltstack / saltstack/salt

[TECH DEBT] Migrating away from `M2Crypto`

Open
#66,149 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description of the tech debt to be addressed, include links and screenshots

Following up on https://github.com/saltstack/salt/issues/63066: Salt currently uses M2Crypto for some of its cryptographic operations. M2Crypto is a wrapper around OpenSSL's APIs that has some drawbacks:

I'm opening this issue to list the places where M2Crypto is still being used inside Salt, and to assess the interest in migrating away from it towards more well-maintained alternatives, such as pyca/cryptography. To note: Salt already depends on pyca/cryptography, so this migration would not add new dependencies.

Going through the codebase, these are the usages that I could find, along with the feasibility of migrating to alternatives:

I'm opening the discussion to see if there is interest in migrating away from M2Crypto, and to discuss related issues such as blockers, deprecation paths, fallback alternatives, etc.

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

Review the listed M2Crypto call sites in salt/crypt.py, salt/channel/server.py, salt/auth/pki.py, and salt/cloud/clouds/joyent.py, noting that runners/digicertapi.py already has a pull request and the x509 module is deprecated. Start by comparing each fallback path with the suggested pyca/cryptography APIs. Done means the remaining unchecked usages have a decided migration or deprecation path without relying on M2Crypto.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.