From b45df38114b94fb57f7282725c837d87f9237dff Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 24 May 2013 08:44:07 -0400 Subject: 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 --- nova/crypto.py | 8 ++++---- 1 file 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 -- cgit