]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
policy TLS_FORWARD: unify logging format
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 17 Jan 2018 13:58:57 +0000 (14:58 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 18 Jan 2018 12:20:10 +0000 (13:20 +0100)
daemon/tls.c
lib/utils.c

index fc846d3cb4c4bc19827128a642a19fd9fe453b33..7c92be92a466e518d40424ece57ae38f50b367f1 100644 (file)
@@ -578,7 +578,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
        char key[INET6_ADDRSTRLEN + 6];
        size_t keylen = sizeof(key);
        if (kr_straddr_join(addr, port, key, &keylen) != kr_ok()) {
-               kr_log_error("[tls client] warning: '%s' is not a valid ip address, ignoring\n", addr);
+               kr_log_error("[tls_client] warning: '%s' is not a valid ip address, ignoring\n", addr);
                return kr_ok();
        }
 
@@ -593,7 +593,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
                int ret = gnutls_certificate_allocate_credentials(&entry->credentials);
                if (ret != GNUTLS_E_SUCCESS) {
                        free(entry);
-                       kr_log_error("[tls client] error: gnutls_certificate_allocate_credentials() fails (%s)\n",
+                       kr_log_error("[tls_client] error: gnutls_certificate_allocate_credentials() fails (%s)\n",
                                     gnutls_strerror_name(ret));
                        return kr_error(ENOMEM);
                }
@@ -605,7 +605,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
                bool already_exists = false;
                for (size_t i = 0; i < entry->ca_files.len; ++i) {
                        if (strcmp(entry->ca_files.at[i], ca_file) == 0) {
-                               kr_log_error("[tls client] error: ca file '%s'for address '%s' already was set, ignoring\n", ca_file, key);
+                               kr_log_error("[tls_client] error: ca file '%s'for address '%s' already was set, ignoring\n", ca_file, key);
                                already_exists = true;
                                break;
                        }
@@ -621,7 +621,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
                                int res = gnutls_certificate_set_x509_trust_file(entry->credentials, value,
                                                                                 GNUTLS_X509_FMT_PEM);
                                if (res < 0) {
-                                       kr_log_error("[tls client] failed to import certificate file '%s' (%s)\n",
+                                       kr_log_error("[tls_client] failed to import certificate file '%s' (%s)\n",
                                                     value, gnutls_strerror_name(res));
                                        /* value will be freed at cleanup */
                                        ret = kr_error(EINVAL);
@@ -634,7 +634,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
                bool already_exists = false;
                for (size_t i = 0; i < entry->hostnames.len; ++i) {
                        if (strcmp(entry->hostnames.at[i], hostname) == 0) {
-                               kr_log_error("[tls client] error: hostname '%s' for address '%s' already was set, ignoring\n", hostname, key);
+                               kr_log_error("[tls_client] error: hostname '%s' for address '%s' already was set, ignoring\n", hostname, key);
                                already_exists = true;
                                break;
                        }
@@ -653,7 +653,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
        if ((ret == kr_ok()) && pin && pin[0] != 0) {
                for (size_t i = 0; i < entry->pins.len; ++i) {
                        if (strcmp(entry->pins.at[i], pin) == 0) {
-                               kr_log_error("[tls client] warning: pin '%s' for address '%s' already was set, ignoring\n", pin, key);
+                               kr_log_error("[tls_client] warning: pin '%s' for address '%s' already was set, ignoring\n", pin, key);
                                return kr_ok();
                        }
                }
@@ -1009,7 +1009,7 @@ int tls_client_connect_start(struct tls_client_ctx_t *ctx,
        if (ret == GNUTLS_E_SUCCESS) {
                return kr_ok();
        } else if (gnutls_error_is_fatal(ret) != 0) {
-               kr_log_error("[tls client] handshake failed (%s)\n", gnutls_strerror(ret));
+               kr_log_error("[tls_client] handshake failed (%s)\n", gnutls_strerror(ret));
                return kr_error(ECONNABORTED);
        }
        return kr_error(EAGAIN);
index ac14767ce63aa29e58c02a7c687110a733b37c65..fa516e55208f7489ae7fb18054736201c421998d 100644 (file)
@@ -77,7 +77,7 @@ static inline int u16tostr(uint8_t *dst, uint16_t num)
 
 static void kres_gnutls_log(int level, const char *message)
 {
-       kr_log_verbose("gnutls: (%d) %s", level, message);
+       kr_log_verbose("[gnutls] (%d) %s", level, message);
 }
 
 bool kr_verbose_set(bool status)