summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ssh/cipher.c8
-rw-r--r--usr.bin/ssh/cipher.h4
-rw-r--r--usr.bin/ssh/kex.c6
-rw-r--r--usr.bin/ssh/kex.h4
-rw-r--r--usr.bin/ssh/mac.c8
-rw-r--r--usr.bin/ssh/mac.h4
-rw-r--r--usr.bin/ssh/servconf.c9
-rw-r--r--usr.bin/ssh/ssh.c8
8 files changed, 27 insertions, 24 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 25ecaa324fa..0ca5e35de2e 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.c,v 1.89 2013/05/17 00:13:13 djm Exp $ */
+/* $OpenBSD: cipher.c,v 1.90 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -94,9 +94,9 @@ static const struct Cipher ciphers[] = {
/*--*/
-/* Returns a comma-separated list of supported ciphers. */
+/* Returns a list of supported ciphers separated by the specified char. */
char *
-cipher_alg_list(void)
+cipher_alg_list(char sep)
{
char *ret = NULL;
size_t nlen, rlen = 0;
@@ -106,7 +106,7 @@ cipher_alg_list(void)
if (c->number != SSH_CIPHER_SSH2)
continue;
if (ret != NULL)
- ret[rlen++] = '\n';
+ ret[rlen++] = sep;
nlen = strlen(c->name);
ret = xrealloc(ret, 1, rlen + nlen + 2);
memcpy(ret + rlen, c->name, nlen + 1);
diff --git a/usr.bin/ssh/cipher.h b/usr.bin/ssh/cipher.h
index b878d50f4fc..46502348b79 100644
--- a/usr.bin/ssh/cipher.h
+++ b/usr.bin/ssh/cipher.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.h,v 1.40 2013/04/19 01:06:50 djm Exp $ */
+/* $OpenBSD: cipher.h,v 1.41 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -75,7 +75,7 @@ const Cipher *cipher_by_number(int);
int cipher_number(const char *);
char *cipher_name(int);
int ciphers_valid(const char *);
-char *cipher_alg_list(void);
+char *cipher_alg_list(char);
void cipher_init(CipherContext *, const Cipher *, const u_char *, u_int,
const u_char *, u_int, int);
void cipher_crypt(CipherContext *, u_char *, const u_char *,
diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c
index d356a680882..8d568006620 100644
--- a/usr.bin/ssh/kex.c
+++ b/usr.bin/ssh/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.92 2013/11/02 21:59:15 markus Exp $ */
+/* $OpenBSD: kex.c,v 1.93 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -70,7 +70,7 @@ static const struct kexalg kexalgs[] = {
};
char *
-kex_alg_list(void)
+kex_alg_list(char sep)
{
char *ret = NULL;
size_t nlen, rlen = 0;
@@ -78,7 +78,7 @@ kex_alg_list(void)
for (k = kexalgs; k->name != NULL; k++) {
if (ret != NULL)
- ret[rlen++] = '\n';
+ ret[rlen++] = sep;
nlen = strlen(k->name);
ret = xrealloc(ret, 1, rlen + nlen + 2);
memcpy(ret + rlen, k->name, nlen + 1);
diff --git a/usr.bin/ssh/kex.h b/usr.bin/ssh/kex.h
index bab9c8d7324..b8a889f5401 100644
--- a/usr.bin/ssh/kex.h
+++ b/usr.bin/ssh/kex.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.h,v 1.57 2013/11/02 21:59:15 markus Exp $ */
+/* $OpenBSD: kex.h,v 1.58 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -143,7 +143,7 @@ struct Kex {
};
int kex_names_valid(const char *);
-char *kex_alg_list(void);
+char *kex_alg_list(char);
Kex *kex_setup(char *[PROPOSAL_MAX]);
void kex_finish(Kex *);
diff --git a/usr.bin/ssh/mac.c b/usr.bin/ssh/mac.c
index 63411422819..63cd09b07aa 100644
--- a/usr.bin/ssh/mac.c
+++ b/usr.bin/ssh/mac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mac.c,v 1.24 2013/06/03 00:03:18 dtucker Exp $ */
+/* $OpenBSD: mac.c,v 1.25 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -82,9 +82,9 @@ static const struct macalg macs[] = {
{ NULL, 0, NULL, 0, 0, 0, 0 }
};
-/* Returns a comma-separated list of supported MACs. */
+/* Returns a list of supported MACs separated by the specified char. */
char *
-mac_alg_list(void)
+mac_alg_list(char sep)
{
char *ret = NULL;
size_t nlen, rlen = 0;
@@ -92,7 +92,7 @@ mac_alg_list(void)
for (m = macs; m->name != NULL; m++) {
if (ret != NULL)
- ret[rlen++] = '\n';
+ ret[rlen++] = sep;
nlen = strlen(m->name);
ret = xrealloc(ret, 1, rlen + nlen + 2);
memcpy(ret + rlen, m->name, nlen + 1);
diff --git a/usr.bin/ssh/mac.h b/usr.bin/ssh/mac.h
index 260798ab3b0..fbe18c463bb 100644
--- a/usr.bin/ssh/mac.h
+++ b/usr.bin/ssh/mac.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mac.h,v 1.7 2013/04/19 01:06:50 djm Exp $ */
+/* $OpenBSD: mac.h,v 1.8 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -24,7 +24,7 @@
*/
int mac_valid(const char *);
-char *mac_alg_list(void);
+char *mac_alg_list(char);
int mac_setup(Mac *, char *);
int mac_init(Mac *);
u_char *mac_compute(Mac *, u_int32_t, u_char *, int);
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c
index bc53e5b01f3..fb35c86e033 100644
--- a/usr.bin/ssh/servconf.c
+++ b/usr.bin/ssh/servconf.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: servconf.c,v 1.244 2013/10/29 09:48:02 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.245 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1985,8 +1985,9 @@ dump_config(ServerOptions *o)
/* string arguments */
dump_cfg_string(sPidFile, o->pid_file);
dump_cfg_string(sXAuthLocation, o->xauth_location);
- dump_cfg_string(sCiphers, o->ciphers);
- dump_cfg_string(sMacs, o->macs);
+ dump_cfg_string(sCiphers, o->ciphers ? o->ciphers :
+ cipher_alg_list(','));
+ dump_cfg_string(sMacs, o->macs ? o->macs : mac_alg_list(','));
dump_cfg_string(sBanner, o->banner);
dump_cfg_string(sForceCommand, o->adm_forced_command);
dump_cfg_string(sChrootDirectory, o->chroot_directory);
@@ -1998,6 +1999,8 @@ dump_config(ServerOptions *o)
dump_cfg_string(sAuthorizedKeysCommand, o->authorized_keys_command);
dump_cfg_string(sAuthorizedKeysCommandUser, o->authorized_keys_command_user);
dump_cfg_string(sHostKeyAgent, o->host_key_agent);
+ dump_cfg_string(sKexAlgorithms, o->kex_algorithms ? o->kex_algorithms :
+ kex_alg_list(','));
/* string arguments requiring a lookup */
dump_cfg_string(sLogLevel, log_level_name(o->log_level));
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 71aec4c65e3..3e06647229e 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.391 2013/10/25 23:04:51 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.392 2013/11/07 11:58:27 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -492,11 +492,11 @@ main(int ac, char **av)
case 'Q': /* deprecated */
cp = NULL;
if (strcasecmp(optarg, "cipher") == 0)
- cp = cipher_alg_list();
+ cp = cipher_alg_list('\n');
else if (strcasecmp(optarg, "mac") == 0)
- cp = mac_alg_list();
+ cp = mac_alg_list('\n');
else if (strcasecmp(optarg, "kex") == 0)
- cp = kex_alg_list();
+ cp = kex_alg_list('\n');
else if (strcasecmp(optarg, "key") == 0)
cp = key_alg_list();
if (cp == NULL)