24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
From 81064206bf3cec2ca4372257ff138481e1227b91 Mon Sep 17 00:00:00 2001
|
|
From: Alex Gaynor <alex.gaynor@gmail.com>
|
|
Date: Sat, 18 Jul 2020 14:18:07 -0400
|
|
Subject: [PATCH] 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(-)
|
|
|
|
Index: paramiko-2.4.3/paramiko/rsakey.py
|
|
===================================================================
|
|
--- paramiko-2.4.3.orig/paramiko/rsakey.py
|
|
+++ paramiko-2.4.3/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,
|