[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....
This commit is contained in:
Ben Lindstrom 2002-06-21 00:41:51 +00:00
parent 115422f918
commit cb72e4f6d2
28 changed files with 101 additions and 99 deletions

View File

@ -23,6 +23,13 @@
- deraadt@cvs.openbsd.org 2002/06/17 06:05:56 - deraadt@cvs.openbsd.org 2002/06/17 06:05:56
[scp.c] [scp.c]
make usage like man page 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 - (bal) Cygwin special handling of empty passwords wrong. Patch by
vinschen@redhat.com vinschen@redhat.com
@ -953,4 +960,4 @@
- (stevesk) entropy.c: typo in debug message - (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@ - (djm) ssh-keygen -i needs seeded RNG; report from markus@
$Id: ChangeLog,v 1.2224 2002/06/21 00:26:22 mouring Exp $ $Id: ChangeLog,v 1.2225 2002/06/21 00:41:51 mouring Exp $

View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #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 #ifdef BSD_AUTH
#include "xmalloc.h" #include "xmalloc.h"
@ -57,7 +57,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
debug3("bsdauth_query: style %s", debug3("bsdauth_query: style %s",
authctxt->style ? authctxt->style : "<default>"); authctxt->style ? authctxt->style : "<default>");
authctxt->as = auth_userchallenge(authctxt->user, authctxt->as = auth_userchallenge(authctxt->user,
authctxt->style, "auth-ssh", &challenge); authctxt->style, "auth-ssh", &challenge);
if (authctxt->as == NULL) if (authctxt->as == NULL)
challenge = NULL; challenge = NULL;
debug2("bsdauth_query: <%s>", challenge ? challenge : "empty"); debug2("bsdauth_query: <%s>", challenge ? challenge : "empty");
@ -66,8 +66,8 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
if (challenge == NULL) if (challenge == NULL)
return -1; return -1;
*name = xstrdup(""); *name = xstrdup("");
*infotxt = xstrdup(""); *infotxt = xstrdup("");
*numprompts = 1; *numprompts = 1;
*prompts = xmalloc(*numprompts * sizeof(char*)); *prompts = xmalloc(*numprompts * sizeof(char*));
*echo_on = xmalloc(*numprompts * sizeof(u_int)); *echo_on = xmalloc(*numprompts * sizeof(u_int));

View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #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 #ifdef SKEY
@ -50,8 +50,8 @@ skey_query(void *ctx, char **name, char **infotxt,
if (skeychallenge(&skey, authctxt->user, challenge) == -1) if (skeychallenge(&skey, authctxt->user, challenge) == -1)
return -1; return -1;
*name = xstrdup(""); *name = xstrdup("");
*infotxt = xstrdup(""); *infotxt = xstrdup("");
*numprompts = 1; *numprompts = 1;
*prompts = xmalloc(*numprompts * sizeof(char*)); *prompts = xmalloc(*numprompts * sizeof(char*));
*echo_on = xmalloc(*numprompts * sizeof(u_int)); *echo_on = xmalloc(*numprompts * sizeof(u_int));

View File

@ -10,7 +10,7 @@
*/ */
#include "includes.h" #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 "xmalloc.h"
#include "rsa.h" #include "rsa.h"
@ -203,7 +203,7 @@ do_authloop(Authctxt *authctxt)
if (bits != BN_num_bits(client_host_key->rsa->n)) if (bits != BN_num_bits(client_host_key->rsa->n))
verbose("Warning: keysize mismatch for client_host_key: " verbose("Warning: keysize mismatch for client_host_key: "
"actual %d, announced %d", "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(); packet_check_eom();
authenticated = auth_rhosts_rsa(pw, client_user, authenticated = auth_rhosts_rsa(pw, client_user,

View File

@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #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 "ssh2.h"
#include "auth.h" #include "auth.h"
@ -219,7 +219,7 @@ send_userauth_info_request(Authctxt *authctxt)
packet_start(SSH2_MSG_USERAUTH_INFO_REQUEST); packet_start(SSH2_MSG_USERAUTH_INFO_REQUEST);
packet_put_cstring(name); packet_put_cstring(name);
packet_put_cstring(instr); packet_put_cstring(instr);
packet_put_cstring(""); /* language not used */ packet_put_cstring(""); /* language not used */
packet_put_int(numprompts); packet_put_int(numprompts);
for (i = 0; i < numprompts; i++) { for (i = 0; i < numprompts; i++) {
packet_put_cstring(prompts[i]); packet_put_cstring(prompts[i]);

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #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 "auth.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -65,7 +65,7 @@ auth2_read_banner(void)
return (NULL); return (NULL);
} }
banner[n] = '\0'; banner[n] = '\0';
return (banner); return (banner);
} }
@ -88,7 +88,6 @@ userauth_banner(void)
done: done:
if (banner) if (banner)
xfree(banner); xfree(banner);
return;
} }
static int static int

View File

@ -35,7 +35,7 @@
*/ */
#include "includes.h" #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 <openssl/evp.h> #include <openssl/evp.h>
@ -59,7 +59,7 @@ int decode_reply(int type);
/* macro to check for "agent failure" message */ /* macro to check for "agent failure" message */
#define agent_failed(x) \ #define agent_failed(x) \
((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \ ((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. */ /* Returns the number of the authentication fd, or -1 if there is none. */

View File

@ -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 <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
@ -40,11 +40,11 @@
/* smartcard */ /* smartcard */
#define SSH_AGENTC_ADD_SMARTCARD_KEY 20 #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 */ /* lock/unlock the agent */
#define SSH_AGENTC_LOCK 22 #define SSH_AGENTC_LOCK 22
#define SSH_AGENTC_UNLOCK 23 #define SSH_AGENTC_UNLOCK 23
/* add key with constraints */ /* add key with constraints */
#define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24 #define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24
@ -56,21 +56,21 @@
#define SSH2_AGENT_FAILURE 30 #define SSH2_AGENT_FAILURE 30
/* additional error code for ssh.com's ssh-agent2 */ /* 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 #define SSH_AGENT_OLD_SIGNATURE 0x01
typedef struct { typedef struct {
int fd; int fd;
Buffer identities; Buffer identities;
int howmany; int howmany;
} AuthenticationConnection; } AuthenticationConnection;
int ssh_get_authentication_socket(void); int ssh_get_authentication_socket(void);
void ssh_close_authentication_socket(int); void ssh_close_authentication_socket(int);
AuthenticationConnection *ssh_get_authentication_connection(void); 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); int ssh_get_num_identities(AuthenticationConnection *, int);
Key *ssh_get_first_identity(AuthenticationConnection *, char **, int); Key *ssh_get_first_identity(AuthenticationConnection *, char **, int);
Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); Key *ssh_get_next_identity(AuthenticationConnection *, char **, int);

View File

@ -25,7 +25,7 @@
*/ */
#include "includes.h" #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 <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/dh.h> #include <openssl/dh.h>
@ -68,7 +68,7 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m)
debug3("%s entering: type %d", __func__, type); debug3("%s entering: type %d", __func__, type);
PUT_32BIT(buf, mlen + 1); 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)) if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf))
fatal("%s: write", __func__); fatal("%s: write", __func__);
if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen) 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); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m);
banner = buffer_get_string(&m, NULL); banner = buffer_get_string(&m, NULL);
buffer_free(&m); buffer_free(&m);
return (banner); return (banner);
} }
@ -694,8 +694,8 @@ static void
mm_chall_setup(char **name, char **infotxt, u_int *numprompts, mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
char ***prompts, u_int **echo_on) char ***prompts, u_int **echo_on)
{ {
*name = xstrdup(""); *name = xstrdup("");
*infotxt = xstrdup(""); *infotxt = xstrdup("");
*numprompts = 1; *numprompts = 1;
*prompts = xmalloc(*numprompts * sizeof(char*)); *prompts = xmalloc(*numprompts * sizeof(char*));
*echo_on = xmalloc(*numprompts * sizeof(u_int)); *echo_on = xmalloc(*numprompts * sizeof(u_int));

4
msg.c
View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #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 "buffer.h"
#include "getput.h" #include "getput.h"
@ -39,7 +39,7 @@ msg_send(int fd, u_char type, Buffer *m)
debug3("msg_send: type %d", type); debug3("msg_send: type %d", type);
PUT_32BIT(buf, mlen + 1); 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)) if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf))
fatal("msg_send: write"); fatal("msg_send: write");
if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen)

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #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 "ssh1.h"
#include "ssh2.h" #include "ssh2.h"
@ -367,7 +367,7 @@ chan_rcvd_ieof(Channel *c)
else else
chan_rcvd_ieof1(c); chan_rcvd_ieof1(c);
if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN && if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN &&
buffer_len(&c->output) == 0 && buffer_len(&c->output) == 0 &&
!CHANNEL_EFD_OUTPUT_ACTIVE(c)) !CHANNEL_EFD_OUTPUT_ACTIVE(c))
chan_obuf_empty(c); chan_obuf_empty(c);
} }

