summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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));
}