summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/paramiko/config.py b/paramiko/config.py
index e6877d01..0e3a5eaa 100644
--- a/paramiko/config.py
+++ b/paramiko/config.py
@@ -27,6 +27,7 @@ import os
import re
import shlex
import socket
+import hashlib
from functools import partial
from .py3compat import StringIO
@@ -435,7 +436,10 @@ class SSHConfig(object):
# The actual tokens!
replacements = {
# TODO: %%???
- # TODO: %C?
+ "%C": hashlib.sha1((local_hostname +
+ target_hostname +
+ str(port) +
+ remoteuser).encode("utf-8")).hexdigest(),
"%d": homedir,
"%h": configured_hostname,
# TODO: %i?