/* Name of the user to which will be dropped root privileges. */
static char *user;
-/* NTS dump dir, certificates, private key, and port */
+/* NTS server and client configuration */
static char *nts_dump_dir = NULL;
+static char *nts_ntp_server = NULL;
static char *nts_server_cert_file = NULL;
static char *nts_server_key_file = NULL;
static int nts_server_port = 11443;
Free(tempcomp_sensor_file);
Free(tempcomp_point_file);
Free(nts_dump_dir);
+ Free(nts_ntp_server);
Free(nts_server_cert_file);
Free(nts_server_key_file);
Free(nts_trusted_cert_file);
} else if (!strcasecmp(command, "ntscachedir") ||
!strcasecmp(command, "ntsdumpdir")) {
parse_string(p, &nts_dump_dir);
+ } else if (!strcasecmp(command, "ntsntpserver")) {
+ parse_string(p, &nts_ntp_server);
} else if (!strcasecmp(command, "ntsport")) {
parse_int(p, &nts_server_port);
} else if (!strcasecmp(command, "ntsprocesses")) {
/* ================================================== */
+char *
+CNF_GetNtsNtpServer(void)
+{
+ return nts_ntp_server;
+}
+
+/* ================================================== */
+
char *
CNF_GetNtsServerCertFile(void)
{
extern int CNF_GetHwTsInterface(unsigned int index, CNF_HwTsInterface **iface);
extern char *CNF_GetNtsDumpDir(void);
+extern char *CNF_GetNtsNtpServer(void);
extern char *CNF_GetNtsServerCertFile(void);
extern char *CNF_GetNtsServerKeyFile(void);
extern int CNF_GetNtsServerPort(void);
{
NKE_Context context;
NKE_Cookie cookie;
+ char *ntp_server;
uint16_t datum;
int i;
return 0;
}
- /* This should be configurable */
- if (0) {
- const char server[] = "::1";
- if (!NKSN_AddRecord(session, 1, NKE_RECORD_NTPV4_SERVER_NEGOTIATION, server,
- sizeof (server) - 1))
+ ntp_server = CNF_GetNtsNtpServer();
+ if (ntp_server) {
+ if (!NKSN_AddRecord(session, 1, NKE_RECORD_NTPV4_SERVER_NEGOTIATION,
+ ntp_server, strlen(ntp_server)))
return 0;
}