From 8a1ab0e32dd55e4bb0d36c74f811693066ee388b Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 10 Mar 2014 19:24:31 +0100 Subject: [PATCH] Print a compact version of the DTLS ciphersuite. --- src/occtl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/occtl.c b/src/occtl.c index d2190d63..35f949a4 100644 --- a/src/occtl.c +++ b/src/occtl.c @@ -688,7 +688,7 @@ int handle_list_users_cmd(DBusConnection * conn, const char *arg) if (iteration++ == 0) { fprintf(out, "%8s %8s %8s %14s %14s %6s %7s %14s %9s\n", "id", "user", "group", "ip", "vpn-ip", "device", - "since", "cipher", "status"); + "since", "dtls-cipher", "status"); } t = since; @@ -705,10 +705,13 @@ int handle_list_users_cmd(DBusConnection * conn, const char *arg) (unsigned)id, username, groupname, ip, vpn_ip, device); print_time_ival7(t, out); - if (dtls_ciphersuite != NULL && dtls_ciphersuite[0] != 0) + if (dtls_ciphersuite != NULL && dtls_ciphersuite[0] != 0) { + if (strncmp(dtls_ciphersuite, "OC-DTLS", 7) == 0 && strlen(dtls_ciphersuite) > 11) + dtls_ciphersuite += 11; fprintf(out, " %14s %9s\n", dtls_ciphersuite, auth); - else + } else { fprintf(out, " %14s %9s\n", "(no dtls)", auth); + } entries_add(username, strlen(username), id);