diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-08 10:52:08 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-08 22:24:34 +0200 |
commit | e3010f2d6dfc022312e86e82f3cf75dfd1b970c8 (patch) | |
tree | 79617d755cabd9c6144a07c748cdb7444cea1f00 /src | |
parent | 38887df2021f4ae8a0912ad363e947aaad56aaab (diff) | |
download | xK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.tar.gz xK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.tar.xz xK-e3010f2d6dfc022312e86e82f3cf75dfd1b970c8.zip |
kike: fix fingerprint generation and checking
Diffstat (limited to 'src')
-rw-r--r-- | src/kike.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |