commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-205-g0db09b4


From: Alfred M. Szmidt
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-205-g0db09b4
Date: Sun, 25 Dec 2011 12:26:38 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  0db09b449c8a03807a91ddc51abf7368bcc46d3b (commit)
       via  665f1e73cdd9b38e2d2e11b8db9958a315935592 (commit)
      from  b48e61c52c10955ca2cc848834c2de306cf0d157 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=0db09b449c8a03807a91ddc51abf7368bcc46d3b


commit 0db09b449c8a03807a91ddc51abf7368bcc46d3b
Author: Alfred M. Szmidt <address@hidden>
Date:   Sun Dec 25 13:22:26 2011 +0100

    Fix indentation, and stop using `register' keyword.

diff --git a/ChangeLog b/ChangeLog
index f4e4457..db6610a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-12-25  Alfred M. Szmidt  <address@hidden>
 
+       * libtelnet/encrypt.c: Fix indentation, and Use ANSI style
+       declarations for prototypes.
+       (EncryptDisable, EncryptType, EncryptStart, encrypt_support)
+       (encrypt_is, encrypt_reply, encrypt_keyid, encrypt_start_output)
+       (encrypt_send_request_start, encrypt_wait, encrypt_printsub):
+       Don't declare any variables as `register'.
+
+2011-12-25  Alfred M. Szmidt  <address@hidden>
+
        * libtelnet/encrypt.c (encrypt_keyid): Make sure that LEN never is
        greater than MAXKEYLEN.
 
diff --git a/libtelnet/encrypt.c b/libtelnet/encrypt.c
index abfa6d4..1f2bb97 100644
--- a/libtelnet/encrypt.c
+++ b/libtelnet/encrypt.c
@@ -102,61 +102,50 @@ static char *Name = "Noname";
 
 # define typemask(x)   ((x) > 0 ? 1 << ((x)-1) : 0)
 
-static long i_support_encrypt = typemask (ENCTYPE_DES_CFB64)
-  | typemask (ENCTYPE_DES_OFB64);
-     static long
-       i_support_decrypt = typemask (ENCTYPE_DES_CFB64)
-  | typemask (ENCTYPE_DES_OFB64);
-     static long
-       i_wont_support_encrypt = 0;
-     static long
-       i_wont_support_decrypt = 0;
+static long i_support_encrypt = typemask (ENCTYPE_DES_CFB64) | typemask 
(ENCTYPE_DES_OFB64);
+static long i_support_decrypt = typemask (ENCTYPE_DES_CFB64) | typemask 
(ENCTYPE_DES_OFB64);
+static long i_wont_support_encrypt = 0;
+static long i_wont_support_decrypt = 0;
 # define I_SUPPORT_ENCRYPT     (i_support_encrypt & ~i_wont_support_encrypt)
 # define I_SUPPORT_DECRYPT     (i_support_decrypt & ~i_wont_support_decrypt)
 
-     static long
-       remote_supports_encrypt = 0;
-     static long
-       remote_supports_decrypt = 0;
+static long remote_supports_encrypt = 0;
+static long remote_supports_decrypt = 0;
 
