2004-09-16 08:55:33 +00:00
|
|
|
/* packet-pkinit.c
|
|
|
|
* Routines for PKINIT packet dissection
|
2004-11-22 03:36:26 +00:00
|
|
|
* Ronnie Sahlberg 2004
|
2004-09-16 08:55:33 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-09-16 08:55:33 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2004-09-16 08:55:33 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 01:29:52 +00:00
|
|
|
#include "config.h"
|
2004-09-16 08:55:33 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2004-09-16 08:55:33 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
#include "packet-pkinit.h"
|
2004-09-17 08:11:30 +00:00
|
|
|
#include "packet-cms.h"
|
|
|
|
#include "packet-pkix1explicit.h"
|
2004-10-28 22:06:55 +00:00
|
|
|
#include "packet-kerberos.h"
|
2004-09-16 08:55:33 +00:00
|
|
|
|
|
|
|
#define PNAME "PKINIT"
|
|
|
|
#define PSNAME "PKInit"
|
|
|
|
#define PFNAME "pkinit"
|
|
|
|
|
2013-12-08 15:40:10 +00:00
|
|
|
void proto_register_pkinit(void);
|
|
|
|
void proto_reg_handoff_pkinit(void);
|
|
|
|
|
2004-09-16 08:55:33 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_pkinit = -1;
|
|
|
|
#include "packet-pkinit-hf.c"
|
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
#include "packet-pkinit-ett.c"
|
|
|
|
|
2007-05-13 20:58:29 +00:00
|
|
|
static int dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
|
|
|
|
static int dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
|
2012-07-17 19:43:17 +00:00
|
|
|
static int dissect_KerberosV5Spec2_Realm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
|
|
|
|
static int dissect_KerberosV5Spec2_PrincipalName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
|
2004-09-16 08:55:33 +00:00
|
|
|
|
|
|
|
#include "packet-pkinit-fn.c"
|
|
|
|
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_PA_PK_AS_REQ(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
|
|
|
|
offset = dissect_pkinit_PaPkAsReq(FALSE, tvb, offset, actx, tree, -1);
|
2004-09-16 08:55:33 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2004-09-17 23:32:33 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_PA_PK_AS_REP(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
|
|
|
|
offset = dissect_pkinit_PaPkAsRep(FALSE, tvb, offset, actx, tree, -1);
|
2004-09-17 23:32:33 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2004-10-28 22:06:55 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
|
|
|
|
offset = dissect_krb5_ctime(tree, tvb, offset, actx);
|
2004-10-28 22:06:55 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_KerberosV5Spec2_Checksum(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
|
|
|
|
offset = dissect_krb5_Checksum(tree, tvb, offset, actx);
|
2004-10-28 22:06:55 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-07-17 19:43:17 +00:00
|
|
|
static int
|
|
|
|
dissect_KerberosV5Spec2_Realm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
|
|
|
|
offset = dissect_krb5_realm(tree, tvb, offset, actx);
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_KerberosV5Spec2_PrincipalName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
|
|
|
|
offset = dissect_krb5_cname(tree, tvb, offset, actx);
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2004-09-16 08:55:33 +00:00
|
|
|
|
|
|
|
/*--- proto_register_pkinit ----------------------------------------------*/
|
|
|
|
void proto_register_pkinit(void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
#include "packet-pkinit-hfarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
#include "packet-pkinit-ettarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Register protocol */
|
|
|
|
proto_pkinit = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array(proto_pkinit, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_pkinit -------------------------------------------*/
|
|
|
|
void proto_reg_handoff_pkinit(void) {
|
2004-11-01 17:49:53 +00:00
|
|
|
#include "packet-pkinit-dis-tab.c"
|
2004-09-16 08:55:33 +00:00
|
|
|
}
|
|
|
|
|