[many files; did this manually to our top-level source dir]
     unexpand and remove end-of-line whitespace; ok markus@
This commit is contained in:
Kevin Steves 2001-02-05 12:42:17 +00:00
parent d2ddda4efa
commit ef4eea9bad
49 changed files with 386 additions and 382 deletions

View File

@ -1,7 +1,11 @@
20010105
- (bal) Disable groupaccess by setting NGROUP_MAX to 0 for platforms
- (bal) Disable groupaccess by setting NGROUPS_MAX to 0 for platforms
that don't have NGROUPS_MAX.
- (bal) AIX patch for auth1.c by William L. Jones <jones@hpc.utexas.edu>
- (stevesk) OpenBSD sync:
- stevesk@cvs.openbsd.org 2001/02/04 08:32:27
[many files; did this manually to our top-level source dir]
unexpand and remove end-of-line whitespace; ok markus@
20010104
- (bal) I think this is the last of the bsd-*.h that don't belong.

View File

@ -34,7 +34,7 @@ char *
get_challenge(Authctxt *authctxt, char *devs)
{
static char challenge[1024];
struct skey skey;
struct skey skey;
if (skeychallenge(&skey, authctxt->user, challenge) == -1)
return NULL;
strlcat(challenge, "\nS/Key Password: ", sizeof challenge);

View File

@ -32,7 +32,7 @@
#include "canohost.h"
#include "readpass.h"
RCSID("$Id: auth-pam.c,v 1.23 2001/02/04 12:20:19 djm Exp $");
RCSID("$Id: auth-pam.c,v 1.24 2001/02/05 12:42:17 stevesk Exp $");
#define NEW_AUTHTOK_MSG \
"Warning: Your password has expired, please change it now"

View File

@ -118,7 +118,7 @@ auth_password(struct passwd * pw, const char *password)
* Empty password is only possible on NT if the user has _really_
* an empty password and authentication is done, though.
*/
if (!is_winnt)
if (!is_winnt)
#endif
if (*password == '\0' && options.permit_empty_passwd == 0)
return 0;

6
auth.c
View File

@ -165,9 +165,9 @@ allowed_user(struct passwd * pw)
Authctxt *
authctxt_new(void)
{
Authctxt *authctxt = xmalloc(sizeof(*authctxt));
memset(authctxt, 0, sizeof(*authctxt));
return authctxt;
Authctxt *authctxt = xmalloc(sizeof(*authctxt));
memset(authctxt, 0, sizeof(*authctxt));
return authctxt;
}
struct passwd *

View File

@ -323,7 +323,7 @@ userauth_reply(Authctxt *authctxt, int authenticated)
authctxt->success = 1;
} else {
if (authctxt->failures++ > AUTH_FAIL_MAX)
packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
methods = authmethods_get();
packet_start(SSH2_MSG_USERAUTH_FAILURE);
packet_put_cstring(methods);
@ -342,7 +342,7 @@ userauth_none(Authctxt *authctxt)
if (m != NULL)
m->enabled = NULL;
packet_done();
userauth_banner();
userauth_banner();
if (authctxt->valid == 0)
return(0);

View File

@ -704,7 +704,7 @@ channel_post_connecting(Channel *c, fd_set * readset, fd_set * writeset)
int err = 0;
int sz = sizeof(err);
c->type = SSH_CHANNEL_OPEN;
if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &sz) < 0) {
if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &sz) < 0) {
debug("getsockopt SO_ERROR failed");
} else {
if (err == 0) {
@ -1553,7 +1553,7 @@ channel_request_forwarding(
if (remote_fwd) {
host = listen_address;
ctype = SSH_CHANNEL_RPORT_LISTENER;
ctype = SSH_CHANNEL_RPORT_LISTENER;
} else {
host = host_to_connect;
ctype =SSH_CHANNEL_PORT_LISTENER;

View File

@ -415,7 +415,7 @@ Cipher ciphers[] = {
SSH_CIPHER_SSH2, 16, 32,
rijndael_setkey, rijndael_setiv,
rijndael_cbc_encrypt, rijndael_cbc_decrypt },
{ NULL, SSH_CIPHER_ILLEGAL, 0, 0, NULL, NULL, NULL, NULL }
{ NULL, SSH_CIPHER_ILLEGAL, 0, 0, NULL, NULL, NULL, NULL }
};
/*--*/

10
cli.c
View File

@ -136,11 +136,11 @@ cli_write(const char* buf, int size)
output = xmalloc(4*size);
for (p = output, i = 0; i < size; i++) {
if (buf[i] == '\n')
*p++ = buf[i];
else
p = vis(p, buf[i], 0, 0);
}
if (buf[i] == '\n')
*p++ = buf[i];
else
p = vis(p, buf[i], 0, 0);
}
len = p - output;
for (pos = 0; pos < len; pos += ret) {

View File

@ -318,8 +318,8 @@ struct winsize {
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)
#endif
@ -340,7 +340,7 @@ struct winsize {
#ifndef SUN_LEN
#define SUN_LEN(su) \
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif /* SUN_LEN */
/* Function replacement / compatibility hacks */

View File

@ -38,7 +38,7 @@
#include "pathnames.h"
#include "log.h"
RCSID("$Id: entropy.c,v 1.25 2001/01/22 21:06:20 mouring Exp $");
RCSID("$Id: entropy.c,v 1.26 2001/02/05 12:42:17 stevesk Exp $");
#ifndef offsetof
# define offsetof(type, member) ((size_t) &((type *)0)->member)
@ -266,7 +266,7 @@ stir_from_programs(void)
if (entropy_estimate > SHA_DIGEST_LENGTH)
entropy_estimate = SHA_DIGEST_LENGTH;
/* Scale back estimates for subsequent passes through list */
/* Scale back estimates for subsequent passes through list */
entropy_estimate /= SCALE_PER_RUN * (i + 1.0);
/* Stir it in */

26
key.c
View File

@ -452,11 +452,11 @@ key_size(Key *k){
RSA *
rsa_generate_private_key(u_int bits)
{
RSA *private;
private = RSA_generate_key(bits, 35, NULL, NULL);
if (private == NULL)
fatal("rsa_generate_private_key: key generation failed.");
return private;
RSA *private;
private = RSA_generate_key(bits, 35, NULL, NULL);
if (private == NULL)
fatal("rsa_generate_private_key: key generation failed.");
return private;
}
DSA*
@ -466,9 +466,9 @@ dsa_generate_private_key(u_int bits)
if (private == NULL)
fatal("dsa_generate_private_key: DSA_generate_parameters failed");
if (!DSA_generate_key(private))
fatal("dsa_generate_private_key: DSA_generate_key failed.");
if (private == NULL)
fatal("dsa_generate_private_key: NULL.");
fatal("dsa_generate_private_key: DSA_generate_key failed.");
if (private == NULL)
fatal("dsa_generate_private_key: NULL.");
return private;
}
@ -477,7 +477,7 @@ key_generate(int type, u_int bits)
{
Key *k = key_new(KEY_UNSPEC);
switch (type) {
case KEY_DSA:
case KEY_DSA:
k->dsa = dsa_generate_private_key(bits);
break;
case KEY_RSA:
@ -485,9 +485,9 @@ key_generate(int type, u_int bits)
k->rsa = rsa_generate_private_key(bits);
break;
default:
fatal("key_generate: unknown type %d", type);
fatal("key_generate: unknown type %d", type);
}
k->type = type;
k->type = type;
return k;
}
@ -496,7 +496,7 @@ key_from_private(Key *k)
{
Key *n = NULL;
switch (k->type) {
case KEY_DSA:
case KEY_DSA:
n = key_new(k->type);
BN_copy(n->dsa->p, k->dsa->p);
BN_copy(n->dsa->q, k->dsa->q);
@ -510,7 +510,7 @@ key_from_private(Key *k)
BN_copy(n->rsa->e, k->rsa->e);
break;
default:
fatal("key_from_private: unknown type %d", k->type);
fatal("key_from_private: unknown type %d", k->type);
break;
}
return n;

2
log.h
View File

@ -21,7 +21,7 @@ typedef enum {
SYSLOG_FACILITY_USER,
SYSLOG_FACILITY_AUTH,
#ifdef LOG_AUTHPRIV
SYSLOG_FACILITY_AUTHPRIV,
SYSLOG_FACILITY_AUTHPRIV,
#endif
SYSLOG_FACILITY_LOCAL0,
SYSLOG_FACILITY_LOCAL1,

View File

@ -163,7 +163,7 @@
#include "log.h"
#include "atomicio.h"
RCSID("$Id: loginrec.c,v 1.30 2001/01/22 05:34:42 mouring Exp $");
RCSID("$Id: loginrec.c,v 1.31 2001/02/05 12:42:17 stevesk Exp $");
#ifdef HAVE_UTIL_H
# include <util.h>
@ -297,7 +297,7 @@ login_get_lastlog(struct logininfo *li, const int uid)
fatal("login_get_lastlog: Cannot find account for uid %i", uid);
/* No MIN_SIZEOF here - we absolutely *must not* truncate the
* username */
* username */
strlcpy(li->username, pw->pw_name, sizeof(li->username));
if (getlast_entry(li))
@ -972,7 +972,7 @@ wtmp_write(struct logininfo *li, struct utmp *ut)
WTMP_FILE, strerror(errno));
return 0;
}
if (fstat(fd, &buf) == 0)
if (fstat(fd, &buf) == 0)
if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
ftruncate(fd, buf.st_size);
log("wtmp_write: problem writing %s: %s",
@ -1065,7 +1065,7 @@ wtmp_get_entry(struct logininfo *li)
WTMP_FILE, strerror(errno));
return 0;
}
if (fstat(fd, &st) != 0) {
if (fstat(fd, &st) != 0) {
log("wtmp_get_entry: couldn't stat %s: %s",
WTMP_FILE, strerror(errno));
close(fd);
@ -1221,7 +1221,7 @@ wtmpx_get_entry(struct logininfo *li)
WTMPX_FILE, strerror(errno));
return 0;
}
if (fstat(fd, &st) != 0) {
if (fstat(fd, &st) != 0) {
log("wtmpx_get_entry: couldn't stat %s: %s",
WTMP_FILE, strerror(errno));
close(fd);
@ -1406,7 +1406,7 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
if ( lseek(*fd, offset, SEEK_SET) != offset ) {
log("lastlog_openseek: %s->lseek(): %s",
lastlog_file, strerror(errno));
lastlog_file, strerror(errno));
return 0;
}
}

View File

@ -40,7 +40,7 @@
#include <netinet/in.h>
#include <sys/socket.h>
/* RCSID("$Id: loginrec.h,v 1.4 2000/06/27 01:18:27 djm Exp $"); */
/* RCSID("$Id: loginrec.h,v 1.5 2001/02/05 12:42:18 stevesk Exp $"); */
/**
** you should use the login_* calls to work around platform dependencies

View File

@ -48,7 +48,7 @@
#include "loginrec.h"
RCSID("$Id: logintest.c,v 1.6 2000/06/19 08:25:36 andre Exp $");
RCSID("$Id: logintest.c,v 1.7 2001/02/05 12:42:18 stevesk Exp $");
#define PAUSE_BEFORE_LOGOUT 3

View File

@ -27,11 +27,11 @@ static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char *magic = "$1$"; /*
* This string is magic for
* this algorithm. Having
* it this way, we can get
* get better later on
*/
* This string is magic for
* this algorithm. Having
* it this way, we can get
* get better later on
*/
static void
to64(char *s, unsigned long v, int n)
@ -45,7 +45,7 @@ to64(char *s, unsigned long v, int n)
int
is_md5_salt(const char *salt)
{
return (!strncmp(salt, magic, strlen(magic)));
return (!strncmp(salt, magic, strlen(magic)));
}
/*

View File

@ -89,15 +89,15 @@ u4byte tab_gen = 0;
#define f_rn(bo, bi, n, k) \
bo[n] = ft_tab[0][byte(bi[n],0)] ^ \
ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
#define i_rn(bo, bi, n, k) \
bo[n] = it_tab[0][byte(bi[n],0)] ^ \
it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
#ifdef LARGE_TABLES
@ -109,15 +109,15 @@ u4byte tab_gen = 0;
#define f_rl(bo, bi, n, k) \
bo[n] = fl_tab[0][byte(bi[n],0)] ^ \
fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
#define i_rl(bo, bi, n, k) \
bo[n] = il_tab[0][byte(bi[n],0)] ^ \
il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
#else
@ -129,15 +129,15 @@ u4byte tab_gen = 0;
#define f_rl(bo, bi, n, k) \
bo[n] = (u4byte)sbx_tab[byte(bi[n],0)] ^ \
rotl(((u4byte)sbx_tab[byte(bi[(n + 1) & 3],1)]), 8) ^ \
rotl(((u4byte)sbx_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
rotl(((u4byte)sbx_tab[byte(bi[(n + 3) & 3],3)]), 24) ^ *(k + n)
rotl(((u4byte)sbx_tab[byte(bi[(n + 1) & 3],1)]), 8) ^ \
rotl(((u4byte)sbx_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
rotl(((u4byte)sbx_tab[byte(bi[(n + 3) & 3],3)]), 24) ^ *(k + n)
#define i_rl(bo, bi, n, k) \
bo[n] = (u4byte)isb_tab[byte(bi[n],0)] ^ \
rotl(((u4byte)isb_tab[byte(bi[(n + 3) & 3],1)]), 8) ^ \
rotl(((u4byte)isb_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
rotl(((u4byte)isb_tab[byte(bi[(n + 1) & 3],3)]), 24) ^ *(k + n)
rotl(((u4byte)isb_tab[byte(bi[(n + 3) & 3],1)]), 8) ^ \
rotl(((u4byte)isb_tab[byte(bi[(n + 2) & 3],2)]), 16) ^ \
rotl(((u4byte)isb_tab[byte(bi[(n + 1) & 3],3)]), 24) ^ *(k + n)
#endif
@ -232,8 +232,8 @@ gen_tabs(void)
t = w ^ (x); \
(y) = u ^ v ^ w; \
(y) ^= rotr(u ^ t, 8) ^ \
rotr(v ^ t, 16) ^ \
rotr(t,24)
rotr(v ^ t, 16) ^ \
rotr(t,24)
/* initialise the key schedule from the user supplied key */
@ -287,21 +287,21 @@ rijndael_set_key(rijndael_ctx *ctx, const u4byte *in_key, const u4byte key_len,
e_key[2] = io_swap(in_key[2]); e_key[3] = io_swap(in_key[3]);
switch(ctx->k_len) {
case 4: t = e_key[3];
for(i = 0; i < 10; ++i)
case 4: t = e_key[3];
for(i = 0; i < 10; ++i)
loop4(i);
break;
break;
case 6: e_key[4] = io_swap(in_key[4]); t = e_key[5] = io_swap(in_key[5]);
for(i = 0; i < 8; ++i)
case 6: e_key[4] = io_swap(in_key[4]); t = e_key[5] = io_swap(in_key[5]);
for(i = 0; i < 8; ++i)
loop6(i);
break;
break;
case 8: e_key[4] = io_swap(in_key[4]); e_key[5] = io_swap(in_key[5]);
e_key[6] = io_swap(in_key[6]); t = e_key[7] = io_swap(in_key[7]);
for(i = 0; i < 7; ++i)
case 8: e_key[4] = io_swap(in_key[4]); e_key[5] = io_swap(in_key[5]);
e_key[6] = io_swap(in_key[6]); t = e_key[7] = io_swap(in_key[7]);
for(i = 0; i < 7; ++i)
loop8(i);
break;
break;
}
if (!encrypt) {

2
scp.c
View File

@ -1060,7 +1060,7 @@ allocbuf(bp, fd, blksize)
size = blksize + (stb.st_blksize - blksize % stb.st_blksize) %
stb.st_blksize;
#else /* HAVE_ST_BLKSIZE */
size = blksize;
size = blksize;
#endif /* HAVE_ST_BLKSIZE */
if (bp->cnt >= size)
return (bp);

View File

@ -222,7 +222,7 @@ static struct {
{ "port", sPort },
{ "hostkey", sHostKeyFile },
{ "hostdsakey", sHostKeyFile }, /* alias */
{ "pidfile", sPidFile },
{ "pidfile", sPidFile },
{ "serverkeybits", sServerKeyBits },
{ "logingracetime", sLoginGraceTime },
{ "keyregenerationinterval", sKeyRegenerationTime },

View File

@ -1106,7 +1106,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
if (jid == -1) {
fatal("Failed to create job container: %.100s",
strerror(errno));
}
}
# endif /* WITH_IRIX_JOBS */
# ifdef WITH_IRIX_ARRAY
/* initialize array session */

View File

@ -222,7 +222,7 @@ do_init(int fd_in, int fd_out)
get_msg(fd_in, &msg);
/* Expecting a VERSION reply */
/* Expecting a VERSION reply */
if ((type = buffer_get_char(&msg)) != SSH2_FXP_VERSION) {
error("Invalid packet back from SSH2_FXP_INIT (type %d)",
type);

View File

@ -932,7 +932,7 @@ main(int ac, char **av)
handle_init();
#ifdef DEBUG_SFTP_SERVER
log_init("sftp-server", SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH, 0);
log_init("sftp-server", SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH, 0);
#endif
in = dup(STDIN_FILENO);

View File

@ -253,7 +253,7 @@ main(int argc, char **argv)
__progname = get_progname(argv[0]);
init_rng();
SSLeay_add_all_algorithms();
SSLeay_add_all_algorithms();
/* At first, get a connection to the authentication agent. */
ac = ssh_get_authentication_connection();

View File

@ -509,7 +509,7 @@ conloop(void)
c = tq.tqh_first;
while (c &&
(c->c_tv.tv_sec < now.tv_sec ||
(c->c_tv.tv_sec == now.tv_sec && c->c_tv.tv_usec < now.tv_usec))) {
(c->c_tv.tv_sec == now.tv_sec && c->c_tv.tv_usec < now.tv_usec))) {
int s = c->c_fd;
c = c->c_link.tqe_next;
conrecycle(s);

2
ssh.c
View File

@ -156,7 +156,7 @@ usage()
#ifdef AFS
fprintf(stderr, " -k Disable Kerberos ticket and AFS token forwarding.\n");
#endif /* AFS */
fprintf(stderr, " -X Enable X11 connection forwarding.\n");
fprintf(stderr, " -X Enable X11 connection forwarding.\n");
fprintf(stderr, " -x Disable X11 connection forwarding.\n");
fprintf(stderr, " -i file Identity for RSA authentication (default: ~/.ssh/identity).\n");
fprintf(stderr, " -t Tty; allocate a tty even if command is given.\n");

View File

@ -688,7 +688,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
error("X11 forwarding is disabled to avoid trojan horses.");
options.forward_x11 = 0;
}
if (options.num_local_forwards > 0 || options.num_remote_forwards > 0) {
if (options.num_local_forwards > 0 || options.num_remote_forwards > 0) {
error("Port forwarding is disabled to avoid trojan horses.");
options.num_local_forwards = options.num_remote_forwards = 0;
}

View File

@ -608,7 +608,7 @@ input_userauth_failure(int type, int plen, void *ctxt)
for (;;) {
method = authmethod_get(authlist);
if (method == NULL)
fatal("Unable to find an authentication method");
fatal("Unable to find an authentication method");
authctxt->method = method;
if (method->userauth(authctxt) != 0) {
debug2("we sent a %s packet, wait for reply", method->name);

6
sshd.c
View File

@ -429,7 +429,7 @@ destroy_sensitive_data(void)
key_free(sensitive_data.server_key);
sensitive_data.server_key = NULL;
}
for(i = 0; i < options.num_host_key_files; i++) {
for(i = 0; i < options.num_host_key_files; i++) {
if (sensitive_data.host_keys[i]) {
key_free(sensitive_data.host_keys[i]);
sensitive_data.host_keys[i] = NULL;
@ -1507,7 +1507,7 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
fprintf(stderr, "\npub= ");
BN_print_fp(stderr, dh->pub_key);
fprintf(stderr, "\n");
DHparams_print_fp(stderr, dh);
DHparams_print_fp(stderr, dh);
#endif
if (!dh_pub_is_valid(dh, dh_client_pub))
packet_disconnect("bad client public DH value");
@ -1650,7 +1650,7 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
fprintf(stderr, "\npub= ");
BN_print_fp(stderr, dh->pub_key);
fprintf(stderr, "\n");
DHparams_print_fp(stderr, dh);
DHparams_print_fp(stderr, dh);
#endif
if (!dh_pub_is_valid(dh, dh_client_pub))
packet_disconnect("bad client public DH value");