]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isakmp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-isakmp.c
index a3c06d1dd2504d698d5df0cae3a01e0a75ed946c..be5b0930c1aea385bd023f4dabb998cc8ae94707 100644 (file)
 
 #include <config.h>
 
-/* The functions from print-esp.c used in this file are only defined when both
- * OpenSSL and evp.h are detected. Employ the same preprocessor device here.
- */
-#ifndef HAVE_OPENSSL_EVP_H
-#undef HAVE_LIBCRYPTO
-#endif
-
 #include "netdissect-stdinc.h"
 
 #include <string.h>
@@ -120,9 +113,9 @@ struct isakmp {
 #define ISAKMP_FLAG_extra 0x04
 
 /* IKEv2 */
-#define ISAKMP_FLAG_I (1 << 3)  /* (I)nitiator */
-#define ISAKMP_FLAG_V (1 << 4)  /* (V)ersion   */
-#define ISAKMP_FLAG_R (1 << 5)  /* (R)esponse  */
+#define ISAKMP_FLAG_I (1 << 3)  /* Initiator */
+#define ISAKMP_FLAG_V (1 << 4)  /* Version   */
+#define ISAKMP_FLAG_R (1 << 5)  /* Response  */
 
 
 /* 3.2 Payload Generic Header
@@ -241,7 +234,7 @@ struct ikev1_pl_cr {
        Certificate Types (variable length)
          -- Contains a list of the types of certificates requested,
          sorted in order of preference.  Each individual certificate
-         type is 1 octet.  This field is NOT requiredo
+         type is 1 octet.  This field is NOT required.
        */
        /* # Certificate Authorities (1 octet) */
        /* Certificate Authorities (variable length) */
@@ -1444,10 +1437,8 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_,
                case IPSECDOI_ID_FQDN:
                case IPSECDOI_ID_USER_FQDN:
                    {
-                       u_int i;
                        ND_PRINT(" len=%u ", len);
-                       for (i = 0; i < len; i++)
-                               fn_print_char(ndo, GET_U_1(data + i));
+                       nd_printjn(ndo, data, len);
                        len = 0;
                        break;
                    }
@@ -2259,7 +2250,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay,
                uint32_t proto _U_, int depth _U_)
 {
        const struct ikev2_id *idp;
-       u_int idtype_len, i;
+       u_int idtype_len;
        unsigned int dumpascii, dumphex;
        const unsigned char *typedata;
 
@@ -2316,13 +2307,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay,
 
        if(dumpascii) {
                ND_TCHECK_LEN(typedata, idtype_len);
-               for(i=0; i<idtype_len; i++) {
-                       if(ND_ASCII_ISPRINT(GET_U_1(typedata + i))) {
-                               ND_PRINT("%c", GET_U_1(typedata + i));
-                       } else {
-                               ND_PRINT(".");
-                       }
-               }
+               nd_printjn(ndo, typedata, idtype_len);
        }
        if(dumphex) {
                if (!rawprint(ndo, (const uint8_t *)typedata, idtype_len))
@@ -2857,7 +2842,7 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay,
                uint32_t proto _U_, int depth _U_)
 {
        const u_char *vid;
-       u_int i, len;
+       u_int len;
 
        ND_TCHECK_SIZE(ext);
        ikev2_pay_print(ndo, NPSTR(tpay), GET_U_1(ext->critical));
@@ -2870,11 +2855,7 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay,
        vid = (const u_char *)(ext+1);
        len = item_len - 4;
        ND_TCHECK_LEN(vid, len);
-       for(i=0; i<len; i++) {
-               if(ND_ASCII_ISPRINT(GET_U_1(vid + i)))
-                       ND_PRINT("%c", GET_U_1(vid + i));
-               else ND_PRINT(".");
-       }
+       nd_printjn(ndo, vid, len);
        if (2 < ndo->ndo_vflag && 4 < len) {
                /* Print the entire payload in hex */
                ND_PRINT(" ");