From 1d32720335ffd8835c4a7b3164fe9aa9028f77a5 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 19 Dec 2017 07:21:07 -0500 Subject: 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 --- libglusterfs/src/checksum.c | 8 +++++--- libglusterfs/src/default-args.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'libglusterfs') 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 +#include #include #include +#include /* * 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); -- cgit