X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient.c;h=c27d055e1e3e230ac2a65ae7bd54d5094761fd15;hp=9fef6df8b6ed453bd9a1353bbc31d529be815925;hb=60180da59ffdbbd12058dded66e3c8a547cd0852;hpb=f1a52c060fd203ee275b9cc6aff711bf1961ad13 diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 9fef6df8..c27d055e 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -149,7 +149,15 @@ static void silc_client_packet_error(SilcPacketEngine engine, void *callback_context, void *stream_context) { - /* Nothing */ + SilcClient client = callback_context; + SilcClientConnection conn = stream_context; + + /* Read and write errors are silent */ + if (error == SILC_PACKET_ERR_READ || error == SILC_PACKET_ERR_WRITE) + return; + + client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR, + (char *)silc_packet_error_string(error)); } /* Packet stream callbacks */ @@ -952,12 +960,8 @@ void silc_client_free(SilcClient client) if (client->rng) silc_rng_free(client->rng); - if (!client->internal->params->dont_register_crypto_library) { - silc_cipher_unregister_all(); - silc_pkcs_unregister_all(); - silc_hash_unregister_all(); - silc_hmac_unregister_all(); - } + if (!client->internal->params->dont_register_crypto_library) + silc_crypto_uninit(); silc_packet_engine_stop(client->internal->packet_engine); silc_dlist_uninit(client->internal->ftp_sessions); @@ -1023,15 +1027,10 @@ SilcBool silc_client_init(SilcClient client, const char *username, if (!client->internal->ftp_sessions) return FALSE; - if (!client->internal->params->dont_register_crypto_library) { + if (!client->internal->params->dont_register_crypto_library) /* 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(); - } + this has no effect. */ + silc_crypto_init(NULL); /* Initialize random number generator */ client->rng = silc_rng_alloc(); @@ -1041,7 +1040,7 @@ SilcBool silc_client_init(SilcClient client, const char *username, silc_rng_global_init(client->rng); /* Initialize the scheduler */ - client->schedule = silc_schedule_init(0, client, NULL); + client->schedule = silc_schedule_init(0, client, NULL, NULL); if (!client->schedule) return FALSE;