Repository navigation
[2.4.x] mod_md: Fix a one-second race in md_asn1_time_get(). - #1158
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
For OpenSSL >= 1.1.1, convert the certificate's ASN1_TIME directly via ASN1_TIME_to_tm() instead of reconstructing it as apr_time_now() + ASN1_TIME_diff(). The latter samples the current time twice, once explicitly and once inside ASN1_TIME_diff(); if the wall clock ticks over a second between the two reads, the result is off by one second. md_asn1_time_get() itself is identical to trunk's; nothing else here needed changing. (cherry picked from commit 7e6d305) GitHub: closes apache#838 [Arturo Bernal]
arturobernalg
force-pushed
the
backport/838-md-asn1-time-race-24x
branch
from
December 3, 2026 18:26
abf1952 to
7d6bd7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For OpenSSL >= 1.1.1, convert the certificate's ASN1_TIME directly via ASN1_TIME_to_tm() instead of reconstructing it as apr_time_now() + ASN1_TIME_diff(). The latter samples the current time twice, once explicitly and once inside ASN1_TIME_diff(); if the wall clock ticks over a second between the two reads, the result is off by one second.
md_asn1_time_get() itself is identical to trunk's; nothing else here needed changing.
(cherry picked from commit 7e6d305)
GitHub: closes #838
[Arturo Bernal]
[x] This PR does not report or address a security vulnerability.
[x] Code follows the httpd style guide.
[ ] New log messages (n/a, no new log messages)
[x] changes-entries/md-asn1-time-race.txt included.
[ ] pyhttpd tests (n/a, timing race; verified with a standalone repro against the real compiled object, see commit message)