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

Convert UTCTime to datetime should care about century #9

Closed
la10736 opened this issue Mar 7, 2022 · 1 comment
Closed

Convert UTCTime to datetime should care about century #9

la10736 opened this issue Mar 7, 2022 · 1 comment

Comments

@la10736
Copy link
Contributor

la10736 commented Mar 7, 2022

Hi, thanks for the great work!!

I noted that the conversion from utc_datetime() don't try to guess the century. As documented in https://www.obj-sys.com/asn1tutorial/node15.html the year is just 2 chars and asn1c use 19 if the year is greater than 0x35 and 20 otherwise.

I guess that the right behavior of asn1-rs should be the same.

I can file a pull request if you are agree.

@chifflier
Copy link
Member

Hi,
Indeed, this should be added to this crate. Currently, callers must take care of changing the offset (for ex in https://github.com/rusticata/x509-parser/blob/master/src/time.rs#L99-L109).
Please submit a PR, I will merge it for the next release (which I plan to do very soon).
Thanks!

la10736 added a commit to la10736/asn1-rs that referenced this issue Mar 12, 2022
chars years date to 20/21 centuries date.
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

2 participants