summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-01-23 00:17:40 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-01-23 00:17:40 +0100
commitc5e3e5e3ad1206987aba6559c72e16582d9957f1 (patch)
tree15575043a66786249cd248c9380a9e859ab69dac
parent0d9b7eeb90fa4fc5978830987555ad12610fbdbf (diff)
downloadfastd-c5e3e5e3ad1206987aba6559c72e16582d9957f1.tar
fastd-c5e3e5e3ad1206987aba6559c72e16582d9957f1.zip
ec25519-fhmqvc: use new hexdump logging feature for unknown keys
-rw-r--r--src/protocols/ec25519_fhmqvc/handshake.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c
index 6b4d735..c86d453 100644
--- a/src/protocols/ec25519_fhmqvc/handshake.c
+++ b/src/protocols/ec25519_fhmqvc/handshake.c
@@ -49,6 +49,9 @@
#endif
+#define KEY_PRINT(k) (const uint8_t *)(k), (size_t)PUBLICKEYBYTES
+
+
/** Derives a key of arbitraty length from the shared key material after a handshake using the HKDF algorithm */
static void derive_key(fastd_sha256_t *out, size_t blocks, const uint32_t *salt, const char *method_name,
const aligned_int256_t *A, const aligned_int256_t *B, const aligned_int256_t *X, const aligned_int256_t *Y,
@@ -512,10 +515,7 @@ void fastd_protocol_ec25519_fhmqvc_handshake_init(fastd_socket_t *sock, const fa
/** Prints a message when a handshake from an unknown peer is received */
static inline void print_unknown_key(const fastd_peer_address_t *addr, const unsigned char key[PUBLICKEYBYTES]) {
- char buf[65];
- hexdump(buf, key);
-
- pr_verbose("ignoring handshake from %I (unknown key %s)", addr, buf);
+ pr_verbose("ignoring handshake from %I (unknown key %H)", addr, KEY_PRINT(key));
}