Use the internal time instead of system time for validation checks in
gnutls.
#include "nts_ke_session.h"
#include "conf.h"
+#include "local.h"
#include "logging.h"
#include "memory.h"
#include "siv.h"
/* ================================================== */
+static time_t
+get_time(time_t *t)
+{
+ struct timespec now;
+
+ LCL_ReadCookedTime(&now, NULL);
+ if (t)
+ *t = now.tv_sec;
+
+ return now.tv_sec;
+}
+
+/* ================================================== */
+
static int gnutls_initialised = 0;
static void
if (r < 0)
LOG_FATAL("Could not initialise %s : %s", "priority cache", gnutls_strerror(r));
+ gnutls_global_set_time_function(get_time);
+
gnutls_initialised = 1;
}