]> tinc-vpn.org Git - tinc/blobdiff - src/net_setup.c
Add support for OpenSSL 3.0+
[tinc] / src / net_setup.c
index d2adc13f32a1b220527bdce4a1a4c495c848d2c3..43895dda251fe87c72a2c7f8c467357305e03048 100644 (file)
@@ -28,6 +28,7 @@
 #include "connection.h"
 #include "compression.h"
 #include "control.h"
+#include "crypto.h"
 #include "device.h"
 #include "digest.h"
 #include "ecdsa.h"
@@ -142,7 +143,7 @@ static timeout_t keyexpire_timeout;
 static void keyexpire_handler(void *data) {
        regenerate_key();
        timeout_set(data, &(struct timeval) {
-               keylifetime, rand() % 100000
+               keylifetime, jitter()
        });
 }
 #endif
@@ -834,7 +835,7 @@ static bool setup_myself(void) {
        free(cipher);
 
        timeout_add(&keyexpire_timeout, keyexpire_handler, &keyexpire_timeout, &(struct timeval) {
-               keylifetime, rand() % 100000
+               keylifetime, jitter()
        });
 
        /* Check if we want to use message authentication codes... */