]> The Tcpdump Group git mirrors - tcpdump/commitdiff
bugfix: use the correct codepoint for the OSPF simple text auth token entry.
authorhannes <hannes>
Wed, 13 Dec 2006 08:21:49 +0000 (08:21 +0000)
committerhannes <hannes>
Wed, 13 Dec 2006 08:21:49 +0000 (08:21 +0000)
use safeputs to print the password.

ospf.h
print-ospf.c

diff --git a/ospf.h b/ospf.h
index da15f5b22e3b12c740ef8b41f9ac5b3ae246fe28..dc4debb37cdaea95d9b93b0d40eab6293fd80ec6 100644 (file)
--- a/ospf.h
+++ b/ospf.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.18 2006-09-05 15:46:42 hannes Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.19 2006-12-13 08:21:50 hannes Exp $ (LBL) */
 /*
  * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
  *     The Regents of the University of California.  All rights reserved.
@@ -48,6 +48,7 @@
 /* ospf_authtype       */
 #define        OSPF_AUTH_NONE          0       /* No auth-data */
 #define        OSPF_AUTH_SIMPLE        1       /* Simple password */
+#define OSPF_AUTH_SIMPLE_LEN   8       /* max length of simple authentication */
 #define OSPF_AUTH_MD5          2       /* MD5 authentication */
 #define OSPF_AUTH_MD5_LEN      16      /* length of MD5 authentication */
 
index 3f438b9c8c46346f740f524f18a667681e8aac10..8112f03ce4fc5f8525f26ca2a299131ddeb68394 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.60 2006-09-05 15:46:42 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.61 2006-12-13 08:21:49 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -57,7 +57,7 @@ static struct tok ospf_option_values[] = {
 
 static struct tok ospf_authtype_values[] = {
        { OSPF_AUTH_NONE,       "none" },
-       { OSPF_AUTH_NONE,       "simple" },
+       { OSPF_AUTH_SIMPLE,     "simple" },
        { OSPF_AUTH_MD5,        "MD5" },
        { 0,                    NULL }
 };
@@ -978,12 +978,8 @@ ospf_print(register const u_char *bp, register u_int length,
                        break;
 
                case OSPF_AUTH_SIMPLE:
-                       if (fn_printn(op->ospf_authdata,
-                           sizeof(op->ospf_authdata), snapend)) {
-                               printf("\"");
-                               goto trunc;
-                       }
-                       printf("\"");
+                        printf("\n\tSimple text password: ");
+                        safeputs(op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN);
                        break;
 
                case OSPF_AUTH_MD5: