2013-04-11 18:14:53 +00:00
|
|
|
/* Do not modify this file. Changes will be overwritten. */
|
|
|
|
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
|
2007-11-04 18:47:49 +00:00
|
|
|
/* packet-pkinit.c */
|
2011-10-15 19:27:27 +00:00
|
|
|
/* ../../tools/asn2wrs.py -b -p pkinit -c ./pkinit.cnf -s ./packet-pkinit-template -D . -O ../../epan/dissectors PKINIT.asn */
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/* Input file: packet-pkinit-template.c */
|
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
/* packet-pkinit.c
|
|
|
|
* Routines for PKINIT packet dissection
|
2004-11-22 03:36:26 +00:00
|
|
|
* Ronnie Sahlberg 2004
|
2004-09-16 09:01:20 +00:00
|
|
|
*
|
2005-08-02 05:39:45 +00:00
|
|
|
* $Id$
|
2004-09-16 09:01:20 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-09-16 09:01:20 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-09-16 09:01:20 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
#include "packet-pkinit.h"
|
2004-09-17 08:12:21 +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 09:01:20 +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 09:01:20 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_pkinit = -1;
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-hf.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-hf.c"
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_AuthPack_PDU = -1; /* AuthPack */
|
2012-07-17 19:43:17 +00:00
|
|
|
static int hf_pkinit_KRB5PrincipalName_PDU = -1; /* KRB5PrincipalName */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_KDCDHKeyInfo_PDU = -1; /* KDCDHKeyInfo */
|
2004-09-16 09:01:20 +00:00
|
|
|
static int hf_pkinit_signedAuthPack = -1; /* ContentInfo */
|
2005-06-26 05:48:50 +00:00
|
|
|
static int hf_pkinit_trustedCertifiers = -1; /* SEQUENCE_OF_TrustedCA */
|
2004-09-16 09:01:20 +00:00
|
|
|
static int hf_pkinit_trustedCertifiers_item = -1; /* TrustedCA */
|
|
|
|
static int hf_pkinit_kdcCert = -1; /* IssuerAndSerialNumber */
|
|
|
|
static int hf_pkinit_caName = -1; /* Name */
|
|
|
|
static int hf_pkinit_issuerAndSerial = -1; /* IssuerAndSerialNumber */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_pkAuthenticator = -1; /* PKAuthenticator */
|
|
|
|
static int hf_pkinit_clientPublicValue = -1; /* SubjectPublicKeyInfo */
|
2005-06-26 05:48:50 +00:00
|
|
|
static int hf_pkinit_supportedCMSTypes = -1; /* SEQUENCE_OF_AlgorithmIdentifier */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_supportedCMSTypes_item = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkinit_cusec = -1; /* INTEGER */
|
|
|
|
static int hf_pkinit_ctime = -1; /* KerberosTime */
|
2004-11-01 17:49:53 +00:00
|
|
|
static int hf_pkinit_paNonce = -1; /* INTEGER_0_4294967295 */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_paChecksum = -1; /* Checksum */
|
2012-07-17 19:43:17 +00:00
|
|
|
static int hf_pkinit_realm = -1; /* Realm */
|
|
|
|
static int hf_pkinit_principalName = -1; /* PrincipalName */
|
2004-09-17 23:33:10 +00:00
|
|
|
static int hf_pkinit_dhSignedData = -1; /* ContentInfo */
|
|
|
|
static int hf_pkinit_encKeyPack = -1; /* ContentInfo */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_subjectPublicKey = -1; /* BIT_STRING */
|
2004-11-01 17:49:53 +00:00
|
|
|
static int hf_pkinit_dhNonce = -1; /* INTEGER */
|
2004-10-28 22:06:55 +00:00
|
|
|
static int hf_pkinit_dhKeyExpiration = -1; /* KerberosTime */
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkinit-hf.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 48 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-ett.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-ett.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
static gint ett_pkinit_PaPkAsReq = -1;
|
2005-06-26 05:48:50 +00:00
|
|
|
static gint ett_pkinit_SEQUENCE_OF_TrustedCA = -1;
|
2004-09-16 09:01:20 +00:00
|
|
|
static gint ett_pkinit_TrustedCA = -1;
|
2004-10-28 22:06:55 +00:00
|
|
|
static gint ett_pkinit_AuthPack = -1;
|
2005-06-26 05:48:50 +00:00
|
|
|
static gint ett_pkinit_SEQUENCE_OF_AlgorithmIdentifier = -1;
|
2004-10-28 22:06:55 +00:00
|
|
|
static gint ett_pkinit_PKAuthenticator = -1;
|
2012-07-17 19:43:17 +00:00
|
|
|
static gint ett_pkinit_KRB5PrincipalName = -1;
|
2004-09-17 23:33:10 +00:00
|
|
|
static gint ett_pkinit_PaPkAsRep = -1;
|
2004-10-28 22:06:55 +00:00
|
|
|
static gint ett_pkinit_KDCDHKeyInfo = -1;
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkinit-ett.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 51 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
|
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 09:01:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-fn.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-fn.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
|
2005-06-26 05:48:50 +00:00
|
|
|
static const value_string pkinit_TrustedCA_vals[] = {
|
2004-09-16 09:01:20 +00:00
|
|
|
{ 0, "caName" },
|
|
|
|
{ 2, "issuerAndSerial" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_choice_t TrustedCA_choice[] = {
|
|
|
|
{ 0, &hf_pkinit_caName , BER_CLASS_CON, 0, 0, dissect_pkix1explicit_Name },
|
|
|
|
{ 2, &hf_pkinit_issuerAndSerial, BER_CLASS_CON, 2, 0, dissect_cms_IssuerAndSerialNumber },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2004-09-16 09:01:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_TrustedCA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
TrustedCA_choice, hf_index, ett_pkinit_TrustedCA,
|
|
|
|
NULL);
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-07-21 21:12:09 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t SEQUENCE_OF_TrustedCA_sequence_of[1] = {
|
|
|
|
{ &hf_pkinit_trustedCertifiers_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkinit_TrustedCA },
|
2004-09-16 09:01:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_SEQUENCE_OF_TrustedCA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SEQUENCE_OF_TrustedCA_sequence_of, hf_index, ett_pkinit_SEQUENCE_OF_TrustedCA);
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-09-02 05:43:49 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t PaPkAsReq_sequence[] = {
|
|
|
|
{ &hf_pkinit_signedAuthPack, BER_CLASS_CON, 0, 0, dissect_cms_ContentInfo },
|
|
|
|
{ &hf_pkinit_trustedCertifiers, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkinit_SEQUENCE_OF_TrustedCA },
|
|
|
|
{ &hf_pkinit_kdcCert , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_cms_IssuerAndSerialNumber },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-09-16 09:01:20 +00:00
|
|
|
};
|
|
|
|
|
2008-10-15 20:08:10 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_PaPkAsReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PaPkAsReq_sequence, hf_index, ett_pkinit_PaPkAsReq);
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-10-15 20:08:10 +00:00
|
|
|
NULL);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_INTEGER_0_4294967295(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-10-15 20:08:10 +00:00
|
|
|
NULL);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-09-02 05:43:49 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t PKAuthenticator_sequence[] = {
|
|
|
|
{ &hf_pkinit_cusec , BER_CLASS_CON, 0, 0, dissect_pkinit_INTEGER },
|
|
|
|
{ &hf_pkinit_ctime , BER_CLASS_CON, 1, 0, dissect_KerberosV5Spec2_KerberosTime },
|
|
|
|
{ &hf_pkinit_paNonce , BER_CLASS_CON, 2, 0, dissect_pkinit_INTEGER_0_4294967295 },
|
|
|
|
{ &hf_pkinit_paChecksum , BER_CLASS_CON, 3, 0, dissect_KerberosV5Spec2_Checksum },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-10-28 22:06:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_PKAuthenticator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PKAuthenticator_sequence, hf_index, ett_pkinit_PKAuthenticator);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-07-21 21:12:09 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t SEQUENCE_OF_AlgorithmIdentifier_sequence_of[1] = {
|
|
|
|
{ &hf_pkinit_supportedCMSTypes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
|
2004-10-28 22:06:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_SEQUENCE_OF_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SEQUENCE_OF_AlgorithmIdentifier_sequence_of, hf_index, ett_pkinit_SEQUENCE_OF_AlgorithmIdentifier);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-09-02 05:43:49 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t AuthPack_sequence[] = {
|
|
|
|
{ &hf_pkinit_pkAuthenticator, BER_CLASS_CON, 0, 0, dissect_pkinit_PKAuthenticator },
|
|
|
|
{ &hf_pkinit_clientPublicValue, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_SubjectPublicKeyInfo },
|
|
|
|
{ &hf_pkinit_supportedCMSTypes, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkinit_SEQUENCE_OF_AlgorithmIdentifier },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-10-28 22:06:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_AuthPack(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
AuthPack_sequence, hf_index, ett_pkinit_AuthPack);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-17 19:43:17 +00:00
|
|
|
static const ber_sequence_t KRB5PrincipalName_sequence[] = {
|
|
|
|
{ &hf_pkinit_realm , BER_CLASS_CON, 0, 0, dissect_KerberosV5Spec2_Realm },
|
|
|
|
{ &hf_pkinit_principalName, BER_CLASS_CON, 1, 0, dissect_KerberosV5Spec2_PrincipalName },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkinit_KRB5PrincipalName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
KRB5PrincipalName_sequence, hf_index, ett_pkinit_KRB5PrincipalName);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-10-15 20:08:10 +00:00
|
|
|
const value_string pkinit_PaPkAsRep_vals[] = {
|
2004-09-17 23:33:10 +00:00
|
|
|
{ 0, "dhSignedData" },
|
|
|
|
{ 1, "encKeyPack" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_choice_t PaPkAsRep_choice[] = {
|
|
|
|
{ 0, &hf_pkinit_dhSignedData , BER_CLASS_CON, 0, 0, dissect_cms_ContentInfo },
|
|
|
|
{ 1, &hf_pkinit_encKeyPack , BER_CLASS_CON, 1, 0, dissect_cms_ContentInfo },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2004-09-17 23:33:10 +00:00
|
|
|
};
|
|
|
|
|
2008-10-15 20:08:10 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_PaPkAsRep(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
PaPkAsRep_choice, hf_index, ett_pkinit_PaPkAsRep,
|
|
|
|
NULL);
|
2004-09-17 23:33:10 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-02 05:43:49 +00:00
|
|
|
|
2004-10-28 22:06:55 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
|
2005-09-02 05:43:49 +00:00
|
|
|
NULL, hf_index, -1,
|
|
|
|
NULL);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-09-02 05:43:49 +00:00
|
|
|
|
2007-11-04 18:47:49 +00:00
|
|
|
static const ber_sequence_t KDCDHKeyInfo_sequence[] = {
|
|
|
|
{ &hf_pkinit_subjectPublicKey, BER_CLASS_CON, 0, 0, dissect_pkinit_BIT_STRING },
|
|
|
|
{ &hf_pkinit_dhNonce , BER_CLASS_CON, 1, 0, dissect_pkinit_INTEGER },
|
|
|
|
{ &hf_pkinit_dhKeyExpiration, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_KerberosV5Spec2_KerberosTime },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-10-28 22:06:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkinit_KDCDHKeyInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-11-04 18:47:49 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
KDCDHKeyInfo_sequence, hf_index, ett_pkinit_KDCDHKeyInfo);
|
2004-10-28 22:06:55 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--- PDUs ---*/
|
|
|
|
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_AuthPack_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
|
|
|
dissect_pkinit_AuthPack(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkinit_AuthPack_PDU);
|
2004-10-28 22:06:55 +00:00
|
|
|
}
|
2012-07-17 19:43:17 +00:00
|
|
|
static void dissect_KRB5PrincipalName_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
|
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
|
|
|
dissect_pkinit_KRB5PrincipalName(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkinit_KRB5PrincipalName_PDU);
|
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_KDCDHKeyInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
|
|
|
dissect_pkinit_KDCDHKeyInfo(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkinit_KDCDHKeyInfo_PDU);
|
2004-10-28 22:06:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-16 09:01:20 +00:00
|
|
|
/*--- End of included file: packet-pkinit-fn.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 58 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
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 09:01:20 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2004-09-17 23:33:10 +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:33:10 +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 09:01:20 +00:00
|
|
|
|
|
|
|
/*--- proto_register_pkinit ----------------------------------------------*/
|
|
|
|
void proto_register_pkinit(void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-hfarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-hfarr.c"
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_AuthPack_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "AuthPack", "pkinit.AuthPack_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2012-07-17 19:43:17 +00:00
|
|
|
{ &hf_pkinit_KRB5PrincipalName_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "KRB5PrincipalName", "pkinit.KRB5PrincipalName_element",
|
2012-07-17 19:43:17 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_KDCDHKeyInfo_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "KDCDHKeyInfo", "pkinit.KDCDHKeyInfo_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_signedAuthPack,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "signedAuthPack", "pkinit.signedAuthPack_element",
|
2004-09-16 09:01:20 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"ContentInfo", HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_trustedCertifiers,
|
|
|
|
{ "trustedCertifiers", "pkinit.trustedCertifiers",
|
2005-07-21 21:12:09 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"SEQUENCE_OF_TrustedCA", HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_trustedCertifiers_item,
|
2009-05-16 22:07:03 +00:00
|
|
|
{ "TrustedCA", "pkinit.TrustedCA",
|
2005-06-26 05:48:50 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(pkinit_TrustedCA_vals), 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_kdcCert,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "kdcCert", "pkinit.kdcCert_element",
|
2004-09-16 09:01:20 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"IssuerAndSerialNumber", HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_caName,
|
|
|
|
{ "caName", "pkinit.caName",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"Name", HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
{ &hf_pkinit_issuerAndSerial,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "issuerAndSerial", "pkinit.issuerAndSerial_element",
|
2004-09-16 09:01:20 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"IssuerAndSerialNumber", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_pkAuthenticator,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "pkAuthenticator", "pkinit.pkAuthenticator_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_clientPublicValue,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "clientPublicValue", "pkinit.clientPublicValue_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"SubjectPublicKeyInfo", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_supportedCMSTypes,
|
|
|
|
{ "supportedCMSTypes", "pkinit.supportedCMSTypes",
|
2005-07-21 21:12:09 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"SEQUENCE_OF_AlgorithmIdentifier", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_supportedCMSTypes_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "AlgorithmIdentifier", "pkinit.AlgorithmIdentifier_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_cusec,
|
|
|
|
{ "cusec", "pkinit.cusec",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_ctime,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "ctime", "pkinit.ctime_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"KerberosTime", HFILL }},
|
2004-11-01 17:49:53 +00:00
|
|
|
{ &hf_pkinit_paNonce,
|
2004-10-28 22:06:55 +00:00
|
|
|
{ "nonce", "pkinit.nonce",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER_0_4294967295", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_paChecksum,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "paChecksum", "pkinit.paChecksum_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"Checksum", HFILL }},
|
2012-07-17 19:43:17 +00:00
|
|
|
{ &hf_pkinit_realm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "realm", "pkinit.realm_element",
|
2012-07-17 19:43:17 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkinit_principalName,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "principalName", "pkinit.principalName_element",
|
2012-07-17 19:43:17 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2004-09-17 23:33:10 +00:00
|
|
|
{ &hf_pkinit_dhSignedData,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "dhSignedData", "pkinit.dhSignedData_element",
|
2004-09-17 23:33:10 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"ContentInfo", HFILL }},
|
2004-09-17 23:33:10 +00:00
|
|
|
{ &hf_pkinit_encKeyPack,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "encKeyPack", "pkinit.encKeyPack_element",
|
2004-09-17 23:33:10 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"ContentInfo", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_subjectPublicKey,
|
|
|
|
{ "subjectPublicKey", "pkinit.subjectPublicKey",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"BIT_STRING", HFILL }},
|
2004-11-01 17:49:53 +00:00
|
|
|
{ &hf_pkinit_dhNonce,
|
2004-10-28 22:06:55 +00:00
|
|
|
{ "nonce", "pkinit.nonce",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2004-10-28 22:06:55 +00:00
|
|
|
{ &hf_pkinit_dhKeyExpiration,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "dhKeyExpiration", "pkinit.dhKeyExpiration_element",
|
2004-10-28 22:06:55 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"KerberosTime", HFILL }},
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkinit-hfarr.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 102 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-ettarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-ettarr.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
&ett_pkinit_PaPkAsReq,
|
2005-06-26 05:48:50 +00:00
|
|
|
&ett_pkinit_SEQUENCE_OF_TrustedCA,
|
2004-09-16 09:01:20 +00:00
|
|
|
&ett_pkinit_TrustedCA,
|
2004-10-28 22:06:55 +00:00
|
|
|
&ett_pkinit_AuthPack,
|
2005-06-26 05:48:50 +00:00
|
|
|
&ett_pkinit_SEQUENCE_OF_AlgorithmIdentifier,
|
2004-10-28 22:06:55 +00:00
|
|
|
&ett_pkinit_PKAuthenticator,
|
2012-07-17 19:43:17 +00:00
|
|
|
&ett_pkinit_KRB5PrincipalName,
|
2004-09-17 23:33:10 +00:00
|
|
|
&ett_pkinit_PaPkAsRep,
|
2004-10-28 22:06:55 +00:00
|
|
|
&ett_pkinit_KDCDHKeyInfo,
|
2004-09-16 09:01:20 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkinit-ettarr.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 107 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
|
|
|
/*--- Included file: packet-pkinit-dis-tab.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkinit/packet-pkinit-dis-tab.c"
|
2005-07-21 21:12:09 +00:00
|
|
|
register_ber_oid_dissector("1.3.6.1.5.2.3.1", dissect_AuthPack_PDU, proto_pkinit, "id-pkauthdata");
|
|
|
|
register_ber_oid_dissector("1.3.6.1.5.2.3.2", dissect_KDCDHKeyInfo_PDU, proto_pkinit, "id-pkdhkeydata");
|
2012-07-17 19:43:17 +00:00
|
|
|
register_ber_oid_dissector("1.3.6.1.5.2.2", dissect_KRB5PrincipalName_PDU, proto_pkinit, "id-pkinit-san");
|
2004-11-01 17:49:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkinit-dis-tab.c ---*/
|
2013-12-08 15:40:10 +00:00
|
|
|
#line 122 "../../asn1/pkinit/packet-pkinit-template.c"
|
2004-09-16 09:01:20 +00:00
|
|
|
}
|
|
|
|
|