summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-05-24 08:44:07 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2013-05-24 09:40:15 -0400
commitb45df38114b94fb57f7282725c837d87f9237dff (patch)
tree1b4d66b0f205281fcf153f48c148f9fee49a4049
parent738a395eba63b51456ce6fa5b959bb9bf032b3d4 (diff)
downloadnova-b45df38114b94fb57f7282725c837d87f9237dff.tar.gz
nova-b45df38114b94fb57f7282725c837d87f9237dff.tar.xz
nova-b45df38114b94fb57f7282725c837d87f9237dff.zip
Removed superflous eval usage.
It was being used as a hex string parser, which is not necessary given that the int builtin can do this. Change-Id: I710093fc83c175ac08d827bb93ba878703ee817a
-rw-r--r--nova/crypto.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/crypto.py b/nova/crypto.py
index aaf102d8a..0447bd9b8 100644
--- a/nova/crypto.py
+++ b/nova/crypto.py
@@ -230,10 +230,10 @@ def convert_from_sshrsa_to_pkcs8(pubkey):
# +- INTEGER 65537
# Build the sequence for the bit string
- n_val = eval(
- '0x' + ''.join(['%02X' % struct.unpack('B', x)[0] for x in parts[2]]))
- e_val = eval(
- '0x' + ''.join(['%02X' % struct.unpack('B', x)[0] for x in parts[1]]))
+ n_val = int(
+ ''.join(['%02X' % struct.unpack('B', x)[0] for x in parts[2]]), 16)
+ e_val = int(
+ ''.join(['%02X' % struct.unpack('B', x)[0] for x in parts[1]]), 16)
pkinfo = _to_sequence(univ.Integer(n_val), univ.Integer(e_val))
# Convert the sequence into a bit string