View File

@ -26,7 +26,7 @@
#include "includes.h" #include "includes.h"
#include "uuencode.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 #ifdef AFS
#include <krb.h> #include <krb.h>
@ -148,7 +148,7 @@ radix_to_creds(const char *buf, CREDENTIALS *creds)
goto done; goto done;
memcpy(&creds->ticket_st.dat, p, len); memcpy(&creds->ticket_st.dat, p, len);
creds->ticket_st.length = len; creds->ticket_st.length = len;
ret = 1; ret = 1;
done: done:
buffer_free(&b); buffer_free(&b);

View File

@ -12,7 +12,7 @@
*/ */
#include "includes.h" #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 "ssh.h"
#include "xmalloc.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 { typedef enum {
oBadOption, oBadOption,
oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication, oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication,
oPasswordAuthentication, oRSAAuthentication, oPasswordAuthentication, oRSAAuthentication,
oChallengeResponseAuthentication, oXAuthLocation, oChallengeResponseAuthentication, oXAuthLocation,
#if defined(KRB4) || defined(KRB5) #if defined(KRB4) || defined(KRB5)
oKerberosAuthentication, oKerberosAuthentication,

4
scp.c
View File

@ -75,7 +75,7 @@
*/ */
#include "includes.h" #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 "xmalloc.h"
#include "atomicio.h" #include "atomicio.h"
@ -227,7 +227,7 @@ main(argc, argv)
__progname = get_progname(argv[0]); __progname = get_progname(argv[0]);
args.list = NULL; args.list = NULL;
addargs(&args, "ssh"); /* overwritten with ssh_program */ addargs(&args, "ssh"); /* overwritten with ssh_program */
addargs(&args, "-x"); addargs(&args, "-x");
addargs(&args, "-oForwardAgent no"); addargs(&args, "-oForwardAgent no");
addargs(&args, "-oClearAllForwardings yes"); addargs(&args, "-oClearAllForwardings yes");

