X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Fsilc%2Fsilc.c;h=fc1ff725a56cde12e28e92403c9af91d085bf8c9;hp=0ff3e1ed0b7112a346e151dc8b43e5de1142ac24;hb=fb8dbc2d9cd7ff5d197654f873ac18aa6ef9c5e3;hpb=e51f4e881515d5e6d69596c4b8fc5235159b3d56 diff --git a/apps/silc/silc.c b/apps/silc/silc.c index 0ff3e1ed..fc1ff725 100644 --- a/apps/silc/silc.c +++ b/apps/silc/silc.c @@ -273,8 +273,6 @@ SILC Secure Internet Live Conferencing, version %s\n", /* Read global configuration file. */ app->config = silc_client_config_alloc(opt_config_file); - if (app->config == NULL) - goto fail; /* XXX Read local configuration file */ @@ -288,11 +286,23 @@ SILC Secure Internet Live Conferencing, version %s\n", silc->realname = silc_get_real_name(); /* Register all configured ciphers, PKCS and hash functions. */ - app->config->client = (void *)app; - silc_client_config_register_ciphers(app->config); - silc_client_config_register_pkcs(app->config); - silc_client_config_register_hashfuncs(app->config); - silc_client_config_register_hmacs(app->config); + if (app->config) { + app->config->client = (void *)app; + if (!silc_client_config_register_ciphers(app->config)) + silc_cipher_register_default(); + if (!silc_client_config_register_pkcs(app->config)) + silc_pkcs_register_default(); + if (!silc_client_config_register_hashfuncs(app->config)) + silc_hash_register_default(); + if (!silc_client_config_register_hmacs(app->config)) + silc_hmac_register_default(); + } else { + /* Register default ciphers, pkcs, hash funtions and hmacs. */ + silc_cipher_register_default(); + silc_pkcs_register_default(); + silc_hash_register_default(); + silc_hmac_register_default(); + } /* Load public and private key */ if (silc_client_load_keys(silc) == FALSE) @@ -320,7 +330,7 @@ SILC Secure Internet Live Conferencing, version %s\n", SILC_TASK_TIMEOUT, SILC_TASK_PRI_LOW); - if (app->config->commands) { + if (app->config && app->config->commands) { /* Run user configured commands with timeout */ silc_task_register(silc->timeout_queue, 0, silc_client_run_commands,