updated copyright years and pekka's email on some files
[silc.git] / apps / silcd / protocol.c
index 2200bfb8ccdad5cca50d4f4473bf0adf8be9c7c8..fb2d41d371021fe807bf55f71507ee64e738c602 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2001 Pekka Riikonen
+  Copyright (C) 1997 - 2002 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -175,8 +175,8 @@ silc_server_protocol_ke_verify_key(SilcSKE ske,
   if (silc_verify_public_key_internal(server, ctx->sock, 
                                      (ctx->responder == FALSE ?
                                       SILC_SOCKET_TYPE_ROUTER:
-                                      ctx->sconfig ? SILC_SOCKET_TYPE_SERVER :
-                                      ctx->rconfig ? SILC_SOCKET_TYPE_ROUTER :
+                                      ctx->sconfig.ref_ptr ? SILC_SOCKET_TYPE_SERVER :
+                                      ctx->rconfig.ref_ptr ? SILC_SOCKET_TYPE_ROUTER :
                                       SILC_SOCKET_TYPE_CLIENT),
                                      pk_data, pk_len, pk_type))
     completion(ske, SILC_SKE_STATUS_OK, completion_context);
@@ -331,8 +331,9 @@ SilcSKEStatus silc_ske_check_version(SilcSKE ske, unsigned char *version,
   SILC_LOG_INFO(("%s (%s) is version %s", ske->sock->hostname,
                 ske->sock->ip, version));
 
-  /* Check for initial version string */
-  if (!strstr(version, "SILC-1.0-"))
+  /* Check for initial version string. Allowed "SILC-x.x-". More 
+     specific protocol version is checked later in session. */
+  if (!strstr(version, "SILC-"))
     status = SILC_SKE_STATUS_BAD_VERSION;
 
   /* Check software version */
@@ -371,14 +372,6 @@ SilcSKEStatus silc_ske_check_version(SilcSKE ske, unsigned char *version,
 
   if (maj != maj2)
     status = SILC_SKE_STATUS_BAD_VERSION;
-#if 0
-  if (min > min2)
-    status = SILC_SKE_STATUS_BAD_VERSION;
-#endif
-
-  /* XXX < 0.6 is not allowed */
-  if (maj == 0 && min < 5)
-    status = SILC_SKE_STATUS_BAD_VERSION;
 
   if (status == SILC_SKE_STATUS_BAD_VERSION)
     SILC_LOG_ERROR(("%s (%s) %s is not allowed/supported version", 
@@ -959,8 +952,8 @@ SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
 
        /* Remote end is client */
        if (conn_type == SILC_SOCKET_TYPE_CLIENT) {
-         SilcServerConfigClient *client = ctx->cconfig;
-         
+         SilcServerConfigClient *client = ctx->cconfig.ref_ptr;
+
          if (client) {
            ret = silc_server_get_authentication(ctx, client->passphrase,
                                                 client->publickeys,
@@ -986,8 +979,8 @@ SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
        
        /* Remote end is server */
        if (conn_type == SILC_SOCKET_TYPE_SERVER) {
-         SilcServerConfigServer *serv = ctx->sconfig;
-         
+         SilcServerConfigServer *serv = ctx->sconfig.ref_ptr;
+
          if (serv) {
            ret = silc_server_get_authentication(ctx, serv->passphrase,
                                                 serv->publickeys,
@@ -1013,7 +1006,7 @@ SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
        
        /* Remote end is router */
        if (conn_type == SILC_SOCKET_TYPE_ROUTER) {
-         SilcServerConfigRouter *serv = ctx->rconfig;
+         SilcServerConfigRouter *serv = ctx->rconfig.ref_ptr;
 
          if (serv) {
            ret = silc_server_get_authentication(ctx, serv->passphrase,