diff options
Diffstat (limited to 'lib/x509/rfc2818_hostname.c')
-rw-r--r-- | lib/x509/rfc2818_hostname.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/x509/rfc2818_hostname.c b/lib/x509/rfc2818_hostname.c index 753deb144b..676be34837 100644 --- a/lib/x509/rfc2818_hostname.c +++ b/lib/x509/rfc2818_hostname.c @@ -69,27 +69,27 @@ gnutls_x509_crt_check_hostname (gnutls_x509_crt_t cert, const char *hostname) dnsnamesize = sizeof (dnsname); ret = gnutls_x509_crt_get_subject_alt_name (cert, i, - dnsname, &dnsnamesize, - NULL); + dnsname, &dnsnamesize, + NULL); if (ret == GNUTLS_SAN_DNSNAME) - { - found_dnsname = 1; - if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) - { - return 1; - } - } + { + found_dnsname = 1; + if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) + { + return 1; + } + } else if (ret == GNUTLS_SAN_IPADDRESS) - { - found_dnsname = 1; /* RFC 2818 is unclear whether the CN - should be compared for IP addresses - too, but we won't do it. */ - if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) - { - return 1; - } - } + { + found_dnsname = 1; /* RFC 2818 is unclear whether the CN + should be compared for IP addresses + too, but we won't do it. */ + if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) + { + return 1; + } + } } if (!found_dnsname) @@ -98,17 +98,17 @@ gnutls_x509_crt_check_hostname (gnutls_x509_crt_t cert, const char *hostname) */ dnsnamesize = sizeof (dnsname); if (gnutls_x509_crt_get_dn_by_oid (cert, OID_X520_COMMON_NAME, 0, - 0, dnsname, &dnsnamesize) < 0) - { - /* got an error, can't find a name - */ - return 0; - } + 0, dnsname, &dnsnamesize) < 0) + { + /* got an error, can't find a name + */ + return 0; + } if (_gnutls_hostname_compare (dnsname, dnsnamesize, hostname)) - { - return 1; - } + { + return 1; + } } /* not found a matching name |