summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-01-26 10:47:24 +0000
committerAron Budea <aron.budea@collabora.com>2018-02-20 17:29:03 +0100
commit9b8198dacc2208a29044ddc25784e328ac4af1cf (patch)
tree9f15ae3fe9bf51f2487952049302a52f804c72d8 /include
parentf26899be899f1a39ea1e6b5ad8b46bad9cf1216f (diff)
Resolves: tdf#114221 generate both std97 and cryptoapi keys from password..
when we open a cryptoapi encrypted binary msoffice document. That way when we save as the same format, and try to reuse the generated keys for encryption, we have matching std97 encryption keys available because we always export using that scheme. Change-Id: I25f24a01d102242615768255ce888acb08ef6447 Reviewed-on: https://gerrit.libreoffice.org/48712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit b5914ba44f2fff9f282b6a5cbe21cbebf19e45b2) Reviewed-on: https://gerrit.libreoffice.org/48914 (cherry picked from commit 82e74f704ce4fe3ffe7ab74c14fe83d2d44dd088)
Diffstat (limited to 'include')
-rw-r--r--include/filter/msfilter/mscodec.hxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/filter/msfilter/mscodec.hxx b/include/filter/msfilter/mscodec.hxx
index b0ab818449ae..aa38f6e9fc00 100644
--- a/include/filter/msfilter/mscodec.hxx
+++ b/include/filter/msfilter/mscodec.hxx
@@ -178,7 +178,7 @@ public:
class MSFILTER_DLLPUBLIC MSCodec97
{
public:
- MSCodec97(size_t nHashLen);
+ MSCodec97(size_t nHashLen, const OUString& rEncKeyName);
virtual ~MSCodec97();
/** Initializes the algorithm with the encryption data.
@@ -195,7 +195,7 @@ public:
The sequence contains the necessary data to initialize
the codec.
*/
- css::uno::Sequence< css::beans::NamedValue > GetEncryptionData();
+ virtual css::uno::Sequence<css::beans::NamedValue> GetEncryptionData();
/** Initializes the algorithm with the specified password and document ID.
@@ -317,6 +317,7 @@ private:
MSCodec97& operator=(const MSCodec97&) = delete;
protected:
+ OUString m_sEncKeyName;
size_t m_nHashLen;
rtlCipher m_hCipher;
std::vector<sal_uInt8> m_aDocId;
@@ -396,6 +397,8 @@ private:
class MSFILTER_DLLPUBLIC MSCodec_CryptoAPI : public MSCodec97
{
+private:
+ css::uno::Sequence<sal_Int8> m_aStd97Key;
public:
MSCodec_CryptoAPI();
@@ -403,6 +406,7 @@ public:
const sal_uInt8 pDocId[16]) override;
virtual bool InitCipher(sal_uInt32 nCounter) override;
virtual void GetDigestFromSalt(const sal_uInt8* pSaltData, sal_uInt8* pDigest) override;
+ virtual css::uno::Sequence<css::beans::NamedValue> GetEncryptionData() override;
};
const sal_uInt32 ENCRYPTINFO_CRYPTOAPI = 0x00000004;