summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1999-09-30 22:12:17 +0000
committerNiels Provos <provos@cvs.openbsd.org>1999-09-30 22:12:17 +0000
commit96395e54e4a2bfd204324953df27b76dba4ddf07 (patch)
treea9567ed4d20370589bc39f50bc5297f55ea70c1d
parent7a121fd137231c43a1e0c83c99dea90ce12b174f (diff)
better cipher name fix.
-rw-r--r--usr.bin/ssh/cipher.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 8a5c92d689e..b9956c03807 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -12,7 +12,7 @@ Created: Wed Apr 19 17:41:39 1995 ylo
*/
#include "includes.h"
-RCSID("$Id: cipher.c,v 1.10 1999/09/30 18:41:24 provos Exp $");
+RCSID("$Id: cipher.c,v 1.11 1999/09/30 22:12:16 provos Exp $");
#include "ssh.h"
#include "cipher.h"
@@ -123,12 +123,12 @@ detect_cbc_attack(const unsigned char *src,
int cipher.h. */
static char *cipher_names[] =
{
- NULL, /* no none */
- NULL, /* no idea */
- NULL, /* no des */
+ "none",
+ "idea",
+ "des",
"3des",
- NULL, /* no tss */
- NULL, /* no rc4 */
+ "tss",
+ "rc4",
"blowfish"
};
@@ -163,7 +163,8 @@ cipher_number(const char *name)
{
int i;
for (i = 0; i < sizeof(cipher_names) / sizeof(cipher_names[0]); i++)
- if (cipher_names[i] != NULL && strcmp(cipher_names[i], name) == 0)
+ if (strcmp(cipher_names[i], name) == 0 &&
+ (cipher_mask() & (1 << i)))
return i;
return -1;
}