diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-30 02:18:44 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-30 02:18:44 +0000 |
commit | 805f948c298ce5b3613328b5c20cd56b78e8fe95 (patch) | |
tree | 6677d3e5499cf6e7402ed1454a8dcb34165010ff /asn1/x509af | |
parent | ee310edcda1ecbb581b87a41dc2819d505691bbd (diff) |
implement AlgorithmIdentifier using the conformance file and remove it from the template
svn path=/trunk/; revision=12437
Diffstat (limited to 'asn1/x509af')
-rw-r--r-- | asn1/x509af/AuthenticationFramework.asn | 16 | ||||
-rw-r--r-- | asn1/x509af/packet-x509af-template.c | 34 | ||||
-rw-r--r-- | asn1/x509af/packet-x509af-template.h | 2 | ||||
-rw-r--r-- | asn1/x509af/x509af.cnf | 10 | ||||
-rw-r--r-- | asn1/x509af/x509af_dummy.cnf | 5 |
5 files changed, 23 insertions, 44 deletions
diff --git a/asn1/x509af/AuthenticationFramework.asn b/asn1/x509af/AuthenticationFramework.asn index ba21daaa7b..7799f8ddbf 100644 --- a/asn1/x509af/AuthenticationFramework.asn +++ b/asn1/x509af/AuthenticationFramework.asn @@ -24,7 +24,9 @@ IMPORTS FROM SelectedAttributeTypes selectedAttributeTypes certificateExactMatch, certificatePairExactMatch, certificateListExactMatch, GeneralNames - FROM CertificateExtensions certificateExtensions; + FROM CertificateExtensions certificateExtensions + Any + FROM DummyAF; -- basic certificate definition Certificate ::= SEQUENCE { @@ -50,10 +52,9 @@ Version ::= INTEGER {v1(0), v2(1), v3(2)} CertificateSerialNumber ::= INTEGER --- Can not be handled by compiler. Handimplemented in the template AlgorithmIdentifier ::= SEQUENCE { --- algorithm ALGORITHM.&id({SupportedAlgorithms}), --- parameters ALGORITHM.&Type({SupportedAlgorithms}{@algorithm}) OPTIONAL + algorithmId OBJECT IDENTIFIER, + parameters Any OPTIONAL } -- Definition of the following information object set is deferred, perhaps to standardized @@ -79,11 +80,10 @@ Extensions ::= SEQUENCE OF Extension -- For those extensions where ordering of individual extensions within the SEQUENCE is significant, the -- specification of those individual extensions shall include the rules for the significance of the order therein --- XXX Implemented by hand in the template Extension ::= SEQUENCE { --- extnId EXTENSION.&id({ExtensionSet}), --- critical BOOLEAN DEFAULT FALSE, --- extnValue OCTET STRING + extnId OBJECT IDENTIFIER, + critical BOOLEAN DEFAULT FALSE, + extnValue Any -- contains a DER encoding of a value of type &ExtnType -- for the extension object identified by extnId } diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c index 4a2a9f1552..b2d4eb9a77 100644 --- a/asn1/x509af/packet-x509af-template.c +++ b/asn1/x509af/packet-x509af-template.c @@ -53,6 +53,8 @@ static int hf_x509af_critical = -1; /* BOOLEAN */ /* Initialize the subtree pointers */ #include "packet-x509af-ett.c" +static char algorithm_id[64]; /*64 chars should be long enough? */ + static char extension_id[64]; /*64 chars should be long enough? */ static int @@ -96,38 +98,6 @@ dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, p return offset; } -static char algorithm_id[64]; /*64 chars should be long enough? */ -static int -dissect_hf_x509af_algorithm_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, - hf_x509af_algorithm_id, algorithm_id); - return offset; -} - -static int -dissect_hf_x509af_algorithm_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree); - - return offset; -} - -/* Algorithm Identifier can not yet be handled by the compiler */ -static const ber_sequence AlgorithmIdentifier_sequence[] = { - { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_algorithm_id }, - { BER_CLASS_ANY, 0, 0, dissect_hf_x509af_algorithm_type }, - { 0, 0, 0, NULL } -}; - -int -dissect_x509af_AlgorithmIdentifier(gboolean implicit_tag, 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, - AlgorithmIdentifier_sequence, hf_index, ett_x509af_AlgorithmIdentifier); - - return offset; -} - #include "packet-x509af-fn.c" diff --git a/asn1/x509af/packet-x509af-template.h b/asn1/x509af/packet-x509af-template.h index ded2f56339..91a487ba95 100644 --- a/asn1/x509af/packet-x509af-template.h +++ b/asn1/x509af/packet-x509af-template.h @@ -25,8 +25,6 @@ #ifndef PACKET_X509AF_H #define PACKET_X509AF_H -int dissect_x509af_AlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index); - #include "packet-x509af-exp.h" #endif /* PACKET_X509AF_H */ diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf index 0aa5f87ba4..51ad2154e2 100644 --- a/asn1/x509af/x509af.cnf +++ b/asn1/x509af/x509af.cnf @@ -11,9 +11,10 @@ SelectedAttributeTypes x509sat #.INCLUDE ../x509ce/x509ce_exp.cnf #.INCLUDE ../x509if/x509if_exp.cnf #.INCLUDE ../x509sat/x509sat_exp.cnf +#.INCLUDE ./x509af_dummy.cnf #.EXPORTS - +AlgorithmIdentifier AttributeCertificate AttributeCertificateAssertion AttributeCertificationPath @@ -37,7 +38,6 @@ CertificateList B "2.5.4.59" "id-at-attributeCertificateRevocationList" #.NO_EMIT -AlgorithmIdentifier Extension #.TYPE_RENAME @@ -57,4 +57,10 @@ IssuerSerial/issuer issuerName CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate revokedUserCertificate #.END +#.FN_BODY AlgorithmIdentifier/algorithmId + offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, + hf_x509af_algorithm_id, algorithm_id); + +#.FN_BODY AlgorithmIdentifier/parameters + offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree); diff --git a/asn1/x509af/x509af_dummy.cnf b/asn1/x509af/x509af_dummy.cnf new file mode 100644 index 0000000000..a672cfcb6a --- /dev/null +++ b/asn1/x509af/x509af_dummy.cnf @@ -0,0 +1,5 @@ +# this dummy is to handle Any type until compiler knows +# about ANY + +#.IMPORT_TAG +Any BER_CLASS_ANY 0 |