[Openvas-commits] r1358 - in trunk/openvas-server: . openvasd
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Sep 17 11:47:40 CEST 2008
Author: mwiegand
Date: 2008-09-17 11:47:39 +0200 (Wed, 17 Sep 2008)
New Revision: 1358
Modified:
trunk/openvas-server/ChangeLog
trunk/openvas-server/openvasd/comm.c
trunk/openvas-server/openvasd/openvasd.c
Log:
Changed communication protocol to use OTP exclusively now. Removed the
last instances of dynamic protocol extension selection.
* openvasd/openvasd.c (server_thread): Ignore obsolete capabilities
fast_login (gone from client) and md5_caching (default now).
* openvasd/comm.c: (extract_extensions) Removed. Protocol features are
no longer supported. (comm_init) Removed handling of NTP 1.0, 1.1 and
1.2 and added handling of OTP 1.0. Moved remaining default options from
extract_extensions to comm_init. Changed log message to be more
descriptive.
Modified: trunk/openvas-server/ChangeLog
===================================================================
--- trunk/openvas-server/ChangeLog 2008-09-17 09:40:15 UTC (rev 1357)
+++ trunk/openvas-server/ChangeLog 2008-09-17 09:47:39 UTC (rev 1358)
@@ -1,3 +1,17 @@
+2008-09-17 Michael Wiegand <michael.wiegand at intevation.de>
+
+ Changed communication protocol to use OTP exclusively now. Removed the
+ last instances of dynamic protocol extension selection.
+
+ * openvasd/openvasd.c (server_thread): Ignore obsolete capabilities
+ fast_login (gone from client) and md5_caching (default now).
+
+ * openvasd/comm.c: (extract_extensions) Removed. Protocol features are
+ no longer supported. (comm_init) Removed handling of NTP 1.0, 1.1 and
+ 1.2 and added handling of OTP 1.0. Moved remaining default options from
+ extract_extensions to comm_init. Changed log message to be more
+ descriptive.
+
2008-09-16 Michael Wiegand <michael.wiegand at intevation.de>
Optimized plugin selection with OIDs. Selection is now considerably
Modified: trunk/openvas-server/openvasd/comm.c
===================================================================
--- trunk/openvas-server/openvasd/comm.c 2008-09-17 09:40:15 UTC (rev 1357)
+++ trunk/openvas-server/openvasd/comm.c 2008-09-17 09:47:39 UTC (rev 1358)
@@ -50,59 +50,7 @@
#define TRUE (!FALSE)
#endif
-void
-extract_extensions(caps, banner)
- ntp_caps * caps;
- char * banner;
-{
- char * t;
- t = strchr(&(banner[1]), '<');
- if(!t)
- return;
-
- t++;
- if ( *t == '\0' ) return;
- t++;
- if ( *t == '\0' ) return;
-
- for(;;)
- {
- char * n = strchr(t, ' ');
- if(!n)
- return;
- n[0] = '\0';
-
- /*
- * MD5 caching of the plugins on the client side
- */
- if(!strcmp(t, "md5_caching"))
- caps->md5_caching = 1;
-
- else if(!strcmp(t, "md5_by_name"))
- caps->md5_by_name = 1;
- caps->plugins_xrefs = 1;
- caps->timestamps = 1;
-
- /*
- * We send the name of the host AND its IP
- */
- if(!strcmp(t, "dns"))
- caps->dns = 1;
-
- /*
- * Immediately jump to the wait order
- */
- else if(!strcmp(t, "fast_login"))
- caps->fast_login = 1;
-
- n[0] = ' ';
- t = &(n[1]);
- if(!t[0])break;
- if(t[0] == '>')break;
- }
-}
-
/*
* comm_init() :
* Initializes the communication between the
@@ -122,40 +70,23 @@
EXIT(0);
buf[sizeof(buf) - 1] = '\0';
- extract_extensions(caps, buf);
- if(!strncmp(buf, "< NTP/1.0 >", 11))
+ if(!strncmp(buf, "< OTP/1.0 >", 11))
{
- caps->ntp_version = NTP_10;
- caps->ciphered = FALSE;
- caps->ntp_11 = FALSE;
- caps->scan_ids = FALSE;
- caps->pubkey_auth = FALSE;
- nsend(soc, "< NTP/1.0 >\n",12,0);
- }
- else if(!strncmp(buf, "< NTP/1.1 >", 11))
- {
- caps->ntp_version = NTP_11;
- caps->ciphered = FALSE;
- caps->ntp_11 = TRUE;
- caps->scan_ids = FALSE;
- caps->pubkey_auth = FALSE;
- nsend(soc, "< NTP/1.1 >\n", 12, 0);
- }
- else if(!strncmp(buf, "< NTP/1.2 >", 11))
- {
caps->ntp_version = NTP_12;
caps->ciphered = FALSE;
caps->ntp_11 = TRUE;
caps->scan_ids = TRUE;
caps->pubkey_auth = FALSE;
- nsend(soc, "< NTP/1.2 >\n", 12, 0);
+ caps->plugins_xrefs = TRUE;
+ caps->timestamps = FALSE;
+ nsend(soc, "< OTP/1.0 >\n", 12, 0);
}
/*ENABLE_CRYPTO_LAYER*/
else
{
EXIT(0);
}
- log_write("Client requested protocol version %d.\n", caps->ntp_version);
+ log_write("Client requested protocol %s.\n", buf);
return(caps);
}
Modified: trunk/openvas-server/openvasd/openvasd.c
===================================================================
--- trunk/openvas-server/openvasd/openvasd.c 2008-09-17 09:40:15 UTC (rev 1357)
+++ trunk/openvas-server/openvasd/openvasd.c 2008-09-17 09:47:39 UTC (rev 1358)
@@ -431,22 +431,13 @@
arg_set_value(globals, "plugins", -1, plugins);
- if(!caps->fast_login)
+ comm_send_md5_plugins(globals);
+ if(caps->ntp_11)
{
- if(!caps->md5_caching)
- comm_send_pluginlist(globals);
- else
- comm_send_md5_plugins(globals);
-
-
- if(caps->ntp_11){
comm_send_preferences(globals);
comm_send_rules(globals);
ntp_1x_send_dependencies(globals);
- }
}
- else if(caps->md5_caching)
- comm_send_md5_plugins(globals);
/* become process group leader and the like ... */
start_daemon_mode();
More information about the Openvas-commits
mailing list