asn1rs
asn1rs copied to clipboard
OBJECT IDENTIFIER not supported
Hi,
[I'm quite new to asn1 (I only used it, but not written anything in it). Are there any good references or books to get into the asn1 topic?]
I've started to try asn1c against 3G/UMTS asn1 files (https://github.com/osmocom/osmo-iuh/tree/master/asn1) It fails when parsing https://github.com/osmocom/osmo-iuh/blob/master/asn1/hnbap/HNBAP-CommonDataTypes.asn with the following error.
I'm using asn1rs v0.2.2-25-gb6d5f77f6095 with rustc 1.56.1.
PrivateIE-ID ::= CHOICE {
local INTEGER (0..65535),
global OBJECT IDENTIFIER
}
lynxis@rust:~/asn1rs$ ./target/debug/asn1rs /tmp/dest /home/lynxis/asn-tests/osmo-iuh/hnbap/HNBAP-CommonDataTypes.asn
Failed to load file /home/lynxis/asn-tests/osmo-iuh/hnbap/HNBAP-CommonDataTypes.asn: Model(At line 36, column 17 an unexpected token was encountered: "IDENTIFIER"
0: <asn1rs_model::model::err::Error as core::convert::From<asn1rs_model::model::err::ErrorKind>>::from
at asn1rs-model/src/model/err.rs:36:24
1: <T as core::convert::Into<U>>::into
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/convert/mod.rs:540:9
2: asn1rs_model::model::err::Error::unexpected_token
at asn1rs-model/src/model/err.rs:93:9
3: <asn1rs_model::model::choice::Choice<asn1rs_model::model::lor::Unresolved> as core::convert::TryFrom<&mut core::iter::adapters::peekable::Peekable<T>>>::try_from
at asn1rs-model/src/model/choice.rs:93:13
4: asn1rs_model::model::Model<asn1rs_model::model::asn::Asn<asn1rs_model::model::lor::Unresolved>>::read_definition
at asn1rs-model/src/model/mod.rs:240:30
5: asn1rs_model::model::Model<asn1rs_model::model::asn::Asn<asn1rs_model::model::lor::Unresolved>>::try_from
at asn1rs-model/src/model/mod.rs:116:40
6: asn1rs::converter::Converter::load_file
at src/converter.rs:66:21
7: asn1rs::main
at src/main.rs:34:25
8: core::ops::function::FnOnce::call_once
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5
9: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:125:18
10: std::rt::lang_start::{{closure}}
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:63:18
11: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:259:13
std::panicking::try::do_call
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
std::panicking::try
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
std::panic::catch_unwind
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
std::rt::lang_start_internal::{{closure}}
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:48
std::panicking::try::do_call
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
std::panicking::try
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
std::panic::catch_unwind
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
std::rt::lang_start_internal
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:20
12: std::rt::lang_start
at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:62:5
13: main
14: __libc_start_main
15: _start
)
This is also required for X.509 https://github.com/kellerkindt/asn1rs/issues/6#issuecomment-708369996
Should I create an overview ticket for osmo-iuh / (parts of 3G/UMTS) instead opening issues for every missing feature?
Hi there. You are right, OBJECT IDENTIFIER is not yet supported. An overview ticket would be nice to have :)
I hope to support, OBJECT IDENTIFIER
Happy to help implement this if I can. So far what I have found is the following.
asn1rs-model/src/model/oid.goneeds to be implemented?object identifierneeds to be added toread_role_given_stringinasn1rs-model/src/model/mod.go