version 1.119, 2023/07/27 22:25:17 |
version 1.120, 2024/05/17 00:30:23 |
|
|
|
|
/* import */ |
/* import */ |
extern ServerOptions options; |
extern ServerOptions options; |
|
extern struct authmethod_cfg methodcfg_pubkey; |
|
|
static char * |
static char * |
format_key(const struct sshkey *key) |
format_key(const struct sshkey *key) |
|
|
#endif |
#endif |
/* test for correct signature */ |
/* test for correct signature */ |
authenticated = 0; |
authenticated = 0; |
if (PRIVSEP(user_key_allowed(ssh, pw, key, 1, &authopts)) && |
if (mm_user_key_allowed(ssh, pw, key, 1, &authopts) && |
PRIVSEP(sshkey_verify(key, sig, slen, |
mm_sshkey_verify(key, sig, slen, |
sshbuf_ptr(b), sshbuf_len(b), |
sshbuf_ptr(b), sshbuf_len(b), |
(ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL, |
(ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL, |
ssh->compat, &sig_details)) == 0) { |
ssh->compat, &sig_details) == 0) { |
authenticated = 1; |
authenticated = 1; |
} |
} |
if (authenticated == 1 && sig_details != NULL) { |
if (authenticated == 1 && sig_details != NULL) { |
|
|
* if a user is not allowed to login. is this an |
* if a user is not allowed to login. is this an |
* issue? -markus |
* issue? -markus |
*/ |
*/ |
if (PRIVSEP(user_key_allowed(ssh, pw, key, 0, NULL))) { |
if (mm_user_key_allowed(ssh, pw, key, 0, NULL)) { |
if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_PK_OK)) |
if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_PK_OK)) |
!= 0 || |
!= 0 || |
(r = sshpkt_put_cstring(ssh, pkalg)) != 0 || |
(r = sshpkt_put_cstring(ssh, pkalg)) != 0 || |
|
|
} |
} |
|
|
Authmethod method_pubkey = { |
Authmethod method_pubkey = { |
"publickey", |
&methodcfg_pubkey, |
"publickey-hostbound-v00@openssh.com", |
|
userauth_pubkey, |
userauth_pubkey, |
&options.pubkey_authentication |
|
}; |
}; |