X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=12b09a91045e716af1165804ba54cf834ff67da2;hp=3c4bf48c71607795b8c5f4bedbc44436ef2e1991;hb=a227843b739d279b63adcf3736ebb03d856080c4;hpb=4bb3793e38b7c7f24dd308801e7f6dbb02cf02d2 diff --git a/src/net_setup.c b/src/net_setup.c index 3c4bf48c..12b09a91 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -13,11 +13,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "system.h" @@ -46,14 +44,11 @@ char *myport; -bool read_rsa_public_key(connection_t *c) -{ +bool read_rsa_public_key(connection_t *c) { FILE *fp; char *fname; char *key; - cp(); - if(!c->rsa_key) { c->rsa_key = RSA_new(); // RSA_blinding_on(c->rsa_key, NULL); @@ -147,14 +142,11 @@ bool read_rsa_public_key(connection_t *c) return false; } -bool read_rsa_private_key(void) -{ +bool read_rsa_private_key(void) { FILE *fp; char *fname, *key, *pubkey; struct stat s; - cp(); - if(get_config_string(lookup_config(config_tree, "PrivateKey"), &key)) { if(!get_config_string(lookup_config(myself->connection->config_tree, "PublicKey"), &pubkey)) { logger(LOG_ERR, _("PrivateKey used but no PublicKey found!")); @@ -211,8 +203,7 @@ bool read_rsa_private_key(void) /* Configure node_t myself and set up the local sockets (listen only) */ -bool setup_myself(void) -{ +bool setup_myself(void) { config_t *cfg; subnet_t *subnet; char *name, *hostname, *mode, *afname, *cipher, *digest; @@ -222,8 +213,6 @@ bool setup_myself(void) bool choice; int i, err; - cp(); - myself = new_node(); myself->connection = new_connection(); init_configuration(&myself->connection->config_tree); @@ -508,10 +497,7 @@ bool setup_myself(void) /* initialize network */ -bool setup_network(void) -{ - cp(); - +bool setup_network(void) { now = time(NULL); init_events(); @@ -545,15 +531,12 @@ bool setup_network(void) /* close all open network connections */ -void close_network_connections(void) -{ +void close_network_connections(void) { avl_node_t *node, *next; connection_t *c; char *envp[5]; int i; - cp(); - for(node = connection_tree->head; node; node = next) { next = node->next; c = node->data;