aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/chunk.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-04-03 11:46:09 +0200
committerMartin Willi <martin@revosec.ch>2014-06-04 15:53:11 +0200
commit460adb5d0925f4af807b09434b771545d1f62b47 (patch)
tree12c6bec9eb811c715d079e82e50840b865ecdb96 /src/libstrongswan/utils/chunk.h
parent5cd28cd25a009fd4d0d5b91b60e82cf7a661a169 (diff)
downloadstrongswan-460adb5d0925f4af807b09434b771545d1f62b47.tar.bz2
strongswan-460adb5d0925f4af807b09434b771545d1f62b47.tar.xz
unit-tests: Seed chunk_hash() only once, but before creating any hashtables
Due to the removal of pthread_once, we manually create the seed for chunk_hash(). With the new testable functions interface, this won't work for the hashtable initiated using __attribute__((constructor)). Enforce seeding before creating that hashtable.
Diffstat (limited to 'src/libstrongswan/utils/chunk.h')
-rw-r--r--src/libstrongswan/utils/chunk.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/chunk.h b/src/libstrongswan/utils/chunk.h
index 760f922e1..9951ff31f 100644
--- a/src/libstrongswan/utils/chunk.h
+++ b/src/libstrongswan/utils/chunk.h
@@ -343,7 +343,8 @@ bool chunk_printable(chunk_t chunk, chunk_t *sane, char replace);
* Seed initial key for chunk_hash().
*
* This call should get invoked once during startup. This is usually done
- * by calling library_init().
+ * by calling library_init(). Calling it multiple times is safe, it gets
+ * executed just once.
*/
void chunk_hash_seed();