8#include <openssl/asn1.h>
15 static inline bool validate_chronological_times(
16 const Unique_X509_TIME& time_before,
17 const Unique_X509_TIME& time_after,
18 const std::optional<uint32_t>& allowed_diff_days = std::nullopt)
22 CHECK1(ASN1_TIME_diff(&diff_days, &diff_secs, time_before, time_after));
24 return (diff_days > 0 || diff_secs > 0) &&
25 (!allowed_diff_days.has_value() ||
26 (
unsigned int)diff_days <= allowed_diff_days.value());
29 static inline std::string to_x509_time_string(
const ASN1_TIME* time)
32 CHECK1(ASN1_TIME_to_tm(time, &t));
33 return ccf::ds::to_x509_time_string(t);
Definition openssl_wrappers.h:29
void CHECK1(int rc)
Throws if rc is not 1 and has error.
Definition openssl_wrappers.h:58