version 1.74, 2017/12/21 00:00:28 |
version 1.75, 2018/01/23 05:27:21 |
|
|
debug2("%s: disabled because of invalid user", __func__); |
debug2("%s: disabled because of invalid user", __func__); |
return 0; |
return 0; |
} |
} |
if ((r = sshpkt_get_u8(ssh, &have_sig)) != 0) |
if ((r = sshpkt_get_u8(ssh, &have_sig)) != 0 || |
fatal("%s: sshpkt_get_u8 failed: %s", __func__, ssh_err(r)); |
(r = sshpkt_get_cstring(ssh, &pkalg, NULL)) != 0 || |
if (ssh->compat & SSH_BUG_PKAUTH) { |
(r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0) |
debug2("%s: SSH_BUG_PKAUTH", __func__); |
fatal("%s: parse request failed: %s", __func__, ssh_err(r)); |
if ((b = sshbuf_new()) == NULL) |
|
fatal("%s: sshbuf_new failed", __func__); |
|
/* no explicit pkalg given */ |
|
/* so we have to extract the pkalg from the pkblob */ |
|
/* XXX use sshbuf_from() */ |
|
if ((r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0 || |
|
(r = sshbuf_put(b, pkblob, blen)) != 0 || |
|
(r = sshbuf_get_cstring(b, &pkalg, NULL)) != 0) |
|
fatal("%s: failed: %s", __func__, ssh_err(r)); |
|
sshbuf_free(b); |
|
} else { |
|
if ((r = sshpkt_get_cstring(ssh, &pkalg, NULL)) != 0 || |
|
(r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0) |
|
fatal("%s: sshpkt_get_cstring failed: %s", |
|
__func__, ssh_err(r)); |
|
} |
|
pktype = sshkey_type_from_name(pkalg); |
pktype = sshkey_type_from_name(pkalg); |
if (pktype == KEY_UNSPEC) { |
if (pktype == KEY_UNSPEC) { |
/* this is perfectly legal */ |
/* this is perfectly legal */ |
|
|
authctxt->style ? authctxt->style : ""); |
authctxt->style ? authctxt->style : ""); |
if ((r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
if ((r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
(r = sshbuf_put_cstring(b, userstyle)) != 0 || |
(r = sshbuf_put_cstring(b, userstyle)) != 0 || |
(r = sshbuf_put_cstring(b, ssh->compat & SSH_BUG_PKSERVICE ? |
(r = sshbuf_put_cstring(b, authctxt->service)) != 0 || |
"ssh-userauth" : authctxt->service)) != 0) |
(r = sshbuf_put_cstring(b, "publickey")) != 0 || |
fatal("%s: build packet failed: %s", |
(r = sshbuf_put_u8(b, have_sig)) != 0 || |
__func__, ssh_err(r)); |
(r = sshbuf_put_cstring(b, pkalg) != 0) || |
if (ssh->compat & SSH_BUG_PKAUTH) { |
(r = sshbuf_put_string(b, pkblob, blen)) != 0) |
if ((r = sshbuf_put_u8(b, have_sig)) != 0) |
|
fatal("%s: build packet failed: %s", |
|
__func__, ssh_err(r)); |
|
} else { |
|
if ((r = sshbuf_put_cstring(b, "publickey")) != 0 || |
|
(r = sshbuf_put_u8(b, have_sig)) != 0 || |
|
(r = sshbuf_put_cstring(b, pkalg) != 0)) |
|
fatal("%s: build packet failed: %s", |
|
__func__, ssh_err(r)); |
|
} |
|
if ((r = sshbuf_put_string(b, pkblob, blen)) != 0) |
|
fatal("%s: build packet failed: %s", |
fatal("%s: build packet failed: %s", |
__func__, ssh_err(r)); |
__func__, ssh_err(r)); |
#ifdef DEBUG_PK |
#ifdef DEBUG_PK |