X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/448422487f2f7da9a8da9a5ae7f0380b46da1eff..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-isakmp.c?ds=sidebyside diff --git a/print-isakmp.c b/print-isakmp.c index c08bbc08..6a978ad0 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -32,16 +32,7 @@ /* specification: RFC 2407, RFC 2408, RFC 5996 */ -#ifdef HAVE_CONFIG_H #include -#endif - -/* 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" @@ -122,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 @@ -243,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) */ @@ -1828,14 +1819,16 @@ ikev1_d_print(netdissect_options *ndo, u_char tpay _U_, ND_PRINT(" spilen=%u", spi_size); num_spi = GET_BE_U_2(p->num_spi); ND_PRINT(" nspi=%u", num_spi); - ND_PRINT(" spi="); q = (const uint8_t *)(p + 1); - for (i = 0; i < num_spi; i++) { - if (i != 0) - ND_PRINT(","); - if (!rawprint(ndo, (const uint8_t *)q, spi_size)) - goto trunc; - q += spi_size; + if (spi_size) { + ND_PRINT(" spi="); + for (i = 0; i < num_spi; i++) { + if (i != 0) + ND_PRINT(","); + if (!rawprint(ndo, (const uint8_t *)q, spi_size)) + goto trunc; + q += spi_size; + } } return q; trunc: