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

Small cleans up of x.encoding.asn1 module #22847

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

blackshirt
Copy link
Contributor

@blackshirt blackshirt commented Nov 13, 2024

This PR contains some smalls cleans up to the x.encoding.asn1, ie,

  • Removes @[noinit] tag from public struct, Its can makes an issue when custom structure contains the standard universal element tagged with @[noinit] tag. For examples, when developing certificates parser, its requires to just instantiate some element with Certificate{} call directly and validates it later, but currently this would gives us an error similar with struct x.encoding.asn1.Integer` is declared with a `@[noinit]` attribute, so it cannot be initialized with `x.encoding.asn1.Integer{}` and other error with other standard element tagged with noinit. Removes this tag makes it more flexible. Standard universal class has builtin check when this element was serialized, so, i think its safe to remove this tag.
  • Adds method to allow creating universal UtcTime and GeneralizedTime from standard time.Time module. Its still rather a hack thing, but can be improved later.
  • Changes definition of Any element into AnyDefinedBy element, to reflect underlying ASN.1 syntax for this, ie ANY DEFINED BY schema. Any maybe good for arbitrary other name, also removes internal marker string, its not relevant now.
  • Some small improvement to the readme files (wrong link for examples and the docs when accessed from modules.vlang.io)

Best regards and thanks.

…Time) from std time.Time, remove @[noinit], some small improvement to the fn docs
Small cleanup to the `x.encoding.asn1` module
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 897ec51 into vlang:master Nov 13, 2024
71 checks passed
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.

2 participants