From 1ce23cd33138a5783e3da269e7c873ab800b818a Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 21 Jan 2014 10:44:35 +0100 Subject: [PATCH] irc: check that server option ssl_fingerprint has exactly 40 hexadecimal digits (when set to non-empty value) --- src/plugins/irc/irc-config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index a9d062eb0..0e293dfc8 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -1059,6 +1059,16 @@ irc_config_server_check_value_cb (void *data, return 0; } break; + case IRC_SERVER_OPTION_SSL_FINGERPRINT: + if (value && value[0] && (strlen (value) != 40)) + { + weechat_printf (NULL, + _("%s%s: fingerprint must have exactly 40 " + "hexadecimal digits"), + weechat_prefix ("error"), IRC_PLUGIN_NAME); + return 0; + } + break; } }