change Extension to be implemented inside the conformance file and remove it from...
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 30 Oct 2004 02:36:58 +0000 (02:36 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 30 Oct 2004 02:36:58 +0000 (02:36 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12438 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/x509af/AuthenticationFramework.asn
asn1/x509af/packet-x509af-template.c
asn1/x509af/x509af.cnf
epan/dissectors/packet-x509af.c
epan/dissectors/packet-x509af.h

index 7799f8ddbf174e18aaba9bde566ee34e90c64cb3..8fd8064a04b1191afdac010768eb4432aff984f1 100644 (file)
@@ -82,8 +82,8 @@ Extensions ::= SEQUENCE OF Extension
 --  specification of those individual extensions shall include the rules for the significance of the order therein
 Extension ::= SEQUENCE {
   extnId     OBJECT IDENTIFIER,
-  critical   BOOLEAN DEFAULT FALSE,
-  extnValue  Any
+  critical   BOOLEAN OPTIONAL,
+  extnValue  OCTET STRING
 --    contains a DER encoding of a value of type &ExtnType
 --    for the extension object identified by extnId 
 }
index b2d4eb9a7791b285ea1b06ce67271d41dffff619..e202523d5d429f235173155640b5bda6b637b7a8 100644 (file)
@@ -47,7 +47,6 @@
 static int proto_x509af = -1;
 static int hf_x509af_algorithm_id = -1;
 static int hf_x509af_extension_id = -1;
-static int hf_x509af_critical = -1;               /* BOOLEAN */
 #include "packet-x509af-hf.c"
 
 /* Initialize the subtree pointers */
@@ -57,46 +56,7 @@ static char algorithm_id[64]; /*64 chars should be long enough? */
 
 
 static char extension_id[64]; /*64 chars should be long enough? */
-static int 
-dissect_hf_x509af_extension_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) 
-{
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509af_extension_id, extension_id);
-  return offset;
-}
-/* BOOLEAN from template, remove later if the compiler starts generating it */
-static int
-dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
-  offset = dissect_ber_boolean(pinfo, tree, tvb, offset, hf_index);
-
-  return offset;
-}
-static int dissect_critical(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_x509af_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x509af_critical);
-}
-
-static int 
-dissect_hf_x509af_extension_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) 
-{
-  offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree);
 
-  return offset;
-}
-
-static const ber_sequence Extension_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_extension_id },
-  { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical },
-  { BER_CLASS_ANY, 0, 0, dissect_hf_x509af_extension_type },
-  { 0, 0, 0, NULL }
-};
-
-static int
-dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
-  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
-                                Extension_sequence, hf_index, ett_x509af_Extension);
-
-  return offset;
-}
 
 #include "packet-x509af-fn.c"
 
@@ -114,10 +74,6 @@ void proto_register_x509af(void) {
       { "Extension Id", "x509af.extension.id",
         FT_STRING, BASE_NONE, NULL, 0,
         "Extension Id", HFILL }},
-    { &hf_x509af_critical,
-      { "critical", "x509af.critical",
-        FT_BOOLEAN, 8, NULL, 0,
-        "Extension/critical", HFILL }},
 #include "packet-x509af-hfarr.c"
   };
 
index 51ad2154e23bbe8c36f09bc24f2b3a5de8904c29..54b4ec1f8e61fecb4f4aa8d01cfa664932351157 100644 (file)
@@ -38,8 +38,6 @@ CertificateList      B "2.5.4.59" "id-at-attributeCertificateRevocationList"
 
 #.NO_EMIT
 
-Extension
-
 #.TYPE_RENAME
 AttributeCertificateInfo/subject       InfoSubject
 AttributeCertificateAssertion/subject  AssertionSubject
@@ -64,3 +62,17 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate
 #.FN_BODY AlgorithmIdentifier/parameters
   offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree);
 
+#.FN_BODY Extension/extnId
+  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
+                                 hf_x509af_extension_id, extension_id);
+
+#.FN_BODY Extension/extnValue
+  guint8 class;
+  gboolean pc, ind;
+  guint32 tag;
+  guint32 len;
+  /* skip past the T and L  */
+  offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
+  offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
+  offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree);
+
index fa6053a2b38899ab815c188aa049216fad531cbe..d70be57cd06db6ccba6d20425dccd16a662421ac 100644 (file)
@@ -8,7 +8,7 @@
 /* packet-x509af.c
  * Routines for X.509 Authentication Framework packet dissection
  *
- * $Id: packet-x509af-template.c 12392 2004-10-26 13:04:09Z sahlberg $
+ * $Id: packet-x509af-template.c 12437 2004-10-30 02:18:44Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -54,7 +54,6 @@
 static int proto_x509af = -1;
 static int hf_x509af_algorithm_id = -1;
 static int hf_x509af_extension_id = -1;
-static int hf_x509af_critical = -1;               /* BOOLEAN */
 
 /*--- Included file: packet-x509af-hf.c ---*/
 
@@ -84,6 +83,9 @@ static int hf_x509af_subjectPublicKey = -1;       /* BIT_STRING */
 static int hf_x509af_utcTime = -1;                /* UTCTime */
 static int hf_x509af_generalizedTime = -1;        /* GeneralizedTime */
 static int hf_x509af_Extensions_item = -1;        /* Extension */
