From: Pekka Riikonen Date: Tue, 26 Jun 2001 18:16:28 +0000 (+0000) Subject: updates. X-Git-Tag: robodoc-323~125 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=856e6b3b96796ca4d89995ee52daad5c416f188b updates. --- diff --git a/CHANGES b/CHANGES index 362fbaae..9f08f765 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,14 @@ Tue Jun 26 19:23:07 EEST 2001 Pekka Riikonen the SKE functions anymore, but this function is used to set the callbacks. + * Fixed the WIN32 DLL generation in lib/Makefile.am.pre. + + * Added `silc_version' argument to the silc_client_alloc + to define the version of the application for the library. + The library will use the version string to compare it + against the remote host's (usually a server) version + string. Affected file lib/silcclient/silcapi.h + Mon Jun 25 21:42:51 EEST 2001 Pekka Riikonen * Do not add regex.h for WIN32. The affected file diff --git a/apps/irssi/src/silc/core/silc-core.c b/apps/irssi/src/silc/core/silc-core.c index 0c80e52a..d29ad5ee 100644 --- a/apps/irssi/src/silc/core/silc-core.c +++ b/apps/irssi/src/silc/core/silc-core.c @@ -271,7 +271,7 @@ void silc_core_init_finish(void) silc_init_userinfo(); /* Allocate SILC client */ - silc_client = silc_client_alloc(&ops, NULL); + silc_client = silc_client_alloc(&ops, NULL, silc_version_string); /* Load local config file */ silc_config = silc_client_config_alloc(SILC_CLIENT_HOME_CONFIG_FILE); diff --git a/apps/silc/silc.c b/apps/silc/silc.c index 40d16d73..47f39dd9 100644 --- a/apps/silc/silc.c +++ b/apps/silc/silc.c @@ -275,7 +275,7 @@ SILC Secure Internet Live Conferencing, version %s\n", app = silc_calloc(1, sizeof(*app)); /* Allocate new client */ - app->client = silc = silc_client_alloc(&ops, app); + app->client = silc = silc_client_alloc(&ops, app, silc_version_string); if (!silc) goto fail; diff --git a/lib/Makefile.am.pre b/lib/Makefile.am.pre index 0b553b69..6201f975 100644 --- a/lib/Makefile.am.pre +++ b/lib/Makefile.am.pre @@ -75,13 +75,13 @@ if SILC_DIST_WIN32DLL # WIN32 DLL generation silc.dll: libsilc.a dllwrap --export-all --output-def silc.def \ - --implib libsilc.a --driver-name $(CC) --target i386-mingw32 \ - --mno-cygwin -o silc.dll libsilc.a -lwsock32 + --implib silc.a --driver-name $(CC) --target i386-mingw32 \ + -mno-cygwin -o silc.dll libsilc.a -lwsock32 silcclient.dll: libsilcclient.a dllwrap --export-all --output-def silcclient.def \ - --implib libsilcclient.a --driver-name $(CC) --target i386-mingw32 \ - --mno-cygwin -o silcclient.dll libsilcclient.a + --implib silcclient.a --driver-name $(CC) --target i386-mingw32 \ + -mno-cygwin -o silcclient.dll libsilcclient.a -L. -lsilc -lwsock32 endif libsilc.a: diff --git a/lib/silcclient/README b/lib/silcclient/README index 499298db..cd2801b3 100644 --- a/lib/silcclient/README +++ b/lib/silcclient/README @@ -30,7 +30,7 @@ needed per application. The client object is SilcClient which is usually allocated in following manner: - SilcClient client = silc_client_alloc(&ops, context); + SilcClient client = silc_client_alloc(&ops, context, version); `ops' is the static structure of client operations that library will call. `context' can be some application specific context that will be saved into diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 4cd047fd..b79fc789 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -40,13 +40,15 @@ static void silc_client_packet_parse_type(SilcClient client, the client. The `application' is application specific user data pointer and caller must free it. */ -SilcClient silc_client_alloc(SilcClientOperations *ops, void *application) +SilcClient silc_client_alloc(SilcClientOperations *ops, void *application, + const char *silc_version) { SilcClient new_client; new_client = silc_calloc(1, sizeof(*new_client)); new_client->application = application; new_client->ops = ops; + new_client->silc_client_version = strdup(silc_version); return new_client; } diff --git a/lib/silcclient/client.h b/lib/silcclient/client.h index dd27a146..1a3b8565 100644 --- a/lib/silcclient/client.h +++ b/lib/silcclient/client.h @@ -186,6 +186,9 @@ struct SilcClientStruct { /* Random Number Generator. Application should use this as its primary random number generator. */ SilcRng rng; + + /* Client version. Used to compare to remote host's version strings. */ + char *silc_client_version; }; /* Macros */ diff --git a/lib/silcclient/protocol.c b/lib/silcclient/protocol.c index f00982e0..ff9ba038 100644 --- a/lib/silcclient/protocol.c +++ b/lib/silcclient/protocol.c @@ -29,8 +29,6 @@ SILC_TASK_CALLBACK(silc_client_protocol_connection_auth); SILC_TASK_CALLBACK(silc_client_protocol_key_exchange); SILC_TASK_CALLBACK(silc_client_protocol_rekey); -extern char *silc_version_string; - /* * Key Exhange protocol functions */ @@ -195,7 +193,7 @@ SilcSKEStatus silc_ske_check_version(SilcSKE ske, unsigned char *version, if (cp) build = atoi(cp + 1); - cp = silc_version_string + 9; + cp = client->silc_client_version + 9; if (!cp) status = SILC_SKE_STATUS_BAD_VERSION; @@ -320,14 +318,14 @@ SILC_TASK_CALLBACK(silc_client_protocol_key_exchange) /* Start the key exchange by processing the received security properties packet from initiator. */ status = silc_ske_responder_start(ske, ctx->rng, ctx->sock, - silc_version_string, + client->silc_client_version, ctx->packet->buffer, TRUE); } else { SilcSKEStartPayload *start_payload; /* Assemble security properties. */ silc_ske_assemble_security_properties(ske, SILC_SKE_SP_FLAG_NONE, - silc_version_string, + client->silc_client_version, &start_payload); /* Start the key exchange by sending our security properties diff --git a/lib/silcclient/silcapi.h b/lib/silcclient/silcapi.h index b84c729b..c1f46d25 100644 --- a/lib/silcclient/silcapi.h +++ b/lib/silcclient/silcapi.h @@ -314,10 +314,13 @@ typedef struct { * Allocates new client object. This has to be done before client may * work. After calling this one must call silc_client_init to initialize * the client. The `application' is application specific user data pointer - * and caller must free it. + * and caller must free it. The `silc_version' is the application version + * that will be used to compare against remote host's (usually a server) + * version string. * ***/ -SilcClient silc_client_alloc(SilcClientOperations *ops, void *application); +SilcClient silc_client_alloc(SilcClientOperations *ops, void *application, + const char *silc_version); /****f* silcclient/SilcClientAPI/silc_client_free *