From 98444c8a3e57ce3b15dd8fd6237357063b286f26 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 6 Sep 2017 21:20:37 +0100 Subject: [PATCH] mon/tripemon.in (CryptoInfo): Use the `cryptolayout' table to populate. --- mon/tripemon.in | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/mon/tripemon.in b/mon/tripemon.in index 0404e21e..d96601fb 100644 --- a/mon/tripemon.in +++ b/mon/tripemon.in @@ -1423,31 +1423,11 @@ class CryptoInfo (TrivialWindow): me.add(table) crypto = conn.algs() - table.info('Diffie-Hellman group', - '%s (%d-bit order, %d-bit elements)' % - (crypto['kx-group'], - int(crypto['kx-group-order-bits']), - int(crypto['kx-group-elt-bits'])), - len = 42) - table.info('Data encryption', - '%s (%d-bit key; %s)' % - (crypto['cipher'], - int(crypto['cipher-keysz']) * 8, - crypto['cipher-blksz'] == '0' - and 'stream cipher' - or '%d-bit block' % (int(crypto['cipher-blksz']) * 8)), - newlinep = True) - table.info('Message authentication', - '%s (%d-bit key; %d-bit tag)' % - (crypto['mac'], - int(crypto['mac-keysz']) * 8, - int(crypto['mac-tagsz']) * 8), - newlinep = True) - table.info('Hash function', - '%s (%d-bit output)' % - (crypto['hash'], - int(crypto['hash-sz']) * 8), - newlinep = True) + firstp = True + for label, format in cryptolayout: + table.info(label, format_stat(format, crypto), + len = 42, newlinep = not firstp) + firstp = False me.show_all() -- 2.11.0