Home
last modified time | relevance | path

Searched refs:ses (Results 1 – 25 of 67) sorted by relevance

123

/external/dropbear/
Dcommon-kex.c69 buf_putbyte(ses.writepayload, SSH_MSG_KEXINIT); in send_msg_kexinit()
72 genrandom(buf_getwriteptr(ses.writepayload, 16), 16); in send_msg_kexinit()
73 buf_incrwritepos(ses.writepayload, 16); in send_msg_kexinit()
76 buf_put_algolist(ses.writepayload, sshkex); in send_msg_kexinit()
79 buf_put_algolist(ses.writepayload, sshhostkey); in send_msg_kexinit()
82 buf_put_algolist(ses.writepayload, sshciphers); in send_msg_kexinit()
85 buf_put_algolist(ses.writepayload, sshciphers); in send_msg_kexinit()
88 buf_put_algolist(ses.writepayload, sshhashes); in send_msg_kexinit()
91 buf_put_algolist(ses.writepayload, sshhashes); in send_msg_kexinit()
94 buf_put_algolist(ses.writepayload, sshcompress); in send_msg_kexinit()
[all …]
Dcommon-session.c41 struct sshsession ses; /* GLOBAL */ variable
57 ses.remotehost = remotehost; in common_session_init()
59 ses.sock = sock; in common_session_init()
60 ses.maxfd = sock; in common_session_init()
62 ses.connecttimeout = 0; in common_session_init()
64 if (pipe(ses.signal_pipe) < 0) { in common_session_init()
67 setnonblocking(ses.signal_pipe[0]); in common_session_init()
68 setnonblocking(ses.signal_pipe[1]); in common_session_init()
72 ses.writepayload = buf_new(MAX_TRANS_PAYLOAD_LEN); in common_session_init()
73 ses.transseq = 0; in common_session_init()
[all …]
Dpacket.c56 dropbear_assert(!isempty(&ses.writequeue)); in write_packet()
59 writebuf = (buffer*)examine(&ses.writequeue); in write_packet()
64 written = write(ses.sock, buf_getptr(writebuf, len), len); in write_packet()
76 ses.remoteclosed(); in write_packet()
81 dequeue(&ses.writequeue); in write_packet()
102 blocksize = ses.keys->recv_algo_crypt->blocksize; in read_packet()
104 if (ses.readbuf == NULL || ses.readbuf->len < blocksize) { in read_packet()
113 if (ses.decryptreadbuf->len == 0) { in read_packet()
121 dropbear_assert(ses.readbuf != NULL); in read_packet()
122 maxlen = ses.readbuf->len - ses.readbuf->pos; in read_packet()
[all …]
Dsvr-auth.c44 ses.authstate.failcount = 0; in svr_authinitialise()
54 memset(&ses.authstate, 0, sizeof(ses.authstate)); in authclear()
56 ses.authstate.authtypes |= AUTH_TYPE_PUBKEY; in authclear()
60 ses.authstate.authtypes |= AUTH_TYPE_PASSWORD; in authclear()
78 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_BANNER); in send_msg_userauth_banner()
79 buf_putstring(ses.writepayload, buf_getptr(svr_opts.banner, in send_msg_userauth_banner()
81 buf_putstring(ses.writepayload, "en", 2); in send_msg_userauth_banner()
100 if (ses.authstate.authdone == 1) { in recv_msg_userauth_request()
111 username = buf_getstring(ses.payload, &userlen); in recv_msg_userauth_request()
112 servicename = buf_getstring(ses.payload, &servicelen); in recv_msg_userauth_request()
[all …]
Dcommon-channel.c66 ses.channels = (struct Channel**)m_malloc(sizeof(struct Channel*)); in chaninitialise()
67 ses.chansize = 1; in chaninitialise()
68 ses.channels[0] = NULL; in chaninitialise()
69 ses.chancount = 0; in chaninitialise()
71 ses.chantypes = chantypes; in chaninitialise()
85 for (i = 0; i < ses.chansize; i++) { in chancleanup()
86 if (ses.channels[i] != NULL) { in chancleanup()
88 remove_channel(ses.channels[i]); in chancleanup()
91 m_free(ses.channels); in chancleanup()
109 for (i = 0; i < ses.chansize; i++) { in newchannel()
[all …]
Dprocess-packet.c50 type = buf_getbyte(ses.payload); in process_packet()
53 ses.lastpacket = type; in process_packet()
76 if (ses.requirenext != 0) { in process_packet()
77 if (ses.requirenext != type) { in process_packet()
80 ses.requirenext); in process_packet()
83 ses.requirenext = 0; in process_packet()
89 if (ses.ignorenext) { in process_packet()
91 ses.ignorenext = 0; in process_packet()
100 if ( !ses.authstate.authdone && type > MAX_UNAUTH_PACKET_TYPE ) { in process_packet()
105 if (ses.packettypes[i].type == 0) { in process_packet()
[all …]
Dcli-chansession.c64 type = buf_getstring(ses.payload, NULL); in cli_chansessreq()
65 wantreply = buf_getbool(ses.payload); in cli_chansessreq()
68 cli_ses.retval = buf_getint(ses.payload); in cli_chansessreq()
87 if (ses.chancount > 1) { in cli_closechansess()
99 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); in start_channel_request()
100 buf_putint(ses.writepayload, channel->remotechan); in start_channel_request()
102 buf_putstring(ses.writepayload, type, strlen(type)); in start_channel_request()
178 buf_putint(ses.writepayload, 1); /* Just the terminator */ in put_termcodes()
179 buf_putbyte(ses.writepayload, 0); /* TTY_OP_END */ in put_termcodes()
183 bufpos1 = ses.writepayload->pos; in put_termcodes()
[all …]
Dlistener.c33 ses.listeners = (struct Listener**)m_malloc(sizeof(struct Listener*)); in listeners_initialise()
34 ses.listensize = 1; in listeners_initialise()
35 ses.listeners[0] = NULL; in listeners_initialise()
45 for (i = 0; i < ses.listensize; i++) { in set_listener_fds()
46 listener = ses.listeners[i]; in set_listener_fds()
63 for (i = 0; i < ses.listensize; i++) { in handle_listeners()
64 listener = ses.listeners[i]; in handle_listeners()
87 for (i = 0; i < ses.listensize; i++) { in new_listener()
88 if (ses.listeners[i] == NULL) { in new_listener()
94 if (i == ses.listensize) { in new_listener()
[all …]
Dsvr-chansession.c131 if (write(ses.signal_pipe[1], &ses.isserver, 1) == 1 in sesssigchild_handler()
167 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); in send_msg_chansess_exitstatus()
168 buf_putint(ses.writepayload, channel->remotechan); in send_msg_chansess_exitstatus()
169 buf_putstring(ses.writepayload, "exit-status", 11); in send_msg_chansess_exitstatus()
170 buf_putbyte(ses.writepayload, 0); /* boolean FALSE */ in send_msg_chansess_exitstatus()
171 buf_putint(ses.writepayload, chansess->exit.exitstatus); in send_msg_chansess_exitstatus()
203 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST); in send_msg_chansess_exitsignal()
204 buf_putint(ses.writepayload, channel->remotechan); in send_msg_chansess_exitsignal()
205 buf_putstring(ses.writepayload, "exit-signal", 11); in send_msg_chansess_exitsignal()
206 buf_putbyte(ses.writepayload, 0); /* boolean FALSE */ in send_msg_chansess_exitsignal()
[all …]
Dcli-auth.c37 memset(&ses.authstate, 0, sizeof(ses.authstate)); in cli_authinitialise()
48 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); in cli_auth_getmethods()
49 buf_putstring(ses.writepayload, cli_opts.username, in cli_auth_getmethods()
51 buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, in cli_auth_getmethods()
53 buf_putstring(ses.writepayload, "none", 4); /* 'none' method */ in cli_auth_getmethods()
67 if (ses.authstate.authdone) { in recv_msg_userauth_banner()
72 banner = buf_getstring(ses.payload, &bannerlen); in recv_msg_userauth_banner()
73 buf_eatstring(ses.payload); /* The language string */ in recv_msg_userauth_banner()
173 methods = buf_getstring(ses.payload, &methlen); in recv_msg_userauth_failure()
175 partial = buf_getbool(ses.payload); in recv_msg_userauth_failure()
[all …]
Dsvr-authpubkey.c67 testkey = (buf_getbool(ses.payload) == 0); in svr_auth_pubkey()
69 algo = buf_getstring(ses.payload, &algolen); in svr_auth_pubkey()
70 keybloblen = buf_getint(ses.payload); in svr_auth_pubkey()
71 keyblob = buf_getptr(ses.payload, keybloblen); in svr_auth_pubkey()
90 if (buf_get_pub_key(ses.payload, key, &type) == DROPBEAR_FAILURE) { in svr_auth_pubkey()
97 signbuf = buf_new(ses.payload->pos + 4 + SHA1_HASH_SIZE); in svr_auth_pubkey()
98 buf_putstring(signbuf, ses.session_id, SHA1_HASH_SIZE); in svr_auth_pubkey()
99 buf_putbytes(signbuf, ses.payload->data, ses.payload->pos); in svr_auth_pubkey()
104 if (buf_verify(ses.payload, key, buf_getptr(signbuf, signbuf->len), in svr_auth_pubkey()
108 ses.authstate.printableuser, fp, svr_ses.addrstring); in svr_auth_pubkey()
[all …]
Dcli-authinteract.c82 name = buf_getstring(ses.payload, NULL); in recv_msg_userauth_info_request()
83 instruction = buf_getstring(ses.payload, NULL); in recv_msg_userauth_info_request()
86 buf_eatstring(ses.payload); in recv_msg_userauth_info_request()
88 num_prompts = buf_getint(ses.payload); in recv_msg_userauth_info_request()
96 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_INFO_RESPONSE); in recv_msg_userauth_info_request()
97 buf_putint(ses.writepayload, num_prompts); in recv_msg_userauth_info_request()
113 prompt = buf_getstring(ses.payload, NULL); in recv_msg_userauth_info_request()
116 echo = buf_getbool(ses.payload); in recv_msg_userauth_info_request()
127 buf_putstring(ses.writepayload, response, response_len); in recv_msg_userauth_info_request()
143 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); in cli_auth_interactive()
[all …]
Dcli-authpubkey.c72 algotype = buf_getstring(ses.payload, &algolen); in recv_msg_userauth_pk_ok()
79 remotelen = buf_getint(ses.payload); in recv_msg_userauth_pk_ok()
106 buf_getptr(ses.payload, remotelen), remotelen) != 0) { in recv_msg_userauth_pk_ok()
139 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); in send_msg_userauth_pubkey()
141 buf_putstring(ses.writepayload, cli_opts.username, in send_msg_userauth_pubkey()
144 buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, in send_msg_userauth_pubkey()
147 buf_putstring(ses.writepayload, AUTH_METHOD_PUBKEY, in send_msg_userauth_pubkey()
150 buf_putbyte(ses.writepayload, realsign); in send_msg_userauth_pubkey()
154 buf_putstring(ses.writepayload, algoname, algolen); in send_msg_userauth_pubkey()
155 buf_put_pub_key(ses.writepayload, key, type); in send_msg_userauth_pubkey()
[all …]
Dsvr-kex.c50 if (!ses.kexstate.recvkexinit) { in recv_msg_kexdh_init()
55 if (buf_getmpint(ses.payload, &dh_e) != DROPBEAR_SUCCESS) { in recv_msg_kexdh_init()
64 ses.requirenext = SSH_MSG_NEWKEYS; in recv_msg_kexdh_init()
89 buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_REPLY); in send_msg_kexdh_reply()
90 buf_put_pub_key(ses.writepayload, svr_opts.hostkey, in send_msg_kexdh_reply()
91 ses.newkeys->algo_hostkey); in send_msg_kexdh_reply()
94 buf_putmpint(ses.writepayload, &dh_f); in send_msg_kexdh_reply()
98 buf_put_sign(ses.writepayload, svr_opts.hostkey, in send_msg_kexdh_reply()
99 ses.newkeys->algo_hostkey, ses.hash, SHA1_HASH_SIZE); in send_msg_kexdh_reply()
Dsvr-session.c98 ses.connecttimeout = timeout.tv_sec + AUTH_TIMEOUT; in svr_session()
101 ses.remoteclosed = svr_remoteclosed; in svr_session()
104 ses.packettypes = svr_packettypes; in svr_session()
105 ses.buf_match_algo = svr_buf_match_algo; in svr_session()
107 ses.isserver = 1; in svr_session()
135 } else if (ses.authstate.authdone) { in svr_dropbear_exit()
139 ses.authstate.printableuser, format); in svr_dropbear_exit()
140 } else if (ses.authstate.printableuser) { in svr_dropbear_exit()
144 ses.authstate.printableuser, ses.authstate.failcount, format); in svr_dropbear_exit()
201 close(ses.sock); in svr_remoteclosed()
[all …]
Dsvr-tcpfwd.c80 reqname = buf_getstring(ses.payload, &namelen); in recv_msg_global_request_remotetcp()
81 wantreply = buf_getbool(ses.payload); in recv_msg_global_request_remotetcp()
114 buf_putbyte(ses.writepayload, SSH_MSG_REQUEST_SUCCESS); in send_msg_request_success()
122 buf_putbyte(ses.writepayload, SSH_MSG_REQUEST_FAILURE); in send_msg_request_failure()
148 bindaddr = buf_getstring(ses.payload, &addrlen); in svr_cancelremotetcp()
154 port = buf_getint(ses.payload); in svr_cancelremotetcp()
182 bindaddr = buf_getstring(ses.payload, &addrlen); in svr_remotetcpreq()
188 port = buf_getint(ses.payload); in svr_remotetcpreq()
200 if (!ses.allowprivport && port < IPPORT_RESERVED) { in svr_remotetcpreq()
244 desthost = buf_getstring(ses.payload, &len); in newtcpdirect()
[all …]
Dcli-kex.c53 buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_INIT); in send_msg_kexdh_init()
54 buf_putmpint(ses.writepayload, cli_ses.dh_e); in send_msg_kexdh_init()
56 ses.requirenext = SSH_MSG_KEXDH_REPLY; in send_msg_kexdh_init()
74 type = ses.newkeys->algo_hostkey; in recv_msg_kexdh_reply()
78 keybloblen = buf_getint(ses.payload); in recv_msg_kexdh_reply()
80 keyblob = buf_getptr(ses.payload, keybloblen); in recv_msg_kexdh_reply()
81 if (!ses.kexstate.donefirstkex) { in recv_msg_kexdh_reply()
86 if (buf_get_pub_key(ses.payload, hostkey, &type) != DROPBEAR_SUCCESS) { in recv_msg_kexdh_reply()
91 if (buf_getmpint(ses.payload, &dh_f) != DROPBEAR_SUCCESS) { in recv_msg_kexdh_reply()
102 if (buf_verify(ses.payload, hostkey, ses.hash, SHA1_HASH_SIZE) in recv_msg_kexdh_reply()
[all …]
Dcli-session.c129 ses.remoteclosed = cli_remoteclosed; in cli_session_init()
130 ses.buf_match_algo = cli_buf_match_algo; in cli_session_init()
133 ses.packettypes = cli_packettypes; in cli_session_init()
135 ses.isserver = 0; in cli_session_init()
144 if (ses.lastpacket == SSH_MSG_KEXINIT && cli_ses.kex_state == KEX_NOTHING) { in cli_sessionloop()
159 if (cli_ses.kex_state != KEX_NOTHING && ses.kexstate.recvkexinit == 0 in cli_sessionloop()
160 && ses.kexstate.sentkexinit == 0) { in cli_sessionloop()
172 if (ses.kexstate.donefirstkex == 0) { in cli_sessionloop()
246 if (ses.chancount < 1 && !cli_opts.no_cmd) { in cli_sessionloop()
297 close(ses.sock); in cli_remoteclosed()
[all …]
Dsvr-authpasswd.c49 passwdcrypt = ses.authstate.pw->pw_passwd; in svr_auth_password()
52 spasswd = getspnam(ses.authstate.printableuser); in svr_auth_password()
68 ses.authstate.printableuser); in svr_auth_password()
74 changepw = buf_getbool(ses.payload); in svr_auth_password()
81 password = buf_getstring(ses.payload, &passwordlen); in svr_auth_password()
92 ses.authstate.printableuser, in svr_auth_password()
98 ses.authstate.printableuser, in svr_auth_password()
Dcli-tcpfwd.c129 buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST); in send_msg_global_request_remotetcp()
130 buf_putstring(ses.writepayload, "tcpip-forward", 13); in send_msg_global_request_remotetcp()
131 buf_putbyte(ses.writepayload, 0); in send_msg_global_request_remotetcp()
138 buf_putstring(ses.writepayload, listenspec, strlen(listenspec)); in send_msg_global_request_remotetcp()
139 buf_putint(ses.writepayload, port); in send_msg_global_request_remotetcp()
174 buf_eatstring(ses.payload); in newtcpforwarded()
176 origport = buf_getint(ses.payload); in newtcpforwarded()
203 ses.maxfd = MAX(ses.maxfd, sock); in newtcpforwarded()
Dcli-authpasswd.c133 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); in cli_auth_password()
135 buf_putstring(ses.writepayload, cli_opts.username, in cli_auth_password()
138 buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, in cli_auth_password()
141 buf_putstring(ses.writepayload, AUTH_METHOD_PASSWORD, in cli_auth_password()
144 buf_putbyte(ses.writepayload, 0); /* FALSE - so says the spec */ in cli_auth_password()
146 buf_putstring(ses.writepayload, password, strlen(password)); in cli_auth_password()
Dsvr-service.c44 name = buf_getstring(ses.payload, &len); in recv_msg_service_request()
59 if (ses.authstate.authdone != 1) { in recv_msg_service_request()
82 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_ACCEPT); in send_msg_service_accept()
83 buf_putstring(ses.writepayload, name, len); in send_msg_service_accept()
Dtcp-accept.c84 buf_putstring(ses.writepayload, addr, strlen(addr)); in tcp_acceptor()
85 buf_putint(ses.writepayload, port); in tcp_acceptor()
88 buf_putstring(ses.writepayload, ipstring, strlen(ipstring)); in tcp_acceptor()
90 buf_putint(ses.writepayload, atol(portstring)); in tcp_acceptor()
122 DROPBEAR_MAX_SOCKS, &errstring, &ses.maxfd); in listen_tcpfwd()
Dcli-service.c40 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_REQUEST); in send_msg_service_request()
41 buf_putstring(ses.writepayload, servicename, strlen(servicename)); in send_msg_service_request()
56 servicename = buf_getstring(ses.payload, &len); in recv_msg_service_accept()
74 if (ses.authstate.authdone != 1) { in recv_msg_service_accept()
/external/openssl/crypto/evp/
Dopenbsd_hw.c91 static int dev_crypto_init(session_op *ses)
114 assert(ses);
115 memset(ses,'\0',sizeof *ses);
122 if(ioctl(fd,CIOCFSESSION,&CDATA(ctx)->ses) == -1)
166 cryp.ses=CDATA(ctx)->ses;
302 if (ioctl(fd,CIOCFSESSION,&md_data->sess.ses) == -1)
316 static int do_digest(int ses,unsigned char *md,const void *data,int len)
333 cryp.ses=ses;
377 return do_digest(md_data->sess.ses,md_data->md,data,len);
398 ret=do_digest(md_data->sess.ses,md,md_data->data,md_data->len);

123