From e0a8d121fa017eb4f883244fc5cf44d13f2978db Mon Sep 17 00:00:00 2001 From: Aaron Jones Date: Tue, 28 Jan 2020 20:37:39 +0000 Subject: [PATCH] extensions/extb_ssl.c: port e0f1c3b5bc6c55b88938 & 5572f43834b93b898ea0 Reported-by: Opal Hart --- extensions/extb_ssl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/extensions/extb_ssl.c b/extensions/extb_ssl.c index 801d4e9b..1e11a755 100644 --- a/extensions/extb_ssl.c +++ b/extensions/extb_ssl.c @@ -33,7 +33,18 @@ static int eb_ssl(const char *data, struct Client *client_p, (void)chptr; (void)mode_type; + + if (! IsSSLClient(client_p)) + return EXTBAN_NOMATCH; + if (data != NULL) - return EXTBAN_INVALID; - return IsSSLClient(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH; + { + if (EmptyString(client_p->certfp)) + return EXTBAN_NOMATCH; + + if (strcmp(data, client_p->certfp) != 0) + return EXTBAN_NOMATCH; + } + + return EXTBAN_MATCH; }