10
sftp.1
View File

@ -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. .\" Copyright (c) 2001 Damien Miller. All rights reserved.
.\" .\"
@ -100,7 +100,7 @@ does not have an sftp subsystem configured.
.It Fl v .It Fl v
Raise logging level. This option is also passed to ssh. Raise logging level. This option is also passed to ssh.
.It Fl B Ar buffer_size .It Fl B Ar buffer_size
Specify the size of the buffer that Specify the size of the buffer that
.Nm .Nm
uses when transferring files. Larger buffers require fewer round trips at uses when transferring files. Larger buffers require fewer round trips at
the cost of higher memory consumption. The default is 32768 bytes. 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 This option is directly passed to
.Xr ssh 1 . .Xr ssh 1 .
.It Fl P Ar sftp_server path .It Fl P Ar sftp_server path
Connect directly to a local Connect directly to a local
.Nm sftp-server .Nm sftp-server
(rather than via (rather than via
.Nm ssh ) .Nm ssh )
This option may be useful in debugging the client and server. This option may be useful in debugging the client and server.
.It Fl R Ar num_requests .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 this may slightly improve file transfer speed but will increase memory
usage. The default is 16 outstanding requests. usage. The default is 16 outstanding requests.
.It Fl S Ar program .It Fl S Ar program

View File

@ -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 -*- .\" -*- nroff -*-
.\" .\"
@ -58,7 +58,7 @@ adds RSA or DSA identities to the authentication agent,
.Xr ssh-agent 1 . .Xr ssh-agent 1 .
When run without arguments, it adds the files When run without arguments, it adds the files
.Pa $HOME/.ssh/id_rsa , .Pa $HOME/.ssh/id_rsa ,
.Pa $HOME/.ssh/id_dsa .Pa $HOME/.ssh/id_dsa
and and
.Pa $HOME/.ssh/identity . .Pa $HOME/.ssh/identity .
Alternative file names can be given on the command line. Alternative file names can be given on the command line.

View File

@ -35,7 +35,7 @@
*/ */
#include "includes.h" #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 <openssl/evp.h> #include <openssl/evp.h>
@ -244,7 +244,7 @@ lock_agent(AuthenticationConnection *ac, int lock)
{ {
char prompt[100], *p1, *p2; char prompt[100], *p1, *p2;
int passok = 1, ret = -1; int passok = 1, ret = -1;
strlcpy(prompt, "Enter lock password: ", sizeof(prompt)); strlcpy(prompt, "Enter lock password: ", sizeof(prompt));
p1 = read_passphrase(prompt, RP_ALLOW_STDIN); p1 = read_passphrase(prompt, RP_ALLOW_STDIN);
if (lock) { if (lock) {

View File

@ -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 <ylo@cs.hut.fi> .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -102,7 +102,7 @@ When executed without arguments,
.Xr ssh-add 1 .Xr ssh-add 1
adds the files adds the files
.Pa $HOME/.ssh/id_rsa , .Pa $HOME/.ssh/id_rsa ,
.Pa $HOME/.ssh/id_dsa .Pa $HOME/.ssh/id_dsa
and and
.Pa $HOME/.ssh/identity . .Pa $HOME/.ssh/identity .
If the identity has a passphrase, If the identity has a passphrase,

View File

@ -35,7 +35,7 @@
#include "includes.h" #include "includes.h"
#include "openbsd-compat/fake-queue.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 <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/md5.h> #include <openssl/md5.h>
@ -365,7 +365,6 @@ process_remove_all_identities(SocketEntry *e, int version)
/* Send success. */ /* Send success. */
buffer_put_int(&e->output, 1); buffer_put_int(&e->output, 1);
buffer_put_char(&e->output, SSH_AGENT_SUCCESS); buffer_put_char(&e->output, SSH_AGENT_SUCCESS);
return;
} }
static void static void
@ -499,11 +498,10 @@ process_lock_agent(SocketEntry *e, int lock)
} }
memset(passwd, 0, strlen(passwd)); memset(passwd, 0, strlen(passwd));
xfree(passwd); xfree(passwd);
buffer_put_int(&e->output, 1); buffer_put_int(&e->output, 1);
buffer_put_char(&e->output, buffer_put_char(&e->output,
success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE); success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE);
return;
} }
static void static void

View File

@ -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 -*- .\" -*- nroff -*-
.\" .\"
@ -86,7 +86,7 @@
generates, manages and converts authentication keys for generates, manages and converts authentication keys for
.Xr ssh 1 . .Xr ssh 1 .
.Nm .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 keys for use by SSH protocol version 2. The type of key to be generated
is specified with the is specified with the
.Fl t .Fl t

View File

@ -12,7 +12,7 @@
*/ */
#include "includes.h" #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 <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pem.h> #include <openssl/pem.h>
@ -140,7 +140,7 @@ load_identity(char *filename)
} }
#define SSH_COM_PUBLIC_BEGIN "---- BEGIN SSH2 PUBLIC KEY ----" #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_BEGIN "---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----"
#define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb #define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb

View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #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 <openssl/evp.h> #include <openssl/evp.h>
@ -59,7 +59,7 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data,
buffer_init(&b); buffer_init(&b);
buffer_append(&b, data, datalen); buffer_append(&b, data, datalen);
/* session id, currently limited to SHA1 (20 bytes) */ /* session id, currently limited to SHA1 (20 bytes) */
p = buffer_get_string(&b, &len); p = buffer_get_string(&b, &len);
if (len != 20) if (len != 20)
@ -104,9 +104,9 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data,
if (strlen(host) != len - 1) if (strlen(host) != len - 1)
fail++; fail++;
else if (p[len - 1] != '.') else if (p[len - 1] != '.')
fail++; fail++;
else if (strncasecmp(host, p, len - 1) != 0) else if (strncasecmp(host, p, len - 1) != 0)
fail++; fail++;
xfree(p); xfree(p);
/* local user */ /* local user */
@ -153,14 +153,14 @@ main(int argc, char **argv)
#ifdef DEBUG_SSH_KEYSIGN #ifdef DEBUG_SSH_KEYSIGN
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0);
#endif #endif
if (key_fd[0] == -1 && key_fd[1] == -1) if (key_fd[0] == -1 && key_fd[1] == -1)
fatal("could not open any host key"); fatal("could not open any host key");
if ((pw = getpwuid(getuid())) == NULL) if ((pw = getpwuid(getuid())) == NULL)
fatal("getpwuid failed"); fatal("getpwuid failed");
pw = pwcopy(pw); pw = pwcopy(pw);
SSLeay_add_all_algorithms(); SSLeay_add_all_algorithms();
@ -188,7 +188,7 @@ main(int argc, char **argv)
fatal("bad fd"); fatal("bad fd");
if ((host = get_local_name(fd)) == NULL) if ((host = get_local_name(fd)) == NULL)
fatal("cannot get sockname for fd"); fatal("cannot get sockname for fd");
data = buffer_get_string(&b, &dlen); data = buffer_get_string(&b, &dlen);
if (valid_request(pw, host, &key, data, dlen) < 0) if (valid_request(pw, host, &key, data, dlen) < 0)
fatal("not a valid request"); fatal("not a valid request");
@ -208,7 +208,7 @@ main(int argc, char **argv)
if (key_sign(keys[i], &signature, &slen, data, dlen) != 0) if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
fatal("key_sign failed"); fatal("key_sign failed");
/* send reply */ /* send reply */
buffer_clear(&b); buffer_clear(&b);
buffer_put_string(&b, signature, slen); buffer_put_string(&b, signature, slen);

4
ssh.1
View File

@ -34,7 +34,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" 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 .Dd September 25, 1999
.Dt SSH 1 .Dt SSH 1
.Os .Os
@ -1377,7 +1377,7 @@ and
.Cm HostbasedAuthentication . .Cm HostbasedAuthentication .
If the protocol version 1 If the protocol version 1
.Cm RhostsRSAAuthentication .Cm RhostsRSAAuthentication
method is used, method is used,
.Nm .Nm
must be setuid root, since the host key is readable only by root. must be setuid root, since the host key is readable only by root.
For protocol version 2, For protocol version 2,

View File

