From 7203d6bb967907375fb3b9a5763b4d1aaba94c30 Mon Sep 17 00:00:00 2001 From: mouring Date: Fri, 21 Jun 2002 00:41:51 +0000 Subject: [PATCH] - deraadt@cvs.openbsd.org 2002/06/19 00:27:55 [auth-bsdauth.c auth-skey.c auth1.c auth2-chall.c auth2-none.c authfd.c authfd.h monitor_wrap.c msg.c nchan.c radix.c readconf.c scp.c sftp.1 ssh-add.1 ssh-add.c ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh-keygen.c ssh-keysign.c ssh.1 sshconnect.c sshconnect.h sshconnect2.c ttymodes.c xmalloc.h] KNF done automatically while reading.... --- ChangeLog | 7 +++++++ auth-bsdauth.c | 8 ++++---- auth-skey.c | 6 +++--- auth1.c | 4 ++-- auth2-chall.c | 4 ++-- auth2-none.c | 5 ++--- authfd.c | 4 ++-- authfd.h | 22 +++++++++++----------- monitor_wrap.c | 10 +++++----- msg.c | 4 ++-- nchan.c | 4 ++-- radix.c | 4 ++-- readconf.c | 4 ++-- scp.c | 4 ++-- sftp.1 | 10 +++++----- ssh-add.1 | 4 ++-- ssh-add.c | 4 ++-- ssh-agent.1 | 4 ++-- ssh-agent.c | 6 ++---- ssh-keygen.1 | 4 ++-- ssh-keygen.c | 4 ++-- ssh-keysign.c | 16 ++++++++-------- ssh.1 | 4 ++-- sshconnect.c | 4 ++-- sshconnect.h | 24 ++++++++++++------------ sshconnect2.c | 16 ++++++++-------- ttymodes.c | 4 +--- xmalloc.h | 4 ++-- 28 files changed, 100 insertions(+), 98 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1582aa8a..d2963665 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,13 @@ - deraadt@cvs.openbsd.org 2002/06/17 06:05:56 [scp.c] make usage like man page + - deraadt@cvs.openbsd.org 2002/06/19 00:27:55 + [auth-bsdauth.c auth-skey.c auth1.c auth2-chall.c auth2-none.c authfd.c + authfd.h monitor_wrap.c msg.c nchan.c radix.c readconf.c scp.c sftp.1 + ssh-add.1 ssh-add.c ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh-keygen.c + ssh-keysign.c ssh.1 sshconnect.c sshconnect.h sshconnect2.c ttymodes.c + xmalloc.h] + KNF done automatically while reading.... - (bal) Cygwin special handling of empty passwords wrong. Patch by vinschen@redhat.com diff --git a/auth-bsdauth.c b/auth-bsdauth.c index fa06732c..4f1b452b 100644 --- a/auth-bsdauth.c +++ b/auth-bsdauth.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-bsdauth.c,v 1.3 2002/03/18 17:50:31 provos Exp $"); +RCSID("$OpenBSD: auth-bsdauth.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $"); #ifdef BSD_AUTH #include "xmalloc.h" @@ -57,7 +57,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt, debug3("bsdauth_query: style %s", authctxt->style ? authctxt->style : ""); authctxt->as = auth_userchallenge(authctxt->user, - authctxt->style, "auth-ssh", &challenge); + authctxt->style, "auth-ssh", &challenge); if (authctxt->as == NULL) challenge = NULL; debug2("bsdauth_query: <%s>", challenge ? challenge : "empty"); @@ -66,8 +66,8 @@ bsdauth_query(void *ctx, char **name, char **infotxt, if (challenge == NULL) return -1; - *name = xstrdup(""); - *infotxt = xstrdup(""); + *name = xstrdup(""); + *infotxt = xstrdup(""); *numprompts = 1; *prompts = xmalloc(*numprompts * sizeof(char*)); *echo_on = xmalloc(*numprompts * sizeof(u_int)); diff --git a/auth-skey.c b/auth-skey.c index b6455044..eb13c5cc 100644 --- a/auth-skey.c +++ b/auth-skey.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth-skey.c,v 1.18 2002/05/13 02:37:39 itojun Exp $"); +RCSID("$OpenBSD: auth-skey.c,v 1.19 2002/06/19 00:27:55 deraadt Exp $"); #ifdef SKEY @@ -50,8 +50,8 @@ skey_query(void *ctx, char **name, char **infotxt, if (skeychallenge(&skey, authctxt->user, challenge) == -1) return -1; - *name = xstrdup(""); - *infotxt = xstrdup(""); + *name = xstrdup(""); + *infotxt = xstrdup(""); *numprompts = 1; *prompts = xmalloc(*numprompts * sizeof(char*)); *echo_on = xmalloc(*numprompts * sizeof(u_int)); diff --git a/auth1.c b/auth1.c index 1f6fcb29..06b6712a 100644 --- a/auth1.c +++ b/auth1.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.40 2002/04/10 08:21:47 markus Exp $"); +RCSID("$OpenBSD: auth1.c,v 1.41 2002/06/19 00:27:55 deraadt Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -203,7 +203,7 @@ do_authloop(Authctxt *authctxt) if (bits != BN_num_bits(client_host_key->rsa->n)) verbose("Warning: keysize mismatch for client_host_key: " "actual %d, announced %d", - BN_num_bits(client_host_key->rsa->n), bits); + BN_num_bits(client_host_key->rsa->n), bits); packet_check_eom(); authenticated = auth_rhosts_rsa(pw, client_user, diff --git a/auth2-chall.c b/auth2-chall.c index 38f955a0..f35bfb2f 100644 --- a/auth2-chall.c +++ b/auth2-chall.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: auth2-chall.c,v 1.17 2002/03/18 17:50:31 provos Exp $"); +RCSID("$OpenBSD: auth2-chall.c,v 1.18 2002/06/19 00:27:55 deraadt Exp $"); #include "ssh2.h" #include "auth.h" @@ -219,7 +219,7 @@ send_userauth_info_request(Authctxt *authctxt) packet_start(SSH2_MSG_USERAUTH_INFO_REQUEST); packet_put_cstring(name); packet_put_cstring(instr); - packet_put_cstring(""); /* language not used */ + packet_put_cstring(""); /* language not used */ packet_put_int(numprompts); for (i = 0; i < numprompts; i++) { packet_put_cstring(prompts[i]); diff --git a/auth2-none.c b/auth2-none.c index 30337fd6..720d3c10 100644 --- a/auth2-none.c +++ b/auth2-none.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2-none.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); +RCSID("$OpenBSD: auth2-none.c,v 1.3 2002/06/19 00:27:55 deraadt Exp $"); #include "auth.h" #include "xmalloc.h" @@ -65,7 +65,7 @@ auth2_read_banner(void) return (NULL); } banner[n] = '\0'; - + return (banner); } @@ -88,7 +88,6 @@ userauth_banner(void) done: if (banner) xfree(banner); - return; } static int diff --git a/authfd.c b/authfd.c index c8a95275..a452a792 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.54 2002/06/15 01:27:48 markus Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.55 2002/06/19 00:27:55 deraadt Exp $"); #include @@ -59,7 +59,7 @@ int decode_reply(int type); /* macro to check for "agent failure" message */ #define agent_failed(x) \ ((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \ - (x == SSH2_AGENT_FAILURE)) + (x == SSH2_AGENT_FAILURE)) /* Returns the number of the authentication fd, or -1 if there is none. */ diff --git a/authfd.h b/authfd.h index d7344bf4..b2767e5c 100644 --- a/authfd.h +++ b/authfd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.h,v 1.29 2002/06/15 01:27:48 markus Exp $ */ +/* $OpenBSD: authfd.h,v 1.30 2002/06/19 00:27:55 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -40,11 +40,11 @@ /* smartcard */ #define SSH_AGENTC_ADD_SMARTCARD_KEY 20 -#define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 +#define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 /* lock/unlock the agent */ #define SSH_AGENTC_LOCK 22 -#define SSH_AGENTC_UNLOCK 23 +#define SSH_AGENTC_UNLOCK 23 /* add key with constraints */ #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24 @@ -56,21 +56,21 @@ #define SSH2_AGENT_FAILURE 30 /* additional error code for ssh.com's ssh-agent2 */ -#define SSH_COM_AGENT2_FAILURE 102 +#define SSH_COM_AGENT2_FAILURE 102 #define SSH_AGENT_OLD_SIGNATURE 0x01 typedef struct { - int fd; - Buffer identities; - int howmany; -} AuthenticationConnection; + int fd; + Buffer identities; + int howmany; +} AuthenticationConnection; -int ssh_get_authentication_socket(void); -void ssh_close_authentication_socket(int); +int ssh_get_authentication_socket(void); +void ssh_close_authentication_socket(int); AuthenticationConnection *ssh_get_authentication_connection(void); -void ssh_close_authentication_connection(AuthenticationConnection *); +void ssh_close_authentication_connection(AuthenticationConnection *); int ssh_get_num_identities(AuthenticationConnection *, int); Key *ssh_get_first_identity(AuthenticationConnection *, char **, int); Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); diff --git a/monitor_wrap.c b/monitor_wrap.c index 65998a1e..e4087462 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_wrap.c,v 1.9 2002/06/14 21:35:00 todd Exp $"); +RCSID("$OpenBSD: monitor_wrap.c,v 1.10 2002/06/19 00:27:55 deraadt Exp $"); #include #include @@ -68,7 +68,7 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) debug3("%s entering: type %d", __func__, type); PUT_32BIT(buf, mlen + 1); - buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ + buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf)) fatal("%s: write", __func__); if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen) @@ -221,7 +221,7 @@ char* mm_auth2_read_banner(void) mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m); banner = buffer_get_string(&m, NULL); buffer_free(&m); - + return (banner); } @@ -694,8 +694,8 @@ static void mm_chall_setup(char **name, char **infotxt, u_int *numprompts, char ***prompts, u_int **echo_on) { - *name = xstrdup(""); - *infotxt = xstrdup(""); + *name = xstrdup(""); + *infotxt = xstrdup(""); *numprompts = 1; *prompts = xmalloc(*numprompts * sizeof(char*)); *echo_on = xmalloc(*numprompts * sizeof(u_int)); diff --git a/msg.c b/msg.c index a159aae8..103aed2c 100644 --- a/msg.c +++ b/msg.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: msg.c,v 1.1 2002/05/23 19:24:30 markus Exp $"); +RCSID("$OpenBSD: msg.c,v 1.2 2002/06/19 00:27:55 deraadt Exp $"); #include "buffer.h" #include "getput.h" @@ -39,7 +39,7 @@ msg_send(int fd, u_char type, Buffer *m) debug3("msg_send: type %d", type); PUT_32BIT(buf, mlen + 1); - buf[4] = type; /* 1st byte of payload is mesg-type */ + buf[4] = type; /* 1st byte of payload is mesg-type */ if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf)) fatal("msg_send: write"); if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) diff --git a/nchan.c b/nchan.c index c4f55e65..bce7325b 100644 --- a/nchan.c +++ b/nchan.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: nchan.c,v 1.46 2002/06/09 13:32:01 markus Exp $"); +RCSID("$OpenBSD: nchan.c,v 1.47 2002/06/19 00:27:55 deraadt Exp $"); #include "ssh1.h" #include "ssh2.h" @@ -367,7 +367,7 @@ chan_rcvd_ieof(Channel *c) else chan_rcvd_ieof1(c); if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN && - buffer_len(&c->output) == 0 && + buffer_len(&c->output) == 0 && !CHANNEL_EFD_OUTPUT_ACTIVE(c)) chan_obuf_empty(c); } diff --git a/radix.c b/radix.c index 019d7a3f..580e7e07 100644 --- a/radix.c +++ b/radix.c @@ -26,7 +26,7 @@ #include "includes.h" #include "uuencode.h" -RCSID("$OpenBSD: radix.c,v 1.20 2002/04/23 12:58:26 markus Exp $"); +RCSID("$OpenBSD: radix.c,v 1.21 2002/06/19 00:27:55 deraadt Exp $"); #ifdef AFS #include @@ -148,7 +148,7 @@ radix_to_creds(const char *buf, CREDENTIALS *creds) goto done; memcpy(&creds->ticket_st.dat, p, len); creds->ticket_st.length = len; - + ret = 1; done: buffer_free(&b); diff --git a/readconf.c b/readconf.c index 9defef1d..80d99fef 100644 --- a/readconf.c +++ b/readconf.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.99 2002/06/10 17:45:20 stevesk Exp $"); +RCSID("$OpenBSD: readconf.c,v 1.100 2002/06/19 00:27:55 deraadt Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -92,7 +92,7 @@ RCSID("$OpenBSD: readconf.c,v 1.99 2002/06/10 17:45:20 stevesk Exp $"); typedef enum { oBadOption, oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication, - oPasswordAuthentication, oRSAAuthentication, + oPasswordAuthentication, oRSAAuthentication, oChallengeResponseAuthentication, oXAuthLocation, #if defined(KRB4) || defined(KRB5) oKerberosAuthentication, diff --git a/scp.c b/scp.c index 2019376e..921ffeed 100644 --- a/scp.c +++ b/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.90 2002/06/17 06:05:56 deraadt Exp $"); +RCSID("$OpenBSD: scp.c,v 1.91 2002/06/19 00:27:55 deraadt Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -227,7 +227,7 @@ main(argc, argv) __progname = get_progname(argv[0]); args.list = NULL; - addargs(&args, "ssh"); /* overwritten with ssh_program */ + addargs(&args, "ssh"); /* overwritten with ssh_program */ addargs(&args, "-x"); addargs(&args, "-oForwardAgent no"); addargs(&args, "-oClearAllForwardings yes"); diff --git a/sftp.1 b/sftp.1 index 2faaff13..0f2212cb 100644 --- a/sftp.1 +++ b/sftp.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sftp.1,v 1.33 2002/02/26 19:06:43 deraadt Exp $ +.\" $OpenBSD: sftp.1,v 1.34 2002/06/19 00:27:55 deraadt Exp $ .\" .\" Copyright (c) 2001 Damien Miller. All rights reserved. .\" @@ -100,7 +100,7 @@ does not have an sftp subsystem configured. .It Fl v Raise logging level. This option is also passed to ssh. .It Fl B Ar buffer_size -Specify the size of the buffer that +Specify the size of the buffer that .Nm uses when transferring files. Larger buffers require fewer round trips at the cost of higher memory consumption. The default is 32768 bytes. @@ -115,13 +115,13 @@ per-user configuration file for This option is directly passed to .Xr ssh 1 . .It Fl P Ar sftp_server path -Connect directly to a local -.Nm sftp-server +Connect directly to a local +.Nm sftp-server (rather than via .Nm ssh ) This option may be useful in debugging the client and server. .It Fl R Ar num_requests -Specify how many requests may be outstanding at any one time. Increasing +Specify how many requests may be outstanding at any one time. Increasing this may slightly improve file transfer speed but will increase memory usage. The default is 16 outstanding requests. .It Fl S Ar program diff --git a/ssh-add.1 b/ssh-add.1 index bbf34203..2a34a513 100644 --- a/ssh-add.1 +++ b/ssh-add.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-add.1,v 1.34 2002/06/10 17:36:22 stevesk Exp $ +.\" $OpenBSD: ssh-add.1,v 1.35 2002/06/19 00:27:55 deraadt Exp $ .\" .\" -*- nroff -*- .\" @@ -58,7 +58,7 @@ adds RSA or DSA identities to the authentication agent, .Xr ssh-agent 1 . When run without arguments, it adds the files .Pa $HOME/.ssh/id_rsa , -.Pa $HOME/.ssh/id_dsa +.Pa $HOME/.ssh/id_dsa and .Pa $HOME/.ssh/identity . Alternative file names can be given on the command line. diff --git a/ssh-add.c b/ssh-add.c index 2085367b..176fd85c 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.60 2002/06/15 01:27:48 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.61 2002/06/19 00:27:55 deraadt Exp $"); #include @@ -244,7 +244,7 @@ lock_agent(AuthenticationConnection *ac, int lock) { char prompt[100], *p1, *p2; int passok = 1, ret = -1; - + strlcpy(prompt, "Enter lock password: ", sizeof(prompt)); p1 = read_passphrase(prompt, RP_ALLOW_STDIN); if (lock) { diff --git a/ssh-agent.1 b/ssh-agent.1 index 5f498b7e..e5ea1e32 100644 --- a/ssh-agent.1 +++ b/ssh-agent.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.32 2002/06/05 16:08:07 markus Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.33 2002/06/19 00:27:55 deraadt Exp $ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -102,7 +102,7 @@ When executed without arguments, .Xr ssh-add 1 adds the files .Pa $HOME/.ssh/id_rsa , -.Pa $HOME/.ssh/id_dsa +.Pa $HOME/.ssh/id_dsa and .Pa $HOME/.ssh/identity . If the identity has a passphrase, diff --git a/ssh-agent.c b/ssh-agent.c index 536db2de..c3a90779 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -35,7 +35,7 @@ #include "includes.h" #include "openbsd-compat/fake-queue.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.94 2002/06/15 01:27:48 markus Exp $"); +RCSID("$OpenBSD: ssh-agent.c,v 1.95 2002/06/19 00:27:55 deraadt Exp $"); #include #include @@ -365,7 +365,6 @@ process_remove_all_identities(SocketEntry *e, int version) /* Send success. */ buffer_put_int(&e->output, 1); buffer_put_char(&e->output, SSH_AGENT_SUCCESS); - return; } static void @@ -499,11 +498,10 @@ process_lock_agent(SocketEntry *e, int lock) } memset(passwd, 0, strlen(passwd)); xfree(passwd); - + buffer_put_int(&e->output, 1); buffer_put_char(&e->output, success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE); - return; } static void diff --git a/ssh-keygen.1 b/ssh-keygen.1 index 6ad94e6e..35b0bb91 100644 --- a/ssh-keygen.1 +++ b/ssh-keygen.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-keygen.1,v 1.53 2002/02/16 14:53:37 stevesk Exp $ +.\" $OpenBSD: ssh-keygen.1,v 1.54 2002/06/19 00:27:55 deraadt Exp $ .\" .\" -*- nroff -*- .\" @@ -86,7 +86,7 @@ generates, manages and converts authentication keys for .Xr ssh 1 . .Nm -can create RSA keys for use by SSH protocol version 1 and RSA or DSA +can create RSA keys for use by SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. The type of key to be generated is specified with the .Fl t diff --git a/ssh-keygen.c b/ssh-keygen.c index d83ccecc..df8c90af 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.99 2002/06/09 13:32:01 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.100 2002/06/19 00:27:55 deraadt Exp $"); #include #include @@ -140,7 +140,7 @@ load_identity(char *filename) } #define SSH_COM_PUBLIC_BEGIN "---- BEGIN SSH2 PUBLIC KEY ----" -#define SSH_COM_PUBLIC_END "---- END SSH2 PUBLIC KEY ----" +#define SSH_COM_PUBLIC_END "---- END SSH2 PUBLIC KEY ----" #define SSH_COM_PRIVATE_BEGIN "---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----" #define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb diff --git a/ssh-keysign.c b/ssh-keysign.c index 52092782..7f1d25d8 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: ssh-keysign.c,v 1.3 2002/06/08 05:07:09 markus Exp $"); +RCSID("$OpenBSD: ssh-keysign.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $"); #include @@ -59,7 +59,7 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, buffer_init(&b); buffer_append(&b, data, datalen); - + /* session id, currently limited to SHA1 (20 bytes) */ p = buffer_get_string(&b, &len); if (len != 20) @@ -104,9 +104,9 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, if (strlen(host) != len - 1) fail++; else if (p[len - 1] != '.') - fail++; + fail++; else if (strncasecmp(host, p, len - 1) != 0) - fail++; + fail++; xfree(p); /* local user */ @@ -153,14 +153,14 @@ main(int argc, char **argv) #ifdef DEBUG_SSH_KEYSIGN log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); -#endif +#endif if (key_fd[0] == -1 && key_fd[1] == -1) fatal("could not open any host key"); if ((pw = getpwuid(getuid())) == NULL) fatal("getpwuid failed"); - pw = pwcopy(pw); + pw = pwcopy(pw); SSLeay_add_all_algorithms(); @@ -188,7 +188,7 @@ main(int argc, char **argv) fatal("bad fd"); if ((host = get_local_name(fd)) == NULL) fatal("cannot get sockname for fd"); - + data = buffer_get_string(&b, &dlen); if (valid_request(pw, host, &key, data, dlen) < 0) fatal("not a valid request"); @@ -208,7 +208,7 @@ main(int argc, char **argv) if (key_sign(keys[i], &signature, &slen, data, dlen) != 0) fatal("key_sign failed"); - + /* send reply */ buffer_clear(&b); buffer_put_string(&b, signature, slen); diff --git a/ssh.1 b/ssh.1 index 0f68e7e6..4bd0f074 100644 --- a/ssh.1 +++ b/ssh.1 @@ -34,7 +34,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: ssh.1,v 1.156 2002/06/10 17:45:20 stevesk Exp $ +.\" $OpenBSD: ssh.1,v 1.157 2002/06/19 00:27:55 deraadt Exp $ .Dd September 25, 1999 .Dt SSH 1 .Os @@ -1377,7 +1377,7 @@ and .Cm HostbasedAuthentication . If the protocol version 1 .Cm RhostsRSAAuthentication -method is used, +method is used, .Nm must be setuid root, since the host key is readable only by root. For protocol version 2, diff --git a/sshconnect.c b/sshconnect.c index 3a93a4fb..9b4c3883 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.124 2002/06/11 04:14:26 markus Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.125 2002/06/19 00:27:55 deraadt Exp $"); #include @@ -771,7 +771,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key, len = strlen(msg); snprintf(msg + len, sizeof(msg) - len, "\nMatching host key in %s:%d", - host_file, host_line); + host_file, host_line); } if (options.strict_host_key_checking == 1) { log(msg); diff --git a/sshconnect.h b/sshconnect.h index 48148833..0be30fe6 100644 --- a/sshconnect.h +++ b/sshconnect.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.h,v 1.16 2002/06/11 04:14:26 markus Exp $ */ +/* $OpenBSD: sshconnect.h,v 1.17 2002/06/19 00:27:55 deraadt Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -28,9 +28,9 @@ typedef struct Sensitive Sensitive; struct Sensitive { - Key **keys; - int nkeys; - int external_keysign; + Key **keys; + int nkeys; + int external_keysign; }; int @@ -54,16 +54,16 @@ void ssh_put_password(char *); /* * Macros to raise/lower permissions. */ -#define PRIV_START do { \ - int save_errno = errno; \ - (void)seteuid(original_effective_uid); \ - errno = save_errno; \ +#define PRIV_START do { \ + int save_errno = errno; \ + (void)seteuid(original_effective_uid); \ + errno = save_errno; \ } while (0) -#define PRIV_END do { \ - int save_errno = errno; \ - (void)seteuid(original_real_uid); \ - errno = save_errno; \ +#define PRIV_END do { \ + int save_errno = errno; \ + (void)seteuid(original_real_uid); \ + errno = save_errno; \ } while (0) #endif diff --git a/sshconnect2.c b/sshconnect2.c index 6950c5ee..7f28ab51 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.103 2002/05/31 10:30:33 markus Exp $"); +RCSID("$OpenBSD: sshconnect2.c,v 1.104 2002/06/19 00:27:55 deraadt Exp $"); #include "ssh.h" #include "ssh2.h" @@ -395,7 +395,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt) if (key->type != pktype) { error("input_userauth_pk_ok: type mismatch " "for decoded key (received %d, expected %d)", - key->type, pktype); + key->type, pktype); break; } fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); @@ -463,7 +463,7 @@ userauth_passwd(Authctxt *authctxt) packet_add_padding(64); packet_send(); - dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, + dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, &input_userauth_passwd_changereq); return 1; @@ -495,7 +495,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt) packet_put_cstring(authctxt->service); packet_put_cstring(authctxt->method->name); packet_put_char(1); /* additional info */ - snprintf(prompt, sizeof(prompt), + snprintf(prompt, sizeof(prompt), "Enter %.30s@%.128s's old password: ", authctxt->server_user, authctxt->host); password = read_passphrase(prompt, 0); @@ -504,7 +504,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt) xfree(password); password = NULL; while (password == NULL) { - snprintf(prompt, sizeof(prompt), + snprintf(prompt, sizeof(prompt), "Enter %.30s@%.128s's new password: ", authctxt->server_user, authctxt->host); password = read_passphrase(prompt, RP_ALLOW_EOF); @@ -512,7 +512,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt) /* bail out */ return; } - snprintf(prompt, sizeof(prompt), + snprintf(prompt, sizeof(prompt), "Retype %.30s@%.128s's new password: ", authctxt->server_user, authctxt->host); retype = read_passphrase(prompt, 0); @@ -530,8 +530,8 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt) xfree(password); packet_add_padding(64); packet_send(); - - dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, + + dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, &input_userauth_passwd_changereq); } diff --git a/ttymodes.c b/ttymodes.c index 8afdff1a..5cc13dcd 100644 --- a/ttymodes.c +++ b/ttymodes.c @@ -43,7 +43,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ttymodes.c,v 1.17 2002/03/19 10:49:35 markus Exp $"); +RCSID("$OpenBSD: ttymodes.c,v 1.18 2002/06/19 00:27:55 deraadt Exp $"); #include "packet.h" #include "log.h" @@ -307,7 +307,6 @@ end: else packet_put_raw(buffer_ptr(&buf), buffer_len(&buf)); buffer_free(&buf); - return; } /* @@ -457,5 +456,4 @@ set: /* Set the new modes for the terminal. */ if (tcsetattr(fd, TCSANOW, &tio) == -1) log("Setting tty modes failed: %.100s", strerror(errno)); - return; } diff --git a/xmalloc.h b/xmalloc.h index 338a2d22..7ac4b13d 100644 --- a/xmalloc.h +++ b/xmalloc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xmalloc.h,v 1.8 2002/03/04 17:27:39 stevesk Exp $ */ +/* $OpenBSD: xmalloc.h,v 1.9 2002/06/19 00:27:55 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -22,6 +22,6 @@ void *xmalloc(size_t); void *xrealloc(void *, size_t); void xfree(void *); -char *xstrdup(const char *); +char *xstrdup(const char *); #endif /* XMALLOC_H */ -- 2.45.1