From 9477340b86bb2d465213224c488453d26aceeed5 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 11 Jan 2015 12:40:04 +0100 Subject: [PATCH] added more precise match of version --- src/occtl-dbus.c | 3 ++- src/occtl-unix.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/occtl-dbus.c b/src/occtl-dbus.c index 977d6341..f58f689b 100644 --- a/src/occtl-dbus.c +++ b/src/occtl-dbus.c @@ -522,7 +522,8 @@ int handle_list_users_cmd(dbus_ctx *ctx, const char *arg) print_time_ival7(t, out); if (dtls_ciphersuite != NULL && dtls_ciphersuite[0] != 0) { - if (strncmp(dtls_ciphersuite, "(DTLS1.2)-(RSA)-", 16) == 0) + if (strlen(dtls_ciphersuite) > 16 && strncmp(dtls_ciphersuite, "(DTLS", 5) == 0 && + strncmp(&dtls_ciphersuite[8], ")-(RSA)-", 8) == 0) dtls_ciphersuite += 16; fprintf(out, " %14s %9s\n", dtls_ciphersuite, auth); } else { diff --git a/src/occtl-unix.c b/src/occtl-unix.c index cff8d974..39a494e8 100644 --- a/src/occtl-unix.c +++ b/src/occtl-unix.c @@ -504,7 +504,8 @@ int handle_list_users_cmd(struct unix_ctx *ctx, const char *arg) dtls_ciphersuite = rep->user[i]->dtls_ciphersuite; if (dtls_ciphersuite != NULL && dtls_ciphersuite[0] != 0) { - if (strncmp(dtls_ciphersuite, "(DTLS1.2)-(RSA)-", 16) == 0) + if (strlen(dtls_ciphersuite) > 16 && strncmp(dtls_ciphersuite, "(DTLS", 5) == 0 && + strncmp(&dtls_ciphersuite[8], ")-(RSA)-", 8) == 0) dtls_ciphersuite += 16; fprintf(out, " %14s %9s\n", dtls_ciphersuite, rep->user[i]->status); } else {