Closed Byter09 closed 3 months ago
Thank you for your issue! The fix is pretty simple I believe, self
needs to be deref'ed or otherwise mad a slice before comparing.
Fixed in 0.12.6 :) https://github.com/librasn/rasn/pull/223 Sorry for the duplicate.
Hello!
First of all, I would like to thank all contributors for this crate. It is amazing.
I'm in the process of switching our manual ASN decoders to using
rasn
, and am currently moving MMS (ISO 9506-1 and 2). One of the carrier protocols is ACSE (ISO 8650), which is also ASN and I already ported it over.While trying to figure out if ACSE is transporting MMS, I'm looking at a "application context name" which is a
ObjectIdentifier
.My initial code to compare the value is like this:
Upon testing this, my stack kept overflowing. I thought maybe I had some recursion, but the more I debugged it, the more it became clear. The comparison is actually the problem:![grafik](https://github.com/librasn/rasn/assets/16060697/22bd170b-a914-4e5b-addd-0fc15aa4d47d)
Specifically, this code in
oid.rs
:I managed to fix this by either dereferncing the field
or using the
Oid
type directly:The
rasn
version used is0.12.5
with a Rust compiler version of1.69.0
.So, I am not sure if this is considered a bug, but it caused confusion :D
On an unrelated note, the
rasn_compiler
struggles to eat all the specifications I tried so far, but nevertheless, good job on that one. I tried simpler ASN and it was so much fun to see the output be basically what I'd write myself. Writing over 6000 lines of code for the MMS one by hand wasn't fun though :D