+static int hf_x509af_extnId = -1;                 /* T_extnId */
+static int hf_x509af_critical = -1;               /* BOOLEAN */
+static int hf_x509af_extnValue = -1;              /* T_extnValue */
 static int hf_x509af_userCertificate = -1;        /* Certificate */
 static int hf_x509af_certificationPath = -1;      /* ForwardCertificationPath */
 static int hf_x509af_ForwardCertificationPath_item = -1;  /* CrossCertificates */
@@ -170,46 +172,7 @@ static char algorithm_id[64]; /*64 chars should be long enough? */
 
 
 static char extension_id[64]; /*64 chars should be long enough? */
-static int 
-dissect_hf_x509af_extension_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) 
-{
-  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
-                                         hf_x509af_extension_id, extension_id);
-  return offset;
-}
-/* BOOLEAN from template, remove later if the compiler starts generating it */
-static int
-dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
-  offset = dissect_ber_boolean(pinfo, tree, tvb, offset, hf_index);
 
-  return offset;
-}
-static int dissect_critical(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
-  return dissect_x509af_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x509af_critical);
-}
-
-static int 
-dissect_hf_x509af_extension_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) 
-{
-  offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree);
-
-  return offset;
-}
-
-static const ber_sequence Extension_sequence[] = {
-  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_extension_id },
-  { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical },
-  { BER_CLASS_ANY, 0, 0, dissect_hf_x509af_extension_type },
-  { 0, 0, 0, NULL }
-};
-
-static int
-dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
-  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
-                                Extension_sequence, hf_index, ett_x509af_Extension);
-
-  return offset;
-}
 
 
 /*--- Included file: packet-x509af-fn.c ---*/
@@ -457,6 +420,63 @@ static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tv
   return dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKeyInfo);
 }
 
+
+static int
+dissect_x509af_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
+  offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
+                                 hf_x509af_extension_id, extension_id);
+
+
+  return offset;
+}
+static int dissect_extnId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_x509af_T_extnId(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnId);
+}
+
+
+static int
+dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
+  offset = dissect_ber_boolean(pinfo, tree, tvb, offset, hf_index);
+
+  return offset;
+}
+static int dissect_critical(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_x509af_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x509af_critical);
+}
+
+
+static int
+dissect_x509af_T_extnValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
+  guint8 class;
+  gboolean pc, ind;
+  guint32 tag;
+  guint32 len;
+  /* skip past the T and L  */
+  offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
+  offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
+  offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree);
+
+
+  return offset;
+}
+static int dissect_extnValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
+  return dissect_x509af_T_extnValue(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnValue);
+}
+
+static const ber_sequence Extension_sequence[] = {
+  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_extnId },
+  { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical },
+  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_extnValue },
+  { 0, 0, 0, NULL }
+};
+
+static int
+dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
+  offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
+                                Extension_sequence, hf_index, ett_x509af_Extension);
+
+  return offset;
+}
 static int dissect_Extensions_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
   return dissect_x509af_Extension(FALSE, tvb, offset, pinfo, tree, hf_x509af_Extensions_item);
 }
@@ -947,10 +967,6 @@ void proto_register_x509af(void) {
       { "Extension Id", "x509af.extension.id",
         FT_STRING, BASE_NONE, NULL, 0,
         "Extension Id", HFILL }},
-    { &hf_x509af_critical,
-      { "critical", "x509af.critical",
-        FT_BOOLEAN, 8, NULL, 0,
-        "Extension/critical", HFILL }},
 
 /*--- Included file: packet-x509af-hfarr.c ---*/
 
@@ -1058,6 +1074,18 @@ void proto_register_x509af(void) {
       { "Item", "x509af.Extensions_item",
         FT_NONE, BASE_NONE, NULL, 0,
         "Extensions/_item", HFILL }},
+    { &hf_x509af_extnId,
+      { "extnId", "x509af.extnId",
+        FT_STRING, BASE_NONE, NULL, 0,
+        "Extension/extnId", HFILL }},
+    { &hf_x509af_critical,
+      { "critical", "x509af.critical",
+        FT_BOOLEAN, 8, NULL, 0,
+        "Extension/critical", HFILL }},
+    { &hf_x509af_extnValue,
+      { "extnValue", "x509af.extnValue",
+        FT_BYTES, BASE_HEX, NULL, 0,
+        "Extension/extnValue", HFILL }},
     { &hf_x509af_userCertificate,
       { "userCertificate", "x509af.userCertificate",
         FT_NONE, BASE_NONE, NULL, 0,
index 531e8cf1813767bb328ad14d91088eb5002a9925..14f6b27750482b2137539f7c2a5da797d6e73c55 100644 (file)
@@ -8,7 +8,7 @@
 /* packet-x509af.h
  * Routines for X.509 Authentication Framework packet dissection
  *
- * $Id: packet-x509af-template.h 12203 2004-10-05 09:18:55Z guy $
+ * $Id: packet-x509af-template.h 12437 2004-10-30 02:18:44Z sahlberg $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>