- RAND_pseudo_bytes(myself->key, myself->keylength);
- EVP_DecryptInit_ex(&packet_ctx, myself->cipher, NULL, myself->key, myself->key + myself->cipher->key_len);
- send_key_changed(broadcast, myself);
- keyexpires = now + keylifetime;
- }
- }
+ signal_set(&sighup_event, SIGHUP, sighup_handler, NULL);
+ signal_add(&sighup_event, NULL);
+ signal_set(&sigint_event, SIGINT, sigint_handler, NULL);
+ signal_add(&sigint_event, NULL);
+ signal_set(&sigterm_event, SIGTERM, sigterm_handler, NULL);
+ signal_add(&sigterm_event, NULL);
+ signal_set(&sigquit_event, SIGQUIT, sigterm_handler, NULL);
+ signal_add(&sigquit_event, NULL);
+ signal_set(&sigusr1_event, SIGUSR1, sigusr1_handler, NULL);
+ signal_add(&sigusr1_event, NULL);
+ signal_set(&sigusr2_event, SIGUSR2, sigusr2_handler, NULL);
+ signal_add(&sigusr2_event, NULL);
+ signal_set(&sigwinch_event, SIGWINCH, sigwinch_handler, NULL);
+ signal_add(&sigwinch_event, NULL);
+ signal_set(&sigalrm_event, SIGALRM, sigalrm_handler, NULL);
+ signal_add(&sigalrm_event, NULL);
+
+ last_ping_check = time(NULL);
+
+ srand(time(NULL));