diff session.h @ 1733:d529a52b2f7c coverity coverity

merge coverity from main
author Matt Johnston <matt@ucc.asn.au>
date Fri, 26 Jun 2020 21:07:34 +0800
parents 41bf8f216644
children d1b279aa5ed1
line wrap: on
line diff
--- a/session.h	Thu Mar 21 23:28:59 2019 +0800
+++ b/session.h	Fri Jun 26 21:07:34 2020 +0800
@@ -38,6 +38,11 @@
 #include "chansession.h"
 #include "dbutil.h"
 #include "netio.h"
+#if DROPBEAR_PLUGIN
+#include "pubkeyapi.h"
+#endif
+#include "gcm.h"
+#include "chachapoly.h"
 
 void common_session_init(int sock_in, int sock_out);
 void session_loop(void(*loophandler)(void)) ATTRIB_NORETURN;
@@ -74,10 +79,18 @@
 #endif
 	/* actual keys */
 	union {
+#if DROPBEAR_ENABLE_CBC_MODE
 		symmetric_CBC cbc;
+#endif
 #if DROPBEAR_ENABLE_CTR_MODE
 		symmetric_CTR ctr;
 #endif
+#if DROPBEAR_ENABLE_GCM_MODE
+		dropbear_gcm_state gcm;
+#endif
+#if DROPBEAR_CHACHA20POLY1305
+		dropbear_chachapoly_state chachapoly;
+#endif
 	} cipher_state;
 	unsigned char mackey[MAX_MAC_LEN];
 	int valid;
@@ -89,7 +102,8 @@
 	struct key_context_directional trans;
 
 	const struct dropbear_kex *algo_kex;
-	int algo_hostkey;
+	enum signkey_type algo_hostkey; /* server key type */
+	enum signature_type algo_signature; /* server signature type */
 
 	int allow_compress; /* whether compression has started (useful in 
 							[email protected] delayed compression case) */
@@ -181,6 +195,9 @@
 
 	/* Enables/disables compression */
 	algo_type *compress_algos;
+
+	/* Other side allows SSH_MSG_EXT_INFO. Currently only set for server */
+	int allow_ext_info;
 							
 	/* a list of queued replies that should be sent after a KEX has
 	   concluded (ie, while dataallowed was unset)*/
@@ -216,6 +233,10 @@
 	volatile int exitflag;
 	/* set once the ses structure (and cli_ses/svr_ses) have been populated to their initial state */
 	int init_done;
+
+#if DROPBEAR_PLUGIN
+        struct PluginSession * plugin_session;
+#endif
 };
 
 struct serversession {
@@ -241,6 +262,13 @@
 	pid_t server_pid;
 #endif
 
+#if DROPBEAR_PLUGIN
+	/* The shared library handle */
+	void *plugin_handle;
+
+	/* The instance created by the plugin_new function */
+	struct PluginInstance *plugin_instance;
+#endif
 };
 
 typedef enum {
@@ -269,7 +297,6 @@
 
 	cli_kex_state kex_state; /* Used for progressing KEX */
 	cli_state state; /* Used to progress auth/channelsession etc */
-	unsigned donefirstkex : 1; /* Set when we set sentnewkeys, never reset */
 
 	int tty_raw_mode; /* Whether we're in raw mode (and have to clean up) */
 	struct termios saved_tio;
@@ -297,6 +324,8 @@
 #endif
 	sign_key *lastprivkey;
 
+	buffer *server_sig_algs;
+
 	int retval; /* What the command exit status was - we emulate it */
 #if 0
 	TODO