diff options
author | Kotresh HR <khiremat@redhat.com> | 2017-12-19 00:05:05 -0500 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-12-19 14:39:04 +0000 |
commit | 5aca4cf569f19d235662c4fbaa04df21e5fd46c2 (patch) | |
tree | faf822a3e6f342a42f1dc4d00f390292728d3a48 /xlators | |
parent | 7ff0ba71d50a324b0099ea85c2a0873dcede779f (diff) |
fips: Replace md5sum usage to enable fips support
md5sum is not fips compliant. Using xxhash64 instead of
md5sum for socket file generation in glusterd and
changelog to enable fips support.
NOTE: md5sum is 128 bit hash. xxhash used is 64 bit.
Updates: #230
Change-Id: I1bf2ea05905b9151cd29fa951f903685ab0dc84c
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/changelog/src/changelog-misc.h | 20 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 8 |
2 files changed, 15 insertions, 13 deletions
diff --git a/xlators/features/changelog/src/changelog-misc.h b/xlators/features/changelog/src/changelog-misc.h index 94d6c507bd6..93af201879e 100644 --- a/xlators/features/changelog/src/changelog-misc.h +++ b/xlators/features/changelog/src/changelog-misc.h @@ -36,24 +36,24 @@ "GlusterFS Changelog | version: v%d.%d | encoding : %d\n" #define CHANGELOG_MAKE_SOCKET_PATH(brick_path, sockpath, len) do { \ - char md5_sum[MD5_DIGEST_LENGTH*2+1] = {0,}; \ - md5_wrapper((unsigned char *) brick_path, \ - strlen(brick_path), \ - md5_sum); \ + char xxh64[GF_XXH64_DIGEST_LENGTH*2+1] = {0,}; \ + gf_xxh64_wrapper ((unsigned char *)brick_path, \ + strlen(brick_path), \ + GF_XXHSUM64_DEFAULT_SEED, xxh64); \ (void) snprintf (sockpath, len, \ - CHANGELOG_UNIX_SOCK, md5_sum); \ + CHANGELOG_UNIX_SOCK, xxh64); \ } while (0) #define CHANGELOG_MAKE_TMP_SOCKET_PATH(brick_path, sockpath, len) do { \ unsigned long pid = 0; \ - char md5_sum[MD5_DIGEST_LENGTH*2+1] = {0,}; \ + char xxh64[GF_XXH64_DIGEST_LENGTH*2+1] = {0,}; \ pid = (unsigned long) getpid (); \ - md5_wrapper((unsigned char *) brick_path, \ - strlen(brick_path), \ - md5_sum); \ + gf_xxh64_wrapper ((unsigned char *)brick_path, \ + strlen(brick_path), \ + GF_XXHSUM64_DEFAULT_SEED, xxh64); \ (void) snprintf (sockpath, \ len, CHANGELOG_TMP_UNIX_SOCK, \ - md5_sum, pid); \ + xxh64, pid); \ } while (0) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a0a2a53830a..8da9362515c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1842,10 +1842,12 @@ out: void glusterd_set_socket_filepath (char *sock_filepath, char *sockpath, size_t len) { - char md5_sum[MD5_DIGEST_LENGTH*2+1] = {0,}; + char xxh64[GF_XXH64_DIGEST_LENGTH*2+1] = {0,}; - md5_wrapper ((unsigned char *) sock_filepath, strlen(sock_filepath), md5_sum); - snprintf (sockpath, len, "%s/%s.socket", GLUSTERD_SOCK_DIR, md5_sum); + gf_xxh64_wrapper ((unsigned char *)sock_filepath, + strlen(sock_filepath), + GF_XXHSUM64_DEFAULT_SEED, xxh64); + snprintf (sockpath, len, "%s/%s.socket", GLUSTERD_SOCK_DIR, xxh64); } void |