Index: /branches/rel_ag_9_4_5/ui/backend/sys_cmd.c
===================================================================
--- /branches/rel_ag_9_4_5/ui/backend/sys_cmd.c	(revision 20513)
+++ /branches/rel_ag_9_4_5/ui/backend/sys_cmd.c	(working copy)
@@ -2780,7 +2780,7 @@
 {
     int i;
     for (i = 0; supported_ciphers[i] != NULL; i++) {
-        if (strcasecmp(cipher, supported_ciphers[i]) == 0) {
+        if (strcmp(cipher, supported_ciphers[i]) == 0) {
             return 1;
         }
     }
@@ -2802,15 +2802,27 @@
 
     token = strtok(tmp, ",");
     while (token != NULL) {
-        while (*token == ' ') token++;
-        if (!is_valid_cipher(token)) {
+
+		if (token[0] == ' ' || token[0] == '\t') {
+			ui_printf("cipher suite is invalid, please remove all spaces or tabs\n");
+			return 0;
+		}
+		char *end = token + strlen(token) - 1;
+		if (end >= token) {
+			if (*end == ' ' || *end == '\t' || *end == '\r' || *end == '\n') {
+				ui_printf("cipher suite is invalid, please remove all spaces or tabs\n");
+				return 0;
+			}
+		}
+
+		if (!is_valid_cipher(token)) {
 			ui_printf("cipher suite \"%s\" is not supported\n", token);
-            return 0;
-        }
-        token = strtok(NULL, ",");
-    }
+			return 0;
+		}
+		token = strtok(NULL, ",");
+	}
 
-    return 1;
+	return 1;
 }
 
 ca_errcode_t
