Skip to content

asn1: align UTCTime year range with RFC 5280 #909

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

Merged
merged 1 commit into from
Jul 12, 2025

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Jul 12, 2025

ASN.1 UTCTime uses two-digit years. While X.680 does not specify how to map them as far as I can tell, X.509/PKIX uses this type to represent dates between year 1950-2049.

OpenSSL::ASN1.decode has used 1969-2068 since the initial implementation. Given that ASN1::UTCTime#to_der relies on OpenSSL ASN1_UTCTIME type, which assumes the 1950-2049 range, this was likely unintentional.

Use the range 1950-2049 consistently, and fix decoding of X.509 certificates with dates in 1950-1968.

ASN.1 UTCTime uses two-digit years. While X.680 does not specify how to
map them as far as I can tell, X.509/PKIX uses this type to represent
dates between year 1950-2049.

OpenSSL::ASN1.decode has used 1969-2068 since the initial
implementation. Given that ASN1::UTCTime#to_der relies on OpenSSL
ASN1_UTCTIME type, which assumes the 1950-2049 range, this was likely
unintentional.

Use the range 1950-2049 consistently, and fix decoding of X.509
certificates with dates in 1950-1968.
@rhenium rhenium merged commit f887d9f into ruby:master Jul 12, 2025
41 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.

1 participant