aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-08-08 10:52:08 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-08-08 22:24:34 +0200
commite3010f2d6dfc022312e86e82f3cf75dfd1b970c8 (patch)
tree79617d755cabd9c6144a07c748cdb7444cea1f00
parent38887df2021f4ae8a0912ad363e947aaad56aaab (diff)
downloadxK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.tar.gz
xK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.tar.xz
xK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.zip
kike: fix fingerprint generation and checking
-rw-r--r--src/kike.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kike.c b/src/kike.c
index 3202333..dde8d42 100644
--- a/src/kike.c
+++ b/src/kike.c
@@ -227,7 +227,7 @@ irc_is_valid_key (const char *key)
static bool
irc_is_valid_fingerprint (const char *fp)
{
- return irc_regex_match ("^[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){20}$", fp);
+ return irc_regex_match ("^[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){19}$", fp);
}
// --- Application data --------------------------------------------------------
@@ -798,7 +798,7 @@ client_get_ssl_cert_fingerprint (struct client *c)
struct str fingerprint;
str_init (&fingerprint);
str_append_printf (&fingerprint, "%02X", hash[0]);
- for (size_t i = 0; i < sizeof hash; i++)
+ for (size_t i = 1; i < sizeof hash; i++)
str_append_printf (&fingerprint, ":%02X", hash[i]);
return str_steal (&fingerprint);
}