summaryrefslogtreecommitdiff
path: root/paramiko/transport.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-02-09 16:58:18 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2019-02-09 16:58:18 +0000
commit02d4370ce7842a418ca27ba9307961d9ecf87397 (patch)
tree6c2ba88ae3e5d797fe317e763e789aa734f163ba /paramiko/transport.py
parent03c7853479d0d58afa5edff4189846e73d15a567 (diff)
downloadparamiko-02d4370ce7842a418ca27ba9307961d9ecf87397.tar.gz
Support linking against older OpenSSLs
Diffstat (limited to 'paramiko/transport.py')
-rw-r--r--paramiko/transport.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 785da060..f25ef95d 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -171,7 +171,6 @@ class Transport(threading.Thread, ClosingContextManager):
"ssh-dss",
)
_preferred_kex = (
- "curve25519-sha256@libssh.org",
"ecdh-sha2-nistp256",
"ecdh-sha2-nistp384",
"ecdh-sha2-nistp521",
@@ -180,6 +179,8 @@ class Transport(threading.Thread, ClosingContextManager):
"diffie-hellman-group14-sha1",
"diffie-hellman-group1-sha1",
)
+ if KexCurve25519.is_available():
+ _preferred_kex = ("curve25519-sha256@libssh.org",) + _preferred_kex
_preferred_gsskex = (
"gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==",
"gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==",
@@ -273,8 +274,9 @@ class Transport(threading.Thread, ClosingContextManager):
"ecdh-sha2-nistp256": KexNistp256,
"ecdh-sha2-nistp384": KexNistp384,
"ecdh-sha2-nistp521": KexNistp521,
- "curve25519-sha256@libssh.org": KexCurve25519,
}
+ if KexCurve25519.is_available():
+ _kex_info["curve25519-sha256@libssh.org"] = KexCurve25519
_compression_info = {
# zlib@openssh.com is just zlib, but only turned on after a successful