Add the version string in library if application does not provide it.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 31 Oct 2002 20:45:07 +0000 (20:45 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 31 Oct 2002 20:45:07 +0000 (20:45 +0000)
CHANGES
lib/silcclient/client.c

diff --git a/CHANGES b/CHANGES
index ebff85fde40d1f8abd12b6a4c309b3a674a13f38..899011a0b85c029ad90e7c327aea02707f54e106 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Thu Oct 31 22:44:07 EET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * If version string in silc_clinet_alloc is NULL the library
+         puts it automatically.  Affected file lib/silcclient/client.c.
+
 Wed Oct 30 16:17:30 CET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Added shared library complation support.
index 06a1ffbb99d3e68a3b8b0835dbcda026514bd8e9..93360e213538fd938e518f00aa23991e40b3d16f 100644 (file)
@@ -21,6 +21,7 @@
 #include "silcincludes.h"
 #include "silcclient.h"
 #include "client_internal.h"
+#include "silcversion.h"
 
 /* Static task callback prototypes */
 SILC_TASK_CALLBACK(silc_client_connect_to_server_start);
@@ -58,6 +59,8 @@ SilcClient silc_client_alloc(SilcClientOperations *ops,
   new_client->internal->ops = ops;
   new_client->internal->params = 
     silc_calloc(1, sizeof(*new_client->internal->params));
+  if (!silc_version)
+    silc_version = silc_version_string;
   new_client->internal->silc_client_version = strdup(silc_version);
 
   if (params)
@@ -102,6 +105,14 @@ int silc_client_init(SilcClient client)
 {
   SILC_LOG_DEBUG(("Initializing client"));
 
+  /* Initialize the crypto library.  If application has done this already
+     this has no effect.  Also, we will not be overriding something
+     application might have registered earlier. */
+  silc_cipher_register_default();
+  silc_pkcs_register_default();
+  silc_hash_register_default();
+  silc_hmac_register_default();
+
   /* Initialize hash functions for client to use */
   silc_hash_alloc("md5", &client->md5hash);
   silc_hash_alloc("sha1", &client->sha1hash);