summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-30 21:53:50 +0000
committerGerrit Code Review <review@openstack.org>2013-05-30 21:53:50 +0000
commit3dbe9f424c0ba885a4dae5afdd8cb91efa555358 (patch)
tree50d1dadcc6838242b57641c2346b0f870dd25f66
parent2d81dc9baad2459211d3493dcb91ab70de26aaf2 (diff)
parentd74b1420a3ce427647a684f78e650c73db2be767 (diff)
downloadheat-3dbe9f424c0ba885a4dae5afdd8cb91efa555358.tar.gz
Merge "uses os.urandom instead of Crypto.Random for backward compatibility" into stable/grizzly2013.1.2
-rw-r--r--heat/common/crypt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/heat/common/crypt.py b/heat/common/crypt.py
index 28c11f534..81b4c92bc 100644
--- a/heat/common/crypt.py
+++ b/heat/common/crypt.py
@@ -15,7 +15,7 @@
import base64
from Crypto.Cipher import AES
-from Crypto import Random
+from os import urandom
from oslo.config import cfg
@@ -36,7 +36,7 @@ logger = logging.getLogger(__name__)
def encrypt(auth_info):
if auth_info is None:
return None
- iv = Random.new().read(AES.block_size)
+ iv = urandom(AES.block_size)
cipher = AES.new(cfg.CONF.auth_encryption_key[:32], AES.MODE_CFB, iv)
res = base64.b64encode(iv + cipher.encrypt(auth_info))
return res