comparison session.h @ 925:bae0b34bc059 pam

Better PAM through recursion
author Matt Johnston <matt@ucc.asn.au>
date Wed, 12 Mar 2014 23:40:02 +0800
parents cbc73a5aefb0
children 73ea0dce9a57
comparison
equal deleted inserted replaced
923:25b7ed9fe854 925:bae0b34bc059
41 41
42 extern int sessinitdone; /* Is set to 0 somewhere */ 42 extern int sessinitdone; /* Is set to 0 somewhere */
43 extern int exitflag; 43 extern int exitflag;
44 44
45 void common_session_init(int sock_in, int sock_out); 45 void common_session_init(int sock_in, int sock_out);
46 void session_loop(void(*loophandler)()); 46 void session_loop();
47 void session_cleanup(); 47 void session_cleanup();
48 void send_session_identification(); 48 void send_session_identification();
49 void send_msg_ignore(); 49 void send_msg_ignore();
50 50
51 const char* get_user_shell(); 51 const char* get_user_shell();
100 }; 100 };
101 101
102 struct sshsession { 102 struct sshsession {
103 103
104 /* Is it a client or server? */ 104 /* Is it a client or server? */
105 unsigned char isserver; 105 unsigned int isserver;
106 106
107 time_t connect_time; /* time the connection was established 107 time_t connect_time; /* time the connection was established
108 (cleared after auth once we're not 108 (cleared after auth once we're not
109 respecting AUTH_TIMEOUT any more) */ 109 respecting AUTH_TIMEOUT any more) */
110 110
130 130
131 /* Packet-handling flags */ 131 /* Packet-handling flags */
132 const packettype * packettypes; /* Packet handler mappings for this 132 const packettype * packettypes; /* Packet handler mappings for this
133 session, see process-packet.c */ 133 session, see process-packet.c */
134 134
135 unsigned dataallowed : 1; /* whether we can send data packets or we are in 135 unsigned int recursion_count; /* Set when the Dropbear main loop is called
136 recursively for PAM auth */
137 unsigned int exit_recursion;
138
139 unsigned int dataallowed; /* whether we can send data packets or we are in
136 the middle of a KEX or something */ 140 the middle of a KEX or something */
137 141
138 unsigned char requirenext; /* byte indicating what packets we require next, 142 unsigned int requirenext; /* byte indicating what packets we require next,
139 or 0x00 for any. */ 143 or 0x00 for any. */
140 144
141 unsigned char ignorenext; /* whether to ignore the next packet, 145 unsigned int ignorenext; /* whether to ignore the next packet,
142 used for kex_follows stuff */ 146 used for kex_follows stuff */
143 147
144 unsigned char lastpacket; /* What the last received packet type was */ 148 unsigned int lastpacket; /* What the last received packet type was */
145 149
146 int signal_pipe[2]; /* stores endpoints of a self-pipe used for 150 int signal_pipe[2]; /* stores endpoints of a self-pipe used for
147 race-free signal handling */ 151 race-free signal handling */
148 152
149 time_t last_trx_packet_time; /* time of the last packet transmission, for 153 time_t last_trx_packet_time; /* time of the last packet transmission, for
173 struct packetlist *reply_queue_head, *reply_queue_tail; 177 struct packetlist *reply_queue_head, *reply_queue_tail;
174 178
175 void(*remoteclosed)(); /* A callback to handle closure of the 179 void(*remoteclosed)(); /* A callback to handle closure of the
176 remote connection */ 180 remote connection */
177 181
182 void(*loop_handler)();
178 void(*extra_session_cleanup)(); /* client or server specific cleanup */ 183 void(*extra_session_cleanup)(); /* client or server specific cleanup */
179 void(*send_kex_first_guess)(); 184 void(*send_kex_first_guess)();
180 185
181 struct AuthState authstate; /* Common amongst client and server, since most 186 struct AuthState authstate; /* Common amongst client and server, since most
182 struct elements are common */ 187 struct elements are common */