Home | History | Annotate | Download | only in dropbear

Lines Matching refs:ses

41 struct sshsession ses; /* GLOBAL */
57 ses.remotehost = remotehost;
59 ses.sock = sock;
60 ses.maxfd = sock;
62 ses.connecttimeout = 0;
64 if (pipe(ses.signal_pipe) < 0) {
67 setnonblocking(ses.signal_pipe[0]);
68 setnonblocking(ses.signal_pipe[1]);
72 ses.writepayload = buf_new(MAX_TRANS_PAYLOAD_LEN);
73 ses.transseq = 0;
75 ses.readbuf = NULL;
76 ses.decryptreadbuf = NULL;
77 ses.payload = NULL;
78 ses.recvseq = 0;
80 initqueue(&ses.writequeue);
82 ses.requirenext = SSH_MSG_KEXINIT;
83 ses.dataallowed = 0; /* don't send data yet, we'll wait until after kex */
84 ses.ignorenext = 0;
85 ses.lastpacket = 0;
88 ses.keys = (struct key_context*)m_malloc(sizeof(struct key_context));
89 ses.newkeys = NULL;
90 ses.keys->recv_algo_crypt = &dropbear_nocipher;
91 ses.keys->trans_algo_crypt = &dropbear_nocipher;
93 ses.keys->recv_algo_mac = &dropbear_nohash;
94 ses.keys->trans_algo_mac = &dropbear_nohash;
96 ses.keys->algo_kex = -1;
97 ses.keys->algo_hostkey = -1;
98 ses.keys->recv_algo_comp = DROPBEAR_COMP_NONE;
99 ses.keys->trans_algo_comp = DROPBEAR_COMP_NONE;
102 ses.keys->recv_zstream = NULL;
103 ses.keys->trans_zstream = NULL;
107 ses.session_id = NULL;
108 ses.kexhashbuf = NULL;
109 ses.transkexinit = NULL;
110 ses.dh_K = NULL;
111 ses.remoteident = NULL;
113 ses.chantypes = NULL;
115 ses.allowprivport = 0;
133 dropbear_assert(ses.payload == NULL);
134 if (ses.sock != -1) {
135 FD_SET(ses.sock, &readfd);
136 if (!isempty(&ses.writequeue)) {
137 FD_SET(ses.sock, &writefd);
143 FD_SET(ses.signal_pipe[0], &readfd);
146 if (ses.dataallowed) {
149 val = select(ses.maxfd+1, &readfd, &writefd, NULL, &timeout);
171 if (FD_ISSET(ses.signal_pipe[0], &readfd)) {
173 while (read(ses.signal_pipe[0], &x, 1) > 0) {}
180 if (ses.sock != -1) {
181 if (FD_ISSET(ses.sock, &writefd) && !isempty(&ses.writequeue)) {
185 if (FD_ISSET(ses.sock, &readfd)) {
191 if (ses.payload != NULL) {
196 /* process pipes etc for the channels, ses.dataallowed == 0
198 if (ses.dataallowed) {
222 m_free(ses.session_id);
223 m_burn(ses.keys, sizeof(struct key_context));
224 m_free(ses.keys);
241 if (atomicio(write, ses.sock, LOCAL_IDENT "\r\n",
243 ses.remoteclosed();
248 len = ident_readln(ses.sock, linebuf, sizeof(linebuf));
264 ses.remoteclosed();
267 ses.remoteident = m_malloc(len);
268 memcpy(ses.remoteident, linebuf, len);
272 if (strncmp(ses.remoteident, "SSH-2.", 6) != 0
273 && strncmp(ses.remoteident, "SSH-1.99-", 9) != 0) {
274 dropbear_exit("Incompatible remote version '%s'", ses.remoteident);
277 TRACE(("remoteident: %s", ses.remoteident))
368 if (ses.connecttimeout != 0 && secs > ses.connecttimeout) {
373 if (ses.remoteident == NULL) {
377 if (!ses.kexstate.sentkexinit
378 && (secs - ses.kexstate.lastkextime >= KEX_REKEY_TIMEOUT
379 || ses.kexstate.datarecv+ses.kexstate.datatrans >= KEX_REKEY_DATA)){