Lines Matching full:ssh
51 #include "ssh.h"
75 #include "ssh-sk.h"
79 #include "ssh-gss.h"
96 verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh) in verify_host_key_callback() argument
220 ssh_kex2(struct ssh *ssh, char *host, struct sockaddr *hostaddr, u_short port, in ssh_kex2() argument
232 ssh_packet_set_rekey_limits(ssh, options.rekey_limit, in ssh_kex2()
255 kex_proposal_populate_entries(ssh, myproposal, in ssh_kex2()
263 if ((r = kex_setup(ssh, myproposal)) != 0) in ssh_kex2()
266 ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client; in ssh_kex2()
267 ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client; in ssh_kex2()
268 ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client; in ssh_kex2()
269 ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client; in ssh_kex2()
270 ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client; in ssh_kex2()
271 ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; in ssh_kex2()
272 ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; in ssh_kex2()
274 ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client; in ssh_kex2()
277 ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client; in ssh_kex2()
278 ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_client; in ssh_kex2()
279 ssh->kex->verify_host_key=&verify_host_key_callback; in ssh_kex2()
281 ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &ssh->kex->done); in ssh_kex2()
286 if ((r = sshpkt_start(ssh, SSH2_MSG_IGNORE)) != 0 || in ssh_kex2()
287 (r = sshpkt_put_cstring(ssh, "markus")) != 0 || in ssh_kex2()
288 (r = sshpkt_send(ssh)) != 0 || in ssh_kex2()
289 (r = ssh_packet_write_wait(ssh)) != 0) in ssh_kex2()
345 int (*userauth)(struct ssh *ssh);
346 void (*cleanup)(struct ssh *ssh);
351 static int input_userauth_service_accept(int, u_int32_t, struct ssh *);
352 static int input_userauth_success(int, u_int32_t, struct ssh *);
353 static int input_userauth_failure(int, u_int32_t, struct ssh *);
354 static int input_userauth_banner(int, u_int32_t, struct ssh *);
355 static int input_userauth_error(int, u_int32_t, struct ssh *);
356 static int input_userauth_info_req(int, u_int32_t, struct ssh *);
357 static int input_userauth_pk_ok(int, u_int32_t, struct ssh *);
358 static int input_userauth_passwd_changereq(int, u_int32_t, struct ssh *);
360 static int userauth_none(struct ssh *);
361 static int userauth_pubkey(struct ssh *);
362 static int userauth_passwd(struct ssh *);
363 static int userauth_kbdint(struct ssh *);
364 static int userauth_hostbased(struct ssh *);
367 static int userauth_gssapi(struct ssh *);
368 static void userauth_gssapi_cleanup(struct ssh *);
369 static int input_gssapi_response(int type, u_int32_t, struct ssh *);
370 static int input_gssapi_token(int type, u_int32_t, struct ssh *);
371 static int input_gssapi_error(int, u_int32_t, struct ssh *);
372 static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
375 void userauth(struct ssh *, char *);
377 static void pubkey_cleanup(struct ssh *);
378 static int sign_and_send_pubkey(struct ssh *ssh, Identity *);
379 static void pubkey_prepare(struct ssh *, Authctxt *);
424 ssh_userauth2(struct ssh *ssh, const char *local_user, in ssh_userauth2() argument
438 authctxt.service = "ssh-connection"; /* service name */ in ssh_userauth2()
456 if ((r = sshpkt_start(ssh, SSH2_MSG_SERVICE_REQUEST)) != 0 || in ssh_userauth2()
457 (r = sshpkt_put_cstring(ssh, "ssh-userauth")) != 0 || in ssh_userauth2()
458 (r = sshpkt_send(ssh)) != 0) in ssh_userauth2()
461 ssh->authctxt = &authctxt; in ssh_userauth2()
462 ssh_dispatch_init(ssh, &input_userauth_error); in ssh_userauth2()
463 ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); in ssh_userauth2()
464 ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); in ssh_userauth2()
465 ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ in ssh_userauth2()
466 pubkey_cleanup(ssh); in ssh_userauth2()
475 ssh->authctxt = NULL; in ssh_userauth2()
477 ssh_dispatch_range(ssh, SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL); in ssh_userauth2()
481 if (ssh_packet_connection_is_on_socket(ssh)) { in ssh_userauth2()
483 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), in ssh_userauth2()
492 input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_service_accept() argument
496 if (ssh_packet_remaining(ssh) > 0) { in input_userauth_service_accept()
499 if ((r = sshpkt_get_cstring(ssh, &reply, NULL)) != 0) in input_userauth_service_accept()
506 if ((r = sshpkt_get_end(ssh)) != 0) in input_userauth_service_accept()
511 userauth_none(ssh); in input_userauth_service_accept()
514 ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, ssh->kex->ext_info_s ? in input_userauth_service_accept()
516 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_SUCCESS, &input_userauth_success); in input_userauth_service_accept()
517 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_FAILURE, &input_userauth_failure); in input_userauth_service_accept()
518 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_BANNER, &input_userauth_banner); in input_userauth_service_accept()
525 userauth(struct ssh *ssh, char *authlist) in userauth() argument
527 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth()
530 authctxt->method->cleanup(ssh); in userauth()
548 ssh_dispatch_range(ssh, SSH2_MSG_USERAUTH_PER_METHOD_MIN, in userauth()
552 if (method->userauth(ssh) != 0) { in userauth()
563 input_userauth_error(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_error() argument
570 input_userauth_banner(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_banner() argument
577 if ((r = sshpkt_get_cstring(ssh, &msg, &len)) != 0 || in input_userauth_banner()
578 (r = sshpkt_get_cstring(ssh, NULL, NULL)) != 0) in input_userauth_banner()
589 input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_success() argument
591 Authctxt *authctxt = ssh->authctxt; in input_userauth_success()
598 authctxt->method->cleanup(ssh); in input_userauth_success()
602 ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); in input_userauth_success()
608 input_userauth_success_unexpected(int type, u_int32_t seq, struct ssh *ssh)
610 Authctxt *authctxt = ssh->authctxt;
622 input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_failure() argument
624 Authctxt *authctxt = ssh->authctxt; in input_userauth_failure()
631 if (sshpkt_get_cstring(ssh, &authlist, NULL) != 0 || in input_userauth_failure()
632 sshpkt_get_u8(ssh, &partial) != 0 || in input_userauth_failure()
633 sshpkt_get_end(ssh) != 0) in input_userauth_failure()
644 userauth(ssh, authlist); in input_userauth_failure()
682 input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_pk_ok() argument
684 Authctxt *authctxt = ssh->authctxt; in input_userauth_pk_ok()
696 if ((r = sshpkt_get_cstring(ssh, &pkalg, NULL)) != 0 || in input_userauth_pk_ok()
697 (r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0 || in input_userauth_pk_ok()
698 (r = sshpkt_get_end(ssh)) != 0) in input_userauth_pk_ok()
736 sent = sign_and_send_pubkey(ssh, id); in input_userauth_pk_ok()
747 userauth(ssh, NULL); in input_userauth_pk_ok()
753 userauth_gssapi(struct ssh *ssh) in userauth_gssapi() argument
755 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_gssapi()
786 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in userauth_gssapi()
787 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in userauth_gssapi()
788 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in userauth_gssapi()
789 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in userauth_gssapi()
790 (r = sshpkt_put_u32(ssh, 1)) != 0 || in userauth_gssapi()
791 (r = sshpkt_put_u32(ssh, (mech->length) + 2)) != 0 || in userauth_gssapi()
792 (r = sshpkt_put_u8(ssh, SSH_GSS_OIDTYPE)) != 0 || in userauth_gssapi()
793 (r = sshpkt_put_u8(ssh, mech->length)) != 0 || in userauth_gssapi()
794 (r = sshpkt_put(ssh, mech->elements, mech->length)) != 0 || in userauth_gssapi()
795 (r = sshpkt_send(ssh)) != 0) in userauth_gssapi()
798 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_RESPONSE, &input_gssapi_response); in userauth_gssapi()
799 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_TOKEN, &input_gssapi_token); in userauth_gssapi()
800 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_ERROR, &input_gssapi_error); in userauth_gssapi()
801 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, &input_gssapi_errtok); in userauth_gssapi()
809 userauth_gssapi_cleanup(struct ssh *ssh) in userauth_gssapi_cleanup() argument
811 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_gssapi_cleanup()
819 process_gssapi_token(struct ssh *ssh, gss_buffer_t recv_tok) in process_gssapi_token() argument
821 Authctxt *authctxt = ssh->authctxt; in process_gssapi_token()
837 if ((r = sshpkt_start(ssh, type)) != 0 || in process_gssapi_token()
838 (r = sshpkt_put_string(ssh, send_tok.value, in process_gssapi_token()
840 (r = sshpkt_send(ssh)) != 0) in process_gssapi_token()
849 if ((r = sshpkt_start(ssh, in process_gssapi_token()
851 (r = sshpkt_send(ssh)) != 0) in process_gssapi_token()
860 ssh->kex->session_id); in process_gssapi_token()
869 if ((r = sshpkt_start(ssh, in process_gssapi_token()
871 (r = sshpkt_put_string(ssh, mic.value, in process_gssapi_token()
873 (r = sshpkt_send(ssh)) != 0) in process_gssapi_token()
886 input_gssapi_response(int type, u_int32_t plen, struct ssh *ssh) in input_gssapi_response() argument
888 Authctxt *authctxt = ssh->authctxt; in input_gssapi_response()
899 if ((r = sshpkt_get_string(ssh, &oidv, &oidlen)) != 0) in input_gssapi_response()
906 userauth(ssh, NULL); in input_gssapi_response()
913 if ((r = sshpkt_get_end(ssh)) != 0) in input_gssapi_response()
916 if (GSS_ERROR(process_gssapi_token(ssh, GSS_C_NO_BUFFER))) { in input_gssapi_response()
919 userauth(ssh, NULL); in input_gssapi_response()
930 input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh) in input_gssapi_token() argument
932 Authctxt *authctxt = ssh->authctxt; in input_gssapi_token()
942 if ((r = sshpkt_get_string(ssh, &p, &len)) != 0 || in input_gssapi_token()
943 (r = sshpkt_get_end(ssh)) != 0) in input_gssapi_token()
948 status = process_gssapi_token(ssh, &recv_tok); in input_gssapi_token()
952 userauth(ssh, NULL); in input_gssapi_token()
962 input_gssapi_errtok(int type, u_int32_t plen, struct ssh *ssh) in input_gssapi_errtok() argument
964 Authctxt *authctxt = ssh->authctxt; in input_gssapi_errtok()
977 if ((r = sshpkt_get_string(ssh, &p, &len)) != 0 || in input_gssapi_errtok()
978 (r = sshpkt_get_end(ssh)) != 0) { in input_gssapi_errtok()
996 input_gssapi_error(int type, u_int32_t plen, struct ssh *ssh) in input_gssapi_error() argument
1002 if ((r = sshpkt_get_u32(ssh, NULL)) != 0 || /* maj */ in input_gssapi_error()
1003 (r = sshpkt_get_u32(ssh, NULL)) != 0 || /* min */ in input_gssapi_error()
1004 (r = sshpkt_get_cstring(ssh, &msg, NULL)) != 0 || in input_gssapi_error()
1005 (r = sshpkt_get_cstring(ssh, &lang, NULL)) != 0) in input_gssapi_error()
1007 r = sshpkt_get_end(ssh); in input_gssapi_error()
1017 userauth_none(struct ssh *ssh) in userauth_none() argument
1019 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_none()
1023 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in userauth_none()
1024 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in userauth_none()
1025 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in userauth_none()
1026 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in userauth_none()
1027 (r = sshpkt_send(ssh)) != 0) in userauth_none()
1033 userauth_passwd(struct ssh *ssh) in userauth_passwd() argument
1035 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_passwd()
1049 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in userauth_passwd()
1050 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in userauth_passwd()
1051 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in userauth_passwd()
1052 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in userauth_passwd()
1053 (r = sshpkt_put_u8(ssh, 0)) != 0 || in userauth_passwd()
1054 (r = sshpkt_put_cstring(ssh, password)) != 0 || in userauth_passwd()
1055 (r = sshpkt_add_padding(ssh, 64)) != 0 || in userauth_passwd()
1056 (r = sshpkt_send(ssh)) != 0) in userauth_passwd()
1063 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, in userauth_passwd()
1073 input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh) in input_userauth_passwd_changereq() argument
1075 Authctxt *authctxt = ssh->authctxt; in input_userauth_passwd_changereq()
1088 if ((r = sshpkt_get_cstring(ssh, &info, NULL)) != 0 || in input_userauth_passwd_changereq()
1089 (r = sshpkt_get_cstring(ssh, &lang, NULL)) != 0) in input_userauth_passwd_changereq()
1093 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in input_userauth_passwd_changereq()
1094 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in input_userauth_passwd_changereq()
1095 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in input_userauth_passwd_changereq()
1096 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in input_userauth_passwd_changereq()
1097 (r = sshpkt_put_u8(ssh, 1)) != 0) /* additional info */ in input_userauth_passwd_changereq()
1104 if ((r = sshpkt_put_cstring(ssh, password)) != 0) in input_userauth_passwd_changereq()
1130 if ((r = sshpkt_put_cstring(ssh, password)) != 0 || in input_userauth_passwd_changereq()
1131 (r = sshpkt_add_padding(ssh, 64)) != 0 || in input_userauth_passwd_changereq()
1132 (r = sshpkt_send(ssh)) != 0) in input_userauth_passwd_changereq()
1135 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, in input_userauth_passwd_changereq()
1150 * Call with ssh==NULL to ignore server-sig-algs extension list and
1154 key_sig_algorithm(struct ssh *ssh, const struct sshkey *key) in key_sig_algorithm() argument
1164 if (ssh == NULL || ssh->kex->server_sig_algs == NULL || in key_sig_algorithm()
1166 (key->type == KEY_RSA_CERT && (ssh->compat & SSH_BUG_SIGTYPE))) { in key_sig_algorithm()
1176 server_sig_algs = ssh->kex->server_sig_algs; in key_sig_algorithm()
1177 if (key->type == KEY_RSA && (ssh->compat & SSH_BUG_SIGTYPE74)) in key_sig_algorithm()
1309 sign_and_send_pubkey(struct ssh *ssh, Identity *id) in sign_and_send_pubkey() argument
1311 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in sign_and_send_pubkey()
1322 if ((ssh->kex->flags & KEX_HAS_PUBKEY_HOSTBOUND) != 0 && in sign_and_send_pubkey()
1390 if ((alg = key_sig_algorithm(fallback_sigtype ? NULL : ssh, in sign_and_send_pubkey()
1400 if (ssh->compat & SSH_OLD_SESSIONID) { in sign_and_send_pubkey()
1401 if ((r = sshbuf_putb(b, ssh->kex->session_id)) != 0) in sign_and_send_pubkey()
1405 ssh->kex->session_id)) != 0) in sign_and_send_pubkey()
1419 if (ssh->kex->initial_hostkey == NULL) { in sign_and_send_pubkey()
1423 if ((r = sshkey_puts(ssh->kex->initial_hostkey, b)) != 0) in sign_and_send_pubkey()
1428 sshbuf_ptr(b), sshbuf_len(b), ssh->compat, alg); in sign_and_send_pubkey()
1463 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in sign_and_send_pubkey()
1464 (r = sshpkt_putb(ssh, b)) != 0 || in sign_and_send_pubkey()
1465 (r = sshpkt_send(ssh)) != 0) in sign_and_send_pubkey()
1480 send_pubkey_test(struct ssh *ssh, Identity *id) in send_pubkey_test() argument
1482 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in send_pubkey_test()
1489 if ((alg = key_sig_algorithm(ssh, id->key)) == NULL) { in send_pubkey_test()
1500 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_PK_OK, &input_userauth_pk_ok); in send_pubkey_test()
1502 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in send_pubkey_test()
1503 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in send_pubkey_test()
1504 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in send_pubkey_test()
1505 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in send_pubkey_test()
1506 (r = sshpkt_put_u8(ssh, have_sig)) != 0 || in send_pubkey_test()
1507 (r = sshpkt_put_cstring(ssh, alg)) != 0 || in send_pubkey_test()
1508 (r = sshpkt_put_string(ssh, blob, bloblen)) != 0 || in send_pubkey_test()
1509 (r = sshpkt_send(ssh)) != 0) in send_pubkey_test()
1629 get_agent_identities(struct ssh *ssh, int *agent_fdp, in get_agent_identities() argument
1640 if ((r = ssh_agent_bind_hostkey(agent_fd, ssh->kex->initial_hostkey, in get_agent_identities()
1641 ssh->kex->session_id, ssh->kex->initial_sig, 0)) == 0) in get_agent_identities()
1667 pubkey_prepare(struct ssh *ssh, Authctxt *authctxt) in pubkey_prepare() argument
1729 if ((r = get_agent_identities(ssh, &agent_fd, &idlist)) == 0) { in pubkey_prepare()
1802 } else if (ssh->kex->server_sig_algs != NULL && in pubkey_prepare()
1803 (cp = key_sig_algorithm(ssh, id->key)) == NULL) { in pubkey_prepare()
1828 pubkey_cleanup(struct ssh *ssh) in pubkey_cleanup() argument
1830 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in pubkey_cleanup()
1856 userauth_pubkey(struct ssh *ssh) in userauth_pubkey() argument
1858 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_pubkey()
1865 pubkey_prepare(ssh, authctxt); in userauth_pubkey()
1884 sent = send_pubkey_test(ssh, id); in userauth_pubkey()
1891 sent = sign_and_send_pubkey(ssh, id); in userauth_pubkey()
1908 userauth_kbdint(struct ssh *ssh) in userauth_kbdint() argument
1910 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_kbdint()
1918 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_INFO_REQUEST, NULL); in userauth_kbdint()
1923 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in userauth_kbdint()
1924 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in userauth_kbdint()
1925 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in userauth_kbdint()
1926 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in userauth_kbdint()
1927 (r = sshpkt_put_cstring(ssh, "")) != 0 || /* lang */ in userauth_kbdint()
1928 (r = sshpkt_put_cstring(ssh, options.kbd_interactive_devices ? in userauth_kbdint()
1930 (r = sshpkt_send(ssh)) != 0) in userauth_kbdint()
1933 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_INFO_REQUEST, &input_userauth_info_req); in userauth_kbdint()
1941 input_userauth_info_req(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_info_req() argument
1943 Authctxt *authctxt = ssh->authctxt; in input_userauth_info_req()
1957 if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0 || in input_userauth_info_req()
1958 (r = sshpkt_get_cstring(ssh, &inst, NULL)) != 0 || in input_userauth_info_req()
1959 (r = sshpkt_get_cstring(ssh, &lang, NULL)) != 0) in input_userauth_info_req()
1966 if ((r = sshpkt_get_u32(ssh, &num_prompts)) != 0) in input_userauth_info_req()
1974 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_INFO_RESPONSE)) != 0 || in input_userauth_info_req()
1975 (r = sshpkt_put_u32(ssh, num_prompts)) != 0) in input_userauth_info_req()
1980 if ((r = sshpkt_get_cstring(ssh, &prompt, NULL)) != 0 || in input_userauth_info_req()
1981 (r = sshpkt_get_u8(ssh, &echo)) != 0) in input_userauth_info_req()
1988 if ((r = sshpkt_put_cstring(ssh, response)) != 0) in input_userauth_info_req()
1996 if ((r = sshpkt_get_end(ssh)) != 0 || in input_userauth_info_req()
1997 (r = sshpkt_add_padding(ssh, 64)) != 0) in input_userauth_info_req()
1999 r = sshpkt_send(ssh); in input_userauth_info_req()
2012 ssh_keysign(struct ssh *ssh, struct sshkey *key, u_char **sigp, size_t *lenp, in ssh_keysign() argument
2019 int sock = ssh_packet_get_connection_in(ssh); in ssh_keysign()
2128 userauth_hostbased(struct ssh *ssh) in userauth_hostbased() argument
2130 Authctxt *authctxt = (Authctxt *)ssh->authctxt; in userauth_hostbased()
2193 lname = get_local_name(ssh_packet_get_connection_in(ssh)); in userauth_hostbased()
2212 if ((r = sshbuf_put_stringb(b, ssh->kex->session_id)) != 0 || in userauth_hostbased()
2228 if ((r = ssh_keysign(ssh, private, &sig, &siglen, in userauth_hostbased()
2234 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 || in userauth_hostbased()
2235 (r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 || in userauth_hostbased()
2236 (r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 || in userauth_hostbased()
2237 (r = sshpkt_put_cstring(ssh, authctxt->method->name)) != 0 || in userauth_hostbased()
2238 (r = sshpkt_put_cstring(ssh, authctxt->active_ktype)) != 0 || in userauth_hostbased()
2239 (r = sshpkt_put_string(ssh, keyblob, keylen)) != 0 || in userauth_hostbased()
2240 (r = sshpkt_put_cstring(ssh, chost)) != 0 || in userauth_hostbased()
2241 (r = sshpkt_put_cstring(ssh, authctxt->local_user)) != 0 || in userauth_hostbased()
2242 (r = sshpkt_put_string(ssh, sig, siglen)) != 0 || in userauth_hostbased()
2243 (r = sshpkt_send(ssh)) != 0) { in userauth_hostbased()