chiark / gitweb /
mon/tripemon.in: Show per-peer crypto details in peer info sheet.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 24 May 2014 13:00:03 +0000 (14:00 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 20 Jul 2014 00:42:30 +0000 (01:42 +0100)
mon/tripemon.in

index 96cf9cc2d7e07189479402d727db4b4c51632214..63d2567f4d399c74f3da936a1af1693a8eb73f03 100644 (file)
@@ -312,6 +312,7 @@ class Peer (MonitorObject):
     """Initialize the object with the given name."""
     MonitorObject.__init__(me, name)
     me.pinghook = HookList()
+    me.__dict__.update(conn.algs(name))
     me.update()
 
   def update(me, hunoz = None):
@@ -1238,6 +1239,15 @@ statsxlate = \
 ## the entry.
 statslayout = \
   [('Start time', '%(start-time)s'),
+   ('Private key', '%(current-key)s'),
+   ('Diffie-Hellman group',
+    '%(kx-group)s '
+    '(%(kx-group-order-bits)s-bit order, '
+    '%(kx-group-elt-bits)s-bit elements)'),
+   ('Cipher',
+    '%(cipher)s (%(cipher-keysz)s-bit key, %(cipher-blksz)s-bit block)'),
+   ('Mac', '%(mac)s (%(mac-keysz)s-bit key, %(mac-tagsz)s-bit tag)'),
+   ('Hash', '%(hash)s (%(hash-sz)s-bit output)'),
    ('Last key-exchange', '%(last-keyexch-time)s'),
    ('Last packet', '%(last-packet-time)s'),
    ('Packets in/out',
@@ -1325,6 +1335,7 @@ class PeerWindow (TrivialWindow):
       stat = conn.stats(me.peer.name)
       for s, trans in statsxlate:
         stat[s] = trans(stat[s])
+      stat.update(me.peer.__dict__)
       for label, format in statslayout:
         me.e[label].set_text(format % stat)
       GL.timeout_add(1000, lambda: me.cr.switch() and False)