From 3188e9862806b2e4eae614cae5847860bd989f29 Mon Sep 17 00:00:00 2001 From: Fabian Mauchle Date: Tue, 29 Sep 2020 07:00:48 +0200 Subject: [PATCH] fix if statements --- tlscommon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tlscommon.c b/tlscommon.c index 4ad9d69..464ac1b 100644 --- a/tlscommon.c +++ b/tlscommon.c @@ -696,16 +696,18 @@ int certnamecheck(X509 *cert, struct list *hostports) { match.af = AF_INET6; else match.af = 0; - match.exact = hp->host; + match.exact = hp->host; - if (match.af) + if (match.af) { match.matchfn = &certattr_matchip; match.type = GEN_IPADD; r = matchsubjaltname(cert, &match); - if (!r) + } + if (!r) { match.matchfn = &certattr_matchregex; match.type = GEN_DNS; r = matchsubjaltname(cert, &match); + } if (r) { if (r > 0) { debug(DBG_DBG, "certnamecheck: Found subjectaltname matching %s %s", match.af ? "address" : "host", hp->host);