-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit changes the default of the ignore_encrypted option to be True when keys are being loaded from config files, automatically ignoring encrypted keys when no passphrase is specified. For keys set via client_keys, the default is to still give an error in this case unless ignore_encrypted is explicitly set. When loading keys from their default locations, encrypted keys were already ignored when no passphrase is given, and this behavior isn't changing.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6491,9 +6491,9 @@ class SSHClientConnectionOptions(SSHConnectionOptions): | |
are already loaded, this argument is ignored. | ||
:param ignore_encrypted: (optional) | ||
Whether or not to ignore encrypted keys when no passphrase is | ||
provided. This is intended to allow encrypted keys specified via | ||
the IdentityFile config option to be ignored if a passphrase | ||
is not specified, loading only unencrypted local keys. Note | ||
specified. This defaults to `True` for keys specified via | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ronf
Author
Owner
|
||
the IdentityFile config option, causing encrypted keys in the | ||
config to be ignored when no passphrase is specified. Note | ||
that encrypted keys loaded into an SSH agent can still be used | ||
when this option is set. | ||
:param host_based_auth: (optional) | ||
|
@@ -6870,7 +6870,7 @@ def prepare(self, last_config: Optional[SSHConfig] = None, # type: ignore | |
client_keys: _ClientKeysArg = (), | ||
client_certs: Sequence[FilePath] = (), | ||
passphrase: Optional[BytesOrStr] = None, | ||
ignore_encrypted: bool = False, | ||
ignore_encrypted: DefTuple[bool] = (), | ||
gss_host: DefTuple[Optional[str]] = (), | ||
gss_kex: DefTuple[bool] = (), gss_auth: DefTuple[bool] = (), | ||
gss_delegate_creds: DefTuple[bool] = (), | ||
|
@@ -7038,6 +7038,11 @@ def prepare(self, last_config: Optional[SSHConfig] = None, # type: ignore | |
|
||
pkcs11_provider: Optional[FilePath] | ||
|
||
if ignore_encrypted == (): | ||
ignore_encrypted = client_keys == () | ||
|
||
ignore_encrypted: bool | ||
|
||
if client_keys == (): | ||
client_keys = cast(_ClientKeysArg, config.get('IdentityFile', ())) | ||
|
||
|
is it really
for
(as - considered per key) or overallas it seems just overall check in the diff.