diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-07-22 14:43:49 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-07-22 14:43:51 +0200 |
commit | c8c4d57860a5568a705efe6f72cbf05f1608468a (patch) | |
tree | 85fa56ea033e4960a3b3572f7cc149128cced6a1 | |
parent | 792799e9f4ebf82b6a74c2c5db522cf32c66b085 (diff) | |
download | gnutls-c8c4d57860a5568a705efe6f72cbf05f1608468a.tar.gz |
gnutls_x509_crt_check_hostname*: use unsigned a return value
This is to prevent issues to callers who may check for negative
error values.
-rw-r--r-- | lib/includes/gnutls/x509.h | 4 | ||||
-rw-r--r-- | lib/x509/hostname-verify.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/includes/gnutls/x509.h b/lib/includes/gnutls/x509.h index 883fa59544..038a342ae6 100644 --- a/lib/includes/gnutls/x509.h +++ b/lib/includes/gnutls/x509.h @@ -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, diff --git a/lib/x509/hostname-verify.c b/lib/x509/hostname-verify.c index a086240e58..06a8d42c05 100644 --- a/lib/x509/hostname-verify.c +++ b/lib/x509/hostname-verify.c @@ -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) { |