bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] telnet cleanup


From: Simon Josefsson
Subject: [bug-inetutils] telnet cleanup
Date: Mon, 08 Jun 2009 18:01:22 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux)

Building telnet with authentication/encryption results in many warnings,
this fixes some of them.  Objections to commit this?  (Will write a
ChangeLog entry of course.)

/Simon

? m4
? lib/.cvsignore
? lib/.deps
? lib/Makefile
? lib/Makefile.in
? lib/charset.alias
? lib/configmake.h
? libtelnet/genget.h
Index: libinetutils/shishi.c
===================================================================
RCS file: /sources/inetutils/inetutils/libinetutils/shishi.c,v
retrieving revision 1.3
diff -u -p -r1.3 shishi.c
--- libinetutils/shishi.c       29 Jun 2007 16:29:31 -0000      1.3
+++ libinetutils/shishi.c       8 Jun 2009 16:00:16 -0000
@@ -1,5 +1,5 @@
 /* shishi.c -- functions to use kerberos V with shishi
-   Copyright (C) 1990-1999, 2000, 2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1990-1999, 2000, 2002, 2007, 2009 Free Software Foundation, 
Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,10 +20,12 @@
 #endif
 
 #ifdef SHISHI
+# include <string.h>
 # include <stdlib.h>
 # include <errno.h>
 # include <shishi.h>
 # include <syslog.h>
+# include <unistd.h>
 # include <shishi_def.h>
 
 /* shishi authentication */
Index: libtelnet/Makefile.am
===================================================================
RCS file: /sources/inetutils/inetutils/libtelnet/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- libtelnet/Makefile.am       29 Jun 2007 16:29:31 -0000      1.8
+++ libtelnet/Makefile.am       8 Jun 2009 16:00:16 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
 # This file is part of GNU Inetutils.
 #
 # GNU Inetutils is free software; you can redistribute it and/or modify
@@ -22,5 +22,4 @@ noinst_LIBRARIES = libtelnet.a
 
 libtelnet_a_SOURCES = auth.c enc_des.c encrypt.c forward.c genget.c getent.c 
kerberos.c kerberos5.c misc.c read_passwd.c shishi.c
 
-noinst_HEADERS = auth-proto.h auth.h enc-proto.h encrypt.h key-proto.h 
misc-proto.h misc.h
-
+noinst_HEADERS = auth-proto.h auth.h enc-proto.h encrypt.h genget.h 
key-proto.h misc-proto.h misc.h
Index: libtelnet/auth.c
===================================================================
RCS file: /sources/inetutils/inetutils/libtelnet/auth.c,v
retrieving revision 1.10
diff -u -p -r1.10 auth.c
--- libtelnet/auth.c    21 Oct 2006 18:08:45 -0000      1.10
+++ libtelnet/auth.c    8 Jun 2009 16:00:16 -0000
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1991, 1993
+ * Copyright (c) 1991, 1993, 2009
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -283,19 +283,7 @@ getauthmask (char *type, int *maskp)
   return (0);
 }
 
-int
-auth_enable (char *type)
-{
-  return (auth_onoff (type, 1));
-}
-
-int
-auth_disable (char *type)
-{
-  return (auth_onoff (type, 0));
-}
-
-int
+static int
 auth_onoff (char *type, int on)
 {
   int i, mask = -1;
@@ -330,6 +318,18 @@ auth_onoff (char *type, int on)
 }
 
 int
