summaryrefslogtreecommitdiff
path: root/src/nm-auth-utils.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-13 16:12:35 +0200
committerThomas Haller <thaller@redhat.com>2017-10-18 13:05:00 +0200
commit3434261811b6edde77689983ac4c4e70cd2ca39a (patch)
treedbed62d0331f640721493ab4ff5528487553fdfe /src/nm-auth-utils.c
parent0e9e35e30913ccd01857bb104880976b63404049 (diff)
downloadNetworkManager-3434261811b6edde77689983ac4c4e70cd2ca39a.tar.gz
core,clients: use our own string hashing function nm_str_hash()
Replace the usage of g_str_hash() with our own nm_str_hash(). GLib's g_str_hash() uses djb2 hashing function, just like we do at the moment. The only difference is, that we use a diffrent seed value. Note, that we initialize the hash seed with random data (by calling getrandom() or reading /dev/urandom). That is a change compared to before. This change of the hashing function and accessing the random pool might be undesired for libnm/libnm-core. Hence, the change is not done there as it possibly changes behavior for public API. Maybe we should do that later though. At this point, there isn't much of a change. This patch becomes interesting, if we decide to use a different hashing algorithm.
Diffstat (limited to 'src/nm-auth-utils.c')
-rw-r--r--src/nm-auth-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm-auth-utils.c b/src/nm-auth-utils.c
index b8e64ceb9d..f1aff43029 100644
--- a/src/nm-auth-utils.c
+++ b/src/nm-auth-utils.c
@@ -24,6 +24,7 @@
#include <string.h>
+#include "nm-utils/nm-hash-utils.h"
#include "nm-setting-connection.h"
#include "nm-auth-subject.h"
#include "nm-auth-manager.h"
@@ -131,7 +132,7 @@ nm_auth_chain_new_subject (NMAuthSubject *subject,
self = g_slice_new0 (NMAuthChain);
self->refcount = 1;
- self->data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, chain_data_free);
+ self->data = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, chain_data_free);
self->done_func = done_func;
self->user_data = user_data;
self->context = context ? g_object_ref (context) : NULL;