[erlang-questions] RFC2630 ASN.1, how to decode?
bengt
cean.ebengt@REDACTED
Mon Jan 30 17:47:31 CET 2017
Greetings,
Has anybody decoded RFC2630 and would be inclined to give pointers on how to go about it? Yes, RFC2630 is obsoleted, but the input data use it.
erlang:system_info(system_version).
"Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]\n”
I create a Data.asn file with ASN contents from the end of
https://tools.ietf.org/html/rfc2630 <https://tools.ietf.org/html/rfc2630>
There are 2 IMPORT statements, like this:
-- Directory Information Framework (X.501)
Name
FROM InformationFramework { joint-iso-itu-t ds(5) modules(1)
informationFramework(1) 3 }
-- Directory Authentication Framework (X.509)
AlgorithmIdentifier, AttributeCertificate, Certificate,
CertificateList, CertificateSerialNumber
FROM AuthenticationFramework { joint-iso-itu-t ds(5)
module(1) authenticationFramework(7) 3 } ;
I have located 2 links:
https://www.itu.int/ITU-T/formal-language/itu-t/x/x501/2012/InformationFramework.html <https://www.itu.int/ITU-T/formal-language/itu-t/x/x501/2012/InformationFramework.html>
https://www.itu.int/ITU-T/formal-language/itu-t/x/x509/2016/AuthenticationFramework.html <https://www.itu.int/ITU-T/formal-language/itu-t/x/x509/2016/AuthenticationFramework.html>
Each links content has been copied into an Erlang .asn file: AuthenticationFramework.asn InformationFramework.asn
When I compile (erlc Data.asn) I get:
Internal error: error:{badrecord,typedef}
[{asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,2544}]},
{asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,2558}]},
{asn1ct_check,check_setof,3,[{file,"asn1ct_check.erl"},{line,4637}]},
{asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,2772}]},
{asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,2558}]},
{asn1ct_check,check_each_component2,4,
[{file,"asn1ct_check.erl"},{line,4863}]},
{asn1ct_check,check_sequence,3,[{file,"asn1ct_check.erl"},{line,4360}]},
{asn1ct_check,check_type,3,[{file,"asn1ct_check.erl"},{line,2740}]}]
erlc: exit 1
If I remove the IMPORT ... FROM AuthenticationFramework the crash goes away and I get undefined's for the no longer imported items, instead.
Is the copy of contents from the two links, to Erlang asn files, too simplistic? The Erlang ASN example says to start with
Data DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
whereas the links start with
AuthenticationFramework {joint-iso-itu-t ds(5) module(1) authenticationFramework(7) 8}
DEFINITIONS ::=
BEGIN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170130/7b59991a/attachment.htm>
More information about the erlang-questions
mailing list