Skip to content

Commit

Permalink
fix if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed Sep 29, 2020
1 parent c4aad6d commit 3188e98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tlscommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3188e98

Please sign in to comment.