]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add `fr_time_max()`
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 23 Sep 2021 17:24:41 +0000 (12:24 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 23 Sep 2021 17:24:41 +0000 (12:24 -0500)
src/lib/util/time.h
src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c

index 06324b1b4bbf3a008115437683870fb18da6510b..69e30803e1be7adf010d9442320afcc1efaa70aa 100644 (file)
@@ -49,7 +49,9 @@ extern "C" {
  *  plays with the local clock.
  */
 typedef struct fr_time_s {
-       int64_t value;
+       int64_t value;          //!< Signed because we need times before the server started
+                               ///< for things like certificate validity checks and cache
+                               ///< entries.
 } fr_time_t;
 
 /** "Unix" time.  This is the time in nanoseconds since midnight January 1, 1970
@@ -72,6 +74,7 @@ typedef uint64_t fr_unix_time_t;
  */
 typedef int64_t fr_time_delta_t;
 
+#define fr_time_max() (fr_time_t){ .value = INT64_MAX }
 #define fr_time_wrap(_time) (fr_time_t){ .value = (_time) }
 #define fr_time_unwrap(_time) (_time).value
 
index 1f2569f9b90689a35f83c3814ad132777e8bd042..7c0214f3020ce15b502ce9e5d430142cd0fda8a4 100644 (file)
@@ -857,7 +857,7 @@ static fr_radius_packet_code_t eap_fast_process_tlvs(request_t *request, eap_ses
                        if (vp->da == attr_eap_fast_pac_acknowledge) {
                                if (vp->vp_uint32 == EAP_FAST_TLV_RESULT_SUCCESS) {
                                        code = FR_RADIUS_CODE_ACCESS_ACCEPT;
-                                       t->pac.expires = fr_time_wrap(~fr_time_unwrap(fr_time_wrap(0)));
+                                       t->pac.expires = fr_time_max();
                                        t->pac.expired = false;
                                        t->stage = EAP_FAST_COMPLETE;
                                }