diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 822f13805..b12ca1b5e 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -2711,7 +2711,7 @@ _host_id_read_timestamp(gboolean use_secret_key_file, #define EPOCH_TWO_YEARS (G_GINT64_CONSTANT(2 * 365 * 24 * 3600) * NM_UTILS_NSEC_PER_SEC) - v = nm_hash_siphash42(1156657133u, host_id, host_id_len); + v = c_siphash_hash(NM_HASH_SEED_16_U64(1156657133u), host_id, host_id_len); now = time(NULL); *out_timestamp_ns = diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index 5a17af5bd..703c00a40 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -56,6 +56,9 @@ void nm_hash_siphash42_init(CSipHash *h, guint static_seed); * Then, why not use c_siphash_hash() directly? Because this also uses the randomized, * per-run hash-seed like nm_hash_init(). So, you get siphash24 with a random * seed (which is cached for the current run of the program). + * + * WARNING: the static_seed gets randomized like with nm_hash*(). If you want a reproducible + * siphash42, use instead `c_siphash_hash(NM_HASH_SEED_16_U64(number), ptr, len)`. */ static inline guint64 nm_hash_siphash42(guint static_seed, const void *ptr, gsize n)