summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-11-08 12:16:49 +1100
committerDamien Miller <djm@mindrot.org>2013-11-08 12:16:49 +1100
commit690d989008e18af3603a5e03f1276c9bad090370 (patch)
tree60dc95d5ad849ee6600da56ac4635b42740aad60
parent08998c5fb9c7c1d248caa73b76e02ca0482e6d85 (diff)
- dtucker@cvs.openbsd.org 2013/11/07 11:58:27
[cipher.c cipher.h kex.c kex.h mac.c mac.h servconf.c ssh.c] Output the effective values of Ciphers, MACs and KexAlgorithms when the default has not been overridden. ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--cipher.c8
-rw-r--r--cipher.h4
-rw-r--r--kex.c6
-rw-r--r--kex.h4
-rw-r--r--mac.c8
-rw-r--r--mac.h4
-rw-r--r--servconf.c9
-rw-r--r--ssh.c8
9 files changed, 32 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index ca7cb03e..a7098f6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
- dtucker@cvs.openbsd.org 2013/11/08 01:06:14
[regress/rekey.sh]
Rekey less frequently during tests to speed them up
+ - (djm) OpenBSD CVS Sync
+ - dtucker@cvs.openbsd.org 2013/11/07 11:58:27
+ [cipher.c cipher.h kex.c kex.h mac.c mac.h servconf.c ssh.c]
+ Output the effective values of Ciphers, MACs and KexAlgorithms when
+ the default has not been overridden. ok markus@
20131107
- (djm) [ssh-pkcs11.c] Bring back "non-constant initialiser" fix (rev 1.5)
diff --git a/cipher.c b/cipher.c
index a2cbe2be..54315f48 100644
--- a/cipher.c
+++ b/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
@@ -100,9 +100,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;
@@ -112,7 +112,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/cipher.h b/cipher.h
index b878d50f..46502348 100644
--- a/cipher.h
+++ b/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/kex.c b/kex.c
index 07f25e2e..0b139dc6 100644
--- a/kex.c
+++ b/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.
*
@@ -85,7 +85,7 @@ static const struct kexalg kexalgs[] = {
};
char *
-kex_alg_list(void)
+kex_alg_list(char sep)
{
char *ret = NULL;
size_t nlen, rlen = 0;
@@ -93,7 +93,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/kex.h b/kex.h
index 0f67f593..800a6923 100644
--- a/kex.h
+++ b/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.
@@ -146,7 +146,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/mac.c b/mac.c
index c4dfb501..c71b6a74 100644
--- a/mac.c
+++ b/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.
*
@@ -91,9 +91,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;
@@ -101,7 +101,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/mac.h b/mac.h
index 260798ab..fbe18c46 100644
--- a/mac.h
+++ b/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/servconf.c b/servconf.c
index 0f1bdd09..3593223f 100644
--- a/servconf.c
+++ b/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
@@ -2037,8 +2037,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);
@@ -2050,6 +2051,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/ssh.c b/ssh.c
index ef94591b..e2c43634 100644
--- a/ssh.c
+++ b/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
@@ -520,11 +520,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)