[auth-bsdauth.c auth-skey.c auth2-chall.c clientloop.c key.c
      monitor_wrap.c monitor_wrap.h scard.h session.h sftp-glob.c ssh.c
      sshconnect2.c sshd.c]
     minor KNF
This commit is contained in:
Ben Lindstrom 2002-07-04 00:14:17 +00:00
parent 5a9d0eaba6
commit a962c2fb35
14 changed files with 49 additions and 42 deletions

View File

@ -33,6 +33,11 @@
- deraadt@cvs.openbsd.org 2002/06/30 21:54:16 - deraadt@cvs.openbsd.org 2002/06/30 21:54:16
[auth2.c session.c sshd.c] [auth2.c session.c sshd.c]
lint asks that we use names that do not overlap lint asks that we use names that do not overlap
- deraadt@cvs.openbsd.org 2002/06/30 21:59:45
[auth-bsdauth.c auth-skey.c auth2-chall.c clientloop.c key.c
monitor_wrap.c monitor_wrap.h scard.h session.h sftp-glob.c ssh.c
sshconnect2.c sshd.c]
minor KNF
20020702 20020702
- (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc & - (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc &
@ -1241,4 +1246,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.2324 2002/07/04 00:12:53 mouring Exp $ $Id: ChangeLog,v 1.2325 2002/07/04 00:14:17 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.4 2002/06/19 00:27:55 deraadt Exp $"); RCSID("$OpenBSD: auth-bsdauth.c,v 1.5 2002/06/30 21:59:45 deraadt Exp $");
#ifdef BSD_AUTH #ifdef BSD_AUTH
#include "xmalloc.h" #include "xmalloc.h"
@ -69,7 +69,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
*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));
(*echo_on)[0] = 0; (*echo_on)[0] = 0;
(*prompts)[0] = xstrdup(challenge); (*prompts)[0] = xstrdup(challenge);

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.19 2002/06/19 00:27:55 deraadt Exp $"); RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
#ifdef SKEY #ifdef SKEY
@ -53,7 +53,7 @@ skey_query(void *ctx, char **name, char **infotxt,
*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));
(*echo_on)[0] = 0; (*echo_on)[0] = 0;

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.19 2002/06/26 13:55:37 markus Exp $"); RCSID("$OpenBSD: auth2-chall.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
#include "ssh2.h" #include "ssh2.h"
#include "auth.h" #include "auth.h"
@ -263,7 +263,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
if (nresp > 100) if (nresp > 100)
fatal("input_userauth_info_response: too many replies"); fatal("input_userauth_info_response: too many replies");
if (nresp > 0) { if (nresp > 0) {
response = xmalloc(nresp * sizeof(char*)); response = xmalloc(nresp * sizeof(char *));
for (i = 0; i < nresp; i++) for (i = 0; i < nresp; i++)
response[i] = packet_get_string(NULL); response[i] = packet_get_string(NULL);
} }

View File