@ -13,7 +13,7 @@
*/ */
#include "includes.h" #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 <openssl/bn.h> #include <openssl/bn.h>
@ -771,7 +771,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
len = strlen(msg); len = strlen(msg);
snprintf(msg + len, sizeof(msg) - len, snprintf(msg + len, sizeof(msg) - len,
"\nMatching host key in %s:%d", "\nMatching host key in %s:%d",
host_file, host_line); host_file, host_line);
} }
if (options.strict_host_key_checking == 1) { if (options.strict_host_key_checking == 1) {
log(msg); log(msg);

View File

@ -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. * Copyright (c) 2000 Markus Friedl. All rights reserved.
@ -28,9 +28,9 @@
typedef struct Sensitive Sensitive; typedef struct Sensitive Sensitive;
struct Sensitive { struct Sensitive {
Key **keys; Key **keys;
int nkeys; int nkeys;
int external_keysign; int external_keysign;
}; };
int int
@ -54,16 +54,16 @@ void ssh_put_password(char *);
/* /*
* Macros to raise/lower permissions. * Macros to raise/lower permissions.
*/ */
#define PRIV_START do { \ #define PRIV_START do { \
int save_errno = errno; \ int save_errno = errno; \
(void)seteuid(original_effective_uid); \ (void)seteuid(original_effective_uid); \
errno = save_errno; \ errno = save_errno; \
} while (0) } while (0)
#define PRIV_END do { \ #define PRIV_END do { \
int save_errno = errno; \ int save_errno = errno; \
(void)seteuid(original_real_uid); \ (void)seteuid(original_real_uid); \
errno = save_errno; \ errno = save_errno; \
} while (0) } while (0)
#endif #endif

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #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 "ssh.h"
#include "ssh2.h" #include "ssh2.h"
@ -395,7 +395,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
if (key->type != pktype) { if (key->type != pktype) {
error("input_userauth_pk_ok: type mismatch " error("input_userauth_pk_ok: type mismatch "
"for decoded key (received %d, expected %d)", "for decoded key (received %d, expected %d)",
key->type, pktype); key->type, pktype);
break; break;
} }
fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
@ -463,7 +463,7 @@ userauth_passwd(Authctxt *authctxt)
packet_add_padding(64); packet_add_padding(64);
packet_send(); packet_send();
dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,
&input_userauth_passwd_changereq); &input_userauth_passwd_changereq);
return 1; 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->service);
packet_put_cstring(authctxt->method->name); packet_put_cstring(authctxt->method->name);
packet_put_char(1); /* additional info */ packet_put_char(1); /* additional info */
snprintf(prompt, sizeof(prompt), snprintf(prompt, sizeof(prompt),
"Enter %.30s@%.128s's old password: ", "Enter %.30s@%.128s's old password: ",
authctxt->server_user, authctxt->host); authctxt->server_user, authctxt->host);
password = read_passphrase(prompt, 0); password = read_passphrase(prompt, 0);
@ -504,7 +504,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
xfree(password); xfree(password);
password = NULL; password = NULL;
while (password == NULL) { while (password == NULL) {
snprintf(prompt, sizeof(prompt), snprintf(prompt, sizeof(prompt),
"Enter %.30s@%.128s's new password: ", "Enter %.30s@%.128s's new password: ",
authctxt->server_user, authctxt->host); authctxt->server_user, authctxt->host);
password = read_passphrase(prompt, RP_ALLOW_EOF); 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 */ /* bail out */
return; return;
} }
snprintf(prompt, sizeof(prompt), snprintf(prompt, sizeof(prompt),
"Retype %.30s@%.128s's new password: ", "Retype %.30s@%.128s's new password: ",
authctxt->server_user, authctxt->host); authctxt->server_user, authctxt->host);
retype = read_passphrase(prompt, 0); retype = read_passphrase(prompt, 0);
@ -530,8 +530,8 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
xfree(password); xfree(password);
packet_add_padding(64); packet_add_padding(64);
packet_send(); packet_send();
dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ,
&input_userauth_passwd_changereq); &input_userauth_passwd_changereq);
} }

View File

@ -43,7 +43,7 @@
*/ */
#include "includes.h" #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 "packet.h"
#include "log.h" #include "log.h"
@ -307,7 +307,6 @@ end:
else else
packet_put_raw(buffer_ptr(&buf), buffer_len(&buf)); packet_put_raw(buffer_ptr(&buf), buffer_len(&buf));
buffer_free(&buf); buffer_free(&buf);
return;
} }
/* /*
@ -457,5 +456,4 @@ set:
/* Set the new modes for the terminal. */ /* Set the new modes for the terminal. */
if (tcsetattr(fd, TCSANOW, &tio) == -1) if (tcsetattr(fd, TCSANOW, &tio) == -1)
log("Setting tty modes failed: %.100s", strerror(errno)); log("Setting tty modes failed: %.100s", strerror(errno));
return;
} }

View File

@ -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 <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
@ -22,6 +22,6 @@
void *xmalloc(size_t); void *xmalloc(size_t);
void *xrealloc(void *, size_t); void *xrealloc(void *, size_t);
void xfree(void *); void xfree(void *);
char *xstrdup(const char *); char *xstrdup(const char *);
#endif /* XMALLOC_H */ #endif /* XMALLOC_H */