Skip to content

asn1: handle GENERALIZEDTIME without seconds - #88

Merged
rhenium merged 2 commits into
ruby:maintfrom
yogo1212:generalizedtime_format
Dec 10, 2016
Merged

rhenium merged 2 commits into
ruby:maintfrom
yogo1212:generalizedtime_format

Conversation

@yogo1212

@yogo1212 yogo1212 commented Dec 6, 2016 •

Copy link
Copy Markdown

encountered this error using a certificate that is accepted by other clients:

OpenSSL::X509::Certificate.new File.read ("openssl_test.crt")
TypeError: bad GENERALIZEDTIME format

this is from asn1parse:

  147:d=2  hl=2 l=  30 cons:   SEQUENCE          
  149:d=3  hl=2 l=  13 prim:    GENERALIZEDTIME   :201401010000Z
  164:d=3  hl=2 l=  13 prim:    UTCTIME           :390512144609Z

@rhenium

rhenium commented Dec 7, 2016

Copy link
Copy Markdown
Member

Thanks for the PR!

Indeed, X.680 specifies that the seconds part can be absent. The asn1time_to_time() function also does not handle {UTC,Generalized}Time with fraction seconds or time zones, but this would be out of scope of this PR.

Could you add some basic tests to test/test_asn1.rb, and update the commit message to include the rationale about the change before merge?

@yogo1212

yogo1212 commented Dec 8, 2016

Copy link
Copy Markdown
Author

@rhenium ping :-)

@rhenium

rhenium commented Dec 9, 2016

Copy link
Copy Markdown
Member

@yogo1212 Nice, thanks! Could you squash the third commit into the first one?

@yogo1212

yogo1212 commented Dec 9, 2016

Copy link
Copy Markdown
Author

nothing comes more naturally than changing the course of history in the past :-D

@rhenium
rhenium changed the base branch from master to maint December 10, 2016 06:47
@rhenium
rhenium merged commit c083ff8 into ruby:maint Dec 10, 2016
@rhenium

rhenium commented Dec 10, 2016

Copy link
Copy Markdown
Member

Thanks!

@yogo1212
yogo1212 deleted the generalizedtime_format branch December 10, 2016 22:30
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