From: Bob Beck Date: Fri, 19 Sep 2025 23:36:50 +0000 (-0600) Subject: Fix the documentation for X509_cmp_timeframe X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c8d25033fc238e3c0d3f921a3c2415a9b7ba37c;p=thirdparty%2Fopenssl.git Fix the documentation for X509_cmp_timeframe Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/28623) --- diff --git a/doc/man3/X509_cmp_time.pod b/doc/man3/X509_cmp_time.pod index 30a09f25f9f..52b1722c9f2 100644 --- a/doc/man3/X509_cmp_time.pod +++ b/doc/man3/X509_cmp_time.pod @@ -61,13 +61,26 @@ X509_cmp_time() and X509_cmp_current_time() return -1 if I is earlier than, or equal to, I (resp. current time), and 1 otherwise. These methods return 0 on error. -X509_cmp_timeframe() returns 0 if I is not NULL and the verification -parameters do not contain B -but do contain B. Otherwise it returns -1 if the end time is not NULL and the reference time (which has determined as -stated above) is past the end time, -1 if the start time is not NULL and the -reference time is before, else 0 to indicate that the reference time is in range -(implying that the end time is not before the start time if both are present). +X509_cmp_timeframe() compares a reference time to a start and end +ASN1_TIME value range. The reference time is compared to the start +value of the range inclusively, and to the end value of the range +exclusively. The reference time used will retrieved from I if the +flag I<509_V_FLAG_USE_CHECK_TIME> is set in I, otherwise it will +be the current time. The start time used will be I if it is non +NULL, and a valid ASN1_TIME value, otherwise it will be infinitely in +the past. The end time used will be I if it is non NULL and a +valid ASN1_TIME value, otherwise it will be infinitely in the +future. 0 is returned unconditionally if the flag +I is set in I. Otherwise 0 will be +returned if the reference time is in the range of the start time and +end time as described above. 1 is returned to indicate the reference +time is after or equal to the end time. -1 is returned to indicate the +reference time is before the start time. As this function treats +invalid ASN1_TIME inputs as unlimited times, it should not be used to +for temporal verification of certificates using untrusted inputs that +have not been pre-validated to be correct ASN1_TIME values for a +certificate as per RFC 5280, as invalid values will be accepted +as valid forever. X509_time_adj(), X509_time_adj_ex() and X509_gmtime_adj() return a pointer to the updated ASN1_TIME structure, and NULL on error.