Mercurial > dropbear
comparison session.h @ 1653:76189c9ffea2
External Public-Key Authentication API (#72)
* Implemented dynamic loading of an external plug-in shared library to delegate public key authentication
* Moved conditional compilation of the plugin infrastructure into the configure.ac script to be able to add -ldl to dropbear build only when the flag is enabled
* Added tags file to the ignore list
* Updated API to have the constructor to return function pointers in the pliugin instance. Added support for passing user name to the checkpubkey function. Added options to the session returned by the plugin and have dropbear to parse and process them
* Added -rdynamic to the linker flags when EPKA is enabled
* Changed the API to pass a previously created session to the checkPubKey function (created during preauth)
* Added documentation to the API
* Added parameter addrstring to plugin creation function
* Modified the API to retrieve the auth options. Instead of having them as field of the EPKASession struct, they are stored internally (plugin-dependent) in the plugin/session and retrieved through a pointer to a function (in the session)
* Changed option string to be a simple char * instead of unsigned char *
author | fabriziobertocci <fabriziobertocci@gmail.com> |
---|---|
date | Wed, 15 May 2019 09:43:57 -0400 |
parents | fa733a314bee |
children | cc0fc5131c5c |
comparison
equal
deleted
inserted
replaced
1652:d2753238f35f | 1653:76189c9ffea2 |
---|---|
36 #include "packet.h" | 36 #include "packet.h" |
37 #include "tcpfwd.h" | 37 #include "tcpfwd.h" |
38 #include "chansession.h" | 38 #include "chansession.h" |
39 #include "dbutil.h" | 39 #include "dbutil.h" |
40 #include "netio.h" | 40 #include "netio.h" |
41 #if DROPBEAR_EPKA | |
42 #include "pubkeyapi.h" | |
43 #endif | |
41 | 44 |
42 void common_session_init(int sock_in, int sock_out); | 45 void common_session_init(int sock_in, int sock_out); |
43 void session_loop(void(*loophandler)(void)) ATTRIB_NORETURN; | 46 void session_loop(void(*loophandler)(void)) ATTRIB_NORETURN; |
44 void session_cleanup(void); | 47 void session_cleanup(void); |
45 void send_session_identification(void); | 48 void send_session_identification(void); |
214 | 217 |
215 /* this is set when we get SIGINT or SIGTERM, the handler is in main.c */ | 218 /* this is set when we get SIGINT or SIGTERM, the handler is in main.c */ |
216 volatile int exitflag; | 219 volatile int exitflag; |
217 /* set once the ses structure (and cli_ses/svr_ses) have been populated to their initial state */ | 220 /* set once the ses structure (and cli_ses/svr_ses) have been populated to their initial state */ |
218 int init_done; | 221 int init_done; |
222 | |
223 #if DROPBEAR_EPKA | |
224 struct EPKASession * epka_session; | |
225 #endif | |
219 }; | 226 }; |
220 | 227 |
221 struct serversession { | 228 struct serversession { |
222 | 229 |
223 /* Server specific options */ | 230 /* Server specific options */ |
237 /* The resolved remote address, used for lastlog etc */ | 244 /* The resolved remote address, used for lastlog etc */ |
238 char *remotehost; | 245 char *remotehost; |
239 | 246 |
240 #if DROPBEAR_VFORK | 247 #if DROPBEAR_VFORK |
241 pid_t server_pid; | 248 pid_t server_pid; |
249 #endif | |
250 | |
251 #if DROPBEAR_EPKA | |
252 /* The shared library handle */ | |
253 void *epka_plugin_handle; | |
254 | |
255 /* The instance created by the plugin_new function */ | |
256 struct EPKAInstance *epka_instance; | |
242 #endif | 257 #endif |
243 | 258 |
244 }; | 259 }; |
245 | 260 |
246 typedef enum { | 261 typedef enum { |