]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_x509_crt_check_hostname*: use unsigned a return value
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 22 Jul 2016 12:43:49 +0000 (14:43 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 22 Jul 2016 12:43:51 +0000 (14:43 +0200)
This is to prevent issues to callers who may check for negative
error values.

lib/includes/gnutls/x509.h
lib/x509/hostname-verify.c

index 883fa595444c6c1bfff6c9f246ce3f2096a26472..038a342ae6a07af4fd777932791d4974ce8880d7 100644 (file)
@@ -185,9 +185,9 @@ int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert,
                                  const char *oid, unsigned indx,
                                  unsigned int raw_flag, void *buf,
                                  size_t * buf_size);
-int gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
+unsigned gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
                                   const char *hostname);
-int gnutls_x509_crt_check_hostname2(gnutls_x509_crt_t cert,
+unsigned gnutls_x509_crt_check_hostname2(gnutls_x509_crt_t cert,
                                    const char *hostname, unsigned int flags);
 int
 gnutls_x509_crt_check_email(gnutls_x509_crt_t cert,
index a086240e58add2f89db9d73f26bc0536454b6111..06a8d42c05eea57b889246050cbb6b7a1cdd0fc0 100644 (file)
@@ -41,7 +41,7 @@
  *
  * Returns: non-zero for a successful match, and zero on failure.
  **/
-int
+unsigned
 gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
                               const char *hostname)
 {
@@ -92,7 +92,7 @@ static int has_embedded_null(const char *str, unsigned size)
 }
 
 /**
- * gnutls_x509_crt_check_hostname:
+ * gnutls_x509_crt_check_hostname2:
  * @cert: should contain an gnutls_x509_crt_t type
  * @hostname: A null terminated string that contains a DNS name
  * @flags: gnutls_certificate_verify_flags
@@ -116,7 +116,7 @@ static int has_embedded_null(const char *str, unsigned size)
  *
  * Returns: non-zero for a successful match, and zero on failure.
  **/
-int
+unsigned
 gnutls_x509_crt_check_hostname2(gnutls_x509_crt_t cert,
                                const char *hostname, unsigned int flags)
 {