+auth_enable (char *type)
+{
+  return (auth_onoff (type, 1));
+}
+
+int
+auth_disable (char *type)
+{
+  return (auth_onoff (type, 0));
+}
+
+int
 auth_togdebug (int on)
 {
   if (on < 0)
Index: libtelnet/enc_des.c
===================================================================
RCS file: /sources/inetutils/inetutils/libtelnet/enc_des.c,v
retrieving revision 1.10
diff -u -p -r1.10 enc_des.c
--- libtelnet/enc_des.c 4 Jun 2007 17:27:40 -0000       1.10
+++ libtelnet/enc_des.c 8 Jun 2009 16:00:16 -0000
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1991, 1993
+ * Copyright (c) 1991, 1993, 2009
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@ extern Shishi *shishi_handle;
 #   include "key-proto.h"
 #   include "misc-proto.h"
 
-extern encrypt_debug_mode;
+extern int encrypt_debug_mode;
 
 #   define CFB 0
 #   define OFB 1
@@ -60,6 +60,7 @@ extern encrypt_debug_mode;
 #   define SUCCESS             0
 #   define FAILED              -1
 
+#include <string.h>
 
 struct fb
 {
Index: libtelnet/encrypt.c
===================================================================
RCS file: /sources/inetutils/inetutils/libtelnet/encrypt.c,v
retrieving revision 1.10
diff -u -p -r1.10 encrypt.c
--- libtelnet/encrypt.c 4 Jun 2007 17:27:02 -0000       1.10
+++ libtelnet/encrypt.c 8 Jun 2009 16:00:16 -0000
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1991, 1993
+ * Copyright (c) 1991, 1993, 2009
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,10 @@
 #  include <string.h>
 # endif
 
+#include "genget.h"
+
+#include <stdio.h>
+
 /*
  * These functions pointers point to the current routines
  * for encrypting and decrypting data.
@@ -140,8 +144,7 @@ static unsigned char str_start[72] = { I
 static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE };
 
 Encryptions *
-findencryption (type)
-     int type;
+findencryption (int type)
 {
   Encryptions *ep = encryptions;
 
@@ -153,8 +156,7 @@ findencryption (type)
 }
 
 Encryptions *
-finddecryption (type)
-     int type;
+finddecryption (int type)
 {
   Encryptions *ep = encryptions;
 
@@ -184,9 +186,7 @@ static struct key_info
 0}, 0, DIR_DECRYPT, &decrypt_mode, finddecryption},};
 
 void
-encrypt_init (name, server)
-     char *name;
-     int server;
+encrypt_init (char *name, int server)
 {
   Encryptions *ep = encryptions;
 
@@ -219,7 +219,7 @@ encrypt_init (name, server)
 }
 
 void
-encrypt_list_types ()
+encrypt_list_types (void)
 {
   Encryptions *ep = encryptions;
 
@@ -232,8 +232,7 @@ encrypt_list_types ()
 }
 
 int
-EncryptEnable (type, mode)
-     char *type, *mode;
+EncryptEnable (char *type, char *mode)
 {
   if (isprefix (type, "help") || isprefix (type, "?"))
     {
@@ -247,8 +246,7 @@ EncryptEnable (type, mode)
 }
 
 int
-EncryptDisable (type, mode)
-     char *type, *mode;
+EncryptDisable (char *type, char *mode)
 {
   register Encryptions *ep;
   int ret = 0;
@@ -290,9 +288,7 @@ EncryptDisable (type, mode)
 }
 
 int
-EncryptType (type, mode)
-     char *type;
-     char *mode;
+EncryptType (char *type, char *mode)
 {
   register Encryptions *ep;
   int ret = 0;
@@ -332,8 +328,7 @@ EncryptType (type, mode)
 }
 
 int
-EncryptStart (mode)
-     char *mode;
+EncryptStart (char *mode)
 {
   register int ret = 0;
   if (mode)
@@ -357,7 +352,7 @@ EncryptStart (mode)
 }
 
 int
-EncryptStartInput ()
+EncryptStartInput (void)
 {
   if (decrypt_mode)
     {
@@ -369,7 +364,7 @@ EncryptStartInput ()
 }
 
 int
-EncryptStartOutput ()
+EncryptStartOutput (void)
 {
   if (encrypt_mode)
     {
@@ -381,8 +376,7 @@ EncryptStartOutput ()
 }
 
 int
-EncryptStop (mode)
-     char *mode;
+EncryptStop (char *mode)
 {
   int ret = 0;
   if (mode)
@@ -406,21 +400,21 @@ EncryptStop (mode)
 }
 
 int
-EncryptStopInput ()
+EncryptStopInput (void)
 {
   encrypt_send_request_end ();
   return (1);
 }
 
 int
-EncryptStopOutput ()
+EncryptStopOutput (void)
 {
   encrypt_send_end ();
   return (1);
 }
 
 void
-encrypt_display ()
+encrypt_display (void)
 {
   if (encrypt_output)
     printf ("Currently encrypting output with %s\r\n",
@@ -431,7 +425,7 @@ encrypt_display ()
 }
 
 int
-EncryptStatus ()
+EncryptStatus (void)
 {
   if (encrypt_output)
     printf ("Currently encrypting output with %s\r\n",
@@ -455,7 +449,7 @@ EncryptStatus ()
 }
 
 void
-encrypt_send_support ()
+encrypt_send_support (void)
 {
   if (str_suplen)
     {
@@ -473,8 +467,7 @@ encrypt_send_support ()
 }
 
 int
-EncryptDebug (on)
-     int on;
+EncryptDebug (int on)
 {
   if (on < 0)
     encrypt_debug_mode ^= 1;
@@ -486,8 +479,7 @@ EncryptDebug (on)
 }
 
 int
-EncryptVerbose (on)
-     int on;
+EncryptVerbose (int on)
 {
   if (on < 0)
     encrypt_verbose ^= 1;
@@ -498,8 +490,7 @@ EncryptVerbose (on)
 }
 
 int
-EncryptAutoEnc (on)
-     int on;
+EncryptAutoEnc (int on)
 {
   encrypt_auto (on);
   printf ("Automatic encryption of output is %s\r\n",
@@ -508,8 +499,7 @@ EncryptAutoEnc (on)
 }
 
 int
-EncryptAutoDec (on)
-     int on;
+EncryptAutoDec (int on)
 {
   decrypt_auto (on);
   printf ("Automatic decryption of input is %s\r\n",
@@ -521,9 +511,7 @@ EncryptAutoDec (on)
  * Called when ENCRYPT SUPPORT is received.
  */
 void
-encrypt_support (typelist, cnt)
-     unsigned char *typelist;
-     int cnt;
+encrypt_support (unsigned char *typelist, int cnt)
 {
   register int type, use_type = 0;
   Encryptions *ep;
@@ -563,9 +551,7 @@ encrypt_support (typelist, cnt)
 }
 
 void
-encrypt_is (data, cnt)
-     unsigned char *data;
-     int cnt;
+encrypt_is (unsigned char *data, int cnt)
 {
   Encryptions *ep;
   register int type, ret;
@@ -614,9 +600,7 @@ encrypt_is (data, cnt)
 }
 
 void
-encrypt_reply (data, cnt)
-     unsigned char *data;
-     int cnt;
+encrypt_reply (unsigned char *data, int cnt)
 {
   Encryptions *ep;
   register int ret, type;
@@ -669,9 +653,7 @@ encrypt_reply (data, cnt)
  * Called when a ENCRYPT START command is received.
  */
 void
-encrypt_start (data, cnt)
-     unsigned char *data;
-     int cnt;
+encrypt_start (unsigned char *data, int cnt)
 {
   Encryptions *ep;
 
@@ -709,9 +691,7 @@ encrypt_start (data, cnt)
 }
 
 void
-encrypt_session_key (key, server)
-     Session_Key *key;
-     int server;
+encrypt_session_key (Session_Key *key, int server)
 {
   Encryptions *ep = encryptions;
 
@@ -729,7 +709,7 @@ encrypt_session_key (key, server)
  * Called when ENCRYPT END is received.
  */
 void
-encrypt_end ()
+encrypt_end (void)
 {
   decrypt_input = 0;
   if (encrypt_debug_mode)
@@ -742,7 +722,7 @@ encrypt_end ()
  * Called when ENCRYPT REQUEST-END is received.
  */
 void
-encrypt_request_end ()
+encrypt_request_end (void)
 {
   encrypt_send_end ();
 }
@@ -754,9 +734,7 @@ encrypt_request_end ()
  * can.
  */
 void
-encrypt_request_start (data, cnt)
-     unsigned char *data;
-     int cnt;
+encrypt_request_start (unsigned char *data, int cnt)
 {
   if (encrypt_mode == 0)
     {
@@ -770,24 +748,20 @@ encrypt_request_start (data, cnt)
 static unsigned char str_keyid[(MAXKEYLEN * 2) + 5] =
   { IAC, SB, TELOPT_ENCRYPT };
 
-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);
 }
 
-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);
 }
 
-encrypt_keyid (kp, keyid, len)
-     struct key_info *kp;
-     unsigned char *keyid;
-     int len;
+void
+encrypt_keyid (struct key_info *kp, unsigned char *keyid, int len)
 {
   Encryptions *ep;
   unsigned char *strp, *cp;
@@ -835,11 +809,7 @@ encrypt_keyid (kp, keyid, len)
 }
 
 void
-encrypt_send_keyid (dir, keyid, keylen, saveit)
-     int dir;
-     unsigned char *keyid;
-     int keylen;
-     int saveit;
+encrypt_send_keyid (int dir, unsigned char *keyid, int keylen, int saveit)
 {
   unsigned char *strp;
 
@@ -863,8 +833,7 @@ encrypt_send_keyid (dir, keyid, keylen, 
 }
 
 void
-encrypt_auto (on)
-     int on;
+encrypt_auto (int on)
 {
   if (on < 0)
     autoencrypt ^= 1;
@@ -873,8 +842,7 @@ encrypt_auto (on)
 }
 
 void
-decrypt_auto (on)
-     int on;
+decrypt_auto (int on)
 {
   if (on < 0)
     autodecrypt ^= 1;
@@ -883,8 +851,7 @@ decrypt_auto (on)
 }
 
 void
-encrypt_start_output (type)
-     int type;
+encrypt_start_output (int type)
 {
   Encryptions *ep;
   register unsigned char *p;
@@ -943,7 +910,7 @@ encrypt_start_output (type)
 }
 
 void
-encrypt_send_end ()
+encrypt_send_end (void)
 {
   if (!encrypt_output)
     return;
@@ -964,7 +931,7 @@ encrypt_send_end ()
 }
 
 void
-encrypt_send_request_start ()
+encrypt_send_request_start (void)
 {
   register unsigned char *p;
   register int i;
@@ -985,7 +952,7 @@ encrypt_send_request_start ()
 }
 
 void
-encrypt_send_request_end ()
+encrypt_send_request_end (void)
 {
   str_end[3] = ENCRYPT_REQEND;
   net_write (str_end, sizeof (str_end));
@@ -996,7 +963,7 @@ encrypt_send_request_end ()
 }
 
 void
-encrypt_wait ()
+encrypt_wait (void)
 {
   register int encrypt, decrypt;
   if (encrypt_debug_mode)
@@ -1009,16 +976,14 @@ encrypt_wait ()
 }
 
 void
-encrypt_debug (mode)
-     int mode;
+encrypt_debug (int mode)
 {
   encrypt_debug_mode = mode;
 }
 
 void
-encrypt_gen_printsub (data, cnt, buf, buflen)
-     unsigned char *data, *buf;
-     int cnt, buflen;
+encrypt_gen_printsub (unsigned char *data, unsigned char *buf,
+                     int cnt, int buflen)
 {
   char tbuf[16], *cp;
 
@@ -1039,9 +1004,7 @@ encrypt_gen_printsub (data, cnt, buf, bu
 }
 
 void
-encrypt_printsub (data, cnt, buf, buflen)
-     unsigned char *data, *buf;
-     int cnt, buflen;
+encrypt_printsub (unsigned char *data, unsigned char *buf, int cnt, int buflen)
 {
   Encryptions *ep;
   register int type = data[1];
Index: libtelnet/misc.c
===================================================================
RCS file: /sources/inetutils/inetutils/libtelnet/misc.c,v
retrieving revision 1.8
diff -u -p -r1.8 misc.c
--- libtelnet/misc.c    21 Oct 2006 18:08:45 -0000      1.8
+++ libtelnet/misc.c    8 Jun 2009 16:00:16 -0000
@@ -33,6 +33,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include "auth.h"
+#include "encrypt.h"
 #include "misc.h"
 
 char *RemoteHostName;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]