diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2007-08-29 18:39:30 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2007-08-29 18:39:30 +0000 |
commit | 21d5aaaa4fc98893a4b4eacd57c6228dbe40221a (patch) | |
tree | af8ca7986e5828259c1d9fb866607884adb29a0e /asn1/x411 | |
parent | b71c2da3e4d371d47211a9f65503721210071b06 (diff) | |
download | wireshark-21d5aaaa4fc98893a4b4eacd57c6228dbe40221a.tar.gz |
- Rewrote handling of extensions to get rid of "funky" oid strings.
- Added ASN.1 integer values for StandardExtension, ExtensionAttributeType
and TokenDataType.
- Added expert info for unknown standard-extension, extension-attribute-type
and tokendata-type.
- Added expert info for unknown built-in content-type.
svn path=/trunk/; revision=22730
Diffstat (limited to 'asn1/x411')
-rw-r--r-- | asn1/x411/packet-x411-template.c | 34 | ||||
-rw-r--r-- | asn1/x411/x411.asn | 106 | ||||
-rw-r--r-- | asn1/x411/x411.cnf | 185 |
3 files changed, 230 insertions, 95 deletions
diff --git a/asn1/x411/packet-x411-template.c b/asn1/x411/packet-x411-template.c index 75f3eaf835..5bc3bf490d 100644 --- a/asn1/x411/packet-x411-template.c +++ b/asn1/x411/packet-x411-template.c @@ -33,6 +33,7 @@ #include <epan/conversation.h> #include <epan/oids.h> #include <epan/asn1.h> +#include <epan/expert.h> #include <stdio.h> #include <string.h> @@ -76,9 +77,6 @@ static proto_item *address_item; static proto_tree *top_tree=NULL; -static int -call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); - #include "packet-x411-hf.c" /* Initialize the subtree pointers */ @@ -86,24 +84,17 @@ static gint ett_x411 = -1; static gint ett_x411_content_unknown = -1; static gint ett_x411_bilateral_information = -1; static gint ett_x411_additional_information = -1; +static gint ett_x411_unknown_standard_extension = -1; +static gint ett_x411_unknown_extension_attribute_type = -1; +static gint ett_x411_unknown_tokendata_type = -1; #include "packet-x411-ett.c" -#include "packet-x411-fn.c" - -static int -call_x411_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) -{ - const char *name = NULL; - char* extension_oid; - - extension_oid = ep_strdup_printf("%s.%d", base_oid, extension_id); +/* Dissector tables */ +static dissector_table_t x411_extension_dissector_table; +static dissector_table_t x411_extension_attribute_dissector_table; +static dissector_table_t x411_tokendata_dissector_table; - name = get_oid_str_name(extension_oid); - proto_item_append_text(tree, " (%s)", name ? name : extension_oid); - - return call_ber_oid_callback(extension_oid, tvb, offset, pinfo, tree); - -} +#include "packet-x411-fn.c" /* @@ -228,6 +219,9 @@ void proto_register_x411(void) { &ett_x411_content_unknown, &ett_x411_bilateral_information, &ett_x411_additional_information, + &ett_x411_unknown_standard_extension, + &ett_x411_unknown_extension_attribute_type, + &ett_x411_unknown_tokendata_type, #include "packet-x411-ettarr.c" }; @@ -240,6 +234,10 @@ void proto_register_x411(void) { proto_register_field_array(proto_x411, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + x411_extension_dissector_table = register_dissector_table("x411.extension", "X411-EXTENSION", FT_UINT32, BASE_DEC); + x411_extension_attribute_dissector_table = register_dissector_table("x411.extension-attribute", "X411-EXTENSION-ATTRIBUTE", FT_UINT32, BASE_DEC); + x411_tokendata_dissector_table = register_dissector_table("x411.tokendata", "X411-TOKENDATA", FT_UINT32, BASE_DEC); + /* Register our configuration options for X411, particularly our port */ #ifdef PREFERENCE_GROUPING diff --git a/asn1/x411/x411.asn b/asn1/x411/x411.asn index 81b49953a1..91feeed283 100644 --- a/asn1/x411/x411.asn +++ b/asn1/x411/x411.asn @@ -1756,10 +1756,58 @@ SupplementaryInformation ::= --} ExtensionType ::= CHOICE { - standard-extension [0] INTEGER --(0..ub-extension-types)--, + standard-extension [0] StandardExtension --(0..ub-extension-types)--, private-extension [3] OBJECT IDENTIFIER } +StandardExtension ::= INTEGER { + recipient-reassignment-prohibited (1), + originator-requested-alternate-recipient (2), + dl-expansion-prohibited (3), + conversion-with-loss-prohibited (4), + latest-delivery-time (5), + requested-delivery-method (6), + physical-forwarding-prohibited (7), + physical-forwarding-address-request (8), + physical-delivery-modes (9), + registered-mail-type (10), + recipient-number-for-advice (11), + physical-rendition-attributes (12), + originator-return-address (13), + physical-delivery-report-request (14), + originator-certificate (15), + message-token (16), + content-confidentiality-algorithm-identifier (17), + content-integrity-check (18), + message-origin-authentication-check (19), + message-security-label (20), + proof-of-submission-request (21), + proof-of-delivery-request (22), + content-correlator (23), + probe-origin-authentication-check (24), + redirection-history (25), + dl-expansion-history (26), + physical-forwarding-address (27), + recipient-certificate (28), + proof-of-delivery (29), + originator-and-DL-expansion-history (30), + reporting-DL-name (31), + reporting-MTA-certificate (32), + report-origin-authentication-check (33), + originating-MTA-certificate (34), + proof-of-submission (35), + forwarding-request (36), + trace-information (37), + internal-trace-information (38), + reporting-MTA-name (39), + multiple-originator-certificates (40), + blind-copy-recipients (41), + dl-exempted-recipients (42), + body-part-encryption-token (43), + forwarded-content-token (44), + certificate-selectors (45) +} + Criticality ::= BIT STRING {for-submission(0), for-transfer(1), for-delivery(2) } -- (SIZE (0..ub-bit-options)) - - critical 'one', non-critical 'zero' @@ -2364,12 +2412,57 @@ ExtensionAttributes ::= ExtensionAttribute ::= SEQUENCE { extension-attribute-type - [0] INTEGER --EXTENSION-ATTRIBUTE.&id({ExtensionAttributeTable}) --, + [0] ExtensionAttributeType --EXTENSION-ATTRIBUTE.&id({ExtensionAttributeTable}) --, extension-attribute-value [1] ANY --EXTENSION-ATTRIBUTE.&Type -- ({ExtensionAttributeTable}{@extension-attribute-type}) } + + +ExtensionAttributeType ::= INTEGER { + common-name (1), + teletex-common-name (2), + teletex-organization-name (3), + teletex-personal-name (4), + teletex-organizational-unit-names (5), + teletex-domain-defined-attributes (6), + pds-name (7), + physical-delivery-country-name (8), + postal-code (9), + physical-delivery-office-name (10), + physical-delivery-office-number (11), + extension-OR-address-components (12), + physical-delivery-personal-name (13), + physical-delivery-organization-name (14), + extension-physical-delivery-address-components (15), + unformatted-postal-address (16), + street-address (17), + post-office-box-address (18), + poste-restante-address (19), + unique-postal-name (20), + local-postal-attributes (21), + extended-network-address (22), + terminal-type (23), + universal-common-name (24), + universal-organization-name (25), + universal-personal-name (26), + universal-organizational-unit-names (27), + universal-domain-defined-attributes (28), + universal-physical-delivery-office-name (29), + universal-physical-delivery-office-number (30), + universal-extension-OR-address-components (31), + universal-physical-delivery-personal-name (32), + universal-physical-delivery-organization-name (33), + universal-extension-physical-delivery-address-components (34), + universal-unformatted-postal-address (35), + universal-street-address (36), + universal-post-office-box-address (37), + universal-poste-restante-address (38), + universal-unique-postal-name (39), + universal-local-postal-attributes (40) +} + --EXTENSION-ATTRIBUTE ::= CLASS { -- &id INTEGER(0..ub-extension-attributes) UNIQUE, -- &Type @@ -2857,10 +2950,17 @@ AsymmetricToken ::= SEQUENCE { } TokenData ::= SEQUENCE { - type [0] INTEGER -- TOKEN-DATA.&id({TokenDataTable}) --, + type [0] TokenDataType -- TOKEN-DATA.&id({TokenDataTable}) --, value [1] ANY -- TOKEN-DATA.&Type({TokenDataTable}{@type}) } +TokenDataType ::= INTEGER { + bind-token-signed-data (1), + message-token-signed-data (2), + message-token-encrypted-data (3), + bind-token-encrypted-data (4) +} + --TOKEN-DATA ::= CLASS {&id INTEGER UNIQUE, -- &Type --}WITH SYNTAX {&Type diff --git a/asn1/x411/x411.cnf b/asn1/x411/x411.cnf index faf1a41160..bccea1ec6e 100644 --- a/asn1/x411/x411.cnf +++ b/asn1/x411/x411.cnf @@ -146,76 +146,76 @@ MTABindError MTS-APDU #.REGISTER -RecipientReassignmentProhibited B "x411.extension.1" "recipient-reassignment-prohibited" -MTSOriginatorRequestedAlternateRecipient B "x411.extension.2" "originator-requested-alternate-recipient" -DLExpansionProhibited B "x411.extension.3" "dl-expansion-prohibited" -ConversionWithLossProhibited B "x411.extension.4" "conversion-with-loss-prohibited" -LatestDeliveryTime B "x411.extension.5" "latest-delivery-time" -RequestedDeliveryMethod B "x411.extension.6" "requested-delivery-method" -PhysicalForwardingProhibited B "x411.extension.7" "physical-forwarding-prohibited" -PhysicalForwardingAddressRequest B "x411.extension.8" "physical-forwarding-address-request" -PhysicalDeliveryModes B "x411.extension.9" "physical-delivery-modes" -RegisteredMailType B "x411.extension.10" "registered-mail-type" -RecipientNumberForAdvice B "x411.extension.11" "recipient-number-for-advice" -PhysicalRenditionAttributes B "x411.extension.12" "physical-rendition-attributes" -OriginatorReturnAddress B "x411.extension.13" "originator-return-address" -PhysicalDeliveryReportRequest B "x411.extension.14" "physical-delivery-report-request" -OriginatorCertificate B "x411.extension.15" "originator-certificate" -MessageToken B "x411.extension.16" "message-token" -ContentConfidentialityAlgorithmIdentifier B "x411.extension.17" "content-confidentiality-algorithm-identifier" -ContentIntegrityCheck B "x411.extension.18" "content-integrity-check" -MessageOriginAuthenticationCheck B "x411.extension.19" "message-origin-authentication-check" -MessageSecurityLabel B "x411.extension.20" "message-security-label" -ProofOfSubmissionRequest B "x411.extension.21" "proof-of-submission-request" -ProofOfDeliveryRequest B "x411.extension.22" "proof-of-delivery-request" -ContentCorrelator B "x411.extension.23" "content-correlator" -ProbeOriginAuthenticationCheck B "x411.extension.24" "probe-origin-authentication-check" -RedirectionHistory B "x411.extension.25" "redirection-history" -DLExpansionHistory B "x411.extension.26" "dl-expansion-history" -PhysicalForwardingAddress B "x411.extension.27" "physical-forwarding-address" -RecipientCertificate B "x411.extension.28" "recipient-certificate" -ProofOfDelivery B "x411.extension.29" "proof-of-delivery" -OriginatorAndDLExpansionHistory B "x411.extension.30" "originator-and-DL-expansion-history" -ReportingDLName B "x411.extension.31" "reporting-DL-name" -ReportingMTACertificate B "x411.extension.32" "reporting-MTA-certificate" -ReportOriginAuthenticationCheck B "x411.extension.33" "report-origin-authentication-check" -ProofOfSubmission B "x411.extension.35" "proof-of-submission" - -TraceInformation B "x411.extension.37" "trace-information" -InternalTraceInformation B "x411.extension.38" "internal-trace-information" -ReportingMTAName B "x411.extension.39" "reporting-MTA-name" -ExtendedCertificates B "x411.extension.40" "multiple-originator-certificates" - -DLExemptedRecipients B "x411.extension.42" "dl-exempted-recipients" - -CertificateSelectors B "x411.extension.45" "certificate-selectors" - -CommonName B "x411.extension-attribute.1" "common-name" -TeletexCommonName B "x411.extension-attribute.2" "teletex-common-name" -TeletexOrganizationName B "x411.extension-attribute.3" "teletex-organization-name" -TeletexPersonalName B "x411.extension-attribute.4" "teletex-personal-name" -TeletexOrganizationalUnitNames B "x411.extension-attribute.5" "teletex-organizational-unit-names" - -PDSName B "x411.extension-attribute.7" "pds-name" -PhysicalDeliveryCountryName B "x411.extension-attribute.8" "physical-delivery-country-name" -PostalCode B "x411.extension-attribute.9" "postal-code" -PhysicalDeliveryOfficeName B "x411.extension-attribute.10" "physical-delivery-office-name" - -UniversalCommonName B "x411.extension-attribute.24" "universal-common-name" -UniversalOrganizationName B "x411.extension-attribute.25" "universal-organization-name" -UniversalPersonalName B "x411.extension-attribute.26" "universal-personal-name" -UniversalOrganizationalUnitNames B "x411.extension-attribute.27" "universal-organizational-unit-names" +RecipientReassignmentProhibited N x411.extension 1 +MTSOriginatorRequestedAlternateRecipient N x411.extension 2 +DLExpansionProhibited N x411.extension 3 +ConversionWithLossProhibited N x411.extension 4 +LatestDeliveryTime N x411.extension 5 +RequestedDeliveryMethod N x411.extension 6 +PhysicalForwardingProhibited N x411.extension 7 +PhysicalForwardingAddressRequest N x411.extension 8 +PhysicalDeliveryModes N x411.extension 9 +RegisteredMailType N x411.extension 10 +RecipientNumberForAdvice N x411.extension 11 +PhysicalRenditionAttributes N x411.extension 12 +OriginatorReturnAddress N x411.extension 13 +PhysicalDeliveryReportRequest N x411.extension 14 +OriginatorCertificate N x411.extension 15 +MessageToken N x411.extension 16 +ContentConfidentialityAlgorithmIdentifier N x411.extension 17 +ContentIntegrityCheck N x411.extension 18 +MessageOriginAuthenticationCheck N x411.extension 19 +MessageSecurityLabel N x411.extension 20 +ProofOfSubmissionRequest N x411.extension 21 +ProofOfDeliveryRequest N x411.extension 22 +ContentCorrelator N x411.extension 23 +ProbeOriginAuthenticationCheck N x411.extension 24 +RedirectionHistory N x411.extension 25 +DLExpansionHistory N x411.extension 26 +PhysicalForwardingAddress N x411.extension 27 +RecipientCertificate N x411.extension 28 +ProofOfDelivery N x411.extension 29 +OriginatorAndDLExpansionHistory N x411.extension 30 +ReportingDLName N x411.extension 31 +ReportingMTACertificate N x411.extension 32 +ReportOriginAuthenticationCheck N x411.extension 33 +ProofOfSubmission N x411.extension 35 + +TraceInformation N x411.extension 37 +InternalTraceInformation N x411.extension 38 +ReportingMTAName N x411.extension 39 +ExtendedCertificates N x411.extension 40 + +DLExemptedRecipients N x411.extension 42 + +CertificateSelectors N x411.extension 45 + +CommonName N x411.extension-attribute 1 +TeletexCommonName N x411.extension-attribute 2 +TeletexOrganizationName N x411.extension-attribute 3 +TeletexPersonalName N x411.extension-attribute 4 +TeletexOrganizationalUnitNames N x411.extension-attribute 5 + +PDSName N x411.extension-attribute 7 +PhysicalDeliveryCountryName N x411.extension-attribute 8 +PostalCode N x411.extension-attribute 9 +PhysicalDeliveryOfficeName N x411.extension-attribute 10 + +UniversalCommonName N x411.extension-attribute 24 +UniversalOrganizationName N x411.extension-attribute 25 +UniversalPersonalName N x411.extension-attribute 26 +UniversalOrganizationalUnitNames N x411.extension-attribute 27 ReportDeliveryArgument B "2.6.1.4.14" "id-et-report" AsymmetricToken B "2.6.3.6.0" "id-tok-asymmetricToken" MTANameAndOptionalGDI B "2.6.5.6.0" "id-on-mtaName" -BindTokenSignedData B "x411.tokendata.1" "bind-token-signed-data" -MessageTokenSignedData B "x411.tokendata.2" "message-token-signed-data" +BindTokenSignedData N x411.tokendata 1 +MessageTokenSignedData N x411.tokendata 2 # the next two are unlikely to ever be seen (unless in a bad encoding) -MessageTokenEncryptedData B "x411.tokendata.3" "message-token-encrypted-data" -BindTokenEncryptedData B "x411.tokendata.4" "bind-token-encrypted-data" +MessageTokenEncryptedData N x411.tokendata 3 +BindTokenEncryptedData N x411.tokendata 4 # X402 - see master list in acp133.cnf @@ -256,9 +256,21 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" #.FN_BODY ExtensionField/value const char *name; - if(extension_id != -1) - offset=call_x411_oid_callback("x411.extension", tvb, offset, actx->pinfo, tree); - else if(object_identifier_id) { + if(extension_id != -1) { + proto_item_append_text(tree, " (%%s)", val_to_str(extension_id, x411_StandardExtension_vals, "standard-extension %%d")); + if (dissector_try_port(x411_extension_dissector_table, extension_id, tvb, actx->pinfo, tree)) { + offset = tvb_length(tvb); + } else { + proto_item *item = NULL; + proto_tree *next_tree = NULL; + + item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + "Dissector for standard-extension %%d not implemented. Contact Wireshark developers if you want this supported", extension_id); + next_tree = proto_item_add_subtree(item, ett_x411_unknown_standard_extension); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); + expert_add_info_format(actx->pinfo, item, PI_UNDECODED, PI_WARN, "Unknown standard-extension"); + } + } else if (object_identifier_id) { call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree); name = get_oid_str_name(object_identifier_id); proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id); @@ -269,12 +281,25 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" offset = dissect_unknown_ber(actx->pinfo, tvb, offset, tree); -#.FN_PARS ExtensionAttribute/extension-attribute-type +#.FN_PARS ExtensionAttributeType VAL_PTR = &extension_id #.FN_BODY ExtensionAttribute/extension-attribute-value - offset=call_x411_oid_callback("x411.extension-attribute", tvb, offset, actx->pinfo, tree); + proto_item_append_text(tree, " (%%s)", val_to_str(extension_id, x411_ExtensionAttributeType_vals, "extension-attribute-type %%d")); + if (dissector_try_port(x411_extension_attribute_dissector_table, extension_id, tvb, actx->pinfo, tree)) { + offset =tvb_length(tvb); + } else { + proto_item *item = NULL; + proto_tree *next_tree = NULL; + + item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + "Dissector for extension-attribute-type %%d not implemented. Contact Wireshark developers if you want this supported", extension_id); + next_tree = proto_item_add_subtree(item, ett_x411_unknown_extension_attribute_type); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); + expert_add_info_format(actx->pinfo, item, PI_UNDECODED, PI_WARN, "Unknown extension-attribute-type"); + } + #.FN_BODY RefusedOperation/refused-argument/refused-extension /*XXX not implemented yet */ @@ -340,13 +365,9 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" actx, tree, tvb, offset, hf_index, NULL); - -#.FN_PARS ExtensionType/standard-extension +#.FN_PARS StandardExtension VAL_PTR = &extension_id - - - #.FN_BODY ExtensionType/private-extension FN_VARIANT = _str VAL_PTR = &object_identifier_id %(DEFAULT_BODY)s @@ -403,6 +424,7 @@ ORAddress B "2.16.840.1.101.2.2.1.134.1" "id-at-collective-mhs-or-addresses" proto_tree *next_tree = NULL; item = proto_tree_add_text(top_tree ? top_tree : tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "X.411 Unknown Content (unknown built-in content-type)"); + expert_add_info_format(actx->pinfo, item, PI_UNDECODED, PI_WARN, "Unknown built-in content-type"); if (item) { next_tree=proto_item_add_subtree(item, ett_x411_content_unknown); } @@ -773,9 +795,24 @@ AddrTeletexString TeletexPersonalName/surname TeletexPersonalName/given-name Tel col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", val_to_str(credentials, x411_Credentials_vals, "Credentials(%%d)")); } +#.FN_PARS TokenDataType + VAL_PTR = &extension_id + #.FN_BODY TokenData/value - offset=call_x411_oid_callback("x411.tokendata", tvb, offset, actx->pinfo, tree); + proto_item_append_text(tree, " (%%s)", val_to_str(extension_id, x411_TokenDataType_vals, "tokendata-type %%d")); + if (dissector_try_port(x411_tokendata_dissector_table, extension_id, tvb, actx->pinfo, tree)) { + offset = tvb_length(tvb); + } else { + proto_item *item = NULL; + proto_tree *next_tree = NULL; + + item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), + "Dissector for tokendata-type %%d not implemented. Contact Wireshark developers if you want this supported", extension_id); + next_tree = proto_item_add_subtree(item, ett_x411_unknown_tokendata_type); + offset = dissect_unknown_ber(actx->pinfo, tvb, offset, next_tree); + expert_add_info_format(actx->pinfo, item, PI_UNDECODED, PI_WARN, "Unknown tokendata-type"); + } #.FN_BODY PerDomainBilateralInformation/bilateral-information proto_item *item = NULL; |