Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBJECT IDENTIFIER not supported #74

Open
lynxis opened this issue Nov 4, 2021 · 4 comments
Open

OBJECT IDENTIFIER not supported #74

lynxis opened this issue Nov 4, 2021 · 4 comments

Comments

@lynxis
Copy link

lynxis commented Nov 4, 2021

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

)
@lynxis
Copy link
Author

lynxis commented Nov 4, 2021

This is also required for X.509 #6 (comment)

Should I create an overview ticket for osmo-iuh / (parts of 3G/UMTS) instead opening issues for every missing feature?

@kellerkindt
Copy link
Owner

Hi there. You are right, OBJECT IDENTIFIER is not yet supported. An overview ticket would be nice to have :)

@septs
Copy link

septs commented Dec 20, 2023

I hope to support, OBJECT IDENTIFIER

@niltooth
Copy link

niltooth commented Jan 6, 2024

Happy to help implement this if I can. So far what I have found is the following.

  1. asn1rs-model/src/model/oid.go needs to be implemented?
  2. object identifier needs to be added to read_role_given_string in asn1rs-model/src/model/mod.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants