/*
invitation.c -- Create and accept invitations
- Copyright (C) 2013-2014 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "ecdsa.h"
#include "ecdsagen.h"
#include "invitation.h"
-#include "names.h"
#include "netutl.h"
-#include "rsagen.h"
#include "sptps.h"
#include "tincctl.h"
#include "utils.h"
char temp_netname[32];
make_names:
- if(!confbasegiven) {
- free(confbase);
- confbase = NULL;
- }
-
- make_names();
-
free(tinc_conf);
free(hosts_dir);
sptps_send_record(&sptps, 1, b64key, strlen(b64key));
free(b64key);
-
- rsa_t *rsa = rsa_generate(2048, 0x1001);
- xasprintf(&filename, "%s" SLASH "rsa_key.priv", confbase);
- f = fopenmask(filename, "w", 0600);
-
- rsa_write_pem_private_key(rsa, f);
- fclose(f);
-
- rsa_write_pem_public_key(rsa, fh);
- fclose(fh);
-
ecdsa_free(key);
- rsa_free(rsa);
check_port(name);
free(newbase);
netname = line;
- make_names();
}
fprintf(stderr, "Configuration stored in: %s\n", confbase);
}
// Make sure confbase exists and is accessible.
- if(!confbase_given && mkdir(confdir, 0755) && errno != EEXIST) {
- fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno));
- return 1;
- }
-
if(mkdir(confbase, 0777) && errno != EEXIST) {
fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno));
return 1;