diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-26 10:47:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-26 16:44:43 +0100 |
commit | 2372003d94d3c58d90f6af524e916a2aa761cee2 (patch) | |
tree | 8d759fa0b0b0613612ee5130b5d832c06b8e29a3 /include | |
parent | iOS, add support for PDF (diff) | |
download | core-2372003d94d3c58d90f6af524e916a2aa761cee2.tar.gz core-2372003d94d3c58d90f6af524e916a2aa761cee2.zip |
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/48680
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/filter/msfilter/mscodec.hxx | 8 |
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; |