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-01 19:36:39 +00:00
|
|
|
/* packet-pkcs12.c */
|
2011-10-15 19:27:27 +00:00
|
|
|
/* ../../tools/asn2wrs.py -b -p pkcs12 -c ./pkcs12.cnf -s ./packet-pkcs12-template -D . -O ../../epan/dissectors pkcs12.asn */
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/* Input file: packet-pkcs12-template.c */
|
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
/* packet-pkcs12.c
|
|
|
|
* Routines for PKCS#12: Personal Information Exchange packet dissection
|
|
|
|
* Graeme Lunt 2006
|
|
|
|
*
|
2014-01-22 04:39:31 +00:00
|
|
|
* See "PKCS #12 v1.1: Personal Information Exchange Syntax":
|
|
|
|
*
|
|
|
|
* http://www.emc.com/emc-plus/rsa-labs/pkcs/files/h11301-wp-pkcs-12v1-1-personal-information-exchange-syntax.pdf
|
|
|
|
*
|
2007-01-13 15:26:13 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* 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.
|
2007-01-13 15:26:13 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2007-08-25 01:14:24 +00:00
|
|
|
#include <epan/oids.h>
|
2007-05-06 22:34:05 +00:00
|
|
|
#include <epan/asn1.h>
|
2007-08-17 18:52:40 +00:00
|
|
|
#include <epan/prefs.h>
|
2013-06-19 23:53:25 +00:00
|
|
|
#include <epan/wmem/wmem.h>
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
#include "packet-pkcs12.h"
|
|
|
|
#include "packet-x509af.h"
|
|
|
|
#include "packet-x509if.h"
|
|
|
|
#include "packet-cms.h"
|
|
|
|
|
2009-11-23 18:47:52 +00:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2007-08-17 18:52:40 +00:00
|
|
|
#include <sys/types.h>
|
2009-11-23 18:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TIME_H
|
2007-08-17 18:52:40 +00:00
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBGCRYPT
|
2013-02-21 18:23:29 +00:00
|
|
|
#include <wsutil/wsgcrypt.h>
|
2009-12-21 21:06:01 +00:00
|
|
|
#endif
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
#define PNAME "PKCS#12: Personal Information Exchange"
|
|
|
|
#define PSNAME "PKCS12"
|
|
|
|
#define PFNAME "pkcs12"
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
#define PKCS12_PBE_ARCFOUR_SHA1_OID "1.2.840.113549.1.12.1.1"
|
|
|
|
#define PKCS12_PBE_3DES_SHA1_OID "1.2.840.113549.1.12.1.3"
|
|
|
|
#define PKCS12_PBE_RC2_40_SHA1_OID "1.2.840.113549.1.12.1.6"
|
|
|
|
|
2013-03-28 07:34:13 +00:00
|
|
|
void proto_register_pkcs12(void);
|
|
|
|
void proto_reg_handoff_pkcs12(void);
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
2009-10-11 16:24:29 +00:00
|
|
|
static int proto_pkcs12 = -1;
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static int hf_pkcs12_X509Certificate_PDU = -1;
|
|
|
|
static gint ett_decrypted_pbe = -1;
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
static const char *object_identifier_id = NULL;
|
2007-08-17 18:52:40 +00:00
|
|
|
static int iteration_count = 0;
|
|
|
|
static tvbuff_t *salt = NULL;
|
2007-08-17 19:40:40 +00:00
|
|
|
static const char *password = NULL;
|
2007-08-17 18:52:40 +00:00
|
|
|
static gboolean try_null_password = FALSE;
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
|
|
|
static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
2007-08-17 18:52:40 +00:00
|
|
|
static void dissect_PrivateKeyInfo_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs12-hf.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-hf.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_PFX_PDU = -1; /* PFX */
|
|
|
|
static int hf_pkcs12_AuthenticatedSafe_PDU = -1; /* AuthenticatedSafe */
|
|
|
|
static int hf_pkcs12_SafeContents_PDU = -1; /* SafeContents */
|
|
|
|
static int hf_pkcs12_KeyBag_PDU = -1; /* KeyBag */
|
|
|
|
static int hf_pkcs12_PKCS8ShroudedKeyBag_PDU = -1; /* PKCS8ShroudedKeyBag */
|
|
|
|
static int hf_pkcs12_CertBag_PDU = -1; /* CertBag */
|
|
|
|
static int hf_pkcs12_CRLBag_PDU = -1; /* CRLBag */
|
|
|
|
static int hf_pkcs12_SecretBag_PDU = -1; /* SecretBag */
|
2007-08-17 18:52:40 +00:00
|
|
|
static int hf_pkcs12_PrivateKeyInfo_PDU = -1; /* PrivateKeyInfo */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_EncryptedPrivateKeyInfo_PDU = -1; /* EncryptedPrivateKeyInfo */
|
|
|
|
static int hf_pkcs12_PBEParameter_PDU = -1; /* PBEParameter */
|
|
|
|
static int hf_pkcs12_PBKDF2Params_PDU = -1; /* PBKDF2Params */
|
|
|
|
static int hf_pkcs12_PBES2Params_PDU = -1; /* PBES2Params */
|
|
|
|
static int hf_pkcs12_PBMAC1Params_PDU = -1; /* PBMAC1Params */
|
|
|
|
static int hf_pkcs12_version = -1; /* T_version */
|
|
|
|
static int hf_pkcs12_authSafe = -1; /* ContentInfo */
|
|
|
|
static int hf_pkcs12_macData = -1; /* MacData */
|
|
|
|
static int hf_pkcs12_mac = -1; /* DigestInfo */
|
|
|
|
static int hf_pkcs12_macSalt = -1; /* OCTET_STRING */
|
|
|
|
static int hf_pkcs12_iterations = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs12_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_digest = -1; /* Digest */
|
|
|
|
static int hf_pkcs12_AuthenticatedSafe_item = -1; /* ContentInfo */
|
|
|
|
static int hf_pkcs12_SafeContents_item = -1; /* SafeBag */
|
2007-06-05 12:00:57 +00:00
|
|
|
static int hf_pkcs12_bagId = -1; /* T_bagId */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_bagValue = -1; /* T_bagValue */
|
|
|
|
static int hf_pkcs12_bagAttributes = -1; /* SET_OF_PKCS12Attribute */
|
|
|
|
static int hf_pkcs12_bagAttributes_item = -1; /* PKCS12Attribute */
|
2007-06-05 12:00:57 +00:00
|
|
|
static int hf_pkcs12_certId = -1; /* T_certId */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_certValue = -1; /* T_certValue */
|
2007-06-05 12:00:57 +00:00
|
|
|
static int hf_pkcs12_crlId = -1; /* T_crlId */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_crlValue = -1; /* T_crlValue */
|
2007-08-17 18:52:40 +00:00
|
|
|
static int hf_pkcs12_secretTypeId = -1; /* T_secretTypeId */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_secretValue = -1; /* T_secretValue */
|
2007-06-05 12:00:57 +00:00
|
|
|
static int hf_pkcs12_attrId = -1; /* T_attrId */
|
2007-01-13 15:26:13 +00:00
|
|
|
static int hf_pkcs12_attrValues = -1; /* T_attrValues */
|
|
|
|
static int hf_pkcs12_attrValues_item = -1; /* T_attrValues_item */
|
|
|
|
static int hf_pkcs12_privateKeyVersion = -1; /* Version */
|
|
|
|
static int hf_pkcs12_privateKeyAlgorithm = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_privateKey = -1; /* PrivateKey */
|
|
|
|
static int hf_pkcs12_attributes = -1; /* Attributes */
|
|
|
|
static int hf_pkcs12_Attributes_item = -1; /* Attribute */
|
|
|
|
static int hf_pkcs12_encryptionAlgorithm = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_encryptedData = -1; /* EncryptedData */
|
|
|
|
static int hf_pkcs12_salt = -1; /* OCTET_STRING */
|
|
|
|
static int hf_pkcs12_iterationCount = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs12_saltChoice = -1; /* T_saltChoice */
|
|
|
|
static int hf_pkcs12_specified = -1; /* OCTET_STRING */
|
|
|
|
static int hf_pkcs12_otherSource = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_keyLength = -1; /* INTEGER_1_MAX */
|
|
|
|
static int hf_pkcs12_prf = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_keyDerivationFunc = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_encryptionScheme = -1; /* AlgorithmIdentifier */
|
|
|
|
static int hf_pkcs12_messageAuthScheme = -1; /* AlgorithmIdentifier */
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-hf.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 83 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs12-ett.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-ett.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
static gint ett_pkcs12_PFX = -1;
|
|
|
|
static gint ett_pkcs12_MacData = -1;
|
|
|
|
static gint ett_pkcs12_DigestInfo = -1;
|
|
|
|
static gint ett_pkcs12_AuthenticatedSafe = -1;
|
|
|
|
static gint ett_pkcs12_SafeContents = -1;
|
|
|
|
static gint ett_pkcs12_SafeBag = -1;
|
|
|
|
static gint ett_pkcs12_SET_OF_PKCS12Attribute = -1;
|
|
|
|
static gint ett_pkcs12_CertBag = -1;
|
|
|
|
static gint ett_pkcs12_CRLBag = -1;
|
|
|
|
static gint ett_pkcs12_SecretBag = -1;
|
|
|
|
static gint ett_pkcs12_PKCS12Attribute = -1;
|
|
|
|
static gint ett_pkcs12_T_attrValues = -1;
|
|
|
|
static gint ett_pkcs12_PrivateKeyInfo = -1;
|
|
|
|
static gint ett_pkcs12_Attributes = -1;
|
|
|
|
static gint ett_pkcs12_EncryptedPrivateKeyInfo = -1;
|
|
|
|
static gint ett_pkcs12_PBEParameter = -1;
|
|
|
|
static gint ett_pkcs12_PBKDF2Params = -1;
|
|
|
|
static gint ett_pkcs12_T_saltChoice = -1;
|
|
|
|
static gint ett_pkcs12_PBES2Params = -1;
|
|
|
|
static gint ett_pkcs12_PBMAC1Params = -1;
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-ett.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 86 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
static void append_oid(proto_tree *tree, const char *oid)
|
|
|
|
{
|
|
|
|
const char *name = NULL;
|
|
|
|
|
2007-11-01 19:36:39 +00:00
|
|
|
name = oid_resolved_from_string(oid);
|
2009-12-21 21:06:01 +00:00
|
|
|
proto_item_append_text(tree, " (%s)", name ? name : oid);
|
2007-06-05 12:00:57 +00:00
|
|
|
}
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
#ifdef HAVE_LIBGCRYPT
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2011-11-20 08:59:19 +00:00
|
|
|
static int
|
2007-08-17 18:52:40 +00:00
|
|
|
generate_key_or_iv(unsigned int id, tvbuff_t *salt_tvb, unsigned int iter,
|
|
|
|
const char *pw, unsigned int req_keylen, char * keybuf)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
unsigned int i, j;
|
|
|
|
gcry_md_hd_t md;
|
|
|
|
gcry_mpi_t num_b1 = NULL;
|
2009-12-21 21:06:01 +00:00
|
|
|
size_t pwlen;
|
2007-08-17 18:52:40 +00:00
|
|
|
char hash[20], buf_b[64], buf_i[128], *p;
|
2012-12-03 22:27:46 +00:00
|
|
|
char *salt_p;
|
2007-08-17 18:52:40 +00:00
|
|
|
int salt_size;
|
|
|
|
size_t cur_keylen;
|
|
|
|
size_t n;
|
|
|
|
gcry_error_t err;
|
|
|
|
|
|
|
|
cur_keylen = 0;
|
|
|
|
|
|
|
|
salt_size = tvb_length(salt_tvb);
|
2014-01-22 04:27:15 +00:00
|
|
|
salt_p = (char *)tvb_memdup(wmem_packet_scope(), salt_tvb, 0, salt_size);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
if (pw == NULL)
|
|
|
|
pwlen = 0;
|
|
|
|
else
|
|
|
|
pwlen = strlen (pw);
|
|
|
|
|
|
|
|
if (pwlen > 63 / 2)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Store salt and password in BUF_I */
|
|
|
|
p = buf_i;
|
|
|
|
for (i = 0; i < 64; i++)
|
2012-12-03 22:27:46 +00:00
|
|
|
*p++ = salt_p[i % salt_size];
|
2007-08-17 18:52:40 +00:00
|
|
|
if (pw)
|
|
|
|
{
|
|
|
|
for (i = j = 0; i < 64; i += 2)
|
|
|
|
{
|
|
|
|
*p++ = 0;
|
|
|
|
*p++ = pw[j];
|
|
|
|
if (++j > pwlen) /* Note, that we include the trailing zero */
|
|
|
|
j = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
memset (p, 0, 64);
|
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
for (;;) {
|
2007-08-17 18:52:40 +00:00
|
|
|
err = gcry_md_open(&md, GCRY_MD_SHA1, 0);
|
2014-01-22 04:14:05 +00:00
|
|
|
if (gcry_err_code(err))
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
for (i = 0; i < 64; i++)
|
|
|
|
{
|
|
|
|
unsigned char lid = id & 0xFF;
|
|
|
|
gcry_md_write (md, &lid, 1);
|
|
|
|
}
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
gcry_md_write(md, buf_i, pw ? 128 : 64);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
gcry_md_final (md);
|
|
|
|
memcpy (hash, gcry_md_read (md, 0), 20);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
gcry_md_close (md);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
for (i = 1; i < iter; i++)
|
|
|
|
gcry_md_hash_buffer (GCRY_MD_SHA1, hash, hash, 20);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 20 && cur_keylen < req_keylen; i++)
|
2014-01-22 04:14:05 +00:00
|
|
|
keybuf[cur_keylen++] = hash[i];
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
if (cur_keylen == req_keylen)
|
|
|
|
{
|
|
|
|
gcry_mpi_release (num_b1);
|
|
|
|
return TRUE; /* ready */
|
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
/* need more bytes. */
|
|
|
|
for (i = 0; i < 64; i++)
|
2014-01-22 04:14:05 +00:00
|
|
|
buf_b[i] = hash[i % 20];
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
n = 64;
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
rc = gcry_mpi_scan (&num_b1, GCRYMPI_FMT_USG, buf_b, n, &n);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
if (rc != 0)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
gcry_mpi_add_ui (num_b1, num_b1, 1);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
for (i = 0; i < 128; i += 64)
|
|
|
|
{
|
|
|
|
gcry_mpi_t num_ij;
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
n = 64;
|
|
|
|
rc = gcry_mpi_scan (&num_ij, GCRYMPI_FMT_USG, buf_i + i, n, &n);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
if (rc != 0)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
gcry_mpi_add (num_ij, num_ij, num_b1);
|
|
|
|
gcry_mpi_clear_highbit (num_ij, 64 * 8);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
n = 64;
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
rc = gcry_mpi_print (GCRYMPI_FMT_USG, buf_i + i, n, &n, num_ij);
|
|
|
|
if (rc != 0)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:14:05 +00:00
|
|
|
gcry_mpi_release (num_ij);
|
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
#endif
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2011-05-27 11:03:04 +00:00
|
|
|
void PBE_reset_parameters(void)
|
2007-08-17 18:52:40 +00:00
|
|
|
{
|
|
|
|
iteration_count = 0;
|
|
|
|
salt = NULL;
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2012-12-03 22:27:46 +00:00
|
|
|
int PBE_decrypt_data(const char *object_identifier_id_param, tvbuff_t *encrypted_tvb, asn1_ctx_t *actx, proto_item *item)
|
2007-08-17 18:52:40 +00:00
|
|
|
{
|
|
|
|
#ifdef HAVE_LIBGCRYPT
|
|
|
|
const char *encryption_algorithm;
|
|
|
|
gcry_cipher_hd_t cipher;
|
|
|
|
gcry_error_t err;
|
|
|
|
int algo;
|
|
|
|
int mode;
|
|
|
|
int ivlen = 0;
|
|
|
|
int keylen = 0;
|
|
|
|
int datalen = 0;
|
|
|
|
char *key = NULL;
|
|
|
|
char *iv = NULL;
|
|
|
|
char *clear_data = NULL;
|
|
|
|
tvbuff_t *clear_tvb = NULL;
|
|
|
|
const gchar *oidname;
|
|
|
|
GString *name;
|
|
|
|
proto_tree *tree;
|
|
|
|
char byte;
|
|
|
|
gboolean decrypt_ok = TRUE;
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
if(((password == NULL) || (*password == '\0')) && (try_null_password == FALSE)) {
|
|
|
|
/* we are not configured to decrypt */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-01-27 09:02:06 +00:00
|
|
|
encryption_algorithm = x509af_get_last_algorithm_id();
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
/* these are the only encryption schemes we understand for now */
|
|
|
|
if(!strcmp(encryption_algorithm, PKCS12_PBE_3DES_SHA1_OID)) {
|
|
|
|
ivlen = 8;
|
|
|
|
keylen = 24;
|
|
|
|
algo = GCRY_CIPHER_3DES;
|
|
|
|
mode = GCRY_CIPHER_MODE_CBC;
|
|
|
|
} else if(!strcmp(encryption_algorithm, PKCS12_PBE_ARCFOUR_SHA1_OID)) {
|
|
|
|
ivlen = 0;
|
|
|
|
keylen = 16;
|
|
|
|
algo = GCRY_CIPHER_ARCFOUR;
|
|
|
|
mode = GCRY_CIPHER_MODE_NONE;
|
|
|
|
} else if(!strcmp(encryption_algorithm, PKCS12_PBE_RC2_40_SHA1_OID)) {
|
|
|
|
ivlen = 8;
|
|
|
|
keylen = 5;
|
|
|
|
algo = GCRY_CIPHER_RFC2268_40;
|
|
|
|
mode = GCRY_CIPHER_MODE_CBC;
|
|
|
|
} else {
|
|
|
|
/* we don't know how to decrypt this */
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
proto_item_append_text(item, " [Unsupported encryption algorithm]");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
if((iteration_count == 0) || (salt == NULL)) {
|
2007-08-17 18:52:40 +00:00
|
|
|
proto_item_append_text(item, " [Insufficient parameters]");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* allocate buffers */
|
2013-06-19 23:08:58 +00:00
|
|
|
key = (char *)wmem_alloc(wmem_packet_scope(), keylen);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
if(!generate_key_or_iv(1 /*LEY */, salt, iteration_count, password, keylen, key))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if(ivlen) {
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2013-06-19 23:08:58 +00:00
|
|
|
iv = (char *)wmem_alloc(wmem_packet_scope(), ivlen);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
if(!generate_key_or_iv(2 /* IV */, salt, iteration_count, password, ivlen, iv))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now try an internal function */
|
2008-01-16 20:41:23 +00:00
|
|
|
err = gcry_cipher_open(&cipher, algo, mode, 0);
|
2007-08-17 18:52:40 +00:00
|
|
|
if (gcry_err_code (err))
|
|
|
|
return FALSE;
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
err = gcry_cipher_setkey (cipher, key, keylen);
|
2007-08-17 18:52:40 +00:00
|
|
|
if (gcry_err_code (err)) {
|
|
|
|
gcry_cipher_close (cipher);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
if(ivlen) {
|
2009-12-21 21:06:01 +00:00
|
|
|
err = gcry_cipher_setiv (cipher, iv, ivlen);
|
2007-08-17 18:52:40 +00:00
|
|
|
if (gcry_err_code (err)) {
|
|
|
|
gcry_cipher_close (cipher);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
datalen = tvb_length(encrypted_tvb);
|
2013-03-02 14:51:04 +00:00
|
|
|
clear_data = (char *)g_malloc(datalen);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-01-22 04:39:31 +00:00
|
|
|
err = gcry_cipher_decrypt (cipher, clear_data, datalen, (char *)tvb_memdup(wmem_packet_scope(), encrypted_tvb, 0, datalen), datalen);
|
2007-08-17 18:52:40 +00:00
|
|
|
if (gcry_err_code (err)) {
|
|
|
|
|
|
|
|
proto_item_append_text(item, " [Failed to decrypt with password preference]");
|
|
|
|
|
|
|
|
gcry_cipher_close (cipher);
|
|
|
|
g_free(clear_data);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gcry_cipher_close (cipher);
|
|
|
|
|
|
|
|
/* We don't know if we have successfully decrypted the data or not so we:
|
2009-12-21 21:06:01 +00:00
|
|
|
a) check the trailing bytes
|
2007-08-17 18:52:40 +00:00
|
|
|
b) see if we start with a sequence or a set (is this too constraining?
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* first the trailing bytes */
|
|
|
|
byte = clear_data[datalen-1];
|
|
|
|
if(byte <= 0x08) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for(i = (int)byte; i > 0 ; i--) {
|
|
|
|
if(clear_data[datalen - i] != byte) {
|
|
|
|
decrypt_ok = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-12-21 21:06:01 +00:00
|
|
|
} else {
|
2007-08-17 18:52:40 +00:00
|
|
|
/* XXX: is this a failure? */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we assume the result is ASN.1 - check it is a SET or SEQUENCE */
|
|
|
|
byte = clear_data[0];
|
|
|
|
if((byte != 0x30) && (byte != 0x31)) { /* do we need more here? OCTET STRING? */
|
|
|
|
decrypt_ok = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!decrypt_ok) {
|
|
|
|
g_free(clear_data);
|
|
|
|
proto_item_append_text(item, " [Failed to decrypt with supplied password]");
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_item_append_text(item, " [Decrypted successfully]");
|
|
|
|
|
|
|
|
tree = proto_item_add_subtree(item, ett_decrypted_pbe);
|
|
|
|
|
|
|
|
/* OK - so now clear_data contains the decrypted data */
|
|
|
|
|
2010-01-11 16:14:26 +00:00
|
|
|
clear_tvb = tvb_new_child_real_data(encrypted_tvb,(const guint8 *)clear_data, datalen, datalen);
|
2007-08-17 18:52:40 +00:00
|
|
|
tvb_set_free_cb(clear_tvb, g_free);
|
|
|
|
|
|
|
|
name = g_string_new("");
|
2012-12-03 22:27:46 +00:00
|
|
|
oidname = oid_resolved_from_string(object_identifier_id_param);
|
|
|
|
g_string_printf(name, "Decrypted %s", oidname ? oidname : object_identifier_id_param);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
/* add it as a new source */
|
|
|
|
add_new_data_source(actx->pinfo, clear_tvb, name->str);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
g_string_free(name, TRUE);
|
|
|
|
|
|
|
|
/* now try and decode it */
|
2013-10-31 00:57:03 +00:00
|
|
|
call_ber_oid_callback(object_identifier_id_param, clear_tvb, 0, actx->pinfo, tree, NULL);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
return TRUE;
|
2007-08-17 18:52:40 +00:00
|
|
|
#else
|
|
|
|
/* we cannot decrypt */
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
#endif
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
/*--- Included file: packet-pkcs12-fn.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-fn.c"
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
static const value_string pkcs12_T_version_vals[] = {
|
|
|
|
{ 3, "v3" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_version(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-01-16 20:41:23 +00:00
|
|
|
NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t DigestInfo_sequence[] = {
|
2010-04-06 20:22:19 +00:00
|
|
|
{ &hf_pkcs12_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
|
2007-08-17 18:52:40 +00:00
|
|
|
{ &hf_pkcs12_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_DigestInfo(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
DigestInfo_sequence, hf_index, ett_pkcs12_DigestInfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_OCTET_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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2007-08-17 18:52:40 +00:00
|
|
|
(hf_index == hf_pkcs12_salt ? &salt : NULL));
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_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-01-16 20:41:23 +00:00
|
|
|
(hf_index == hf_pkcs12_iterationCount ? &iteration_count : NULL));
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t MacData_sequence[] = {
|
|
|
|
{ &hf_pkcs12_mac , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs12_DigestInfo },
|
|
|
|
{ &hf_pkcs12_macSalt , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_OCTET_STRING },
|
|
|
|
{ &hf_pkcs12_iterations , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs12_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_MacData(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
MacData_sequence, hf_index, ett_pkcs12_MacData);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PFX_sequence[] = {
|
|
|
|
{ &hf_pkcs12_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_version },
|
|
|
|
{ &hf_pkcs12_authSafe , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ContentInfo },
|
|
|
|
{ &hf_pkcs12_macData , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs12_MacData },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PFX(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 58 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
dissector_handle_t dissector_handle;
|
|
|
|
|
|
|
|
/* we change the CMS id-data dissector to dissect as AuthenticatedSafe
|
|
|
|
not sure why PKCS#12 couldn't have used its own content type OID for AuthenticatedSafe */
|
|
|
|
dissector_handle=create_dissector_handle(dissect_AuthenticatedSafe_OCTETSTRING_PDU, proto_pkcs12);
|
|
|
|
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PFX_sequence, hf_index, ett_pkcs12_PFX);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", "1.2.840.113549.1.7.1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t AuthenticatedSafe_sequence_of[1] = {
|
|
|
|
{ &hf_pkcs12_AuthenticatedSafe_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ContentInfo },
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_AuthenticatedSafe(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 71 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
dissector_handle_t dissector_handle;
|
|
|
|
|
|
|
|
/* we change the CMS id-data dissector to dissect as SafeContents */
|
|
|
|
dissector_handle=create_dissector_handle(dissect_SafeContents_OCTETSTRING_PDU, proto_pkcs12);
|
|
|
|
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
AuthenticatedSafe_sequence_of, hf_index, ett_pkcs12_AuthenticatedSafe);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", "1.2.840.113549.1.7.1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-06-05 12:00:57 +00:00
|
|
|
dissect_pkcs12_T_bagId(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_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 84 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-06-05 12:00:57 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_bagValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 108 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2013-10-31 00:57:03 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs12_T_attrId(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_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 104 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-06-05 12:00:57 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_attrValues_item(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 112 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2013-10-31 00:57:03 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t T_attrValues_set_of[1] = {
|
|
|
|
{ &hf_pkcs12_attrValues_item, BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_attrValues_item },
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_attrValues(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
T_attrValues_set_of, hf_index, ett_pkcs12_T_attrValues);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PKCS12Attribute_sequence[] = {
|
|
|
|
{ &hf_pkcs12_attrId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_attrId },
|
|
|
|
{ &hf_pkcs12_attrValues , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_attrValues },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PKCS12Attribute(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PKCS12Attribute_sequence, hf_index, ett_pkcs12_PKCS12Attribute);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t SET_OF_PKCS12Attribute_set_of[1] = {
|
|
|
|
{ &hf_pkcs12_bagAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs12_PKCS12Attribute },
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_SET_OF_PKCS12Attribute(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SET_OF_PKCS12Attribute_set_of, hf_index, ett_pkcs12_SET_OF_PKCS12Attribute);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t SafeBag_sequence[] = {
|
|
|
|
{ &hf_pkcs12_bagId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_bagId },
|
|
|
|
{ &hf_pkcs12_bagValue , BER_CLASS_CON, 0, 0, dissect_pkcs12_T_bagValue },
|
|
|
|
{ &hf_pkcs12_bagAttributes, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs12_SET_OF_PKCS12Attribute },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_SafeBag(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SafeBag_sequence, hf_index, ett_pkcs12_SafeBag);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t SafeContents_sequence_of[1] = {
|
|
|
|
{ &hf_pkcs12_SafeContents_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs12_SafeBag },
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_SafeContents(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SafeContents_sequence_of, hf_index, ett_pkcs12_SafeContents);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string pkcs12_Version_vals[] = {
|
|
|
|
{ 0, "v1" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_Version(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-01-16 20:41:23 +00:00
|
|
|
NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PrivateKey(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2007-01-13 15:26:13 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t Attributes_set_of[1] = {
|
|
|
|
{ &hf_pkcs12_Attributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509if_Attribute },
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_Attributes(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
Attributes_set_of, hf_index, ett_pkcs12_Attributes);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PrivateKeyInfo_sequence[] = {
|
|
|
|
{ &hf_pkcs12_privateKeyVersion, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs12_Version },
|
|
|
|
{ &hf_pkcs12_privateKeyAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ &hf_pkcs12_privateKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_PrivateKey },
|
|
|
|
{ &hf_pkcs12_attributes , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkcs12_Attributes },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PrivateKeyInfo(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PrivateKeyInfo_sequence, hf_index, ett_pkcs12_PrivateKeyInfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_KeyBag(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_pkcs12_PrivateKeyInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 139 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-08-17 18:52:40 +00:00
|
|
|
tvbuff_t *encrypted_tvb;
|
|
|
|
dissector_handle_t dissector_handle;
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2007-08-17 18:52:40 +00:00
|
|
|
&encrypted_tvb);
|
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 145 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
dissector_handle=create_dissector_handle(dissect_PrivateKeyInfo_PDU, proto_pkcs12);
|
2010-04-06 20:22:19 +00:00
|
|
|
dissector_change_string("ber.oid", object_identifier_id, dissector_handle);
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2008-01-03 13:20:10 +00:00
|
|
|
PBE_decrypt_data(object_identifier_id, encrypted_tvb, actx, actx->created_item);
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", object_identifier_id);
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t EncryptedPrivateKeyInfo_sequence[] = {
|
|
|
|
{ &hf_pkcs12_encryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ &hf_pkcs12_encryptedData, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_EncryptedData },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_EncryptedPrivateKeyInfo(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
EncryptedPrivateKeyInfo_sequence, hf_index, ett_pkcs12_EncryptedPrivateKeyInfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PKCS8ShroudedKeyBag(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_pkcs12_EncryptedPrivateKeyInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs12_T_certId(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_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 89 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-06-05 12:00:57 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_certValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 116 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2013-10-31 00:57:03 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t CertBag_sequence[] = {
|
|
|
|
{ &hf_pkcs12_certId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_certId },
|
|
|
|
{ &hf_pkcs12_certValue , BER_CLASS_CON, 0, 0, dissect_pkcs12_T_certValue },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_CertBag(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
CertBag_sequence, hf_index, ett_pkcs12_CertBag);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs12_T_crlId(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_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 94 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-06-05 12:00:57 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_crlValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 120 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2013-10-31 00:57:03 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t CRLBag_sequence[] = {
|
|
|
|
{ &hf_pkcs12_crlId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_crlId },
|
|
|
|
{ &hf_pkcs12_crlValue , BER_CLASS_CON, 0, 0, dissect_pkcs12_T_crlValue },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_CRLBag(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
CRLBag_sequence, hf_index, ett_pkcs12_CRLBag);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
static int
|
2007-08-17 18:52:40 +00:00
|
|
|
dissect_pkcs12_T_secretTypeId(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_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
|
|
|
|
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 99 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-08-17 18:52:40 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
2007-06-05 12:00:57 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_secretValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 124 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2013-10-31 00:57:03 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t SecretBag_sequence[] = {
|
|
|
|
{ &hf_pkcs12_secretTypeId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs12_T_secretTypeId },
|
|
|
|
{ &hf_pkcs12_secretValue , BER_CLASS_CON, 0, 0, dissect_pkcs12_T_secretValue },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_SecretBag(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
SecretBag_sequence, hf_index, ett_pkcs12_SecretBag);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PBEParameter_sequence[] = {
|
|
|
|
{ &hf_pkcs12_salt , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_OCTET_STRING },
|
|
|
|
{ &hf_pkcs12_iterationCount, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs12_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PBEParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 128 "../../asn1/pkcs12/pkcs12.cnf"
|
2007-08-17 18:52:40 +00:00
|
|
|
/* initialise the encryption parameters */
|
|
|
|
PBE_reset_parameters();
|
|
|
|
|
|
|
|
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PBEParameter_sequence, hf_index, ett_pkcs12_PBEParameter);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string pkcs12_T_saltChoice_vals[] = {
|
|
|
|
{ 0, "specified" },
|
|
|
|
{ 1, "otherSource" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_choice_t T_saltChoice_choice[] = {
|
|
|
|
{ 0, &hf_pkcs12_specified , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs12_OCTET_STRING },
|
|
|
|
{ 1, &hf_pkcs12_otherSource , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_T_saltChoice(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
T_saltChoice_choice, hf_index, ett_pkcs12_T_saltChoice,
|
|
|
|
NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_INTEGER_1_MAX(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-01-16 20:41:23 +00:00
|
|
|
NULL);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PBKDF2Params_sequence[] = {
|
|
|
|
{ &hf_pkcs12_saltChoice , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkcs12_T_saltChoice },
|
|
|
|
{ &hf_pkcs12_iterationCount, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs12_INTEGER },
|
|
|
|
{ &hf_pkcs12_keyLength , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs12_INTEGER_1_MAX },
|
|
|
|
{ &hf_pkcs12_prf , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PBKDF2Params(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PBKDF2Params_sequence, hf_index, ett_pkcs12_PBKDF2Params);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PBES2Params_sequence[] = {
|
|
|
|
{ &hf_pkcs12_keyDerivationFunc, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ &hf_pkcs12_encryptionScheme, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PBES2Params(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PBES2Params_sequence, hf_index, ett_pkcs12_PBES2Params);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
static const ber_sequence_t PBMAC1Params_sequence[] = {
|
|
|
|
{ &hf_pkcs12_keyDerivationFunc, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ &hf_pkcs12_messageAuthScheme, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_PBMAC1Params(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-08-17 18:52:40 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
PBMAC1Params_sequence, hf_index, ett_pkcs12_PBMAC1Params);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--- PDUs ---*/
|
|
|
|
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PFX_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_pkcs12_PFX(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PFX_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_AuthenticatedSafe_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_pkcs12_AuthenticatedSafe(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_AuthenticatedSafe_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_SafeContents_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_pkcs12_SafeContents(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_SafeContents_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_KeyBag_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_pkcs12_KeyBag(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_KeyBag_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PKCS8ShroudedKeyBag_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_pkcs12_PKCS8ShroudedKeyBag(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PKCS8ShroudedKeyBag_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_CertBag_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_pkcs12_CertBag(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_CertBag_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_CRLBag_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_pkcs12_CRLBag(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_CRLBag_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_SecretBag_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_pkcs12_SecretBag(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_SecretBag_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-08-17 18:52:40 +00:00
|
|
|
static void dissect_PrivateKeyInfo_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_pkcs12_PrivateKeyInfo(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PrivateKeyInfo_PDU);
|
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_EncryptedPrivateKeyInfo_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_pkcs12_EncryptedPrivateKeyInfo(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_EncryptedPrivateKeyInfo_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PBEParameter_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_pkcs12_PBEParameter(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PBEParameter_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PBKDF2Params_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_pkcs12_PBKDF2Params(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PBKDF2Params_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PBES2Params_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_pkcs12_PBES2Params(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PBES2Params_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
2007-03-21 10:22:22 +00:00
|
|
|
static void dissect_PBMAC1Params_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_pkcs12_PBMAC1Params(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkcs12_PBMAC1Params_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-fn.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 394 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
static int strip_octet_string(tvbuff_t *tvb)
|
2007-01-13 15:26:13 +00:00
|
|
|
{
|
2011-11-20 08:59:19 +00:00
|
|
|
gint8 ber_class;
|
2007-01-13 15:26:13 +00:00
|
|
|
gboolean pc, ind;
|
|
|
|
gint32 tag;
|
|
|
|
guint32 len;
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
/* PKCS#7 encodes the content as OCTET STRING, whereas CMS is just any ANY */
|
|
|
|
/* if we use CMS (rather than PKCS#7) - which we are - we need to strip the OCTET STRING tag */
|
|
|
|
/* before proceeding */
|
|
|
|
|
2011-11-20 08:59:19 +00:00
|
|
|
offset = get_ber_identifier(tvb, 0, &ber_class, &pc, &tag);
|
2007-08-24 07:12:04 +00:00
|
|
|
offset = get_ber_length(tvb, offset, &len, &ind);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2011-11-20 08:59:19 +00:00
|
|
|
if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_OCTETSTRING))
|
2007-01-13 15:26:13 +00:00
|
|
|
return offset;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|
|
|
int offset = 0;
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
if((offset = strip_octet_string(tvb)) > 0)
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs12_AuthenticatedSafe(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_AuthenticatedSafe_PDU);
|
2007-08-17 18:52:40 +00:00
|
|
|
else
|
2014-01-22 04:14:05 +00:00
|
|
|
proto_tree_add_text(tree, tvb, 0, 1, "BER Error: OCTET STRING expected");
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2007-01-13 15:26:13 +00:00
|
|
|
{
|
|
|
|
int offset = 0;
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
offset = strip_octet_string(tvb);
|
2009-12-21 21:06:01 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
dissect_pkcs12_SafeContents(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_SafeContents_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
static void dissect_X509Certificate_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2007-01-13 15:26:13 +00:00
|
|
|
{
|
2007-08-17 18:52:40 +00:00
|
|
|
int offset = 0;
|
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
if((offset = strip_octet_string(tvb)) > 0)
|
|
|
|
dissect_x509af_Certificate(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_X509Certificate_PDU);
|
|
|
|
else
|
|
|
|
proto_tree_add_text(tree, tvb, 0, 1, "BER Error: OCTET STRING expected");
|
2007-01-13 15:26:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*--- proto_register_pkcs12 ----------------------------------------------*/
|
|
|
|
void proto_register_pkcs12(void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
2014-01-22 04:14:05 +00:00
|
|
|
{ &hf_pkcs12_X509Certificate_PDU,
|
2007-08-17 18:52:40 +00:00
|
|
|
{ "X509Certificate", "pkcs12.X509Certificate",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"pkcs12.X509Certificate", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs12-hfarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-hfarr.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PFX_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PFX", "pkcs12.PFX_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_AuthenticatedSafe_PDU,
|
|
|
|
{ "AuthenticatedSafe", "pkcs12.AuthenticatedSafe",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_SafeContents_PDU,
|
|
|
|
{ "SafeContents", "pkcs12.SafeContents",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_KeyBag_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "KeyBag", "pkcs12.KeyBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PKCS8ShroudedKeyBag_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PKCS8ShroudedKeyBag", "pkcs12.PKCS8ShroudedKeyBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_CertBag_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "CertBag", "pkcs12.CertBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_CRLBag_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "CRLBag", "pkcs12.CRLBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_SecretBag_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "SecretBag", "pkcs12.SecretBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-08-17 18:52:40 +00:00
|
|
|
{ &hf_pkcs12_PrivateKeyInfo_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PrivateKeyInfo", "pkcs12.PrivateKeyInfo_element",
|
2007-08-17 18:52:40 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_EncryptedPrivateKeyInfo_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "EncryptedPrivateKeyInfo", "pkcs12.EncryptedPrivateKeyInfo_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PBEParameter_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PBEParameter", "pkcs12.PBEParameter_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PBKDF2Params_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PBKDF2Params", "pkcs12.PBKDF2Params_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PBES2Params_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PBES2Params", "pkcs12.PBES2Params_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_PBMAC1Params_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PBMAC1Params", "pkcs12.PBMAC1Params_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_version,
|
|
|
|
{ "version", "pkcs12.version",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(pkcs12_T_version_vals), 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_authSafe,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "authSafe", "pkcs12.authSafe_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"ContentInfo", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_macData,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "macData", "pkcs12.macData_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_mac,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "mac", "pkcs12.mac_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"DigestInfo", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_macSalt,
|
|
|
|
{ "macSalt", "pkcs12.macSalt",
|
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
|
|
|
"OCTET_STRING", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_iterations,
|
|
|
|
{ "iterations", "pkcs12.iterations",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_digestAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "digestAlgorithm", "pkcs12.digestAlgorithm_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"DigestAlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_digest,
|
|
|
|
{ "digest", "pkcs12.digest",
|
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
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_AuthenticatedSafe_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "ContentInfo", "pkcs12.ContentInfo_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_SafeContents_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "SafeBag", "pkcs12.SafeBag_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_bagId,
|
|
|
|
{ "bagId", "pkcs12.bagId",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_bagValue,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "bagValue", "pkcs12.bagValue_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_bagAttributes,
|
|
|
|
{ "bagAttributes", "pkcs12.bagAttributes",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"SET_OF_PKCS12Attribute", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_bagAttributes_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "PKCS12Attribute", "pkcs12.PKCS12Attribute_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_certId,
|
|
|
|
{ "certId", "pkcs12.certId",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_certValue,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "certValue", "pkcs12.certValue_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_crlId,
|
|
|
|
{ "crlId", "pkcs12.crlId",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_crlValue,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "crlValue", "pkcs12.crlValue_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_secretTypeId,
|
|
|
|
{ "secretTypeId", "pkcs12.secretTypeId",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_secretValue,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "secretValue", "pkcs12.secretValue_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_attrId,
|
|
|
|
{ "attrId", "pkcs12.attrId",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_attrValues,
|
|
|
|
{ "attrValues", "pkcs12.attrValues",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_attrValues_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "attrValues item", "pkcs12.attrValues_item_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_privateKeyVersion,
|
|
|
|
{ "version", "pkcs12.version",
|
2008-11-10 13:36:24 +00:00
|
|
|
FT_UINT32, BASE_DEC, VALS(pkcs12_Version_vals), 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_privateKeyAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "privateKeyAlgorithm", "pkcs12.privateKeyAlgorithm_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_privateKey,
|
|
|
|
{ "privateKey", "pkcs12.privateKey",
|
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
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_attributes,
|
|
|
|
{ "attributes", "pkcs12.attributes",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_Attributes_item,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "Attribute", "pkcs12.Attribute_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_encryptionAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "encryptionAlgorithm", "pkcs12.encryptionAlgorithm_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_encryptedData,
|
|
|
|
{ "encryptedData", "pkcs12.encryptedData",
|
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
|
|
|
NULL, HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_salt,
|
|
|
|
{ "salt", "pkcs12.salt",
|
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
|
|
|
"OCTET_STRING", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_iterationCount,
|
|
|
|
{ "iterationCount", "pkcs12.iterationCount",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_saltChoice,
|
|
|
|
{ "salt", "pkcs12.salt",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(pkcs12_T_saltChoice_vals), 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"T_saltChoice", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_specified,
|
|
|
|
{ "specified", "pkcs12.specified",
|
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
|
|
|
"OCTET_STRING", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_otherSource,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "otherSource", "pkcs12.otherSource_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_keyLength,
|
|
|
|
{ "keyLength", "pkcs12.keyLength",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER_1_MAX", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_prf,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "prf", "pkcs12.prf_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_keyDerivationFunc,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "keyDerivationFunc", "pkcs12.keyDerivationFunc_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_encryptionScheme,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "encryptionScheme", "pkcs12.encryptionScheme_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
{ &hf_pkcs12_messageAuthScheme,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "messageAuthScheme", "pkcs12.messageAuthScheme_element",
|
2007-01-13 15:26:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"AlgorithmIdentifier", HFILL }},
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-hfarr.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 461 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
2007-08-17 18:52:40 +00:00
|
|
|
&ett_decrypted_pbe,
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs12-ettarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-ettarr.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
&ett_pkcs12_PFX,
|
|
|
|
&ett_pkcs12_MacData,
|
|
|
|
&ett_pkcs12_DigestInfo,
|
|
|
|
&ett_pkcs12_AuthenticatedSafe,
|
|
|
|
&ett_pkcs12_SafeContents,
|
|
|
|
&ett_pkcs12_SafeBag,
|
|
|
|
&ett_pkcs12_SET_OF_PKCS12Attribute,
|
|
|
|
&ett_pkcs12_CertBag,
|
|
|
|
&ett_pkcs12_CRLBag,
|
|
|
|
&ett_pkcs12_SecretBag,
|
|
|
|
&ett_pkcs12_PKCS12Attribute,
|
|
|
|
&ett_pkcs12_T_attrValues,
|
|
|
|
&ett_pkcs12_PrivateKeyInfo,
|
|
|
|
&ett_pkcs12_Attributes,
|
|
|
|
&ett_pkcs12_EncryptedPrivateKeyInfo,
|
|
|
|
&ett_pkcs12_PBEParameter,
|
|
|
|
&ett_pkcs12_PBKDF2Params,
|
|
|
|
&ett_pkcs12_T_saltChoice,
|
|
|
|
&ett_pkcs12_PBES2Params,
|
|
|
|
&ett_pkcs12_PBMAC1Params,
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-ettarr.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 467 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
};
|
2007-08-17 18:52:40 +00:00
|
|
|
module_t *pkcs12_module;
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
/* Register protocol */
|
|
|
|
proto_pkcs12 = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array(proto_pkcs12, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
/* Register preferences */
|
|
|
|
pkcs12_module = prefs_register_protocol(proto_pkcs12, NULL);
|
|
|
|
|
|
|
|
prefs_register_string_preference(pkcs12_module, "password",
|
|
|
|
"Password to decrypt the file with",
|
|
|
|
"The password to used to decrypt the encrypted elements within"
|
|
|
|
" the PKCS#12 file", &password);
|
|
|
|
|
|
|
|
prefs_register_bool_preference(pkcs12_module, "try_null_password",
|
|
|
|
"Try to decrypt with a empty password",
|
|
|
|
"Whether to try and decrypt the encrypted data within the"
|
|
|
|
" PKCS#12 with a NULL password", &try_null_password);
|
|
|
|
|
2009-12-21 21:06:01 +00:00
|
|
|
register_ber_syntax_dissector("PKCS#12", proto_pkcs12, dissect_PFX_PDU);
|
2007-01-13 15:26:13 +00:00
|
|
|
register_ber_oid_syntax(".p12", NULL, "PKCS#12");
|
|
|
|
register_ber_oid_syntax(".pfx", NULL, "PKCS#12");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_pkcs12 -------------------------------------------*/
|
|
|
|
void proto_reg_handoff_pkcs12(void) {
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs12-dis-tab.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/pkcs12/packet-pkcs12-dis-tab.c"
|
2007-01-13 15:26:13 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.1", dissect_KeyBag_PDU, proto_pkcs12, "keyBag");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.2", dissect_PKCS8ShroudedKeyBag_PDU, proto_pkcs12, "pkcs8ShroudedKeyBag");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.3", dissect_CertBag_PDU, proto_pkcs12, "certBag");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.4", dissect_SecretBag_PDU, proto_pkcs12, "secretBag");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.5", dissect_CRLBag_PDU, proto_pkcs12, "crlBag");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.10.1.6", dissect_SafeContents_PDU, proto_pkcs12, "safeContentsBag");
|
|
|
|
register_ber_oid_dissector("2.16.840.1.113730.3.1.216", dissect_PFX_PDU, proto_pkcs12, "pkcs-9-at-PKCS12");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.9.25.2", dissect_EncryptedPrivateKeyInfo_PDU, proto_pkcs12, "pkcs-9-at-encryptedPrivateKeyInfo");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.1", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd128BitRC4");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.2", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd40BitRC4");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.3", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd3-KeyTripleDES-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.4", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd2-KeyTripleDES-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.5", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd128BitRC2-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.12.1.6", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHAAnd128BitRC2-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.1", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithMD2AndDES-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.3", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithMD5AndDES-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.4", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithMD2AndRC2-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.6", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithMD5AndRC2-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.10", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHA1AndDES-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.11", dissect_PBEParameter_PDU, proto_pkcs12, "pbeWithSHA1AndRC2-CBC");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.12", dissect_PBKDF2Params_PDU, proto_pkcs12, "id-PBKDF2");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.13", dissect_PBES2Params_PDU, proto_pkcs12, "id-PBES2");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.5.14", dissect_PBMAC1Params_PDU, proto_pkcs12, "id-PBMAC1");
|
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs12-dis-tab.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 499 "../../asn1/pkcs12/packet-pkcs12-template.c"
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.9.22.1", dissect_X509Certificate_OCTETSTRING_PDU, proto_pkcs12, "x509Certificate");
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|