diff options
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: cipher.c,v 1.28 2000/06/20 01:39:40 markus Exp $"); | 15 | RCSID("$OpenBSD: cipher.c,v 1.29 2000/07/10 16:30:25 ho Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "cipher.h" | 18 | #include "cipher.h" |
@@ -174,14 +174,15 @@ cipher_name(int cipher) | |||
174 | int | 174 | int |
175 | ciphers_valid(const char *names) | 175 | ciphers_valid(const char *names) |
176 | { | 176 | { |
177 | char *ciphers; | 177 | char *ciphers, *cp; |
178 | char *p; | 178 | char *p; |
179 | int i; | 179 | int i; |
180 | 180 | ||
181 | if (names == NULL || strcmp(names, "") == 0) | 181 | if (names == NULL || strcmp(names, "") == 0) |
182 | return 0; | 182 | return 0; |
183 | ciphers = xstrdup(names); | 183 | ciphers = cp = xstrdup(names); |
184 | for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) { | 184 | for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0'; |
185 | (p = strsep(&cp, CIPHER_SEP))) { | ||
185 | i = cipher_number(p); | 186 | i = cipher_number(p); |
186 | if (i == -1 || !(cipher_mask2() & (1 << i))) { | 187 | if (i == -1 || !(cipher_mask2() & (1 << i))) { |
187 | xfree(ciphers); | 188 | xfree(ciphers); |