Move key regeneration handling to net_setup.c.
[tinc] / src / net.c
index 57ac824..df5fae7 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -480,18 +480,6 @@ int main_loop(void)
                if(last_ping_check + pingtimeout < now) {
                        check_dead_connections();
                        last_ping_check = now;
-
-                       /* Should we regenerate our key? */
-
-                       if(keyexpires < now) {
-                               ifdebug(STATUS) logger(LOG_INFO, _("Regenerating symmetric key"));
-
-                               RAND_pseudo_bytes((unsigned char *)myself->key, myself->keylength);
-                               if(myself->cipher)
-                                       EVP_DecryptInit_ex(&packet_ctx, myself->cipher, NULL, (unsigned char *)myself->key, (unsigned char *)myself->key + myself->cipher->key_len);
-                               send_key_changed(broadcast, myself);
-                               keyexpires = now + keylifetime;
-                       }
                }
        }