#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.23 2000-10-03 05:16:38 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.26 2000-12-12 09:20:26 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
-#ifdef INET6
-#include <netinet/ip6.h>
-#endif
-
#include <stdio.h>
#include <netdb.h>
#include "extract.h" /* must come after interface.h */
#include "ip.h"
+#ifdef INET6
+#include "ip6.h"
+#endif
#ifndef HAVE_SOCKADDR_STORAGE
#define sockaddr_storage sockaddr
{
struct isakmp_pl_sa *p, sa;
u_int32_t *q;
- u_int32_t doi;
- u_int32_t sit;
- u_char *cp;
+ u_int32_t doi, sit, ident;
+ u_char *cp, *np;
int t;
printf("%s:", NPSTR(ISAKMP_NPTYPE_SA));
p = (struct isakmp_pl_sa *)ext;
safememcpy(&sa, ext, sizeof(sa));
doi = ntohl(sa.doi);
+ sit = ntohl(sa.sit);
if (doi != 1) {
printf(" doi=%d", doi);
printf(" situation=%u", (u_int32_t)ntohl(sa.sit));
q = (u_int32_t *)&sa.sit;
printf(" situation=");
t = 0;
- if (ntohl(*q) & 0x01) {
+ if (sit & 0x01) {
printf("identity");
t++;
}
- if (ntohl(*q) & 0x02) {
+ if (sit & 0x02) {
printf("%ssecrecy", t ? "+" : "");
t++;
}
- if (ntohl(*q) & 0x04)
+ if (sit & 0x04)
printf("%sintegrity", t ? "+" : "");
- sit = htonl(*q++);
- if (sit != 0x01)
- printf(" ident=%u", (u_int32_t)ntohl(*q++));
+ np = (u_char *)ext + sizeof(sa);
+ if (sit != 0x01) {
+ safememcpy(&ident, ext + 1, sizeof(ident));
+ printf(" ident=%u", (u_int32_t)ntohl(ident));
+ np += sizeof(ident);
+ }
- ext = (struct isakmp_gen *)q;
+ ext = (struct isakmp_gen *)np;
cp = isakmp_sub_print(ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0);
static char *ah_p_map[] = {
NULL, "(reserved)", "md5", "sha", "1des",
+ "sha2-256", "sha2-384", "sha2-512",
};
static char *esp_p_map[] = {
NULL, "1des-iv64", "1des", "3des", "rc5", "idea", "cast",
- "blowfish", "3idea", "1des-iv32", "rc4", "null"
+ "blowfish", "3idea", "1des-iv32", "rc4", "null", "aes"
};
static char *ipcomp_p_map[] = {
struct attrmap oakley_t_map[] = {
{ NULL, 0 },
- { "enc", 7, { NULL, "1des", "idea", "blowfish", "rc5",
- "3des", "cast"}, },
- { "hash", 4, { NULL, "md5", "sha1", "tiger", }, },
+ { "enc", 8, { NULL, "1des", "idea", "blowfish", "rc5",
+ "3des", "cast", "aes", }, },
+ { "hash", 7, { NULL, "md5", "sha1", "tiger",
+ "sha2-256", "sha2-384", "sha2-512", }, },
{ "auth", 6, { NULL, "preshared", "dss", "rsa sig", "rsa enc",
"rsa enc revised", }, },
{ "group desc", 5, { NULL, "modp768", "modp1024", "EC2N 2^155",