From ad14e021310378575eb0ebc8ba87432f0f6f4290 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 31 Oct 2002 20:45:07 +0000 Subject: [PATCH] Add the version string in library if application does not provide it. --- CHANGES | 5 +++++ lib/silcclient/client.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGES b/CHANGES index ebff85fd..899011a0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Thu Oct 31 22:44:07 EET 2002 Pekka Riikonen + + * 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 * Added shared library complation support. diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 06a1ffbb..93360e21 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -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); -- 2.24.0