@ -59,7 +59,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: clientloop.c,v 1.102 2002/06/24 14:33:27 markus Exp $"); RCSID("$OpenBSD: clientloop.c,v 1.103 2002/06/30 21:59:45 deraadt Exp $");
#include "ssh.h" #include "ssh.h"
#include "ssh1.h" #include "ssh1.h"
@ -1114,7 +1114,7 @@ client_input_exit_status(int type, u_int32_t seq, void *ctxt)
static Channel * static Channel *
client_request_forwarded_tcpip(const char *request_type, int rchan) client_request_forwarded_tcpip(const char *request_type, int rchan)
{ {
Channel* c = NULL; Channel *c = NULL;
char *listen_address, *originator_address; char *listen_address, *originator_address;
int listen_port, originator_port; int listen_port, originator_port;
int sock; int sock;
@ -1144,7 +1144,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan)
return c; return c;
} }
static Channel* static Channel *
client_request_x11(const char *request_type, int rchan) client_request_x11(const char *request_type, int rchan)
{ {
Channel *c = NULL; Channel *c = NULL;
@ -1180,7 +1180,7 @@ client_request_x11(const char *request_type, int rchan)
return c; return c;
} }
static Channel* static Channel *
client_request_agent(const char *request_type, int rchan) client_request_agent(const char *request_type, int rchan)
{ {
Channel *c = NULL; Channel *c = NULL;

14
key.c
View File

@ -32,7 +32,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: key.c,v 1.45 2002/06/23 03:26:19 deraadt Exp $"); RCSID("$OpenBSD: key.c,v 1.46 2002/06/30 21:59:45 deraadt Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
@ -171,7 +171,7 @@ key_equal(Key *a, Key *b)
return 0; return 0;
} }
static u_char* static u_char *
key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
{ {
const EVP_MD *md = NULL; const EVP_MD *md = NULL;
@ -227,8 +227,8 @@ key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
return retval; return retval;
} }
static char* static char *
key_fingerprint_hex(u_char* dgst_raw, u_int dgst_raw_len) key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len)
{ {
char *retval; char *retval;
int i; int i;
@ -244,8 +244,8 @@ key_fingerprint_hex(u_char* dgst_raw, u_int dgst_raw_len)
return retval; return retval;
} }
static char* static char *
key_fingerprint_bubblebabble(u_char* dgst_raw, u_int dgst_raw_len) key_fingerprint_bubblebabble(u_char *dgst_raw, u_int dgst_raw_len)
{ {
char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' };
char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm', char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm',
@ -291,7 +291,7 @@ key_fingerprint_bubblebabble(u_char* dgst_raw, u_int dgst_raw_len)
return retval; return retval;
} }
char* char *
key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep) key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
{ {
char *retval = NULL; char *retval = NULL;

View File

@ -25,7 +25,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: monitor_wrap.c,v 1.13 2002/06/28 01:50:37 deraadt Exp $"); RCSID("$OpenBSD: monitor_wrap.c,v 1.14 2002/06/30 21:59:45 deraadt Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/dh.h> #include <openssl/dh.h>
@ -207,7 +207,7 @@ mm_getpwnamallow(const char *login)
return (pw); return (pw);
} }
char* mm_auth2_read_banner(void) char *mm_auth2_read_banner(void)
{ {
Buffer m; Buffer m;
char *banner; char *banner;
@ -705,7 +705,7 @@ mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
*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));
(*echo_on)[0] = 0; (*echo_on)[0] = 0;
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: monitor_wrap.h,v 1.5 2002/05/12 23:53:45 djm Exp $ */ /* $OpenBSD: monitor_wrap.h,v 1.6 2002/06/30 21:59:45 deraadt Exp $ */
/* /*
* Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@ -44,7 +44,7 @@ DH *mm_choose_dh(int, int, int);
int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int); int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int);
void mm_inform_authserv(char *, char *); void mm_inform_authserv(char *, char *);
struct passwd *mm_getpwnamallow(const char *); struct passwd *mm_getpwnamallow(const char *);
char* mm_auth2_read_banner(void); char *mm_auth2_read_banner(void);
int mm_auth_password(struct Authctxt *, char *); int mm_auth_password(struct Authctxt *, char *);
int mm_key_allowed(enum mm_keytype, char *, char *, Key *); int mm_key_allowed(enum mm_keytype, char *, char *, Key *);
int mm_user_key_allowed(struct passwd *, Key *); int mm_user_key_allowed(struct passwd *, Key *);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: scard.h,v 1.10 2002/03/25 17:34:27 markus Exp $ */ /* $OpenBSD: scard.h,v 1.11 2002/06/30 21:59:45 deraadt Exp $ */
/* /*
* Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Markus Friedl. All rights reserved.
@ -33,8 +33,8 @@
#define SCARD_ERROR_NOCARD -2 #define SCARD_ERROR_NOCARD -2
#define SCARD_ERROR_APPLET -3 #define SCARD_ERROR_APPLET -3
Key **sc_get_keys(const char*, const char*); Key **sc_get_keys(const char *, const char *);
void sc_close(void); void sc_close(void);
int sc_put_key(Key *, const char*); int sc_put_key(Key *, const char *);
#endif #endif

View File

@ -1,4 +1,4 @@
/* $OpenBSD: session.h,v 1.18 2002/06/23 21:06:41 deraadt Exp $ */ /* $OpenBSD: session.h,v 1.19 2002/06/30 21:59:45 deraadt Exp $ */
/* /*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@ -57,7 +57,7 @@ struct Session {
void do_authenticated(Authctxt *); void do_authenticated(Authctxt *);
int session_open(Authctxt*, int); int session_open(Authctxt *, int);
int session_input_channel_req(Channel *, const char *); int session_input_channel_req(Channel *, const char *);
void session_close_by_pid(pid_t, int); void session_close_by_pid(pid_t, int);
void session_close_by_channel(int, void *); void session_close_by_channel(int, void *);

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sftp-glob.c,v 1.10 2002/02/13 00:59:23 djm Exp $"); RCSID("$OpenBSD: sftp-glob.c,v 1.11 2002/06/30 21:59:45 deraadt Exp $");
#include "buffer.h" #include "buffer.h"
#include "bufaux.h" #include "bufaux.h"
@ -51,12 +51,12 @@ fudge_opendir(const char *path)
r = xmalloc(sizeof(*r)); r = xmalloc(sizeof(*r));
if (do_readdir(cur.conn, (char*)path, &r->dir)) if (do_readdir(cur.conn, (char *)path, &r->dir))
return(NULL); return(NULL);
r->offset = 0; r->offset = 0;
return((void*)r); return((void *)r);
} }
static struct dirent * static struct dirent *
@ -129,7 +129,7 @@ fudge_lstat(const char *path, struct stat *st)
{ {
Attrib *a; Attrib *a;
if (!(a = do_lstat(cur.conn, (char*)path, 0))) if (!(a = do_lstat(cur.conn, (char *)path, 0)))
return(-1); return(-1);
attrib_to_stat(a, st); attrib_to_stat(a, st);
@ -142,7 +142,7 @@ fudge_stat(const char *path, struct stat *st)
{ {
Attrib *a; Attrib *a;
if (!(a = do_stat(cur.conn, (char*)path, 0))) if (!(a = do_stat(cur.conn, (char *)path, 0)))
return(-1); return(-1);
attrib_to_stat(a, st); attrib_to_stat(a, st);

7
ssh.c
View File

@ -40,7 +40,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh.c,v 1.179 2002/06/12 01:09:52 markus Exp $"); RCSID("$OpenBSD: ssh.c,v 1.180 2002/06/30 21:59:45 deraadt Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/err.h> #include <openssl/err.h>
@ -552,7 +552,7 @@ again:
if (buffer_len(&command) == 0) if (buffer_len(&command) == 0)
tty_flag = 1; tty_flag = 1;
/* Force no tty*/ /* Force no tty */
if (no_tty_flag) if (no_tty_flag)
tty_flag = 0; tty_flag = 0;
/* Do not allocate a tty if stdin is not a tty. */ /* Do not allocate a tty if stdin is not a tty. */
@ -637,7 +637,8 @@ again:
if (options.rhosts_rsa_authentication || if (options.rhosts_rsa_authentication ||
options.hostbased_authentication) { options.hostbased_authentication) {
sensitive_data.nkeys = 3; sensitive_data.nkeys = 3;
sensitive_data.keys = xmalloc(sensitive_data.nkeys*sizeof(Key)); sensitive_data.keys = xmalloc(sensitive_data.nkeys *
sizeof(Key));
PRIV_START; PRIV_START;
sensitive_data.keys[0] = key_load_private_type(KEY_RSA1, sensitive_data.keys[0] = key_load_private_type(KEY_RSA1,

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect2.c,v 1.105 2002/06/23 03:30:17 deraadt Exp $"); RCSID("$OpenBSD: sshconnect2.c,v 1.106 2002/06/30 21:59:45 deraadt Exp $");
#include "ssh.h" #include "ssh.h"
#include "ssh2.h" #include "ssh2.h"
@ -422,7 +422,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
clear_auth_state(authctxt); clear_auth_state(authctxt);
dispatch_set(SSH2_MSG_USERAUTH_PK_OK, NULL); dispatch_set(SSH2_MSG_USERAUTH_PK_OK, NULL);
/* try another method if we did not send a packet*/ /* try another method if we did not send a packet */
if (sent == 0) if (sent == 0)
userauth(authctxt, NULL); userauth(authctxt, NULL);

9
sshd.c
View File

@ -42,7 +42,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshd.c,v 1.254 2002/06/30 21:54:16 deraadt Exp $"); RCSID("$OpenBSD: sshd.c,v 1.255 2002/06/30 21:59:45 deraadt Exp $");
#include <openssl/dh.h> #include <openssl/dh.h>
#include <openssl/bn.h> #include <openssl/bn.h>
@ -550,7 +550,7 @@ privsep_preauth_child(void)
memset(pw->pw_passwd, 0, strlen(pw->pw_passwd)); memset(pw->pw_passwd, 0, strlen(pw->pw_passwd));
endpwent(); endpwent();
/* Change our root directory*/ /* Change our root directory */
if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1) if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1)
fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR, fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR,
strerror(errno)); strerror(errno));
@ -573,7 +573,7 @@ privsep_preauth_child(void)
#endif #endif
} }
static Authctxt* static Authctxt *
privsep_preauth(void) privsep_preauth(void)
{ {
Authctxt *authctxt = NULL; Authctxt *authctxt = NULL;
@ -958,7 +958,8 @@ main(int ac, char **av)
debug("sshd version %.100s", SSH_VERSION); debug("sshd version %.100s", SSH_VERSION);
/* load private host keys */ /* load private host keys */
sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*)); sensitive_data.host_keys = xmalloc(options.num_host_key_files *
sizeof(Key *));
for (i = 0; i < options.num_host_key_files; i++) for (i = 0; i < options.num_host_key_files; i++)
sensitive_data.host_keys[i] = NULL; sensitive_data.host_keys[i] = NULL;
sensitive_data.server_key = NULL; sensitive_data.server_key = NULL;