path: root/package/source/xstor/xstorage.cxx
diff options
authorMike Kaganski <>2020-01-03 22:40:07 +0300
committerThorsten Behrens <>2020-02-09 15:19:00 +0100
commit5b6c866d522e7eef636a5fa4048c39c1ea60e466 (patch)
tree4a799c74af9e59ce2d572fb3ebc1153623906082 /package/source/xstor/xstorage.cxx
parentb838986c6edfb4e5fb1e30bf47d8ad54ae2b4098 (diff)
tdf#93389: keep encryption information for autorecovered MS formats
The autorecovery data is stored in ODF, regardless of the original document format. When restoring, type detection generates ODF data, which is stored in the media descriptor attached to document, even after real filter was restored (see AutoRecovery::implts_openDocs). If real filter is not ODF, then at the save time, it doesn't find necessary information in encryption data, and makes not encrypted package. This patch adds both MS binary data, and OOXML data, to existing ODF data for recovered password-protected documents (regardless of their real filter). TODO: only add required information to encryption data: pass real filter name to DocPasswordHelper::requestAndVerifyDocPassword from AutoRecovery::implts_openDocs. Reviewed-on: Reviewed-by: Mike Kaganski <> Tested-by: Mike Kaganski <> (cherry picked from commit dd198398b6e5c84ab1255a90ef96e6445b66a64f) Conflicts: comphelper/source/misc/docpasswordhelper.cxx Change-Id: I4717f067ad3c40167312b99eefef5584a467bfed (cherry picked from commit 6017cdff264afc3b98beeba1330d6df28102fe7a)
Diffstat (limited to 'package/source/xstor/xstorage.cxx')
1 files changed, 1 insertions, 1 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 0a43a07869f9..1725b1627762 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -857,7 +857,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
SAL_INFO("package.xstor", "No Encryption: " << rNoEncryptionException);
- if (bHasCommonEncryptionData && ::package::PackageEncryptionDatasEqual(pElement->m_xStream->GetCachedEncryptionData(), aCommonEncryptionData))
+ if (bHasCommonEncryptionData && ::package::PackageEncryptionDataLessOrEqual(pElement->m_xStream->GetCachedEncryptionData(), aCommonEncryptionData))
// If the stream can be opened with the common storage password
// it must be stored with the common storage password as well