Module: check_mk
Branch: master
Commit: 76a934784973429d3a0faf8fd6178df8f556c2b4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=76a93478497342…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jan 24 13:24:05 2018 +0100
Use pycryptodomex modules instead of pycrypto/pycryptodome ones.
This module name chaos is quite unfortunate, but we are forced to do this
because of a change in (transitive) dependency:
https://github.com/etingof/pysnmp/commit/82e594610
In detail: The current pysnmp version depends on pycryptodomex, but we use
"Crypto.Foo" modules in our code. These are gone with pycryptodomex, so we
3 alternatives:
* Additionally install pycrypto just for our own use: Not very attractive,
because all the functionality is already there, and having 2 different
libraries for basically identical purposes would be a bit obscure.
* Additionally install pycryptodome (without the "x"): This has the old
names, but it doesn't work when pycryptodomex is used, too. A brilliant
library design and versioning strategy... :-P
* Just switch to the new name.
We opt for the last case.
Change-Id: I527897314c476cf4cf5c6060bb19376a127c1475
---
bin/mkbackup | 6 +++---
cmk_base/data_sources/tcp.py | 2 +-
doc/treasures/livedump/livedump-mail-fetch | 6 +++---
web/htdocs/valuespec.py | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/bin/mkbackup b/bin/mkbackup
index c33b562..b761368 100755
--- a/bin/mkbackup
+++ b/bin/mkbackup
@@ -53,9 +53,9 @@ from tarfile import TarFile, ReadError
from hashlib import md5
from OpenSSL import crypto
-from Crypto.Cipher import AES, PKCS1_OAEP
-from Crypto.PublicKey import RSA
-import Crypto.Util.number
+from Cryptodome.Cipher import AES, PKCS1_OAEP
+from Cryptodome.PublicKey import RSA
+import Cryptodome.Util.number
try:
import simplejson as json
diff --git a/cmk_base/data_sources/tcp.py b/cmk_base/data_sources/tcp.py
index 215d58b..5b0d02c 100644
--- a/cmk_base/data_sources/tcp.py
+++ b/cmk_base/data_sources/tcp.py
@@ -146,7 +146,7 @@ class TCPDataSource(CheckMKAgentDataSource):
def _decrypt_package(self, encrypted_pkg, encryption_key):
- from Crypto.Cipher import AES
+ from Cryptodome.Cipher import AES
from hashlib import md5
unpad = lambda s : s[0:-ord(s[-1])]
diff --git a/doc/treasures/livedump/livedump-mail-fetch
b/doc/treasures/livedump/livedump-mail-fetch
index d681d38..92ac8a6 100755
--- a/doc/treasures/livedump/livedump-mail-fetch
+++ b/doc/treasures/livedump/livedump-mail-fetch
@@ -33,9 +33,9 @@ encrypt = None
if encrypt:
from base64 import b64decode
- from Crypto import Random
- from Crypto.Hash import MD5
- from Crypto.Cipher import AES
+ from Cryptodome import Random
+ from Cryptodome.Hash import MD5
+ from Cryptodome.Cipher import AES
M = poplib.POP3_SSL(pop_server)
M.user(pop_user)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index c444209..4bf8b33 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -42,7 +42,7 @@ import socket
import ipaddress
from lib import *
import cmk.defines as defines
-from Crypto.PublicKey import RSA
+from Cryptodome.PublicKey import RSA
try:
import simplejson as json