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:37:06 +00:00
|
|
|
/* packet-pkcs1.c */
|
2016-03-09 03:17:51 +00:00
|
|
|
/* asn2wrs.py -b -p pkcs1 -c ./pkcs1.cnf -s ./packet-pkcs1-template -D . -O ../.. PKIXAlgs-2009.asn */
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/* Input file: packet-pkcs1-template.c */
|
|
|
|
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
/* packet-pkcs1.c
|
|
|
|
* Routines for PKCS#1/RFC2313 packet dissection
|
2004-12-12 01:14:03 +00:00
|
|
|
* Ronnie Sahlberg 2004
|
2004-07-29 12:10:44 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-07-29 12:10:44 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2004-07-29 12:10:44 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2011-07-14 13:47:13 +00:00
|
|
|
#include <epan/oids.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
2007-05-13 20:58:29 +00:00
|
|
|
#include "packet-pkcs1.h"
|
2004-07-29 12:10:44 +00:00
|
|
|
#include "packet-x509af.h"
|
|
|
|
|
|
|
|
#define PNAME "PKCS#1"
|
|
|
|
#define PSNAME "PKCS-1"
|
|
|
|
#define PFNAME "pkcs-1"
|
|
|
|
|
2013-12-07 11:37:58 +00:00
|
|
|
void proto_register_pkcs1(void);
|
|
|
|
void proto_reg_handoff_pkcs1(void);
|
|
|
|
|
2004-07-29 12:10:44 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_pkcs1 = -1;
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-hf.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-hf.c"
|
2011-07-14 13:47:13 +00:00
|
|
|
static int hf_pkcs1_DSA_Params_PDU = -1; /* DSA_Params */
|
|
|
|
static int hf_pkcs1_DomainParameters_PDU = -1; /* DomainParameters */
|
|
|
|
static int hf_pkcs1_KEA_Params_Id_PDU = -1; /* KEA_Params_Id */
|
2011-11-10 20:52:44 +00:00
|
|
|
static int hf_pkcs1_HashAlgorithm_PDU = -1; /* HashAlgorithm */
|
|
|
|
static int hf_pkcs1_RSASSA_PSS_params_PDU = -1; /* RSASSA_PSS_params */
|
2011-07-14 13:47:13 +00:00
|
|
|
static int hf_pkcs1_ECParameters_PDU = -1; /* ECParameters */
|
2020-01-30 00:02:27 +00:00
|
|
|
static int hf_pkcs1_Prime_p_PDU = -1; /* Prime_p */
|
2004-07-29 12:10:44 +00:00
|
|
|
static int hf_pkcs1_modulus = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_publicExponent = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
|
|
|
|
static int hf_pkcs1_digest = -1; /* Digest */
|
2011-07-14 13:47:13 +00:00
|
|
|
static int hf_pkcs1_p = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_q = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_g = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_j = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_validationParams = -1; /* ValidationParams */
|
|
|
|
static int hf_pkcs1_seed = -1; /* BIT_STRING */
|
|
|
|
static int hf_pkcs1_pgenCounter = -1; /* INTEGER */
|
2011-11-10 20:52:44 +00:00
|
|
|
static int hf_pkcs1_hashAlgorithm = -1; /* HashAlgorithm */
|
|
|
|
static int hf_pkcs1_maskGenAlgorithm = -1; /* MaskGenAlgorithm */
|
|
|
|
static int hf_pkcs1_saltLength = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_trailerField = -1; /* INTEGER */
|
2020-01-30 00:02:27 +00:00
|
|
|
static int hf_pkcs1_specifiedCurve = -1; /* SpecifiedECDomain */
|
2011-07-14 13:47:13 +00:00
|
|
|
static int hf_pkcs1_namedCurve = -1; /* OBJECT_IDENTIFIER */
|
2020-01-30 00:02:27 +00:00
|
|
|
static int hf_pkcs1_version = -1; /* ECPVer */
|
|
|
|
static int hf_pkcs1_fieldID = -1; /* FieldID */
|
|
|
|
static int hf_pkcs1_curve = -1; /* Curve */
|
|
|
|
static int hf_pkcs1_base = -1; /* ECPoint */
|
|
|
|
static int hf_pkcs1_order = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_cofactor = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_fieldType = -1; /* T_fieldType */
|
|
|
|
static int hf_pkcs1_parameters = -1; /* T_parameters */
|
|
|
|
static int hf_pkcs1_a = -1; /* FieldElement */
|
|
|
|
static int hf_pkcs1_b = -1; /* FieldElement */
|
2011-07-14 13:47:13 +00:00
|
|
|
static int hf_pkcs1_r = -1; /* INTEGER */
|
|
|
|
static int hf_pkcs1_s = -1; /* INTEGER */
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs1-hf.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 32 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-ett.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-ett.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
static gint ett_pkcs1_RSAPublicKey = -1;
|
|
|
|
static gint ett_pkcs1_DigestInfo = -1;
|
2011-07-14 13:47:13 +00:00
|
|
|
static gint ett_pkcs1_DSA_Params = -1;
|
|
|
|
static gint ett_pkcs1_DomainParameters = -1;
|
|
|
|
static gint ett_pkcs1_ValidationParams = -1;
|
2011-11-10 20:52:44 +00:00
|
|
|
static gint ett_pkcs1_RSASSA_PSS_params = -1;
|
2011-07-14 13:47:13 +00:00
|
|
|
static gint ett_pkcs1_ECParameters = -1;
|
2020-01-30 00:02:27 +00:00
|
|
|
static gint ett_pkcs1_SpecifiedECDomain = -1;
|
|
|
|
static gint ett_pkcs1_FieldID = -1;
|
|
|
|
static gint ett_pkcs1_Curve = -1;
|
2011-07-14 13:47:13 +00:00
|
|
|
static gint ett_pkcs1_DSA_Sig_Value = -1;
|
|
|
|
static gint ett_pkcs1_ECDSA_Sig_Value = -1;
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs1-ett.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 35 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-fn.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-fn.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs1_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-11-01 22:30:14 +00:00
|
|
|
NULL);
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2007-11-04 18:37:06 +00:00
|
|
|
static const ber_sequence_t RSAPublicKey_sequence[] = {
|
|
|
|
{ &hf_pkcs1_modulus , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_publicExponent, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-07-29 12:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs1_RSAPublicKey(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:37:06 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
RSAPublicKey_sequence, hf_index, ett_pkcs1_RSAPublicKey);
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs1_DigestAlgorithmIdentifier(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_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2004-07-29 12:10:44 +00:00
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs1_Digest(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,
|
2005-12-08 23:29:21 +00:00
|
|
|
NULL);
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2007-11-04 18:37:06 +00:00
|
|
|
static const ber_sequence_t DigestInfo_sequence[] = {
|
|
|
|
{ &hf_pkcs1_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_DigestAlgorithmIdentifier },
|
|
|
|
{ &hf_pkcs1_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Digest },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2004-07-29 12:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkcs1_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-11-04 18:37:06 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
DigestInfo_sequence, hf_index, ett_pkcs1_DigestInfo);
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-14 13:47:13 +00:00
|
|
|
static const ber_sequence_t DSA_Params_sequence[] = {
|
|
|
|
{ &hf_pkcs1_p , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_q , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_g , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_DSA_Params(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,
|
|
|
|
DSA_Params_sequence, hf_index, ett_pkcs1_DSA_Params);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_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_) {
|
|
|
|
offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
|
2019-04-02 11:39:52 +00:00
|
|
|
NULL, 0, hf_index, -1,
|
2011-07-14 13:47:13 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t ValidationParams_sequence[] = {
|
|
|
|
{ &hf_pkcs1_seed , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_BIT_STRING },
|
|
|
|
{ &hf_pkcs1_pgenCounter , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_ValidationParams(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,
|
|
|
|
ValidationParams_sequence, hf_index, ett_pkcs1_ValidationParams);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t DomainParameters_sequence[] = {
|
|
|
|
{ &hf_pkcs1_p , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_g , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_q , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_j , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_validationParams, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_ValidationParams },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_DomainParameters(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,
|
|
|
|
DomainParameters_sequence, hf_index, ett_pkcs1_DomainParameters);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_KEA_Params_Id(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-10 20:52:44 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs1_HashAlgorithm(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_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_MaskGenAlgorithm(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_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t RSASSA_PSS_params_sequence[] = {
|
|
|
|
{ &hf_pkcs1_hashAlgorithm , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_pkcs1_HashAlgorithm },
|
|
|
|
{ &hf_pkcs1_maskGenAlgorithm, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkcs1_MaskGenAlgorithm },
|
|
|
|
{ &hf_pkcs1_saltLength , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_trailerField , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_pkcs1_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_RSASSA_PSS_params(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,
|
|
|
|
RSASSA_PSS_params_sequence, hf_index, ett_pkcs1_RSASSA_PSS_params);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-30 00:02:27 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs1_ECPoint(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string pkcs1_ECPVer_vals[] = {
|
|
|
|
{ 1, "ecpVer1" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_ECPVer(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_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_T_fieldType(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, &actx->external.direct_reference);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
|
|
|
#line 21 "./asn1/pkcs1/pkcs1.cnf"
|
|
|
|
offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t FieldID_sequence[] = {
|
|
|
|
{ &hf_pkcs1_fieldType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs1_T_fieldType },
|
|
|
|
{ &hf_pkcs1_parameters , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_pkcs1_T_parameters },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_FieldID(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,
|
|
|
|
FieldID_sequence, hf_index, ett_pkcs1_FieldID);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_FieldElement(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_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t Curve_sequence[] = {
|
|
|
|
{ &hf_pkcs1_a , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldElement },
|
|
|
|
{ &hf_pkcs1_b , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldElement },
|
|
|
|
{ &hf_pkcs1_seed , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_BIT_STRING },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_Curve(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,
|
|
|
|
Curve_sequence, hf_index, ett_pkcs1_Curve);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const ber_sequence_t SpecifiedECDomain_sequence[] = {
|
|
|
|
{ &hf_pkcs1_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_ECPVer },
|
|
|
|
{ &hf_pkcs1_fieldID , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_FieldID },
|
|
|
|
{ &hf_pkcs1_curve , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_Curve },
|
|
|
|
{ &hf_pkcs1_base , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkcs1_ECPoint },
|
|
|
|
{ &hf_pkcs1_order , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ &hf_pkcs1_cofactor , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkcs1_INTEGER },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_SpecifiedECDomain(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,
|
|
|
|
SpecifiedECDomain_sequence, hf_index, ett_pkcs1_SpecifiedECDomain);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-14 13:47:13 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_OBJECT_IDENTIFIER(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(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string pkcs1_ECParameters_vals[] = {
|
2020-01-30 00:02:27 +00:00
|
|
|
{ 0, "specifiedCurve" },
|
|
|
|
{ 1, "namedCurve" },
|
2011-07-14 13:47:13 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const ber_choice_t ECParameters_choice[] = {
|
2020-01-30 00:02:27 +00:00
|
|
|
{ 0, &hf_pkcs1_specifiedCurve, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkcs1_SpecifiedECDomain },
|
|
|
|
{ 1, &hf_pkcs1_namedCurve , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkcs1_OBJECT_IDENTIFIER },
|
2011-07-14 13:47:13 +00:00
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_pkcs1_ECParameters(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_choice(actx, tree, tvb, offset,
|
|
|
|
ECParameters_choice, hf_index, ett_pkcs1_ECParameters,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-30 00:02:27 +00:00
|
|
|
static int
|
|
|
|
dissect_pkcs1_Prime_p(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_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-14 13:47:13 +00:00
|
|
|
/*--- PDUs ---*/
|
|
|
|
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_DSA_Params_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-07-14 13:47:13 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_DSA_Params(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_DSA_Params_PDU);
|
|
|
|
return offset;
|
2011-07-14 13:47:13 +00:00
|
|
|
}
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_DomainParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-07-14 13:47:13 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_DomainParameters(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_DomainParameters_PDU);
|
|
|
|
return offset;
|
2011-07-14 13:47:13 +00:00
|
|
|
}
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_KEA_Params_Id_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-07-14 13:47:13 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_KEA_Params_Id(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_KEA_Params_Id_PDU);
|
|
|
|
return offset;
|
2011-07-14 13:47:13 +00:00
|
|
|
}
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_HashAlgorithm_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-11-10 20:52:44 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_HashAlgorithm(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_HashAlgorithm_PDU);
|
|
|
|
return offset;
|
2011-11-10 20:52:44 +00:00
|
|
|
}
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_RSASSA_PSS_params_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-11-10 20:52:44 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_RSASSA_PSS_params(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_RSASSA_PSS_params_PDU);
|
|
|
|
return offset;
|
2011-11-10 20:52:44 +00:00
|
|
|
}
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_ECParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2011-07-14 13:47:13 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_pkcs1_ECParameters(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_ECParameters_PDU);
|
|
|
|
return offset;
|
2011-07-14 13:47:13 +00:00
|
|
|
}
|
2020-01-30 00:02:27 +00:00
|
|
|
static int dissect_Prime_p_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
|
|
|
offset = dissect_pkcs1_Prime_p(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs1_Prime_p_PDU);
|
|
|
|
return offset;
|
|
|
|
}
|
2011-07-14 13:47:13 +00:00
|
|
|
|
|
|
|
|
2004-07-29 12:10:44 +00:00
|
|
|
/*--- End of included file: packet-pkcs1-fn.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 37 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/*--- proto_register_pkcs1 ----------------------------------------------*/
|
|
|
|
void proto_register_pkcs1(void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-hfarr.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-hfarr.c"
|
2011-07-14 13:47:13 +00:00
|
|
|
{ &hf_pkcs1_DSA_Params_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "DSA-Params", "pkcs1.DSA_Params_element",
|
2011-07-14 13:47:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_DomainParameters_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "DomainParameters", "pkcs1.DomainParameters_element",
|
2011-07-14 13:47:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_KEA_Params_Id_PDU,
|
|
|
|
{ "KEA-Params-Id", "pkcs1.KEA_Params_Id",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2011-11-10 20:52:44 +00:00
|
|
|
{ &hf_pkcs1_HashAlgorithm_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "HashAlgorithm", "pkcs1.HashAlgorithm_element",
|
2011-11-10 20:52:44 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_RSASSA_PSS_params_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "RSASSA-PSS-params", "pkcs1.RSASSA_PSS_params_element",
|
2011-11-10 20:52:44 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2011-07-14 13:47:13 +00:00
|
|
|
{ &hf_pkcs1_ECParameters_PDU,
|
|
|
|
{ "ECParameters", "pkcs1.ECParameters",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(pkcs1_ECParameters_vals), 0,
|
|
|
|
NULL, HFILL }},
|
2020-01-30 00:02:27 +00:00
|
|
|
{ &hf_pkcs1_Prime_p_PDU,
|
|
|
|
{ "Prime-p", "pkcs1.Prime_p",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2004-07-29 12:10:44 +00:00
|
|
|
{ &hf_pkcs1_modulus,
|
|
|
|
{ "modulus", "pkcs1.modulus",
|
2015-09-15 21:24:26 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2004-07-29 12:10:44 +00:00
|
|
|
{ &hf_pkcs1_publicExponent,
|
|
|
|
{ "publicExponent", "pkcs1.publicExponent",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"INTEGER", HFILL }},
|
2004-07-29 12:10:44 +00:00
|
|
|
{ &hf_pkcs1_digestAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "digestAlgorithm", "pkcs1.digestAlgorithm_element",
|
2004-07-29 12:10:44 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:37:46 +00:00
|
|
|
"DigestAlgorithmIdentifier", HFILL }},
|
2004-07-29 12:10:44 +00:00
|
|
|
{ &hf_pkcs1_digest,
|
|
|
|
{ "digest", "pkcs1.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 }},
|
2011-07-14 13:47:13 +00:00
|
|
|
{ &hf_pkcs1_p,
|
|
|
|
{ "p", "pkcs1.p",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_q,
|
|
|
|
{ "q", "pkcs1.q",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_g,
|
|
|
|
{ "g", "pkcs1.g",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_j,
|
|
|
|
{ "j", "pkcs1.j",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_validationParams,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "validationParams", "pkcs1.validationParams_element",
|
2011-07-14 13:47:13 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_seed,
|
|
|
|
{ "seed", "pkcs1.seed",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
"BIT_STRING", HFILL }},
|
|
|
|
{ &hf_pkcs1_pgenCounter,
|
|
|
|
{ "pgenCounter", "pkcs1.pgenCounter",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
2011-11-10 20:52:44 +00:00
|
|
|
{ &hf_pkcs1_hashAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "hashAlgorithm", "pkcs1.hashAlgorithm_element",
|
2011-11-10 20:52:44 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_maskGenAlgorithm,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "maskGenAlgorithm", "pkcs1.maskGenAlgorithm_element",
|
2011-11-10 20:52:44 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_saltLength,
|
|
|
|
{ "saltLength", "pkcs1.saltLength",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_trailerField,
|
|
|
|
{ "trailerField", "pkcs1.trailerField",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
2020-01-30 00:02:27 +00:00
|
|
|
{ &hf_pkcs1_specifiedCurve,
|
|
|
|
{ "specifiedCurve", "pkcs1.specifiedCurve_element",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"SpecifiedECDomain", HFILL }},
|
2011-07-14 13:47:13 +00:00
|
|
|
{ &hf_pkcs1_namedCurve,
|
|
|
|
{ "namedCurve", "pkcs1.namedCurve",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
|
|
|
"OBJECT_IDENTIFIER", HFILL }},
|
2020-01-30 00:02:27 +00:00
|
|
|
{ &hf_pkcs1_version,
|
|
|
|
{ "version", "pkcs1.version",
|
|
|
|
FT_INT32, BASE_DEC, VALS(pkcs1_ECPVer_vals), 0,
|
|
|
|
"ECPVer", HFILL }},
|
|
|
|
{ &hf_pkcs1_fieldID,
|
|
|
|
{ "fieldID", "pkcs1.fieldID_element",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_curve,
|
|
|
|
{ "curve", "pkcs1.curve_element",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_base,
|
|
|
|
{ "base", "pkcs1.base",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
"ECPoint", HFILL }},
|
|
|
|
{ &hf_pkcs1_order,
|
|
|
|
{ "order", "pkcs1.order",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_cofactor,
|
|
|
|
{ "cofactor", "pkcs1.cofactor",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_fieldType,
|
|
|
|
{ "fieldType", "pkcs1.fieldType",
|
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_parameters,
|
|
|
|
{ "parameters", "pkcs1.parameters_element",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_pkcs1_a,
|
|
|
|
{ "a", "pkcs1.a",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
"FieldElement", HFILL }},
|
|
|
|
{ &hf_pkcs1_b,
|
|
|
|
{ "b", "pkcs1.b",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
"FieldElement", HFILL }},
|
2011-07-14 13:47:13 +00:00
|
|
|
{ &hf_pkcs1_r,
|
|
|
|
{ "r", "pkcs1.r",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
|
|
|
{ &hf_pkcs1_s,
|
|
|
|
{ "s", "pkcs1.s",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0,
|
|
|
|
"INTEGER", HFILL }},
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs1-hfarr.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 44 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-ettarr.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-ettarr.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
&ett_pkcs1_RSAPublicKey,
|
|
|
|
&ett_pkcs1_DigestInfo,
|
2011-07-14 13:47:13 +00:00
|
|
|
&ett_pkcs1_DSA_Params,
|
|
|
|
&ett_pkcs1_DomainParameters,
|
|
|
|
&ett_pkcs1_ValidationParams,
|
2011-11-10 20:52:44 +00:00
|
|
|
&ett_pkcs1_RSASSA_PSS_params,
|
2011-07-14 13:47:13 +00:00
|
|
|
&ett_pkcs1_ECParameters,
|
2020-01-30 00:02:27 +00:00
|
|
|
&ett_pkcs1_SpecifiedECDomain,
|
|
|
|
&ett_pkcs1_FieldID,
|
|
|
|
&ett_pkcs1_Curve,
|
2011-07-14 13:47:13 +00:00
|
|
|
&ett_pkcs1_DSA_Sig_Value,
|
|
|
|
&ett_pkcs1_ECDSA_Sig_Value,
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs1-ettarr.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 49 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2004-07-29 12:10:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Register protocol */
|
|
|
|
proto_pkcs1 = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array(proto_pkcs1, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_pkcs1 -------------------------------------------*/
|
|
|
|
void proto_reg_handoff_pkcs1(void) {
|
2011-07-14 13:47:13 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-pkcs1-dis-tab.c ---*/
|
2016-03-09 03:17:51 +00:00
|
|
|
#line 1 "./asn1/pkcs1/packet-pkcs1-dis-tab.c"
|
2015-12-10 02:50:10 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.10040.4.1", dissect_DSA_Params_PDU, proto_pkcs1, "id-dsa");
|
|
|
|
register_ber_oid_dissector("1.2.840.10046.2.1", dissect_DomainParameters_PDU, proto_pkcs1, "dhpublicnumber");
|
|
|
|
register_ber_oid_dissector("2.16.840.1.101.2.1.1.22", dissect_KEA_Params_Id_PDU, proto_pkcs1, "id-keyExchangeAlgorithm");
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.2.1", dissect_ECParameters_PDU, proto_pkcs1, "id-ecPublicKey");
|
|
|
|
register_ber_oid_dissector("1.3.132.1.12", dissect_ECParameters_PDU, proto_pkcs1, "id-ecDH");
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.2.13", dissect_ECParameters_PDU, proto_pkcs1, "id-ecMQV");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.10", dissect_RSASSA_PSS_params_PDU, proto_pkcs1, "id-RSASSA-PSS");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.8", dissect_HashAlgorithm_PDU, proto_pkcs1, "id-mgf1");
|
2020-01-30 00:02:27 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.10045.1.1", dissect_Prime_p_PDU, proto_pkcs1, "prime-field");
|
2011-07-14 13:47:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-pkcs1-dis-tab.c ---*/
|
2018-02-18 14:19:48 +00:00
|
|
|
#line 64 "./asn1/pkcs1/packet-pkcs1-template.c"
|
2011-07-14 13:47:13 +00:00
|
|
|
|
2015-12-10 02:50:10 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.113549.2.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.2.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.2.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5");
|
2004-07-29 12:10:44 +00:00
|
|
|
|
2015-12-10 02:50:10 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "md2WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.3", dissect_ber_oid_NULL_callback, proto_pkcs1, "md4WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "md5WithRSAEncryption");
|
2004-07-29 12:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* these two are not from RFC2313 but pulled in from
|
|
|
|
http://www.alvestrand.no/objectid/1.2.840.113549.1.1.html
|
|
|
|
*/
|
2015-12-10 02:50:10 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.5", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha1WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.6", dissect_ber_oid_NULL_callback, proto_pkcs1, "rsaOAEPEncryptionSET");
|
2011-07-14 13:47:13 +00:00
|
|
|
|
2015-08-05 19:19:48 +00:00
|
|
|
/* these sha2 algorithms are from RFC3447 */
|
2015-12-10 02:50:10 +00:00
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.11", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha256WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.12", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha384WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.13", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha512WithRSAEncryption");
|
|
|
|
register_ber_oid_dissector("1.2.840.113549.1.1.14", dissect_ber_oid_NULL_callback, proto_pkcs1, "sha224WithRSAEncryption");
|
2015-08-05 19:19:48 +00:00
|
|
|
|
2018-05-07 23:58:34 +00:00
|
|
|
/* ECDSA SHA-1 algorithm from RFC 3279 */
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.4.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA1");
|
|
|
|
|
2017-06-09 08:34:40 +00:00
|
|
|
/* ECDSA SHA2 algorithms from X9.62, RFC5480, RFC 5758, RFC 5912 */
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.4.3.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA224");
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.4.3.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA256");
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.4.3.3", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA384");
|
|
|
|
register_ber_oid_dissector("1.2.840.10045.4.3.4", dissect_ber_oid_NULL_callback, proto_pkcs1, "ecdsa-with-SHA512");
|
|
|
|
|
|
|
|
/* DSA SHA2 algorithms from FIPS186-3, RFC5480, RFC 5758, RFC 5912 */
|
|
|
|
register_ber_oid_dissector("2.16.840.1.101.3.4.3.1", dissect_ber_oid_NULL_callback, proto_pkcs1, "id-dsa-with-sha224");
|
|
|
|
register_ber_oid_dissector("2.16.840.1.101.3.4.3.2", dissect_ber_oid_NULL_callback, proto_pkcs1, "id-dsa-with-sha256");
|
|
|
|
|
2011-07-14 13:47:13 +00:00
|
|
|
oid_add_from_string("secp192r1","1.2.840.10045.3.1.1");
|
|
|
|
oid_add_from_string("sect163k1","1.3.132.0.1");
|
|
|
|
oid_add_from_string("sect163r2","1.3.132.0.15");
|
|
|
|
oid_add_from_string("secp224r1","1.3.132.0.33");
|
|
|
|
oid_add_from_string("sect233k1","1.3.132.0.26");
|
|
|
|
oid_add_from_string("sect233r1","1.3.132.0.27");
|
|
|
|
oid_add_from_string("secp256r1","1.2.840.10045.3.1.7");
|
|
|
|
oid_add_from_string("sect283k1","1.3.132.0.16");
|
|
|
|
oid_add_from_string("sect283r1","1.3.132.0.17");
|
|
|
|
oid_add_from_string("secp384r1","1.3.132.0.34");
|
|
|
|
oid_add_from_string("sect409k1","1.3.132.0.36");
|
|
|
|
oid_add_from_string("sect409r1","1.3.132.0.37");
|
2015-04-06 07:45:33 +00:00
|
|
|
oid_add_from_string("secp521r1","1.3.132.0.35");
|
|
|
|
oid_add_from_string("sect571k1","1.3.132.0.38");
|
2011-07-14 13:47:13 +00:00
|
|
|
oid_add_from_string("sect571r1","1.3.132.0.39");
|
|
|
|
|
2012-07-13 12:34:36 +00:00
|
|
|
/* sha2 family, see RFC3447 and http://www.oid-info.com/get/2.16.840.1.101.3.4.2 */
|
2012-06-24 23:52:24 +00:00
|
|
|
oid_add_from_string("sha256", "2.16.840.1.101.3.4.2.1");
|
2015-08-05 19:19:48 +00:00
|
|
|
oid_add_from_string("sha384", "2.16.840.1.101.3.4.2.2");
|
|
|
|
oid_add_from_string("sha512", "2.16.840.1.101.3.4.2.3");
|
|
|
|
oid_add_from_string("sha224", "2.16.840.1.101.3.4.2.4");
|
2012-06-24 23:52:24 +00:00
|
|
|
|
2004-07-29 12:10:44 +00:00
|
|
|
}
|
|
|
|
|