summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2015-11-01 18:17:20 -0800
committerJeff Forcier <jeff@bitprophet.org>2015-11-01 18:17:20 -0800
commit375ab8b8475081dfdd8c92ae3a6953d8dbbe6297 (patch)
tree9bc509eb1dc2b1d625c240a992ba91bf5323f96e
parent445d739757c927e0bde8cb4156122e90ac1d486a (diff)
Implement SHA-2 512bit HMAC support from #581
-rw-r--r--paramiko/transport.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 5f170ffd..b8ad8424 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -26,7 +26,7 @@ import sys
import threading
import time
import weakref
-from hashlib import md5, sha1, sha256
+from hashlib import md5, sha1, sha256, sha512
import paramiko
from paramiko import util
@@ -108,6 +108,7 @@ class Transport (threading.Thread, ClosingContextManager):
)
_preferred_macs = (
'hmac-sha2-256',
+ 'hmac-sha2-512',
'hmac-md5',
'hmac-sha1-96',
'hmac-md5-96',
@@ -181,6 +182,7 @@ class Transport (threading.Thread, ClosingContextManager):
'hmac-sha1': {'class': sha1, 'size': 20},
'hmac-sha1-96': {'class': sha1, 'size': 12},
'hmac-sha2-256': {'class': sha256, 'size': 32},
+ 'hmac-sha2-512': {'class': sha512, 'size': 64},
'hmac-md5': {'class': md5, 'size': 16},
'hmac-md5-96': {'class': md5, 'size': 12},
}