summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-02-11 06:54:35 +0530
committerAmar Tumballi <amarts@redhat.com>2018-02-19 14:57:12 +0000
commit6daa6535692b2c68b493636a9bbfdcbc475b3d80 (patch)
tree7df7839a468dd544103b3e0bc752da718db04fa8 /xlators/cluster/afr/src/afr-self-heal-common.c
parente80c10d5e6fb97e132ff7f1c2846629fb5ad915f (diff)
posix/afr: handle backward compatibility for rchecksum fop
Added a volume option 'fips-mode-rchecksum' tied to op version 4. If not set, rchecksum fop will use MD5 instead of SHA256. updates: #230 Change-Id: Id8ea1303777e6450852c0bc25503cda341a6aec2 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 7e2a6027126..7195dfe058c 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -648,7 +648,13 @@ 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, SHA256_DIGEST_LENGTH);
+ if (xdata && dict_get_str_boolean (xdata, "fips-mode-rchecksum",
+ _gf_false) == _gf_true) {
+ memcpy (dst->checksum, src->checksum, SHA256_DIGEST_LENGTH);
+ } else {
+ memcpy (dst->checksum, src->checksum, MD5_DIGEST_LENGTH);
+ }
+ dst->fips_mode_rchecksum = src->fips_mode_rchecksum;
}
void