diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-02-13 20:47:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-02-13 20:47:17 +0000 |
commit | 7fa0ba0a113967611fb4f24cf36cea59d9a8f0e2 (patch) | |
tree | 4c08a2f841efc9f7a5ad6f29224be388764eaac4 /packet-isakmp.c | |
parent | bea00e22cf3bf02eb574ec95a949de069d742b85 (diff) |
Updates from Yaniv Kaul to show the certificate encoding and type
symbolically.
svn path=/trunk/; revision=3031
Diffstat (limited to 'packet-isakmp.c')
-rw-r--r-- | packet-isakmp.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/packet-isakmp.c b/packet-isakmp.c index efa111001d..2a22ca7620 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -3,7 +3,7 @@ * (ISAKMP) (RFC 2408) * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-isakmp.c,v 1.34 2001/01/09 06:31:37 guy Exp $ + * $Id: packet-isakmp.c,v 1.35 2001/02/13 20:47:17 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -323,7 +323,7 @@ static const char *value2str(int, guint16, guint16); static const char *num2str(const guint8 *, guint16); static const char *attrtype2str(guint8); static const char *cfgattrident2str(guint16); - +static const char *certtype2str(guint8); #define NUM_LOAD_TYPES 15 #define loadtype2str(t) \ ((t < NUM_LOAD_TYPES) ? strfuncs[t].str : "Unknown payload type") @@ -754,7 +754,7 @@ dissect_cert(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { offset += sizeof(length); proto_tree_add_text(ntree, NullTVB, offset, sizeof(hdr->cert_enc), - "Certificate encoding: %u", hdr->cert_enc); + "Certificate encoding: %u - %s", hdr->cert_enc,certtype2str(hdr->cert_enc)); offset += sizeof(hdr->cert_enc); proto_tree_add_text(ntree, NullTVB, offset, length - sizeof(*hdr), "Certificate Data"); @@ -790,7 +790,7 @@ dissect_certreq(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) offset += sizeof(length); proto_tree_add_text(ntree, NullTVB, offset, sizeof(hdr->cert_type), - "Certificate type: %u", hdr->cert_type); + "Certificate type: %u - %s", hdr->cert_type,certtype2str(hdr->cert_type)); offset += sizeof(hdr->cert_type); proto_tree_add_text(ntree, NullTVB, offset, length - sizeof(*hdr), "Certificate Authority"); @@ -1407,6 +1407,27 @@ cfgattrident2str(guint16 ident) { } static const char * +certtype2str(guint8 type) { +#define NUM_CERTTYPE 11 + static const char *msgs[NUM_CERTTYPE] = { + "NONE", + "PKCS #7 wrapped X.509 certificate", + "PGP Certificate", + "DNS Signed Key", + "X.509 Certificate - Signature", + "X.509 Certificate - Key Exchange", + "Kerberos Tokens", + "Certificate Revocation List (CRL)", + "Authority Revocation List (ARL)", + "SPKI Certificate", + "X.509 Certificate - Attribute", + }; + if(type > NUM_CERTTYPE) + return "RESERVED"; + return msgs[type]; +} + +static const char * num2str(const guint8 *pd, guint16 len) { #define NUMSTR_LEN 1024 |