summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Encryption.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-12-05 14:47:09 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-12-05 14:47:09 -0500
commit96f1e72d5da30bb4d3c9b63cff010c8048d9e51d (patch)
treec84ce7d6e5680aa4dfef76cb1b9a6f88782eb1bb /src/lib/Bcfg2/Encryption.py
parent5e0501ee6b9414b506c903696251a73975524907 (diff)
downloadbcfg2-96f1e72d5da30bb4d3c9b63cff010c8048d9e51d.tar.gz
bcfg2-96f1e72d5da30bb4d3c9b63cff010c8048d9e51d.tar.bz2
bcfg2-96f1e72d5da30bb4d3c9b63cff010c8048d9e51d.zip
Encryption: fixed unit tests
Diffstat (limited to 'src/lib/Bcfg2/Encryption.py')
-rwxr-xr-xsrc/lib/Bcfg2/Encryption.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Encryption.py b/src/lib/Bcfg2/Encryption.py
index b4674d72f..6d16748d5 100755
--- a/src/lib/Bcfg2/Encryption.py
+++ b/src/lib/Bcfg2/Encryption.py
@@ -116,11 +116,11 @@ def ssl_decrypt(data, passwd, algorithm=ALGORITHM):
# base64-decode the data
data = b64decode(data)
salt = data[8:16]
- # pylint: disable=E1101
+ # pylint: disable=E1101,E1121
hashes = [md5(passwd + salt).digest()]
for i in range(1, 3):
hashes.append(md5(hashes[i - 1] + passwd + salt).digest())
- # pylint: enable=E1101
+ # pylint: enable=E1101,E1121
key = hashes[0] + hashes[1]
iv = hashes[2]
@@ -146,11 +146,11 @@ def ssl_encrypt(plaintext, passwd, algorithm=ALGORITHM, salt=None):
if salt is None:
salt = Rand.rand_bytes(8)
- # pylint: disable=E1101
+ # pylint: disable=E1101,E1121
hashes = [md5(passwd + salt).digest()]
for i in range(1, 3):
hashes.append(md5(hashes[i - 1] + passwd + salt).digest())
- # pylint: enable=E1101
+ # pylint: enable=E1101,E1121
key = hashes[0] + hashes[1]
iv = hashes[2]