added more precise match of version

This commit is contained in:
Nikos Mavrogiannopoulos
2015-01-11 12:40:04 +01:00
parent 406c171069
commit 9477340b86
2 changed files with 4 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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 {