From 81064206bf3cec2ca4372257ff138481e1227b91 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 18 Jul 2020 14:18:07 -0400 Subject: fix RSA key loading: p and q were being swapped This currently works, because OpenSSL simply re-computes iqmp when it doesn't match the p & q values. However a future pyca/cryptography patch enforces this. --- paramiko/rsakey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'paramiko/rsakey.py') diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index 9707b268..172f42d4 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -189,7 +189,7 @@ class RSAKey(PKey): except ValueError as e: raise SSHException(str(e)) elif pkformat == self._PRIVATE_KEY_FORMAT_OPENSSH: - n, e, d, iqmp, q, p = self._uint32_cstruct_unpack(data, "iiiiii") + n, e, d, iqmp, p, q = self._uint32_cstruct_unpack(data, "iiiiii") public_numbers = rsa.RSAPublicNumbers(e=e, n=n) key = rsa.RSAPrivateNumbers( p=p, -- cgit v1.2.1