[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:30:59 UTC 2013
The following commit has been merged in the master branch:
commit f4d87e0c8528980db45f160f04c67735fa95ea94
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Tue Apr 2 17:21:42 2013 -0700
Switch GetPassword from M2Crypto to openssl
diff --git a/euca2ools/commands/euca/getpassword.py b/euca2ools/commands/euca/getpassword.py
index ef4ba10..d9facc7 100644
--- a/euca2ools/commands/euca/getpassword.py
+++ b/euca2ools/commands/euca/getpassword.py
@@ -29,18 +29,17 @@
# POSSIBILITY OF SUCH DAMAGE.
import base64
-from euca2ools.commands.argtypes import file_contents
from euca2ools.commands.euca.getpassworddata import GetPasswordData
-from M2Crypto import RSA
from requestbuilder import Arg
+import subprocess
class GetPassword(GetPasswordData):
NAME = 'GetPasswordData'
DESCRIPTION = ('Retrieve the administrator password for an instance '
'running Windows')
- ARGS = [Arg('-k', '--priv-launch-key', metavar='FILE',
- type=file_contents, required=True, route_to=None,
+ ARGS = [Arg('-k', '--priv-launch-key', metavar='FILE', required=True,
+ route_to=None,
help='''file containing the private key corresponding to the
key pair supplied at instance launch time (required)''')]
@@ -50,7 +49,8 @@ class GetPassword(GetPasswordData):
except AttributeError:
# The reply didn't contain a passwordData element.
raise AttributeError('no password data found for this instance')
- privkey = RSA.load_key_string(self.args['priv_launch_key'])
- password = privkey.private_decrypt(base64.b64decode(pwdata),
- RSA.pkcs1_padding)
- print password
+ cmd = subprocess.Popen(['openssl', 'rsautl', '-decrypt', '-inkey',
+ self.args['priv_launch_key']],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ stdout, __ = cmd.communicate(base64.b64decode(pwdata))
+ print stdout
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list