}
if (!server_mode) {
- r = gnutls_server_name_set(session, GNUTLS_NAME_DNS, server_name, strlen(server_name));
- if (r < 0)
- goto error;
+ assert(server_name);
+
+ if (!UTI_IsStringIP(server_name)) {
+ r = gnutls_server_name_set(session, GNUTLS_NAME_DNS, server_name, strlen(server_name));
+ if (r < 0)
+ goto error;
+ }
flags = 0;
#define DUMP_IDENTIFIER "NNC0\n"
struct NNC_Instance_Record {
+ /* Pointer to current address of NTP server */
const IPSockAddr *ntp_address;
+ /* Address of NTS-KE server */
IPSockAddr nts_address;
+ /* Hostname or IP address for certificate verification */
char *name;
NKC_Instance nke;
inst->ntp_address = ntp_address;
inst->nts_address = *nts_address;
- inst->name = !UTI_IsStringIP(name) ? Strdup(name) : NULL;
+ inst->name = Strdup(name);
inst->siv = NULL;
inst->nke = NULL;
return 0;
}
- if (!inst->name) {
- LOG(LOGS_ERR, "Missing name of %s for NTS-KE",
- UTI_IPToString(&inst->nts_address.ip_addr));
- return 0;
- }
-
inst->nke = NKC_CreateInstance(&inst->nts_address, inst->name);
inst->nke_attempts++;
FILE *f;
int i;
- if (inst->num_cookies < 1 || !inst->name || !UTI_IsIPReal(&inst->nts_address.ip_addr))
+ if (inst->num_cookies < 1 || !UTI_IsIPReal(&inst->nts_address.ip_addr))
return;
dump_dir = CNF_GetNtsDumpDir();
if (!fgets(line, sizeof (line), f) || strcmp(line, DUMP_IDENTIFIER) != 0 ||
!fgets(line, sizeof (line), f) || UTI_SplitString(line, words, MAX_WORDS) != 1 ||
- !inst->name || strcmp(words[0], inst->name) != 0 ||
+ strcmp(words[0], inst->name) != 0 ||
!fgets(line, sizeof (line), f) || UTI_SplitString(line, words, MAX_WORDS) != 1 ||
sscanf(words[0], "%lf", &context_time) != 1 ||
!fgets(line, sizeof (line), f) || UTI_SplitString(line, words, MAX_WORDS) != 2 ||