pac.info.lifetime.hdr.type = htons(attr_eap_fast_pac_info_pac_lifetime->attr);
pac.info.lifetime.hdr.length = htons(sizeof(pac.info.lifetime.data));
- pac.info.lifetime.data = htonl(time(NULL) + t->pac_lifetime);
+ pac.info.lifetime.data = htonl(fr_time_to_sec(request->packet->timestamp) + t->pac_lifetime);
pac.info.a_id.hdr.type = htons(EAP_FAST_TLV_MANDATORY | attr_eap_fast_pac_a_id->attr);
pac.info.a_id.hdr.length = htons(sizeof(pac.info.a_id.data));
t->mode = EAP_FAST_PROVISIONING_AUTH;
}
- if (!t->pac.expires || t->pac.expired || t->pac.expires - time(NULL) < t->pac_lifetime * 0.6) {
+ if (!t->pac.expires || t->pac.expired || (t->pac.expires - fr_time_to_sec(request->packet->timestamp)) < (t->pac_lifetime * 6) / 10) {
t->pac.send = true;
}
}
} else if (vp->da == attr_eap_fast_pac_info_pac_lifetime) {
fr_assert(t->pac.expires == 0);
t->pac.expires = vp->vp_uint32;
- t->pac.expired = (vp->vp_uint32 <= time(NULL));
+ t->pac.expired = (vp->vp_uint32 <= fr_time_to_sec(request->packet->timestamp));
/*
* Not sure if this is the correct attr
* The original enum didn't match a specific TLV nesting level