diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-11-09 08:54:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-18 11:52:52 +0100 |
commit | c726de0c282cab62b9f1a3b51249e37224325fe9 (patch) | |
tree | 801a341269c597a84908da4a9b79070942afcefc /package/inc/ZipFile.hxx | |
parent | 4fc80f9a1dcd3a1705a0e4c2b092a3804ca4b554 (diff) |
Backport reading AES-encrypted ODF 1.2 documents (as genereated by LibO 3.5).
This backports the reading half of CWS mav60 plus <http://cgit.freedesktop.org/
libreoffice/core/commit/?id=2d775f593abd9bc487ccc60f06aa5a3ca9632056> "Produce
correct sha256 uri, consume correct uri and original spec typo." It spans the
repos components, libs-core, libs-gui, and ure.
Diffstat (limited to 'package/inc/ZipFile.hxx')
-rw-r--r-- | package/inc/ZipFile.hxx | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index c64500cb6..bd108b340 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -32,9 +32,15 @@ #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/packages/NoEncryptionException.hpp> #include <com/sun/star/packages/WrongPasswordException.hpp> +#include <com/sun/star/xml/crypto/XCipherContext.hpp> +#include <com/sun/star/xml/crypto/XDigestContext.hpp> + +#include <rtl/ref.hxx> + #include <ByteGrabber.hxx> #include <HashMaps.hxx> #include <Inflater.hxx> +#include <EncryptionData.hxx> #include <mutexholder.hxx> @@ -56,7 +62,6 @@ namespace rtl typedef void* rtlCipher; class ZipEnumeration; -class EncryptionData; class ZipFile { @@ -69,7 +74,7 @@ protected: ZipUtils::Inflater aInflater; com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream; com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek; - const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > xFactory; + const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; ::com::sun::star::uno::Reference < ::com::sun::star::ucb::XProgressHandler > xProgressHandler; sal_Bool bRecoveryMode; @@ -133,25 +138,41 @@ public: static sal_Bool StaticGetCipher ( const rtl::Reference < EncryptionData > & xEncryptionData, rtlCipher &rCipher, sal_Bool bDecode ); - static void StaticFillHeader ( const rtl::Reference < EncryptionData > & rData, + static ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XDigestContext > StaticGetDigestContextForChecksum( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xArgFactory, + const ::rtl::Reference< EncryptionData >& xEncryptionData ); + + static ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XCipherContext > StaticGetCipher( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xArgFactory, + const ::rtl::Reference< EncryptionData >& xEncryptionData, + bool bEncrypt ); + + static void StaticFillHeader ( const ::rtl::Reference < EncryptionData > & rData, sal_Int32 nSize, const ::rtl::OUString& aMediaType, sal_Int8 * & pHeader ); - static sal_Bool StaticFillData ( rtl::Reference < EncryptionData > & rData, + static sal_Bool StaticFillData ( ::rtl::Reference < BaseEncryptionData > & rData, + sal_Int32 &rEncAlgorithm, + sal_Int32 &rChecksumAlgorithm, + sal_Int32 &rDerivedKeySize, + sal_Int32 &rStartKeyGenID, sal_Int32 &rSize, ::rtl::OUString& aMediaType, - ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream > &rStream ); + const ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& rStream ); static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > StaticGetDataFromRawStream( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xStream, const rtl::Reference < EncryptionData > &rData ) throw ( ::com::sun::star::packages::WrongPasswordException, ::com::sun::star::packages::zip::ZipIOException, ::com::sun::star::uno::RuntimeException ); - static sal_Bool StaticHasValidPassword ( const ::com::sun::star::uno::Sequence< sal_Int8 > &aReadBuffer, - const rtl::Reference < EncryptionData > &rData ); + static sal_Bool StaticHasValidPassword ( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, + const ::com::sun::star::uno::Sequence< sal_Int8 > &aReadBuffer, + const ::rtl::Reference < EncryptionData > &rData ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( |