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

Parse and resolve ValueReferences #49

Merged
merged 53 commits into from
Mar 19, 2021
Merged

Parse and resolve ValueReferences #49

merged 53 commits into from
Mar 19, 2021

Conversation

kellerkindt
Copy link
Owner

@kellerkindt kellerkindt commented Mar 19, 2021

ValueReferences are the constants of ASN.1. With this PR constant definitions in ASN.1 are parsed. The Model<Asn> type has been split intoModel<Asn<Unresolved>> (which is now returned after parsing the Tokenizer stream) and Model<Asn<Resolved>> which is required for the .to_rust() conversion. The function Model::<Asn<Unresolved>>::try_resolve(&self) -> Result<Model<Resolved>, _> transforms the model by replacing VR-occurances with their declared value.

TODOS remaining

  • Add constant values to rust
  • Properly parse hex values and other non-integer VRs

This PR changes public API and thus is a breaking change in this regard. A version bump to 0.3.0 is therefore required by the semantic versioning guidelines No. 4: "Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable."

@kellerkindt kellerkindt changed the title Parse and resolve Valuereferences Parse and resolve ValueReferences Mar 19, 2021
@kellerkindt kellerkindt merged commit d05cdc2 into master Mar 19, 2021
@kellerkindt kellerkindt deleted the valuereferences branch March 19, 2021 16:30
@kellerkindt kellerkindt restored the valuereferences branch May 3, 2021 15:48
@kellerkindt kellerkindt deleted the valuereferences branch May 3, 2021 15:50
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

Successfully merging this pull request may close these issues.

None yet

1 participant