Patch paramiko
Its not clear how long it will take for paramiko to merge
https://github.com/paramiko/paramiko/pull/1928 to allow paramiko to
work in a FIPS enabled environment.
In the meantime, lets patch paramiko so we can merge our FIPS enabled
gates. When the patch or its equivalent is merged, we can remove this
code.
Change-Id: Ib59647e6aa3dc313ee603ee9d322416179ef615c
diff --git a/tempest/lib/common/ssh.py b/tempest/lib/common/ssh.py
index eb03faa..cb59a82 100644
--- a/tempest/lib/common/ssh.py
+++ b/tempest/lib/common/ssh.py
@@ -21,6 +21,7 @@
import warnings
from oslo_log import log as logging
+from oslo_utils.secretutils import md5
from tempest.lib import exceptions
@@ -33,6 +34,21 @@
LOG = logging.getLogger(__name__)
+def get_fingerprint(self):
+ """Patch paramiko
+
+ This method needs to be patched to allow paramiko to work under FIPS.
+ Until the patch to do this merges, patch paramiko here.
+
+ TODO(alee) Remove this when paramiko is patched.
+ See https://github.com/paramiko/paramiko/pull/1928
+ """
+ return md5(self.asbytes(), usedforsecurity=False).digest()
+
+
+paramiko.pkey.PKey.get_fingerprint = get_fingerprint
+
+
class Client(object):
def __init__(self, host, username, password=None, timeout=300, pkey=None,