]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix implicit value change in verify-high.c
authorTim Rühsen <tim.ruehsen@gmx.de>
Wed, 18 Dec 2019 18:44:10 +0000 (19:44 +0100)
committerTim Rühsen <tim.ruehsen@gmx.de>
Fri, 3 Jan 2020 10:34:37 +0000 (11:34 +0100)
verify-high.c:284:7: runtime error: implicit conversion from type 'size_t'
(aka 'unsigned long') of value 15421545260338 418178 (64-bit, unsigned) to
type 'uint32_t' (aka 'unsigned int') changed the value to 437555714 (32-bit,
unsigned)

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
lib/x509/verify-high.c

index 5515d54ff90b54e1a1bcf146ed8c4982b69b418b..b1421ef17a76d263bd769c08c1e7cbd44cb556e3 100644 (file)
@@ -274,7 +274,7 @@ gnutls_x509_trust_list_add_cas(gnutls_x509_trust_list_t list,
                               unsigned clist_size, unsigned int flags)
 {
        unsigned i, j;
-       uint32_t hash;
+       size_t hash;
        int ret;
        unsigned exists;
 
@@ -565,7 +565,7 @@ gnutls_x509_trust_list_remove_cas(gnutls_x509_trust_list_t list,
 {
        int r = 0;
        unsigned j, i;
-       uint32_t hash;
+       size_t hash;
 
        for (i = 0; i < clist_size; i++) {
                hash =
@@ -644,7 +644,7 @@ gnutls_x509_trust_list_add_named_crt(gnutls_x509_trust_list_t list,
                                     const void *name, size_t name_size,
                                     unsigned int flags)
 {
-       uint32_t hash;
+       size_t hash;
 
        if (name_size >= MAX_SERVER_NAME_SIZE)
                return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
@@ -712,7 +712,7 @@ gnutls_x509_trust_list_add_crls(gnutls_x509_trust_list_t list,
        int ret;
        unsigned x, i, j = 0;
        unsigned int vret = 0;
-       uint32_t hash;
+       size_t hash;
        gnutls_x509_crl_t *tmp;
 
        /* Probably we can optimize things such as removing duplicates
@@ -806,7 +806,7 @@ static int shorten_clist(gnutls_x509_trust_list_t list,
                         unsigned int clist_size)
 {
        unsigned int j, i;
-       uint32_t hash;
+       size_t hash;
 
        if (clist_size > 1) {
                /* Check if the last certificate in the path is self signed.
@@ -859,7 +859,7 @@ int trust_list_get_issuer(gnutls_x509_trust_list_t list,
 {
        int ret;
        unsigned int i;
-       uint32_t hash;
+       size_t hash;
 
        hash =
            hash_pjw_bare(cert->raw_issuer_dn.data,
@@ -893,7 +893,7 @@ int trust_list_get_issuer_by_dn(gnutls_x509_trust_list_t list,
 {
        int ret;
        unsigned int i, j;
-       uint32_t hash;
+       size_t hash;
        uint8_t tmp[256];
        size_t tmp_size;
 
@@ -1257,7 +1257,7 @@ gnutls_x509_trust_list_verify_crt2(gnutls_x509_trust_list_t list,
 {
        int ret;
        unsigned int i;
-       uint32_t hash;
+       size_t hash;
        gnutls_x509_crt_t sorted[DEFAULT_MAX_VERIFY_DEPTH];
        const char *hostname = NULL, *purpose = NULL, *email = NULL;
        unsigned hostname_size = 0;
@@ -1501,7 +1501,7 @@ gnutls_x509_trust_list_verify_named_crt(gnutls_x509_trust_list_t list,
 {
        int ret;
        unsigned int i;
-       uint32_t hash;
+       size_t hash;
 
 
        hash =
@@ -1558,7 +1558,7 @@ _gnutls_trustlist_inlist(gnutls_x509_trust_list_t list,
 {
        int ret;
        unsigned int i;
-       uint32_t hash;
+       size_t hash;
 
        hash = hash_pjw_bare(cert->raw_dn.data, cert->raw_dn.size);
        hash %= list->size;