From b9fc4f7c2cbfd319512b89d6af6421bb7cc1d2f0 Mon Sep 17 00:00:00 2001 From: Jason Brand Date: Tue, 15 Feb 2022 23:15:23 +0000 Subject: %C support in config file --- paramiko/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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? -- cgit v1.2.3