else
xasprintf(&hostport, "%s:%s", hostname, port);
} else {
- hostport = hostname;
- hostname = NULL;
+ if(strchr(hostname, ':'))
+ xasprintf(&hostport, "[%s]", hostname);
+ else
+ hostport = xstrdup(hostname);
}
free(hostname);
}
free(filename);
- // If a daemon is running, ensure no other nodes now about this name
+ // If a daemon is running, ensure no other nodes know about this name
bool found = false;
if(connect_tincd(false)) {
sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);
free(filename);
ecdsa_t *key;
- xasprintf(&filename, "%s" SLASH "invitations" SLASH "ecdsa_key.priv", confbase);
+ xasprintf(&filename, "%s" SLASH "invitations" SLASH "ed25519_key.priv", confbase);
// Remove the key if there are no outstanding invitations.
if(!count)
if(!b64key)
return false;
- xasprintf(&filename, "%s" SLASH "ecdsa_key.priv", confbase);
+ xasprintf(&filename, "%s" SLASH "ed25519_key.priv", confbase);
f = fopenmask(filename, "w", 0600);
if(!ecdsa_write_pem_private_key(key, f)) {
fclose(f);
- fprintf(fh, "ECDSAPublicKey = %s\n", b64key);
+ fprintf(fh, "Ed25519PublicKey = %s\n", b64key);
sptps_send_record(&sptps, 1, b64key, strlen(b64key));
free(b64key);
if(!port || !*port)
port = "655";
- if(!b64decode(slash, hash, 18) || !b64decode(slash + 24, cookie, 18))
+ if(!b64decode(slash, hash, 24) || !b64decode(slash + 24, cookie, 24))
goto invalid;
// Generate a throw-away key for the invitation.