version 1.361, 2022/09/17 10:33:18 |
version 1.362, 2023/02/17 04:22:50 |
|
|
} |
} |
|
|
static int |
static int |
try_identity(struct ssh *ssh, Identity *id) |
|
{ |
|
if (!id->key) |
|
return (0); |
|
if (sshkey_type_plain(id->key->type) == KEY_RSA && |
|
(ssh->compat & SSH_BUG_RSASIGMD5) != 0) { |
|
debug("Skipped %s key %s for RSA/MD5 server", |
|
sshkey_type(id->key), id->filename); |
|
return (0); |
|
} |
|
return 1; |
|
} |
|
|
|
static int |
|
userauth_pubkey(struct ssh *ssh) |
userauth_pubkey(struct ssh *ssh) |
{ |
{ |
Authctxt *authctxt = (Authctxt *)ssh->authctxt; |
Authctxt *authctxt = (Authctxt *)ssh->authctxt; |
|
|
* private key instead |
* private key instead |
*/ |
*/ |
if (id->key != NULL) { |
if (id->key != NULL) { |
if (try_identity(ssh, id)) { |
if (id->key != NULL) { |
ident = format_identity(id); |
ident = format_identity(id); |
debug("Offering public key: %s", ident); |
debug("Offering public key: %s", ident); |
free(ident); |
free(ident); |
|
|
debug("Trying private key: %s", id->filename); |
debug("Trying private key: %s", id->filename); |
id->key = load_identity_file(id); |
id->key = load_identity_file(id); |
if (id->key != NULL) { |
if (id->key != NULL) { |
if (try_identity(ssh, id)) { |
if (id->key != NULL) { |
id->isprivate = 1; |
id->isprivate = 1; |
sent = sign_and_send_pubkey(ssh, id); |
sent = sign_and_send_pubkey(ssh, id); |
} |
} |