Skip to content

Commit 5fa8fc6

Browse files
author
mcr
committed
added "make check"
when optimization is not on, glibc6 doesn't define ntohs(), and our attempt to optimize it for x86 doesn't work --- the functions need to be static, not extern. added decryption of IKE v2 payloads, when keys are provided by -E.
1 parent c51a2d7 commit 5fa8fc6

File tree

6 files changed

+471
-139
lines changed

6 files changed

+471
-139
lines changed

Makefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1818
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1919
#
20-
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.317 2007-09-24 23:46:26 guy Exp $ (LBL)
20+
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.318 2007-11-24 18:13:33 mcr Exp $ (LBL)
2121

2222
#
2323
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -197,6 +197,9 @@ distclean:
197197
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
198198
config.h gnuc.h os-proto.h stamp-h stamp-h.in
199199

200+
check:
201+
(cd tests && ./TESTrun.sh)
202+
200203
tags: $(TAGFILES)
201204
ctags -wtd $(TAGFILES)
202205

isakmp.h

+21-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*/
29-
/* YIPS @(#)$Id: isakmp.h,v 1.11 2007-08-29 02:38:14 mcr Exp $ */
29+
/* YIPS @(#)$Id: isakmp.h,v 1.12 2007-11-24 18:13:33 mcr Exp $ */
3030

3131
/* refer to RFC 2408 */
3232

@@ -127,6 +127,7 @@ struct isakmp {
127127
#define ISAKMP_NPTYPE_N 11 /* Notification */
128128
#define ISAKMP_NPTYPE_D 12 /* Delete */
129129
#define ISAKMP_NPTYPE_VID 13 /* Vendor ID */
130+
#define ISAKMP_NPTYPE_v2E 46 /* v2 Encrypted payload */
130131

131132
#define IKEv1_MAJOR_VERSION 1
132133
#define IKEv1_MINOR_VERSION 0
@@ -422,14 +423,31 @@ struct ikev2_ke {
422423
};
423424

424425

426+
/* 3.5. Identification Payloads */
427+
enum ikev2_id_type {
428+
ID_IPV4_ADDR=1,
429+
ID_FQDN=2,
430+
ID_RFC822_ADDR=3,
431+
ID_IPV6_ADDR=5,
432+
ID_DER_ASN1_DN=9,
433+
ID_DER_ASN1_GN=10,
434+
ID_KEY_ID=11,
435+
};
436+
struct ikev2_id {
437+
struct isakmp_gen h;
438+
u_int8_t type; /* ID type */
439+
u_int8_t res1;
440+
u_int16_t res2;
441+
/* SPI */
442+
/* Notification Data */
443+
};
444+
425445
/* 3.10 Notification Payload */
426446
struct ikev2_n {
427447
struct isakmp_gen h;
428448
u_int8_t prot_id; /* Protocol-ID */
429449
u_int8_t spi_size; /* SPI Size */
430450
u_int16_t type; /* Notify Message Type */
431-
/* SPI */
432-
/* Notification Data */
433451
};
434452

435453
enum ikev2_n_type {

netdissect.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
2222
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2323
*
24-
* @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.23 2007-01-29 09:59:42 hannes Exp $ (LBL)
24+
* @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.24 2007-11-24 18:13:33 mcr Exp $ (LBL)
2525
*/
2626

2727
#ifndef netdissect_h
@@ -438,4 +438,11 @@ extern u_short in_cksum(const u_short *,
438438

439439
#endif
440440

441+
extern void esp_print_decodesecret(netdissect_options *ndo);
442+
extern int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
443+
int initiator,
444+
u_char spii[8], u_char spir[8],
445+
u_char *buf, u_char *end);
446+
447+
441448
#endif /* netdissect_h */

0 commit comments

Comments
 (0)