diff options
author | Kotresh HR <khiremat@redhat.com> | 2017-12-19 07:21:07 -0500 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2017-12-21 04:31:31 +0000 |
commit | 1d32720335ffd8835c4a7b3164fe9aa9028f77a5 (patch) | |
tree | 9234608444f07d385564e1e386844dadd63fd1ee /xlators/cluster | |
parent | 4a06f851dcad6bdd730f3d2e12bd8f26709f27fe (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 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 2 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 4 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 8e75d200567..7e020bb6bee 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -648,7 +648,7 @@ afr_reply_copy (struct afr_reply *dst, struct afr_reply *src) if (dst->xdata) dict_unref (dst->xdata); dst->xdata = xdata; - memcpy (dst->checksum, src->checksum, MD5_DIGEST_LENGTH); + memcpy (dst->checksum, src->checksum, SHA256_DIGEST_LENGTH); } void diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 8cf43f2807b..7880a611592 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -42,7 +42,7 @@ __checksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, replies[i].buf_has_zeroes = dict_get_str_boolean (xdata, "buf-has-zeroes", _gf_false); if (strong) - memcpy (local->replies[i].checksum, strong, MD5_DIGEST_LENGTH); + memcpy (local->replies[i].checksum, strong, SHA256_DIGEST_LENGTH); syncbarrier_wake (&local->barrier); return 0; @@ -92,7 +92,7 @@ __afr_can_skip_data_block_heal (call_frame_t *frame, xlator_t *this, fd_t *fd, if (local->replies[i].valid) { if (memcmp (local->replies[source].checksum, local->replies[i].checksum, - MD5_DIGEST_LENGTH)) { + SHA256_DIGEST_LENGTH)) { checksum_match = _gf_false; break; } diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index b59b9439273..7a7cb2e656f 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -319,7 +319,7 @@ struct afr_reply { struct iatt preparent2; struct iatt postparent2; /* For rchecksum */ - uint8_t checksum[MD5_DIGEST_LENGTH]; + uint8_t checksum[SHA256_DIGEST_LENGTH]; gf_boolean_t buf_has_zeroes; /* For lookup */ int8_t need_heal; |