-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TECH DEBT] Migrating away from M2Crypto
#66149
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
@facutuesca The intent is to migrate everything to cryptography. We just have not had a chance to prioritize it. Any contributions moving things in that direction are welcome. |
A couple more comments from tired maintainer of M2Crypto, who doesn’t wish anything more than to let M2Crypto leave its duties for peace of retirement.
Besides, M2Crypto follows OpenSSL API very closely, so it is very easy to create insecure application with it, no, sometimes it is actually quite difficult to call OpenSSL APIs in secure manner. If cryptography is doing more in preventing its users to shoot into their feet, it is great advantage of it.
And the header files for OpenSSL (which might be
Whatever I said about |
First PR for the migration is up here: #66166 |
@facutuesca I will take care of |
This module should also be migrated to use cryptography's openssl backend instead of ctypes. |
On second thought, let's get off x9.31 all together as it's likely considered to be insecure: openssl/openssl#10919 (comment) |
Description of the tech debt to be addressed, include links and screenshots
Following up on #63066: Salt currently uses
M2Crypto
for some of its cryptographic operations.M2Crypto
is a wrapper aroundOpenSSL
's APIs that has some drawbacks:pyca/cryptography
)swig
, something that adds complexity and results in user installation issues.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 aspyca/cryptography
. To note: Salt already depends onpyca/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:
PyCryptodome
or elsePyCrypto
ifM2Crypto
is not foundcryptography
usingRSA.generate_private_key()
M2Crypto
toPyCA/cryptography
#66166x509v2
was re-written to usepyca/cryptography
insteadPyCryptodome
or elsePyCrypto
ifM2Crypto
is not foundpyca/cryptography
. An exception is encryption/decryption with X931 padding, but Salt already has its own fallback implementation for it.PyCryptodome
or elsePyCrypto
ifM2Crypto
is not foundpyca/cryptography
pyOpenSSL
andPyCryptodome/PyCrypto
ifM2Crypto
is not availablepyca/cryptography
using https://cryptography.io/en/latest/x509/verification/PyCryptodome
or elsePyCrypto
ifM2Crypto
is not foundpyca/cryptography
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.The text was updated successfully, but these errors were encountered: