summaryrefslogtreecommitdiff
path: root/src/core/wee-config.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-03-27 16:48:58 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-03-27 16:48:58 +0100
commit540756bf5446f30b66b716027b4f8550a462f4fc (patch)
tree4ab8124a532d498eaba1985ba9642d77542ba87c /src/core/wee-config.c
parent6e7b62be9723205cb4f7dc69966ed80ed7119dd6 (diff)
downloadweechat-540756bf5446f30b66b716027b4f8550a462f4fc.zip
Fix SSL connection to some IRC servers using Diffie Hellman and small exchange keys (bug #25996)
Diffstat (limited to 'src/core/wee-config.c')
-rw-r--r--src/core/wee-config.c56
1 files changed, 53 insertions, 3 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 7d6b727bd..b5fd829e4 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -159,6 +159,10 @@ struct t_config_option *config_history_max_lines;
struct t_config_option *config_history_max_commands;
struct t_config_option *config_history_display_default;
+/* config, network section */
+
+struct t_config_option *config_network_gnutls_dh_prime_bits;
+
/* config, plugin section */
struct t_config_option *config_plugin_autoload;
@@ -978,12 +982,12 @@ config_weechat_key_write_cb (void *data, struct t_config_file *config_file,
}
/*
- * config_weechat_init: init WeeChat config structure
- * return: 1 if ok, 0 if error
+ * config_weechat_init_options: init WeeChat config structure (all core options)
+ * return: 1 if ok, 0 if error
*/
int
-config_weechat_init ()
+config_weechat_init_options ()
{
struct t_config_section *ptr_section;
@@ -1680,6 +1684,24 @@ config_weechat_init ()
}
weechat_config_section_proxy = ptr_section;
+
+ /* network */
+ ptr_section = config_file_new_section (weechat_config_file, "network",
+ 0, 0,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL);
+ if (!ptr_section)
+ {
+ config_file_free (weechat_config_file);
+ return 0;
+ }
+
+ config_network_gnutls_dh_prime_bits = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "gnutls_dh_prime_bitsmax_lines", "integer",
+ N_("minimum size in bits for handshake using Diffie Hellman key "
+ "exchange"),
+ NULL, 0, INT_MAX, "512", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
/* plugin */
ptr_section = config_file_new_section (weechat_config_file, "plugin",
@@ -1786,6 +1808,27 @@ config_weechat_init ()
}
/*
+ * config_weechat_init: init WeeChat config structure
+ * return: 1 if ok, 0 if error
+ */
+
+int
+config_weechat_init ()
+{
+ int rc;
+
+ rc = config_weechat_init_options ();
+
+ if (!rc)
+ {
+ gui_chat_printf (NULL,
+ _("FATAL: error initializing configuration options"));
+ }
+
+ return rc;
+}
+
+/*
* config_weechat_read: read WeeChat configuration file
* return one of these values:
* WEECHAT_CONFIG_READ_OK
@@ -1806,6 +1849,13 @@ config_weechat_read ()
gui_bar_use_temp_bars ();
gui_bar_create_default ();
}
+
+ if (rc != WEECHAT_CONFIG_READ_OK)
+ {
+ gui_chat_printf (NULL,
+ _("%sError reading configuration"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
+ }
return rc;
}