From c5e3e5e3ad1206987aba6559c72e16582d9957f1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 23 Jan 2015 00:17:40 +0100 Subject: ec25519-fhmqvc: use new hexdump logging feature for unknown keys --- src/protocols/ec25519_fhmqvc/handshake.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocols/ec25519_fhmqvc') 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)); } -- cgit v1.2.3