From 5523fecc24a1b23310a17f826ce99025eefad6b5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 25 May 2016 16:14:07 +0300 Subject: [PATCH] monitor: Split public key into multiple lines Printing the entire public key value on a single line requires some 160 characters which ends up wrapping on most terminals. Instead, print the X and Y components separately, which is also consistent with how SMP is decoded. --- monitor/packet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index 322bba694..ca824bf50 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -1870,7 +1870,9 @@ static void print_randomizer_p256(const uint8_t *randomizer) static void print_pk256(const char *label, const uint8_t *key) { - print_hex_field(label, key, 64); + print_field("%s:", label); + print_hex_field(" X", &key[0], 32); + print_hex_field(" Y", &key[32], 32); } static void print_dhkey(const uint8_t *dhkey) -- 2.47.3