summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-30 13:44:51 +1000
committerDamien Miller <djm@mindrot.org>2000-05-30 13:44:51 +1000
commitb1715dc0cf5ea91707b437310f63b17bed2dc7a6 (patch)
treef7fe557697d12b37c6be6a97c6ce083d23fd07de /cipher.c
parent9448c002db7427058ecca76760f3a75e379bf0a1 (diff)
- OpenBSD CVS updates:
- markus@cvs.openbsd.org [session.c] make x11-fwd work w/ localhost (xauth add host/unix:11) [cipher.c compat.c readconf.c servconf.c] check strtok() != NULL; ok niels@ [key.c] fix key_read() for uuencoded keys w/o '=' [serverloop.c] group ssh1 vs. ssh2 in serverloop [kex.c kex.h myproposal.h sshconnect2.c sshd.c] split kexinit/kexdh, factor out common code [readconf.c ssh.1 ssh.c] forwardagent defaults to no, add ssh -A - theo@cvs.openbsd.org [session.c] just some line shortening
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cipher.c b/cipher.c
index 639c1abbd..4117cb772 100644
--- a/cipher.c
+++ b/cipher.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$Id: cipher.c,v 1.20 2000/04/16 02:31:50 damien Exp $"); 15RCSID("$Id: cipher.c,v 1.21 2000/05/30 03:44:52 damien Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "cipher.h" 18#include "cipher.h"
@@ -178,7 +178,7 @@ ciphers_valid(const char *names)
178 char *p; 178 char *p;
179 int i; 179 int i;
180 180
181 if (strcmp(names, "") == 0) 181 if (names == NULL || strcmp(names, "") == 0)
182 return 0; 182 return 0;
183 ciphers = xstrdup(names); 183 ciphers = xstrdup(names);
184 for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) { 184 for ((p = strtok(ciphers, CIPHER_SEP)); p; (p = strtok(NULL, CIPHER_SEP))) {
@@ -201,6 +201,8 @@ int
201cipher_number(const char *name) 201cipher_number(const char *name)
202{ 202{
203 int i; 203 int i;
204 if (name == NULL)
205 return -1;
204 for (i = 0; i < sizeof(cipher_names) / sizeof(cipher_names[0]); i++) 206 for (i = 0; i < sizeof(cipher_names) / sizeof(cipher_names[0]); i++)
205 if (strcmp(cipher_names[i], name) == 0 && 207 if (strcmp(cipher_names[i], name) == 0 &&
206 (cipher_mask() & (1 << i))) 208 (cipher_mask() & (1 << i)))