summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/kex.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-09-10 08:31:17 +0000
committerkris <kris@FreeBSD.org>2000-09-10 08:31:17 +0000
commit0ca2bdc2f755d323cf97966ca69c4d32b283070a (patch)
treec42b17e610c0f98d5a0dda76cbd9035109d60303 /crypto/openssh/kex.c
parent3639dd9acea182e29b2d59915fbb97029217d9b2 (diff)
downloadFreeBSD-src-0ca2bdc2f755d323cf97966ca69c4d32b283070a.zip
FreeBSD-src-0ca2bdc2f755d323cf97966ca69c4d32b283070a.tar.gz
Initial import of OpenSSH post-2.2.0 snapshot dated 2000-09-09
Diffstat (limited to 'crypto/openssh/kex.c')
-rw-r--r--crypto/openssh/kex.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c
index a6c8174..8a83db4 100644
--- a/crypto/openssh/kex.c
+++ b/crypto/openssh/kex.c
@@ -9,11 +9,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Markus Friedl.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -28,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$Id: kex.c,v 1.7 2000/05/25 20:45:20 markus Exp $");
+RCSID("$OpenBSD: kex.c,v 1.10 2000/09/07 20:27:51 deraadt Exp $");
#include "ssh.h"
#include "ssh2.h"
@@ -287,13 +282,14 @@ char *
get_match(char *client, char *server)
{
char *sproposals[MAX_PROP];
- char *c, *s, *p, *ret;
+ char *c, *s, *p, *ret, *cp, *sp;
int i, j, nproposals;
- c = xstrdup(client);
- s = xstrdup(server);
+ c = cp = xstrdup(client);
+ s = sp = xstrdup(server);
- for ((p = strtok(s, SEP)), i=0; p; (p = strtok(NULL, SEP)), i++) {
+ for ((p = strsep(&sp, SEP)), i=0; p && *p != '\0';
+ (p = strsep(&sp, SEP)), i++) {
if (i < MAX_PROP)
sproposals[i] = p;
else
@@ -301,7 +297,8 @@ get_match(char *client, char *server)
}
nproposals = i;
- for ((p = strtok(c, SEP)), i=0; p; (p = strtok(NULL, SEP)), i++) {
+ for ((p = strsep(&cp, SEP)), i=0; p && *p != '\0';
+ (p = strsep(&cp, SEP)), i++) {
for (j = 0; j < nproposals; j++) {
if (strcmp(p, sproposals[j]) == 0) {
ret = xstrdup(p);
OpenPOWER on IntegriCloud