From 7422ecbc2a6057dfcd4d2237da3f581965d270f3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 9 Mar 2011 17:29:09 +0100 Subject: mav60: #164341# support AES encryption --- package/inc/ZipPackage.hxx | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'package/inc/ZipPackage.hxx') diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index e3b8d44be183..3d0ad38f6aac 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -35,11 +35,12 @@ #include #include #include -#ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ +#include #include -#endif -#include +#include #include + +#include #include #include @@ -83,18 +84,25 @@ class ZipPackage : public cppu::WeakImplHelper7 protected: SotMutexHolderRef m_aMutexHolder; - ::com::sun::star::uno::Sequence < sal_Int8 > m_aEncryptionKey; - FolderHash m_aRecent; - ::rtl::OUString m_aURL; - sal_Bool m_bHasEncryptedEntries; - sal_Bool m_bHasNonEncryptedEntries; - sal_Bool m_bInconsistent; - sal_Bool m_bUseManifest; - sal_Bool m_bForceRecovery; + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > m_aStorageEncryptionKeys; + ::com::sun::star::uno::Sequence< sal_Int8 > m_aEncryptionKey; - sal_Bool m_bMediaTypeFallbackUsed; - sal_Int32 m_nFormat; - sal_Bool m_bAllowRemoveOnInsert; + FolderHash m_aRecent; + ::rtl::OUString m_aURL; + + bool m_bStartKeyGenerationImported; + sal_Int32 m_nStartKeyGenerationID; + sal_Int32 m_nChecksumDigestID; + sal_Int32 m_nCommonEncryptionID; + sal_Bool m_bHasEncryptedEntries; + sal_Bool m_bHasNonEncryptedEntries; + + sal_Bool m_bInconsistent; + sal_Bool m_bForceRecovery; + + sal_Bool m_bMediaTypeFallbackUsed; + sal_Int32 m_nFormat; + sal_Bool m_bAllowRemoveOnInsert; InitialisationMode m_eMode; @@ -121,15 +129,20 @@ protected: const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xTempStream ); public: - ZipPackage (const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory); + ZipPackage( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > &xNewFactory ); virtual ~ZipPackage( void ); ZipFile& getZipFile() { return *m_pZipFile;} - const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return m_aEncryptionKey;} sal_Int32 getFormat() const { return m_nFormat; } + sal_Int32 GetKeyGenID() const { return m_nStartKeyGenerationID; } + sal_Int32 GetEncAlgID() const { return m_nCommonEncryptionID; } + sal_Int32 GetChecksumAlgID() const { return m_nChecksumDigestID; } + sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == ::com::sun::star::xml::crypto::CipherID::AES_CBC ? 32 : 16; } + SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } void ConnectTo( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream ); + const ::com::sun::star::uno::Sequence< sal_Int8 > GetEncryptionKey(); // XInitialization virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) -- cgit From 1decd7beffc8333d441b4327649685464e129d26 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 23 Mar 2011 14:13:24 +0100 Subject: mav60: #164341# fix problems with the new implementation --- package/inc/ZipPackage.hxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'package/inc/ZipPackage.hxx') diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 3d0ad38f6aac..c9fef60c29c7 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -90,7 +90,6 @@ protected: FolderHash m_aRecent; ::rtl::OUString m_aURL; - bool m_bStartKeyGenerationImported; sal_Int32 m_nStartKeyGenerationID; sal_Int32 m_nChecksumDigestID; sal_Int32 m_nCommonEncryptionID; @@ -137,7 +136,7 @@ public: sal_Int32 GetKeyGenID() const { return m_nStartKeyGenerationID; } sal_Int32 GetEncAlgID() const { return m_nCommonEncryptionID; } sal_Int32 GetChecksumAlgID() const { return m_nChecksumDigestID; } - sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == ::com::sun::star::xml::crypto::CipherID::AES_CBC ? 32 : 16; } + sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == ::com::sun::star::xml::crypto::CipherID::AES_CBC_W3C_PADDING ? 32 : 16; } SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } -- cgit From 481a55dc3bbf3c97c828fa727f4c30f0d8ab171e Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 24 Mar 2011 13:44:49 +0100 Subject: mav60: #164341# fix problems with the new implementation --- package/inc/ZipPackage.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/inc/ZipPackage.hxx') diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index c9fef60c29c7..f7b80f38b359 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -133,7 +133,7 @@ public: ZipFile& getZipFile() { return *m_pZipFile;} sal_Int32 getFormat() const { return m_nFormat; } - sal_Int32 GetKeyGenID() const { return m_nStartKeyGenerationID; } + sal_Int32 GetStartKeyGenID() const { return m_nStartKeyGenerationID; } sal_Int32 GetEncAlgID() const { return m_nCommonEncryptionID; } sal_Int32 GetChecksumAlgID() const { return m_nChecksumDigestID; } sal_Int32 GetDefaultDerivedKeySize() const { return m_nCommonEncryptionID == ::com::sun::star::xml::crypto::CipherID::AES_CBC_W3C_PADDING ? 32 : 16; } -- cgit