summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2017-12-19 07:21:07 -0500
committerAmar Tumballi <amarts@redhat.com>2017-12-21 04:31:31 +0000
commit1d32720335ffd8835c4a7b3164fe9aa9028f77a5 (patch)
tree9234608444f07d385564e1e386844dadd63fd1ee /libglusterfs
parent4a06f851dcad6bdd730f3d2e12bd8f26709f27fe (diff)
rchecksum/fips: Replace MD5 usage to enable fips support
rchecksum uses MD5 which is not fips compliant. Hence using sha256 for the same. Updates: #230 Change-Id: I7fad016fcc2a9900395d0da919cf5ba996ec5278 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/checksum.c8
-rw-r--r--libglusterfs/src/default-args.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/libglusterfs/src/checksum.c b/libglusterfs/src/checksum.c
index 5fac1330094..a7f9877ddf0 100644
--- a/libglusterfs/src/checksum.c
+++ b/libglusterfs/src/checksum.c
@@ -8,9 +8,10 @@
cases as published by the Free Software Foundation.
*/
-#include <openssl/md5.h>
+#include <openssl/sha.h>
#include <zlib.h>
#include <stdint.h>
+#include <string.h>
/*
* The "weak" checksum required for the rsync algorithm.
@@ -30,7 +31,8 @@ gf_rsync_weak_checksum (unsigned char *buf, size_t len)
* The "strong" checksum required for the rsync algorithm.
*/
void
-gf_rsync_strong_checksum (unsigned char *data, size_t len, unsigned char *md5)
+gf_rsync_strong_checksum (unsigned char *data, size_t len,
+ unsigned char *sha256_md)
{
- MD5 (data, len, md5);
+ SHA256((const unsigned char *)data, len, sha256_md);
}
diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c
index 20cd05e68cb..2bc1ec28649 100644
--- a/libglusterfs/src/default-args.c
+++ b/libglusterfs/src/default-args.c
@@ -1180,7 +1180,7 @@ args_rchecksum_cbk_store (default_args_cbk_t *args,
args->weak_checksum =
weak_checksum;
args->strong_checksum =
- memdup (strong_checksum, MD5_DIGEST_LENGTH);
+ memdup (strong_checksum, SHA256_DIGEST_LENGTH);
}
if (xdata)
args->xdata = dict_ref (xdata);