Depending on how CLOCK_MONOTONIC is implemented, time_monotonic() might
return 0 within 1 second after the system is started. If that's the
case, we just default to 0 for now to avoid a crash (doesn't "hide" the
system time, but it's only the uptime anyway in this case).
Closes strongswan/strongswan#435.
},
.esp_cb_mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.secret_switch = now,
- .secret_offset = random() % now,
+ .secret_offset = now ? random() % now : 0,
);
if (lib->settings->get_bool(lib->settings,