From 64abb12ed40573f622bc444905c8d4788dfcd021 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 9 Apr 2019 15:26:08 -0400 Subject: [PATCH] rgw: don't recalculate etags for slo/dlo for slo, we've already calculated this as 'lo_etag' in get_params() for dlo, the local 'etag' already contains the hash of an empty string the calls to complete_etag() were calling hash.Final() a second time on the same hash without a hash.Restart() in between. this apparently worked fine with NSS, but with OpenSSL the second call to Final() returns a different value Fixes: https://tracker.ceph.com/issues/39160 Signed-off-by: Casey Bodley (cherry picked from commit 4b849a49bd6c6b66f8185739ae21f0e6aa526a1a) --- src/rgw/rgw_op.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index e0d339e69465..78af1d10f132 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3842,18 +3842,12 @@ void RGWPutObj::execute() ldpp_dout(this, 0) << "bad user manifest: " << dlo_manifest << dendl; return; } - complete_etag(hash, &etag); - ldpp_dout(this, 10) << __func__ << ": calculated md5 for user manifest: " << etag << dendl; } if (slo_info) { bufferlist manifest_bl; encode(*slo_info, manifest_bl); emplace_attr(RGW_ATTR_SLO_MANIFEST, std::move(manifest_bl)); - - hash.Update((unsigned char *)(slo_info->raw_data.c_str()), slo_info->raw_data.length()); - complete_etag(hash, &etag); - ldpp_dout(this, 10) << __func__ << ": calculated md5 for user manifest: " << etag << dendl; } if (supplied_etag && etag.compare(supplied_etag) != 0) { -- 2.47.3