-     static
-       Encryptions
-       encryptions[] = {
+static Encryptions encryptions[] = {
 # if defined DES_ENCRYPTION || defined SHISHI
-       {"DES_CFB64", ENCTYPE_DES_CFB64,
-       cfb64_encrypt,
-       cfb64_decrypt,
-       cfb64_init,
-       cfb64_start,
-       cfb64_is,
-       cfb64_reply,
-       cfb64_session,
-       cfb64_keyid,
-       cfb64_printsub},
-       {"DES_OFB64", ENCTYPE_DES_OFB64,
-       ofb64_encrypt,
-       ofb64_decrypt,
-       ofb64_init,
-       ofb64_start,
-       ofb64_is,
-       ofb64_reply,
-       ofb64_session,
-       ofb64_keyid,
-       ofb64_printsub},
+  {"DES_CFB64", ENCTYPE_DES_CFB64,
+   cfb64_encrypt,
+   cfb64_decrypt,
+   cfb64_init,
+   cfb64_start,
+   cfb64_is,
+   cfb64_reply,
+   cfb64_session,
+   cfb64_keyid,
+   cfb64_printsub},
+  {"DES_OFB64", ENCTYPE_DES_OFB64,
+   ofb64_encrypt,
+   ofb64_decrypt,
+   ofb64_init,
+   ofb64_start,
+   ofb64_is,
+   ofb64_reply,
+   ofb64_session,
+   ofb64_keyid,
+   ofb64_printsub},
 # endif        /* DES_ENCRYPTION */
-       {0,},
-     };
-
-static unsigned char str_send[64] = { IAC, SB, TELOPT_ENCRYPT,
-  ENCRYPT_SUPPORT
+  {0,},
 };
+
+static unsigned char str_send[64] =
+  { IAC, SB, TELOPT_ENCRYPT, ENCRYPT_SUPPORT };
 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;
+findencryption (int type)
 {
   Encryptions *ep = encryptions;
 
@@ -168,8 +157,7 @@ findencryption (type)
 }
 
 Encryptions *
-finddecryption (type)
-     int type;
+finddecryption (int type)
 {
   Encryptions *ep = encryptions;
 
@@ -189,19 +177,13 @@ static struct key_info
   int dir;
   int *modep;
   Encryptions *(*getcrypt) ();
-} ki[2] =
-{
-  {
-    {
-  0}, 0, DIR_ENCRYPT, &encrypt_mode, findencryption},
-  {
-    {
-0}, 0, DIR_DECRYPT, &decrypt_mode, finddecryption},};
+} ki[2] = {
+  {{0}, 0, DIR_ENCRYPT, &encrypt_mode, findencryption},
+  {{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;
 
@@ -234,7 +216,7 @@ encrypt_init (name, server)
 }
 
 void
-encrypt_list_types ()
+encrypt_list_types (void)
 {
   Encryptions *ep = encryptions;
 
@@ -247,8 +229,7 @@ encrypt_list_types ()
 }
 
 int
-EncryptEnable (type, mode)
-     char *type, *mode;
+EncryptEnable (char *type, *mode)
 {
   if (isprefix (type, "help") || isprefix (type, "?"))
     {
@@ -262,10 +243,9 @@ EncryptEnable (type, mode)
 }
 
 int
-EncryptDisable (type, mode)
-     char *type, *mode;
+EncryptDisable (char *type, *mode)
 {
-  register Encryptions *ep;
+  Encryptions *ep;
   int ret = 0;
 
   if (isprefix (type, "help") || isprefix (type, "?"))
@@ -275,13 +255,9 @@ EncryptDisable (type, mode)
     }
   else if ((ep = (Encryptions *) genget (type, encryptions,
                                         sizeof (Encryptions))) == 0)
-    {
-      printf ("%s: invalid encryption type\n", type);
-    }
+    printf ("%s: invalid encryption type\n", type);
   else if (Ambiguous (ep))
-    {
-      printf ("Ambiguous type '%s'\n", type);
-    }
+    printf ("Ambiguous type '%s'\n", type);
   else
     {
       if ((mode == 0) || (isprefix (mode, "input") ? 1 : 0))
@@ -305,11 +281,9 @@ EncryptDisable (type, mode)
 }
 
 int
-EncryptType (type, mode)
-     char *type;
-     char *mode;
+EncryptType (char *type, char *mode)
 {
-  register Encryptions *ep;
+  Encryptions *ep;
   int ret = 0;
 
   if (isprefix (type, "help") || isprefix (type, "?"))
@@ -319,13 +293,9 @@ EncryptType (type, mode)
     }
   else if ((ep = (Encryptions *) genget (type, encryptions,
                                         sizeof (Encryptions))) == 0)
-    {
-      printf ("%s: invalid encryption type\n", type);
-    }
+    printf ("%s: invalid encryption type\n", type);
   else if (Ambiguous (ep))
-    {
-      printf ("Ambiguous type '%s'\n", type);
-    }
+    printf ("Ambiguous type '%s'\n", type);
   else
     {
       if ((mode == 0) || isprefix (mode, "input"))
@@ -347,10 +317,9 @@ EncryptType (type, mode)
 }
 
 int
-EncryptStart (mode)
-     char *mode;
+EncryptStart (char *mode)
 {
-  register int ret = 0;
+  int ret = 0;
   if (mode)
     {
       if (isprefix (mode, "input"))
@@ -372,7 +341,7 @@ EncryptStart (mode)
 }
 
 int
-EncryptStartInput ()
+EncryptStartInput (void)
 {
   if (decrypt_mode)
     {
@@ -384,7 +353,7 @@ EncryptStartInput ()
 }
 
 int
-EncryptStartOutput ()
+EncryptStartOutput (void)
 {
   if (encrypt_mode)
     {
@@ -396,8 +365,7 @@ EncryptStartOutput ()
 }
 
 int
-EncryptStop (mode)
-     char *mode;
+EncryptStop (char *mode)
 {
   int ret = 0;
   if (mode)
@@ -421,21 +389,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",
@@ -446,7 +414,7 @@ encrypt_display ()
 }
 
 int
-EncryptStatus ()
+EncryptStatus (void)
 {
   if (encrypt_output)
     printf ("Currently encrypting output with %s\r\n",
@@ -457,10 +425,8 @@ EncryptStatus ()
       printf ("Last encryption mode was %s\r\n", ENCTYPE_NAME (encrypt_mode));
     }
   if (decrypt_input)
-    {
-      printf ("Currently decrypting input with %s\r\n",
-             ENCTYPE_NAME (decrypt_mode));
-    }
+    printf ("Currently decrypting input with %s\r\n",
+           ENCTYPE_NAME (decrypt_mode));
   else if (decrypt_mode)
     {
       printf ("Currently input is clear text.\r\n");
@@ -470,7 +436,7 @@ EncryptStatus ()
 }
 
 void
-encrypt_send_support ()
+encrypt_send_support (void)
 {
   if (str_suplen)
     {
@@ -488,8 +454,7 @@ encrypt_send_support ()
 }
 
 int
-EncryptDebug (on)
-     int on;
+EncryptDebug (int on)
 {
   if (on < 0)
     encrypt_debug_mode ^= 1;
@@ -501,8 +466,7 @@ EncryptDebug (on)
 }
 
 int
-EncryptVerbose (on)
-     int on;
+EncryptVerbose (int on)
 {
   if (on < 0)
     encrypt_verbose ^= 1;
@@ -513,8 +477,7 @@ EncryptVerbose (on)
 }
 
 int
-EncryptAutoEnc (on)
-     int on;
+EncryptAutoEnc (int on)
 {
   encrypt_auto (on);
   printf ("Automatic encryption of output is %s\r\n",
@@ -523,8 +486,7 @@ EncryptAutoEnc (on)
 }
 
 int
-EncryptAutoDec (on)
-     int on;
+EncryptAutoDec (int on)
 {
   decrypt_auto (on);
   printf ("Automatic decryption of input is %s\r\n",
@@ -536,11 +498,9 @@ 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;
+  int type, use_type = 0;
   Encryptions *ep;
 
   /*
@@ -578,12 +538,10 @@ 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;
+  int type, ret;
 
   if (--cnt < 0)
     return;
@@ -617,9 +575,7 @@ encrypt_is (data, cnt)
                (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret);
     }
   if (ret < 0)
-    {
-      autodecrypt = 0;
-    }
+    autodecrypt = 0;
   else
     {
       decrypt_mode = type;
@@ -629,12 +585,10 @@ 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;
+  int ret, type;
 
   if (--cnt < 0)
     return;
@@ -669,9 +623,7 @@ encrypt_reply (data, cnt)
   if (encrypt_debug_mode)
     printf (">>>%s: encrypt_reply returned %d\n", Name, ret);
   if (ret < 0)
-    {
-      autoencrypt = 0;
-    }
+    autoencrypt = 0;
   else
     {
       encrypt_mode = type;
@@ -684,9 +636,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;
 
@@ -724,9 +674,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;
 
@@ -744,7 +692,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)
@@ -757,7 +705,7 @@ encrypt_end ()
  * Called when ENCRYPT REQUEST-END is received.
  */
 void
-encrypt_request_end ()
+encrypt_request_end (void)
 {
   encrypt_send_end ();
 }
@@ -769,9 +717,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)
     {
@@ -786,15 +732,12 @@ static unsigned char str_keyid[(MAXKEYLEN * 2) + 5] =
   { IAC, SB, TELOPT_ENCRYPT };
 
 static 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;
   unsigned char *strp, *cp;
   int dir = kp->dir;
-  register int ret = 0;
+  int ret = 0;
 
   if (len > MAXKEYLEN)
     len = MAXKEYLEN;
@@ -840,27 +783,19 @@ encrypt_keyid (kp, keyid, len)
 }
 
 void
-encrypt_enc_keyid (keyid, len)
-     unsigned char *keyid;
-     int len;
+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;
+encrypt_dec_keyid (unsigned char *keyid, int len)
 {
   encrypt_keyid (&ki[0], 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;
 
@@ -884,8 +819,7 @@ encrypt_send_keyid (dir, keyid, keylen, saveit)
 }
 
 void
-encrypt_auto (on)
-     int on;
+encrypt_auto (int on)
 {
   if (on < 0)
     autoencrypt ^= 1;
@@ -894,8 +828,7 @@ encrypt_auto (on)
 }
 
 void
-decrypt_auto (on)
-     int on;
+decrypt_auto (int on)
 {
   if (on < 0)
     autodecrypt ^= 1;
@@ -904,12 +837,11 @@ decrypt_auto (on)
 }
 
 void
-encrypt_start_output (type)
-     int type;
+encrypt_start_output (int type)
 {
   Encryptions *ep;
-  register unsigned char *p;
-  register int i;
+  unsigned char *p;
+  int i;
 
   if (!(ep = findencryption (type)))
     {
@@ -964,7 +896,7 @@ encrypt_start_output (type)
 }
 
 void
-encrypt_send_end ()
+encrypt_send_end (void)
 {
   if (!encrypt_output)
     return;
@@ -985,10 +917,10 @@ encrypt_send_end ()
 }
 
 void
-encrypt_send_request_start ()
+encrypt_send_request_start (void)
 {
-  register unsigned char *p;
-  register int i;
+  unsigned char *p;
+  int i;
 
   p = &str_start[3];
   *p++ = ENCRYPT_REQSTART;
@@ -1006,7 +938,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));
@@ -1017,9 +949,9 @@ encrypt_send_request_end ()
 }
 
 void
-encrypt_wait ()
+encrypt_wait (void)
 {
-  register int encrypt, decrypt;
+  int encrypt, decrypt;
   if (encrypt_debug_mode)
     printf (">>>%s: in encrypt_wait\r\n", Name);
   if (!havesessionkey || !(I_SUPPORT_ENCRYPT & remote_supports_decrypt))
@@ -1030,16 +962,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;
 
@@ -1060,12 +990,11 @@ encrypt_gen_printsub (data, cnt, buf, buflen)
 }
 
 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];
+  int type = data[1];
 
   for (ep = encryptions; ep->type && ep->type != type; ep++)
     ;

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=665f1e73cdd9b38e2d2e11b8db9958a315935592


commit 665f1e73cdd9b38e2d2e11b8db9958a315935592
Author: Alfred M. Szmidt <address@hidden>
Date:   Sun Dec 25 13:11:52 2011 +0100

    libtelnet/encrypt.c (encrypt_keyid): Make sure that LEN never is greater 
than MAXKEYLEN.

diff --git a/ChangeLog b/ChangeLog
index dd381d1..f4e4457 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-25  Alfred M. Szmidt  <address@hidden>
+
+       * libtelnet/encrypt.c (encrypt_keyid): Make sure that LEN never is
+       greater than MAXKEYLEN.
+
 2011-12-22  Mats Erik Andersson <address@hidden>
 
        * libinetutils/setsig.c (setsig) [HAVE_SIGACTION]: Initialize
diff --git a/libtelnet/encrypt.c b/libtelnet/encrypt.c
index 06827d9..abfa6d4 100644
--- a/libtelnet/encrypt.c
+++ b/libtelnet/encrypt.c
@@ -796,6 +796,9 @@ encrypt_keyid (kp, keyid, len)
   int dir = kp->dir;
   register int ret = 0;
 
+  if (len > MAXKEYLEN)
+    len = MAXKEYLEN;
+
   if (!(ep = (*kp->getcrypt) (*kp->modep)))
     {
       if (len == 0)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   14 +++
 libtelnet/encrypt.c |  274 +++++++++++++++++++--------------------------------
 2 files changed, 117 insertions(+), 171 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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