aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortg(x) <*@tg-x.net>2017-02-24 20:10:42 +0100
committertg(x) <*@tg-x.net>2017-02-24 20:10:42 +0100
commitcb1165ecfc5c89c22aa4a6fffb72e27e0bde43a3 (patch)
tree401701a61ae8245f212364df7b44b228a9f4c225
parent435ef0a62ffe830ccee159f430157cfc8cc6a3d4 (diff)
util: add component name to LOG macros; util/client: log incoming message type/size/source for gnunet-logread
-rwxr-xr-xcontrib/gnunet-logread5
-rw-r--r--src/util/bio.c2
-rw-r--r--src/util/client.c7
-rw-r--r--src/util/common_allocation.c4
-rw-r--r--src/util/common_endian.c2
-rw-r--r--src/util/configuration_loader.c2
-rw-r--r--src/util/connection.c4
-rw-r--r--src/util/container_bloomfilter.c6
-rw-r--r--src/util/container_heap.c2
-rw-r--r--src/util/container_meta_data.c2
-rw-r--r--src/util/container_multihashmap.c2
-rw-r--r--src/util/container_multihashmap32.c2
-rw-r--r--src/util/container_multipeermap.c2
-rw-r--r--src/util/container_multishortmap.c2
-rw-r--r--src/util/crypto_crc.c2
-rw-r--r--src/util/crypto_ecc.c6
-rw-r--r--src/util/crypto_ecc_setup.c6
-rw-r--r--src/util/crypto_hash.c4
-rw-r--r--src/util/crypto_hash_file.c4
-rw-r--r--src/util/crypto_hkdf.c2
-rw-r--r--src/util/crypto_kdf.c2
-rw-r--r--src/util/crypto_mpi.c2
-rw-r--r--src/util/crypto_random.c4
-rw-r--r--src/util/crypto_rsa.c38
-rw-r--r--src/util/crypto_symmetric.c2
-rw-r--r--src/util/disk.c6
-rw-r--r--src/util/getopt.c4
-rw-r--r--src/util/getopt_helpers.c2
-rw-r--r--src/util/load.c2
-rw-r--r--src/util/mq.c40
-rw-r--r--src/util/mst.c2
-rw-r--r--src/util/network.c6
-rw-r--r--src/util/os_installation.c4
-rw-r--r--src/util/os_network.c4
-rw-r--r--src/util/os_priority.c6
-rw-r--r--src/util/peer.c2
-rw-r--r--src/util/plugin.c2
-rw-r--r--src/util/program.c4
-rw-r--r--src/util/resolver_api.c8
-rw-r--r--src/util/server.c6
-rw-r--r--src/util/server_mst.c2
-rw-r--r--src/util/server_tc.c2
-rw-r--r--src/util/service.c6
-rw-r--r--src/util/service_new.c6
-rw-r--r--src/util/signal.c2
-rw-r--r--src/util/socks.c4
-rw-r--r--src/util/speedup.c2
-rw-r--r--src/util/strings.c4
-rw-r--r--src/util/time.c2
-rw-r--r--src/util/winproc.c2
50 files changed, 129 insertions, 117 deletions
diff --git a/contrib/gnunet-logread b/contrib/gnunet-logread
index 5b125a5a45..e4b6752b8a 100755
--- a/contrib/gnunet-logread
+++ b/contrib/gnunet-logread
@@ -85,7 +85,7 @@ sub perform {
if (fileno O) {
my ($time, $type, $size, $from, $to, $level, $msg);
if (($time, $type, $size, $from, $to) =
- /^([A-Z][a-z]{2}\ .[0-9]\ [0-9:]{8}(?:-[0-9]{6})?)\ util-.*\b
+ /^([A-Z][a-z]{2}\ .[0-9]\ [0-9:]{8}(?:-[0-9]{6})?)\ util-client-.*\b
(?: Received | Transmitting )\ message \b.*?\b
type \s+ (\d+) \b.*?\b
size \s+ (\d+) \b.*?\b
@@ -172,7 +172,7 @@ gnunet-logread - a GNUnet log analyzer, colorizer and aggregator
=head1 MOTIVATION
-GNUnet debug logs are a tedious read, but given a complex system that we
+GNUnet debug logs are a tedious read, but given a complex system that we
cannot run all parts of in a debugger all the time, some gathering and
structuring of events and message passing is useful.
@@ -196,4 +196,3 @@ instead, but that is still subject to further consideration.
=head1 AUTHORS
tg & lynX
-
diff --git a/src/util/bio.c b/src/util/bio.c
index 62f4904f7d..08e30dc01a 100644
--- a/src/util/bio.c
+++ b/src/util/bio.c
@@ -25,7 +25,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-bio",__VA_ARGS__)
#ifndef PATH_MAX
/**
diff --git a/src/util/client.c b/src/util/client.c
index a5e04d7b27..0f7d0d3593 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -33,7 +33,7 @@
#include "gnunet_socks.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-client",__VA_ARGS__)
/**
@@ -298,6 +298,11 @@ recv_message (void *cls,
if (GNUNET_YES == cstate->in_destroy)
return GNUNET_SYSERR;
+
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Received message of type %u and size %u from %s\n",
+ ntohs (msg->type), ntohs (msg->size), cstate->service_name);
+
GNUNET_MQ_inject_message (cstate->mq,
msg);
if (GNUNET_YES == cstate->in_destroy)
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index 71a2221eec..7375848155 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -32,9 +32,9 @@
#include <malloc/malloc.h>
#endif
-#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-common-allocation",__VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-common-allocation", syscall)
#ifndef INT_MAX
#define INT_MAX 0x7FFFFFFF
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 4c8ad71820..f29e42c98a 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -28,7 +28,7 @@
#include "platform.h"
#include "gnunet_crypto_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-common-endian",__VA_ARGS__)
uint64_t
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c
index 07eeb98f07..ceaf2a6ea2 100644
--- a/src/util/configuration_loader.c
+++ b/src/util/configuration_loader.c
@@ -27,7 +27,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-configuration", __VA_ARGS__)
/**
diff --git a/src/util/connection.c b/src/util/connection.c
index 02dd9f9911..dfa673a864 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -35,9 +35,9 @@
#include "gnunet_resolver_service.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-connection", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-connection", syscall)
/**
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 58725dcc57..aedca232d7 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -42,11 +42,11 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-bloomfilter", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-container-bloomfilter", syscall)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-container-bloomfilter", syscall, filename)
struct GNUNET_CONTAINER_BloomFilter
{
diff --git a/src/util/container_heap.c b/src/util/container_heap.c
index 1ead5ec6d7..21bdee8343 100644
--- a/src/util/container_heap.c
+++ b/src/util/container_heap.c
@@ -28,7 +28,7 @@
#include "platform.h"
#include "gnunet_container_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-heap", __VA_ARGS__)
#define EXTRA_CHECKS 0
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index b4d231dae9..ec527005a0 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -31,7 +31,7 @@
#endif
#include <zlib.h>
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-meta-data", __VA_ARGS__)
diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c
index d855625793..ffeb4a71f3 100644
--- a/src/util/container_multihashmap.c
+++ b/src/util/container_multihashmap.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_container_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-multihashmap", __VA_ARGS__)
/**
* An entry in the hash map with the full key.
diff --git a/src/util/container_multihashmap32.c b/src/util/container_multihashmap32.c
index 4cc9b7ebd3..d33c3c2d98 100644
--- a/src/util/container_multihashmap32.c
+++ b/src/util/container_multihashmap32.c
@@ -28,7 +28,7 @@
#include "platform.h"
#include "gnunet_container_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-multihashmap32", __VA_ARGS__)
/**
* An entry in the hash map.
diff --git a/src/util/container_multipeermap.c b/src/util/container_multipeermap.c
index 6c62e74035..7830771d86 100644
--- a/src/util/container_multipeermap.c
+++ b/src/util/container_multipeermap.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-multipeermap", __VA_ARGS__)
/**
* An entry in the hash map with the full key.
diff --git a/src/util/container_multishortmap.c b/src/util/container_multishortmap.c
index 5e8a47b096..cfa82ca20b 100644
--- a/src/util/container_multishortmap.c
+++ b/src/util/container_multishortmap.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-container-multishortmap", __VA_ARGS__)
/**
* An entry in the hash map with the full key.
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index d7f5f7fc8a..03b24d9f76 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -30,7 +30,7 @@
#include "platform.h"
#include "gnunet_crypto_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-crc", __VA_ARGS__)
/* Avoid wasting space on 8-byte longs. */
#if UINT_MAX >= 0xffffffff
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index 3f91507626..eaa49a9919 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -38,11 +38,11 @@
*/
#define CURVE "Ed25519"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-crypto-ecc", syscall, filename)
/**
* Log an error message at log-level 'level' that indicates
diff --git a/src/util/crypto_ecc_setup.c b/src/util/crypto_ecc_setup.c
index 0ce55ddbfc..2f2e2f122d 100644
--- a/src/util/crypto_ecc_setup.c
+++ b/src/util/crypto_ecc_setup.c
@@ -27,11 +27,11 @@
#include <gcrypt.h>
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-crypto-ecc", syscall, filename)
/**
* Log an error message at log-level 'level' that indicates
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 31824e72a2..49dbacd0bd 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -28,9 +28,9 @@
#include "gnunet_strings_lib.h"
#include <gcrypt.h>
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-hash", __VA_ARGS__)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-crypto-hash", syscall, filename)
/**
* Hash block of given size.
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c
index ace5212c9d..3e59002003 100644
--- a/src/util/crypto_hash_file.c
+++ b/src/util/crypto_hash_file.c
@@ -27,9 +27,9 @@
#include "gnunet_util_lib.h"
#include <gcrypt.h>
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-hash-file", __VA_ARGS__)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-crypto-hash-file", syscall, filename)
/**
diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c
index c6c43f800c..f04d3e6750 100644
--- a/src/util/crypto_hkdf.c
+++ b/src/util/crypto_hkdf.c
@@ -36,7 +36,7 @@
* - Matthias Wachs (08.10.2010)
*/
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-hkdf", __VA_ARGS__)
/**
* Set this to 0 if you compile this code outside of GNUnet.
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c
index 78fb1911aa..6d7c5a0964 100644
--- a/src/util/crypto_kdf.c
+++ b/src/util/crypto_kdf.c
@@ -30,7 +30,7 @@
#include "platform.h"
#include "gnunet_crypto_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-kdf", __VA_ARGS__)
/**
* @brief Derive key
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c
index 668d5e602b..ff3e9a8a72 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -29,7 +29,7 @@
#include "gnunet_crypto_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-mpi", __VA_ARGS__)
/**
* Log an error message at log-level 'level' that indicates
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 8897ae24fb..d5b5eb9ec8 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -28,9 +28,9 @@
#include "gnunet_crypto_lib.h"
#include <gcrypt.h>
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-random", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-crypto-random", syscall)
/* TODO: ndurner, move this to plibc? */
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index 443d597e4c..7a108c21b1 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -25,7 +25,7 @@
#include <gcrypt.h>
#include "gnunet_crypto_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-rsa", __VA_ARGS__)
/**
@@ -430,7 +430,7 @@ rsa_blinding_key_derive (const struct GNUNET_CRYPTO_RsaPublicKey *pkey,
char *xts = "Blinding KDF extrator HMAC key"; /* Trusts bks' randomness more */
struct RsaBlindingKey *blind;
gcry_mpi_t n;
-
+
blind = GNUNET_new (struct RsaBlindingKey);
GNUNET_assert( NULL != blind );
@@ -454,25 +454,25 @@ rsa_blinding_key_derive (const struct GNUNET_CRYPTO_RsaPublicKey *pkey,
}
-/*
+/*
We originally added GNUNET_CRYPTO_kdf_mod_mpi for the benifit of the
previous routine.
-There was previously a call to GNUNET_CRYPTO_kdf in
+There was previously a call to GNUNET_CRYPTO_kdf in
bkey = rsa_blinding_key_derive (len, bks);
-that gives exactly len bits where
+that gives exactly len bits where
len = GNUNET_CRYPTO_rsa_public_key_len (pkey);
Now r = 2^(len-1)/pkey.n is the probability that a set high bit being
okay, meaning bkey < pkey.n. It follows that (1-r)/2 of the time bkey >
-pkey.n making the effective bkey be
+pkey.n making the effective bkey be
bkey mod pkey.n = bkey - pkey.n
so the effective bkey has its high bit set with probability r/2.
We expect r to be close to 1/2 if the exchange is honest, but the
exchange can choose r otherwise.
-In blind signing, the exchange sees
+In blind signing, the exchange sees
B = bkey * S mod pkey.n
On deposit, the exchange sees S so they can compute bkey' = B/S mod
pkey.n for all B they recorded to see if bkey' has it's high bit set.
@@ -489,7 +489,7 @@ the wrong and right probabilities 1/3 and 1/4, respectively.
I feared this gives the exchange a meaningful fraction of a bit of
information per coin involved in the transaction. It sounds damaging if
numerous coins were involved. And it could run across transactions in
-some scenarios.
+some scenarios.
We fixed this by using a more uniform deterministic pseudo-random number
generator for blinding factors. I do not believe this to be a problem
@@ -748,7 +748,7 @@ GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash,
}
data = rsa_full_domain_hash (pkey, hash);
- if (NULL == data)
+ if (NULL == data)
goto rsa_gcd_validate_failure;
bkey = rsa_blinding_key_derive (pkey, bks);
@@ -771,7 +771,7 @@ GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash,
gcry_mpi_release (ne[0]);
gcry_mpi_release (ne[1]);
gcry_mpi_release (r_e);
- rsa_blinding_key_free (bkey);
+ rsa_blinding_key_free (bkey);
*buf_size = numeric_mpi_alloc_n_print (data_r_e, buf);
gcry_mpi_release (data_r_e);
@@ -917,7 +917,7 @@ GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
GNUNET_CRYPTO_rsa_public_key_free (pkey);
if (NULL == v) /* rsa_gcd_validate failed meaning */
return NULL; /* our *own* RSA key is malicious. */
-
+
sig = rsa_sign_mpi (key, v);
gcry_mpi_release (v);
return sig;
@@ -1077,11 +1077,11 @@ GNUNET_CRYPTO_rsa_unblind (struct GNUNET_CRYPTO_RsaSignature *sig,
}
bkey = rsa_blinding_key_derive (pkey, bks);
- if (NULL == bkey)
+ if (NULL == bkey)
{
- /* RSA key is malicious since rsa_gcd_validate failed here.
+ /* RSA key is malicious since rsa_gcd_validate failed here.
* It should have failed during GNUNET_CRYPTO_rsa_blind too though,
- * so the exchange is being malicious in an unfamilair way, maybe
+ * so the exchange is being malicious in an unfamilair way, maybe
* just trying to crash us. */
GNUNET_break_op (0);
gcry_mpi_release (n);
@@ -1096,10 +1096,10 @@ GNUNET_CRYPTO_rsa_unblind (struct GNUNET_CRYPTO_RsaSignature *sig,
n))
{
/* We cannot find r mod n, so gcd(r,n) != 1, which should get *
- * caught above, but we handle it the same here. */
+ * caught above, but we handle it the same here. */
GNUNET_break_op (0);
gcry_mpi_release (r_inv);
- rsa_blinding_key_free (bkey);
+ rsa_blinding_key_free (bkey);
gcry_mpi_release (n);
gcry_mpi_release (s);
return NULL;
@@ -1144,11 +1144,11 @@ GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash,
r = rsa_full_domain_hash (pkey, hash);
if (NULL == r) {
GNUNET_break_op (0);
- /* RSA key is malicious since rsa_gcd_validate failed here.
+ /* RSA key is malicious since rsa_gcd_validate failed here.
* It should have failed during GNUNET_CRYPTO_rsa_blind too though,
- * so the exchange is being malicious in an unfamilair way, maybe
+ * so the exchange is being malicious in an unfamilair way, maybe
* just trying to crash us. Arguably, we've only an internal error
- * though because we should've detected this in our previous call
+ * though because we should've detected this in our previous call
* to GNUNET_CRYPTO_rsa_unblind. */
return GNUNET_NO;
}
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c
index 381a5d2f85..e25e2f1dd5 100644
--- a/src/util/crypto_symmetric.c
+++ b/src/util/crypto_symmetric.c
@@ -29,7 +29,7 @@
#include "gnunet_crypto_lib.h"
#include <gcrypt.h>
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-crypto-symmetric", __VA_ARGS__)
/**
* Create a new SessionKey (for symmetric encryption).
diff --git a/src/util/disk.c b/src/util/disk.c
index 40043549bf..3056075943 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -28,11 +28,11 @@
#include "gnunet_strings_lib.h"
#include "gnunet_disk_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-disk", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-disk", syscall)
-#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
+#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util-disk", syscall, filename)
/**
* Block size for IO for copying files.
diff --git a/src/util/getopt.c b/src/util/getopt.c
index e150496ae2..ff62dba9be 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -47,9 +47,9 @@ Copyright Copyright (C) 2006 Christian Grothoff
#endif
#endif
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-getopt", __VA_ARGS__)
-#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util", syscall)
+#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-getopt", syscall)
#if defined (WIN32) && !defined (__CYGWIN32__)
/* It's not Unix, really. See? Capital letters. */
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index ab0b67412b..4d71045031 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-getopt", __VA_ARGS__)
/**
diff --git a/src/util/load.c b/src/util/load.c
index d374d7a17c..d1de6aa366 100644
--- a/src/util/load.c
+++ b/src/util/load.c
@@ -27,7 +27,7 @@
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-load", __VA_ARGS__)
/**
* Values we track for load calculations.
diff --git a/src/util/mq.c b/src/util/mq.c
index 95bcd71cb4..a8216d9648 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#define LOG(kind,...) GNUNET_log_from (kind, "mq",__VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-mq",__VA_ARGS__)
struct GNUNET_MQ_Envelope
@@ -235,24 +235,29 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq,
{
const struct GNUNET_MQ_MessageHandler *handler;
int handled = GNUNET_NO;
- uint16_t ms = ntohs (mh->size);
+ uint16_t msize = ntohs (mh->size);
+ uint16_t mtype = ntohs (mh->type);
+
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Received message of type %u and size %u\n",
+ mtype, msize);
if (NULL == mq->handlers)
goto done;
for (handler = mq->handlers; NULL != handler->cb; handler++)
{
- if (handler->type == ntohs (mh->type))
+ if (handler->type == mtype)
{
handled = GNUNET_YES;
- if ( (handler->expected_size > ms) ||
- ( (handler->expected_size != ms) &&
+ if ( (handler->expected_size > msize) ||
+ ( (handler->expected_size != msize) &&
(NULL == handler->mv) ) )
{
/* Too small, or not an exact size and
no 'mv' handler to check rest */
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Received malformed message of type %u\n",
- (unsigned int) handler->type);
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+