Module Name: src Committed By: matt Date: Wed Mar 21 05:33:27 UTC 2012
Modified Files: src/lib/libcrypt: bcrypt.c src/lib/libedit: readline.c src/lib/libisns: isns_pdu.c isns_util.c src/lib/libmenu: item.c menu.c src/lib/libtelnet: auth.c enc_des.c encrypt.c genget.c getent.c misc.c Log Message: Use C89 functions definitions. Remove use of __P To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libcrypt/bcrypt.c cvs rdiff -u -r1.100 -r1.101 src/lib/libedit/readline.c cvs rdiff -u -r1.2 -r1.3 src/lib/libisns/isns_pdu.c cvs rdiff -u -r1.1.1.1 -r1.2 src/lib/libisns/isns_util.c cvs rdiff -u -r1.11 -r1.12 src/lib/libmenu/item.c cvs rdiff -u -r1.16 -r1.17 src/lib/libmenu/menu.c cvs rdiff -u -r1.20 -r1.21 src/lib/libtelnet/auth.c cvs rdiff -u -r1.15 -r1.16 src/lib/libtelnet/enc_des.c cvs rdiff -u -r1.16 -r1.17 src/lib/libtelnet/encrypt.c cvs rdiff -u -r1.12 -r1.13 src/lib/libtelnet/genget.c \ src/lib/libtelnet/misc.c cvs rdiff -u -r1.10 -r1.11 src/lib/libtelnet/getent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libcrypt/bcrypt.c diff -u src/lib/libcrypt/bcrypt.c:1.15 src/lib/libcrypt/bcrypt.c:1.16 --- src/lib/libcrypt/bcrypt.c:1.15 Wed Dec 28 03:12:38 2011 +++ src/lib/libcrypt/bcrypt.c Wed Mar 21 05:33:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: bcrypt.c,v 1.15 2011/12/28 03:12:38 christos Exp $ */ +/* $NetBSD: bcrypt.c,v 1.16 2012/03/21 05:33:26 matt Exp $ */ /* $OpenBSD: bcrypt.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */ /* @@ -46,7 +46,7 @@ * */ #include <sys/cdefs.h> -__RCSID("$NetBSD: bcrypt.c,v 1.15 2011/12/28 03:12:38 christos Exp $"); +__RCSID("$NetBSD: bcrypt.c,v 1.16 2012/03/21 05:33:26 matt Exp $"); #include <stdio.h> #include <stdlib.h> @@ -210,9 +210,7 @@ bcrypt_gensalt(u_int8_t log_rounds) i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ char * -__bcrypt(key, salt) - const char *key; - const char *salt; +__bcrypt(const char *key, const char *salt) { blf_ctx state; u_int32_t rounds, i, k; Index: src/lib/libedit/readline.c diff -u src/lib/libedit/readline.c:1.100 src/lib/libedit/readline.c:1.101 --- src/lib/libedit/readline.c:1.100 Fri Nov 18 20:38:42 2011 +++ src/lib/libedit/readline.c Wed Mar 21 05:33:26 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.100 2011/11/18 20:38:42 christos Exp $ */ +/* $NetBSD: readline.c,v 1.101 2012/03/21 05:33:26 matt Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.100 2011/11/18 20:38:42 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.101 2012/03/21 05:33:26 matt Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -1922,7 +1922,7 @@ rl_add_defun(const char *name, Function } void -rl_callback_read_char() +rl_callback_read_char(void) { int count = 0, done = 0; const char *buf = el_gets(e, &count); Index: src/lib/libisns/isns_pdu.c diff -u src/lib/libisns/isns_pdu.c:1.2 src/lib/libisns/isns_pdu.c:1.3 --- src/lib/libisns/isns_pdu.c:1.2 Tue Oct 25 00:02:30 2011 +++ src/lib/libisns/isns_pdu.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: isns_pdu.c,v 1.2 2011/10/25 00:02:30 christos Exp $ */ +/* $NetBSD: isns_pdu.c,v 1.3 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 2004,2009 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> -__RCSID("$NetBSD: isns_pdu.c,v 1.2 2011/10/25 00:02:30 christos Exp $"); +__RCSID("$NetBSD: isns_pdu.c,v 1.3 2012/03/21 05:33:27 matt Exp $"); #include <sys/types.h> @@ -93,7 +93,7 @@ static struct isns_buffer_pool_s G_buffe * isns_init_buffer_pool - initialize buffer pool for use */ void -isns_init_buffer_pool() +isns_init_buffer_pool(void) { pthread_mutexattr_t mutexattr; Index: src/lib/libisns/isns_util.c diff -u src/lib/libisns/isns_util.c:1.1.1.1 src/lib/libisns/isns_util.c:1.2 --- src/lib/libisns/isns_util.c:1.1.1.1 Sun Jan 16 01:22:50 2011 +++ src/lib/libisns/isns_util.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: isns_util.c,v 1.1.1.1 2011/01/16 01:22:50 agc Exp $ */ +/* $NetBSD: isns_util.c,v 1.2 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 2004,2009 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: isns_util.c,v 1.1.1.1 2011/01/16 01:22:50 agc Exp $"); +__RCSID("$NetBSD: isns_util.c,v 1.2 2012/03/21 05:33:27 matt Exp $"); #include <sys/types.h> @@ -82,7 +82,7 @@ isns_change_kevent_list(struct isns_conf struct isns_config_s * -isns_new_config() +isns_new_config(void) { struct isns_config_s *cfg_p; pthread_mutexattr_t mutexattr; Index: src/lib/libmenu/item.c diff -u src/lib/libmenu/item.c:1.11 src/lib/libmenu/item.c:1.12 --- src/lib/libmenu/item.c:1.11 Mon Jul 23 12:12:19 2007 +++ src/lib/libmenu/item.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: item.c,v 1.11 2007/07/23 12:12:19 blymn Exp $ */ +/* $NetBSD: item.c,v 1.12 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn (bl...@baea.com.au, brett_l...@yahoo.com.au) @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: item.c,v 1.11 2007/07/23 12:12:19 blymn Exp $"); +__RCSID("$NetBSD: item.c,v 1.12 2012/03/21 05:33:27 matt Exp $"); #include <menu.h> #include <stdlib.h> @@ -185,9 +185,7 @@ item_selected(MENU *menu, int **sel) * defaults. */ int -set_item_opts(item, opts) - ITEM *item; - OPTIONS opts; +set_item_opts(ITEM *item, OPTIONS opts) { /* selectable seems to be the only allowable item opt! */ if (opts != O_SELECTABLE) Index: src/lib/libmenu/menu.c diff -u src/lib/libmenu/menu.c:1.16 src/lib/libmenu/menu.c:1.17 --- src/lib/libmenu/menu.c:1.16 Sun Mar 9 01:08:48 2003 +++ src/lib/libmenu/menu.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: menu.c,v 1.16 2003/03/09 01:08:48 lukem Exp $ */ +/* $NetBSD: menu.c,v 1.17 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1998-1999 Brett Lymn (bl...@baea.com.au, brett_l...@yahoo.com.au) @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: menu.c,v 1.16 2003/03/09 01:08:48 lukem Exp $"); +__RCSID("$NetBSD: menu.c,v 1.17 2012/03/21 05:33:27 matt Exp $"); #include <ctype.h> #include <menu.h> @@ -135,8 +135,7 @@ set_menu_unmark(MENU *m, char *mark) * Return the menu unmark string for the menu. */ char * -menu_unmark(menu) - MENU *menu; +menu_unmark(MENU *menu) { if (menu == NULL) return _menui_default_menu.unmark.string; @@ -181,9 +180,7 @@ menu_win(MENU *menu) * Set the menu subwindow for the menu. */ int -set_menu_sub(menu, sub) - MENU *menu; - WINDOW *sub; +set_menu_sub(MENU *menu, WINDOW *sub) { if (menu == NULL) { _menui_default_menu.menu_subwin = sub; Index: src/lib/libtelnet/auth.c diff -u src/lib/libtelnet/auth.c:1.20 src/lib/libtelnet/auth.c:1.21 --- src/lib/libtelnet/auth.c:1.20 Mon Jan 9 15:25:33 2012 +++ src/lib/libtelnet/auth.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: auth.c,v 1.20 2012/01/09 15:25:33 christos Exp $ */ +/* $NetBSD: auth.c,v 1.21 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95" #else -__RCSID("$NetBSD: auth.c,v 1.20 2012/01/09 15:25:33 christos Exp $"); +__RCSID("$NetBSD: auth.c,v 1.21 2012/03/21 05:33:27 matt Exp $"); #endif #endif /* not lint */ @@ -167,10 +167,8 @@ static Authenticator NoAuth = { .type = static int i_support = 0; static int i_wont_support = 0; - Authenticator * -findauthenticator(type, way) - int type; - int way; +Authenticator * +findauthenticator(int type, int way) { Authenticator *ap = authenticators; @@ -179,10 +177,8 @@ findauthenticator(type, way) return(ap->type ? ap : 0); } - void -auth_init(name, server) - const char *name; - int server; +void +auth_init(const char *name, int server) { Authenticator *ap = authenticators; @@ -207,9 +203,8 @@ auth_init(name, server) } } - void -auth_disable_name(name) - char *name; +void +auth_disable_name(char *name) { int x; for (x = 0; x < AUTHTYPE_CNT; ++x) { @@ -220,10 +215,8 @@ auth_disable_name(name) } } - int -getauthmask(type, maskp) - char *type; - int *maskp; +int +getauthmask(char *type, int *maskp) { register int x; @@ -241,24 +234,20 @@ getauthmask(type, maskp) return(0); } - int -auth_enable(type) - char *type; +int +auth_enable(char *type) { return(auth_onoff(type, 1)); } - int -auth_disable(type) - char *type; +int +auth_disable(char *type) { return(auth_onoff(type, 0)); } - int -auth_onoff(type, on) - char *type; - int on; +int +auth_onoff(char *type, int on) { int i, mask = -1; Authenticator *ap; @@ -288,9 +277,8 @@ auth_onoff(type, on) return(1); } - int -auth_togdebug(on) - int on; +int +auth_togdebug(int on) { if (on < 0) auth_debug_mode ^= 1; @@ -300,9 +288,8 @@ auth_togdebug(on) return(1); } - int -auth_status(s) - char *s; +int +auth_status(char *s) { Authenticator *ap; int i, mask; @@ -328,8 +315,8 @@ auth_status(s) * This routine is called by the server to start authentication * negotiation. */ - void -auth_request() +void +auth_request(void) { static unsigned char str_request[64] = { IAC, SB, TELOPT_AUTHENTICATION, @@ -368,10 +355,8 @@ auth_request() * with KERBEROS instead of LOGIN (which is against what the * protocol says)) you will have to hack this code... */ - void -auth_send(data, cnt) - unsigned char *data; - int cnt; +void +auth_send(unsigned char *data, int cnt) { Authenticator *ap; static unsigned char str_none[] = { IAC, SB, TELOPT_AUTHENTICATION, @@ -454,8 +439,8 @@ auth_send(data, cnt) #endif /* KANNAN */ } - void -auth_send_retry() +void +auth_send_retry(void) { /* * if auth_send_cnt <= 0 then auth_send will end up rejecting @@ -464,10 +449,8 @@ auth_send_retry() auth_send(auth_send_data, auth_send_cnt); } - void -auth_is(data, cnt) - unsigned char *data; - int cnt; +void +auth_is(unsigned char *data, int cnt) { Authenticator *ap; @@ -487,10 +470,8 @@ auth_is(data, cnt) Name, *data); } - void -auth_reply(data, cnt) - unsigned char *data; - int cnt; +void +auth_reply(unsigned char *data, int cnt) { Authenticator *ap; @@ -505,10 +486,8 @@ auth_reply(data, cnt) Name, *data); } - void -auth_name(data, cnt) - unsigned char *data; - int cnt; +void +auth_name(unsigned char *data, int cnt) { unsigned char savename[256]; @@ -530,10 +509,8 @@ auth_name(data, cnt) auth_encrypt_user(savename); } - int -auth_sendname(cp, len) - unsigned char *cp; - int len; +int +auth_sendname(unsigned char *cp, int len) { static unsigned char str_request[256+6] = { IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_NAME, }; @@ -553,10 +530,8 @@ auth_sendname(cp, len) return(1); } - void -auth_finished(ap, result) - Authenticator *ap; - int result; +void +auth_finished(Authenticator *ap, int result) { if (!(authenticated = ap)) authenticated = &NoAuth; @@ -564,17 +539,14 @@ auth_finished(ap, result) } /* ARGSUSED */ - static void -auth_intr(sig) - int sig; +static void +auth_intr(int sig) { auth_finished(0, AUTH_REJECT); } - int -auth_wait(name, l) - char *name; - size_t l; +int +auth_wait(char *name, size_t l) { if (auth_debug_mode) printf(">>>%s: in auth_wait.\r\n", Name); @@ -605,17 +577,14 @@ auth_wait(name, l) return(validuser); } - void -auth_debug(mode) - int mode; +void +auth_debug(int mode) { auth_debug_mode = mode; } - void -auth_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +void +auth_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen) { Authenticator *ap; @@ -625,10 +594,8 @@ auth_printsub(data, cnt, buf, buflen) auth_gen_printsub(data, cnt, buf, buflen); } - void -auth_gen_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +void +auth_gen_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen) { register unsigned char *cp; unsigned char tbuf[16]; Index: src/lib/libtelnet/enc_des.c diff -u src/lib/libtelnet/enc_des.c:1.15 src/lib/libtelnet/enc_des.c:1.16 --- src/lib/libtelnet/enc_des.c:1.15 Mon Jan 9 15:25:33 2012 +++ src/lib/libtelnet/enc_des.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: enc_des.c,v 1.15 2012/01/09 15:25:33 christos Exp $ */ +/* $NetBSD: enc_des.c,v 1.16 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; */ #else -__RCSID("$NetBSD: enc_des.c,v 1.15 2012/01/09 15:25:33 christos Exp $"); +__RCSID("$NetBSD: enc_des.c,v 1.16 2012/03/21 05:33:27 matt Exp $"); #endif #endif /* not lint */ @@ -120,9 +120,8 @@ static void fb64_session(Session_Key *, void fb64_stream_key(Block *, struct stinfo *); int fb64_keyid(int, unsigned char *, int *, struct fb *); - void -cfb64_init(server) - int server; +void +cfb64_init(int server) { fb64_init(&fb[CFB]); fb[CFB].fb_feed[4] = ENCTYPE_DES_CFB64; @@ -130,9 +129,8 @@ cfb64_init(server) fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, CFB); } - void -ofb64_init(server) - int server; +void +ofb64_init(int server) { fb64_init(&fb[OFB]); fb[OFB].fb_feed[4] = ENCTYPE_DES_OFB64; @@ -140,9 +138,8 @@ ofb64_init(server) fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, OFB); } - void -fb64_init(fbp) - register struct fb *fbp; +void +fb64_init(register struct fb *fbp) { memset((void *)fbp, 0, sizeof(*fbp)); fbp->state[0] = fbp->state[1] = FAILED; @@ -160,26 +157,20 @@ fb64_init(fbp) * 2: Not yet. Other things (like getting the key from * Kerberos) have to happen before we can continue. */ - int -cfb64_start(dir, server) - int dir; - int server; +int +cfb64_start(int dir, int server) { return(fb64_start(&fb[CFB], dir, server)); } - int -ofb64_start(dir, server) - int dir; - int server; + +int +ofb64_start(int dir, int server) { return(fb64_start(&fb[OFB], dir, server)); } - static int -fb64_start(fbp, dir, server) - struct fb *fbp; - int dir; - int server; +static int +fb64_start(struct fb *fbp, int dir, int server) { size_t x; unsigned char *p; @@ -243,26 +234,19 @@ fb64_start(fbp, dir, server) * 0: Successful, initial negotiation all done. * 1: successful, negotiation not done yet. */ - int -cfb64_is(data, cnt) - unsigned char *data; - int cnt; +int +cfb64_is(unsigned char *data, int cnt) { return(fb64_is(data, cnt, &fb[CFB])); } - int -ofb64_is(data, cnt) - unsigned char *data; - int cnt; +int +ofb64_is(unsigned char *data, int cnt) { return(fb64_is(data, cnt, &fb[OFB])); } - int -fb64_is(data, cnt, fbp) - unsigned char *data; - int cnt; - struct fb *fbp; +int +fb64_is(unsigned char *data, int cnt, struct fb *fbp) { unsigned char *p; register int state = fbp->state[DIR_DECRYPT-1]; @@ -332,27 +316,19 @@ fb64_is(data, cnt, fbp) * 0: Successful, initial negotiation all done. * 1: successful, negotiation not done yet. */ - int -cfb64_reply(data, cnt) - unsigned char *data; - int cnt; +int +cfb64_reply(unsigned char *data, int cnt) { return(fb64_reply(data, cnt, &fb[CFB])); } - int -ofb64_reply(data, cnt) - unsigned char *data; - int cnt; +int +ofb64_reply(unsigned char *data, int cnt) { return(fb64_reply(data, cnt, &fb[OFB])); } - - int -fb64_reply(data, cnt, fbp) - unsigned char *data; - int cnt; - struct fb *fbp; +int +fb64_reply(unsigned char *data, int cnt, struct fb *fbp) { register int state = fbp->state[DIR_ENCRYPT-1]; @@ -388,27 +364,20 @@ fb64_reply(data, cnt, fbp) return(fbp->state[DIR_ENCRYPT-1] = state); } - void -cfb64_session(key, server) - Session_Key *key; - int server; +void +cfb64_session(Session_Key *key, int server) { fb64_session(key, server, &fb[CFB]); } - void -ofb64_session(key, server) - Session_Key *key; - int server; +void +ofb64_session( Session_Key *key, int server) { fb64_session(key, server, &fb[OFB]); } - static void -fb64_session(key, server, fbp) - Session_Key *key; - int server; - struct fb *fbp; +static void +fb64_session(Session_Key *key, int server, struct fb *fbp) { if (!key || key->type != SK_DES) { @@ -441,27 +410,20 @@ fb64_session(key, server, fbp) * We only accept a keyid of 0. If we get a keyid of * 0, then mark the state as SUCCESS. */ - int -cfb64_keyid(dir, kp, lenp) - int dir, *lenp; - unsigned char *kp; +int +cfb64_keyid(int dir, unsigned char *kp, int *lenp) { return(fb64_keyid(dir, kp, lenp, &fb[CFB])); } int -ofb64_keyid(dir, kp, lenp) - int dir, *lenp; - unsigned char *kp; +ofb64_keyid(int dir, unsigned char *kp, int *lenp) { return(fb64_keyid(dir, kp, lenp, &fb[OFB])); } - int -fb64_keyid(dir, kp, lenp, fbp) - int dir, *lenp; - unsigned char *kp; - struct fb *fbp; +int +fb64_keyid(int dir, unsigned char *kp, int *lenp, struct fb *fbp) { register int state = fbp->state[dir-1]; @@ -478,7 +440,7 @@ fb64_keyid(dir, kp, lenp, fbp) return(fbp->state[dir-1] = state); } - void +void fb64_printsub(const unsigned char *data, int cnt, unsigned char *buf, int buflen, const unsigned char *type) { @@ -520,26 +482,20 @@ fb64_printsub(const unsigned char *data, } } - void -cfb64_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +void +cfb64_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen) { fb64_printsub(data, cnt, buf, buflen, "CFB64"); } void -ofb64_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +ofb64_printsub(unsigned char *data, int cnt, unsigned char *buf, int buflen) { fb64_printsub(data, cnt, buf, buflen, "OFB64"); } - void -fb64_stream_iv(seed, stp) - Block seed; - register struct stinfo *stp; +void +fb64_stream_iv(Block seed, struct stinfo *stp) { memmove((void *)stp->str_iv, (void *)seed, sizeof(Block)); @@ -550,10 +506,8 @@ fb64_stream_iv(seed, stp) stp->str_index = sizeof(Block); } - void -fb64_stream_key(key, stp) - Block *key; - register struct stinfo *stp; +void +fb64_stream_key(Block *key, struct stinfo *stp) { memmove((void *)stp->str_ikey, (void *)key, sizeof(Block)); des_key_sched(key, stp->str_sched); @@ -585,10 +539,8 @@ fb64_stream_key(key, stp) * V(n+1) = DES(On, key) */ - void -cfb64_encrypt(s, c) - register unsigned char *s; - int c; +void +cfb64_encrypt(unsigned char *s, int c) { register struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1]; register int idx; @@ -610,9 +562,8 @@ cfb64_encrypt(s, c) stp->str_index = idx; } - int -cfb64_decrypt(data) - int data; +int +cfb64_decrypt(int data) { register struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1]; int idx; @@ -661,10 +612,8 @@ cfb64_decrypt(data) * V(n+1) = DES(Vn, key) * On = Dn ^ Vn */ - void -ofb64_encrypt(s, c) - register unsigned char *s; - int c; +void +ofb64_encrypt(unsigned char *s, int c) { register struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1]; register int idx; @@ -683,9 +632,8 @@ ofb64_encrypt(s, c) stp->str_index = idx; } - int -ofb64_decrypt(data) - int data; +int +ofb64_decrypt(int data) { register struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1]; int idx; Index: src/lib/libtelnet/encrypt.c diff -u src/lib/libtelnet/encrypt.c:1.16 src/lib/libtelnet/encrypt.c:1.17 --- src/lib/libtelnet/encrypt.c:1.16 Mon Jan 9 15:25:33 2012 +++ src/lib/libtelnet/encrypt.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: encrypt.c,v 1.16 2012/01/09 15:25:33 christos Exp $ */ +/* $NetBSD: encrypt.c,v 1.17 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -33,7 +33,7 @@ #if 0 static char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: encrypt.c,v 1.16 2012/01/09 15:25:33 christos Exp $"); +__RCSID("$NetBSD: encrypt.c,v 1.17 2012/03/21 05:33:27 matt Exp $"); #endif /* not lint */ /* @@ -135,9 +135,8 @@ static unsigned char str_suplen = 0; static unsigned char str_start[72] = { IAC, SB, TELOPT_ENCRYPT }; static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE }; - Encryptions * -findencryption(type) - int type; +Encryptions * +findencryption(int type) { Encryptions *ep = encryptions; @@ -148,9 +147,8 @@ findencryption(type) return(ep->type ? ep : 0); } - Encryptions * -finddecryption(type) - int type; +Encryptions * +finddecryption(int type) { Encryptions *ep = encryptions; @@ -174,10 +172,8 @@ static struct key_info { { { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption }, }; - void -encrypt_init(name, server) - const char *name; - int server; +void +encrypt_init(const char *name, int server) { Encryptions *ep = encryptions; @@ -212,8 +208,8 @@ encrypt_init(name, server) str_send[str_suplen++] = SE; } - void -encrypt_list_types() +void +encrypt_list_types(void) { Encryptions *ep = encryptions; @@ -224,9 +220,8 @@ encrypt_list_types() } } - int -EncryptEnable(type, mode) - char *type, *mode; +int +EncryptEnable(char *type, char *mode) { if (isprefix(type, "help") || isprefix(type, "?")) { printf("Usage: encrypt enable <type> [input|output]\n"); @@ -238,9 +233,8 @@ EncryptEnable(type, mode) return(0); } - int -EncryptDisable(type, mode) - char *type, *mode; +int +EncryptDisable(char *type, char *mode) { register Encryptions *ep; int ret = 0; @@ -272,10 +266,8 @@ EncryptDisable(type, mode) return(ret); } - int -EncryptType(type, mode) - char *type; - char *mode; +int +EncryptType(char *type, char *mode) { register Encryptions *ep; int ret = 0; @@ -305,9 +297,8 @@ EncryptType(type, mode) return(ret); } - int -EncryptStart(mode) - char *mode; +int +EncryptStart(char *mode) { register int ret = 0; if (mode) { @@ -327,8 +318,8 @@ EncryptStart(mode) return(ret); } - int -EncryptStartInput() +int +EncryptStartInput(void) { if (decrypt_mode) { encrypt_send_request_start(); @@ -338,8 +329,8 @@ EncryptStartInput() return(0); } - int -EncryptStartOutput() +int +EncryptStartOutput(void) { if (encrypt_mode) { encrypt_start_output(encrypt_mode); @@ -349,9 +340,8 @@ EncryptStartOutput() return(0); } - int -EncryptStop(mode) - char *mode; +int +EncryptStop(char *mode) { int ret = 0; if (mode) { @@ -371,22 +361,22 @@ EncryptStop(mode) return(ret); } - int -EncryptStopInput() +int +EncryptStopInput(void) { encrypt_send_request_end(); return(1); } - int -EncryptStopOutput() +int +EncryptStopOutput(void) { encrypt_send_end(); return(1); } - void -encrypt_display() +void +encrypt_display(void) { if (encrypt_output) printf("Currently encrypting output with %s\r\n", @@ -396,8 +386,8 @@ encrypt_display() ENCTYPE_NAME(decrypt_mode)); } - int -EncryptStatus() +int +EncryptStatus(void) { if (encrypt_output) printf("Currently encrypting output with %s\r\n", @@ -418,8 +408,8 @@ EncryptStatus() return 1; } - void -encrypt_send_support() +void +encrypt_send_support(void) { if (str_suplen) { /* @@ -435,9 +425,8 @@ encrypt_send_support() } } - int -EncryptDebug(on) - int on; +int +EncryptDebug(int on) { if (on < 0) encrypt_debug_mode ^= 1; @@ -448,9 +437,8 @@ EncryptDebug(on) return(1); } - int -EncryptVerbose(on) - int on; +int +EncryptVerbose(int on) { if (on < 0) encrypt_verbose ^= 1; @@ -461,9 +449,8 @@ EncryptVerbose(on) return(1); } - int -EncryptAutoEnc(on) - int on; +int +EncryptAutoEnc(int on) { encrypt_auto(on); printf("Automatic encryption of output is %s\r\n", @@ -471,9 +458,8 @@ EncryptAutoEnc(on) return(1); } - int -EncryptAutoDec(on) - int on; +int +EncryptAutoDec(int on) { decrypt_auto(on); printf("Automatic decryption of input is %s\r\n", @@ -484,10 +470,8 @@ EncryptAutoDec(on) /* * Called when ENCRYPT SUPPORT is received. */ - void -encrypt_support(typelist, cnt) - unsigned char *typelist; - int cnt; +void +encrypt_support(unsigned char *typelist, int cnt) { register int type, use_type = 0; Encryptions *ep; @@ -526,10 +510,8 @@ encrypt_support(typelist, cnt) } } - void -encrypt_is(data, cnt) - unsigned char *data; - int cnt; +void +encrypt_is(unsigned char *data, int cnt) { Encryptions *ep; register int type, ret; @@ -572,10 +554,8 @@ encrypt_is(data, cnt) } } - void -encrypt_reply(data, cnt) - unsigned char *data; - int cnt; +void +encrypt_reply(unsigned char *data, int cnt) { Encryptions *ep; register int ret, type; @@ -622,10 +602,8 @@ encrypt_reply(data, cnt) /* * Called when a ENCRYPT START command is received. */ - void -encrypt_start(data, cnt) - unsigned char *data; - int cnt; +void +encrypt_start(unsigned char *data, int cnt) { Encryptions *ep; @@ -660,10 +638,8 @@ encrypt_start(data, cnt) } } - void -encrypt_session_key(key, server) - Session_Key *key; - int server; +void +encrypt_session_key(Session_Key *key, int server) { Encryptions *ep = encryptions; @@ -685,8 +661,8 @@ encrypt_session_key(key, server) /* * Called when ENCRYPT END is received. */ - void -encrypt_end() +void +encrypt_end(void) { decrypt_input = 0; if (encrypt_debug_mode) @@ -698,8 +674,8 @@ encrypt_end() /* * Called when ENCRYPT REQUEST-END is received. */ - void -encrypt_request_end() +void +encrypt_request_end(void) { encrypt_send_end(); } @@ -710,10 +686,8 @@ encrypt_request_end() * other side wants us to start encrypting data as soon as we * can. */ - void -encrypt_request_start(data, cnt) - unsigned char *data; - int cnt; +void +encrypt_request_start(unsigned char *data, int cnt) { if (encrypt_mode == 0) { if (Server) @@ -725,27 +699,20 @@ encrypt_request_start(data, cnt) static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT }; - void -encrypt_enc_keyid(keyid, len) - unsigned char *keyid; - int len; +void +encrypt_enc_keyid(unsigned char *keyid, int len) { encrypt_keyid(&ki[1], keyid, len); } - void -encrypt_dec_keyid(keyid, len) - unsigned char *keyid; - int len; +void +encrypt_dec_keyid(unsigned char *keyid, int len) { encrypt_keyid(&ki[0], keyid, len); } void -encrypt_keyid(kp, keyid, len) - struct key_info *kp; - unsigned char *keyid; - int len; +encrypt_keyid(struct key_info *kp, unsigned char *keyid, int len) { Encryptions *ep; int dir = kp->dir; @@ -787,7 +754,7 @@ encrypt_keyid(kp, keyid, len) encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0); } - void +void encrypt_send_keyid(int dir, const unsigned char *keyid, int keylen, int saveit) { unsigned char *strp; @@ -810,9 +777,8 @@ encrypt_send_keyid(int dir, const unsign printsub('>', &str_keyid[2], strp - str_keyid - 2); } - void -encrypt_auto(on) - int on; +void +encrypt_auto(int on) { if (on < 0) autoencrypt ^= 1; @@ -820,9 +786,8 @@ encrypt_auto(on) autoencrypt = on ? 1 : 0; } - void -decrypt_auto(on) - int on; +void +decrypt_auto(int on) { if (on < 0) autodecrypt ^= 1; @@ -830,9 +795,8 @@ decrypt_auto(on) autodecrypt = on ? 1 : 0; } - void -encrypt_start_output(type) - int type; +void +encrypt_start_output(int type) { Encryptions *ep; register unsigned char *p; @@ -887,8 +851,8 @@ encrypt_start_output(type) ENCTYPE_NAME(type)); } - void -encrypt_send_end() +void +encrypt_send_end(void) { if (!encrypt_output) return; @@ -908,8 +872,8 @@ encrypt_send_end() printf("[ Output is now clear text ]\r\n"); } - void -encrypt_send_request_start() +void +encrypt_send_request_start(void) { register unsigned char *p; register int i; @@ -928,8 +892,8 @@ encrypt_send_request_start() printf(">>>%s: Request input to be encrypted\r\n", Name); } - void -encrypt_send_request_end() +void +encrypt_send_request_end(void) { str_end[3] = ENCRYPT_REQEND; telnet_net_write(str_end, sizeof(str_end)); @@ -939,8 +903,8 @@ encrypt_send_request_end() printf(">>>%s: Request input to be clear text\r\n", Name); } - void -encrypt_wait() +void +encrypt_wait(void) { if (encrypt_debug_mode) printf(">>>%s: in encrypt_wait\r\n", Name); @@ -951,17 +915,15 @@ encrypt_wait() return; } - void -encrypt_debug(mode) - int mode; +void +encrypt_debug(int mode) { encrypt_debug_mode = mode; } - void -encrypt_gen_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +void +encrypt_gen_printsub(unsigned char *data, int cnt, + unsigned char *buf, int buflen) { char tbuf[16], *cp; @@ -980,10 +942,9 @@ encrypt_gen_printsub(data, cnt, buf, buf *buf = '\0'; } - void -encrypt_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; +void +encrypt_printsub(unsigned char *data, int cnt, + unsigned char *buf, int buflen) { Encryptions *ep; register int type = data[1]; Index: src/lib/libtelnet/genget.c diff -u src/lib/libtelnet/genget.c:1.12 src/lib/libtelnet/genget.c:1.13 --- src/lib/libtelnet/genget.c:1.12 Mon Jan 9 15:25:33 2012 +++ src/lib/libtelnet/genget.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: genget.c,v 1.12 2012/01/09 15:25:33 christos Exp $ */ +/* $NetBSD: genget.c,v 1.13 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: genget.c,v 1.12 2012/01/09 15:25:33 christos Exp $"); +__RCSID("$NetBSD: genget.c,v 1.13 2012/03/21 05:33:27 matt Exp $"); #endif #endif /* not lint */ @@ -49,7 +49,7 @@ __RCSID("$NetBSD: genget.c,v 1.12 2012/0 * the length is returned. If *s1 is a prefix of *s2, * the length of *s1 is returned. */ - int +int isprefix(char *s1, const char *s2) { char *os1; @@ -71,11 +71,10 @@ isprefix(char *s1, const char *s2) static char *ambiguous; /* special return value for command routines */ - char ** -genget(name, table, stlen) - char *name; /* name to match */ - char **table; /* name entry in table */ - int stlen; +char ** +genget( char *name, /* name to match */ + char **table, /* name entry in table */ + int stlen) { register char **c, **found; register int n; @@ -99,9 +98,8 @@ genget(name, table, stlen) /* * Function call version of Ambiguous() */ - int -Ambiguous(s) - void *s; +int +Ambiguous(void *s) { return(s == &ambiguous); } Index: src/lib/libtelnet/misc.c diff -u src/lib/libtelnet/misc.c:1.12 src/lib/libtelnet/misc.c:1.13 --- src/lib/libtelnet/misc.c:1.12 Thu Aug 7 16:44:56 2003 +++ src/lib/libtelnet/misc.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.12 2003/08/07 16:44:56 agc Exp $ */ +/* $NetBSD: misc.c,v 1.13 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: misc.c,v 1.12 2003/08/07 16:44:56 agc Exp $"); +__RCSID("$NetBSD: misc.c,v 1.13 2012/03/21 05:33:27 matt Exp $"); #endif #endif /* not lint */ @@ -50,12 +50,9 @@ const char *LocalHostName; char *UserNameRequested = 0; int ConnectedCount = 0; - void -auth_encrypt_init(local, remote, name, server) - const char *local; - const char *remote; - const char *name; - int server; +void +auth_encrypt_init(const char *local, const char *remote, const char *name, + int server) { RemoteHostName = remote; LocalHostName = local; @@ -71,25 +68,21 @@ auth_encrypt_init(local, remote, name, s } } - void -auth_encrypt_user(name) - const char *name; +void +auth_encrypt_user(const char *name) { if (UserNameRequested) free(UserNameRequested); UserNameRequested = name ? strdup(name) : 0; } - void -auth_encrypt_connect(cnt) - int cnt; +void +auth_encrypt_connect(int cnt) { } - void -printd(data, cnt) - const unsigned char *data; - int cnt; +void +printd(const unsigned char *data, int cnt) { if (cnt > 16) cnt = 16; Index: src/lib/libtelnet/getent.c diff -u src/lib/libtelnet/getent.c:1.10 src/lib/libtelnet/getent.c:1.11 --- src/lib/libtelnet/getent.c:1.10 Sun Feb 6 05:53:07 2005 +++ src/lib/libtelnet/getent.c Wed Mar 21 05:33:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: getent.c,v 1.10 2005/02/06 05:53:07 perry Exp $ */ +/* $NetBSD: getent.c,v 1.11 2012/03/21 05:33:27 matt Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; #else -__RCSID("$NetBSD: getent.c,v 1.10 2005/02/06 05:53:07 perry Exp $"); +__RCSID("$NetBSD: getent.c,v 1.11 2012/03/21 05:33:27 matt Exp $"); #endif #endif /* not lint */ @@ -48,8 +48,7 @@ char *getstr(char *, char **); /*ARGSUSED*/ int -getent(cp, name) -char *cp, *name; +getent(char *cp, char *name) { #ifdef HAS_CGETENT const char *dba[2]; @@ -65,8 +64,7 @@ char *cp, *name; #ifndef SOLARIS /*ARGSUSED*/ char * -getstr(id, cpp) -char *id, **cpp; +getstr(char *id, char **cpp) { # ifdef HAS_CGETENT char *answer;