summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2011-03-24 19:39:35 +0100
committerMikhail Voytenko <mav@openoffice.org>2011-03-24 19:39:35 +0100
commitb7460db35b7a6d556b40c0e9cde8b808b0029352 (patch)
treed035adcbbde422744c3d51455f73d44bfa7f36c7 /package
parentdb79f11eaa47a31541d033a5c90d43cac014b265 (diff)
mav60: fix rebase problems
Diffstat (limited to 'package')
-rw-r--r--package/inc/EncryptionData.hxx3
-rw-r--r--package/inc/ZipFile.hxx2
-rw-r--r--package/inc/ZipPackageFolder.hxx2
-rw-r--r--package/source/manifest/ManifestImport.cxx2
-rw-r--r--package/source/zipapi/ZipFile.cxx3
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx1
-rw-r--r--package/source/zippackage/ZipPackage.cxx41
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx50
8 files changed, 55 insertions, 49 deletions
diff --git a/package/inc/EncryptionData.hxx b/package/inc/EncryptionData.hxx
index 549669b3feb1..5d49ae2b7b0f 100644
--- a/package/inc/EncryptionData.hxx
+++ b/package/inc/EncryptionData.hxx
@@ -42,7 +42,8 @@ public:
: m_nIterationCount ( 0 ){}
BaseEncryptionData( const BaseEncryptionData& aData )
- : m_aSalt( aData.m_aSalt )
+ : cppu::OWeakObject()
+ , m_aSalt( aData.m_aSalt )
, m_aInitVector( aData.m_aInitVector )
, m_aDigest( aData.m_aDigest )
, m_nIterationCount( aData.m_nIterationCount )
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index a6fc36bb0dfb..2be52615c90b 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -153,7 +153,7 @@ public:
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,
diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx
index 505c057a7696..6a80f0effdaa 100644
--- a/package/inc/ZipPackageFolder.hxx
+++ b/package/inc/ZipPackageFolder.hxx
@@ -90,7 +90,7 @@ public:
void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; }
void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; }
- bool saveChild(const rtl::OUString &rShortName, const com::sun::star::packages::ContentInfo &rInfo, rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, com::sun::star::uno::Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool & rRandomPool);
+ bool saveChild(const rtl::OUString &rShortName, const com::sun::star::packages::ContentInfo &rInfo, rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, const com::sun::star::uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool & rRandomPool);
// Recursive functions
void saveContents(rtl::OUString &rPath, std::vector < com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > > &rManList, ZipOutputStream & rZipOut, const com::sun::star::uno::Sequence< sal_Int8 > &rEncryptionKey, rtlRandomPool & rRandomPool)
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 8272cedf6d15..08999765cf7d 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -90,9 +90,9 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV
, sSHA1_Name ( RTL_CONSTASCII_USTRINGPARAM ( SHA1_NAME ) )
, sSHA1_URL ( RTL_CONSTASCII_USTRINGPARAM ( SHA1_URL ) )
+, sSHA256_1k_URL ( RTL_CONSTASCII_USTRINGPARAM ( SHA256_1K_URL ) )
, sSHA1_1k_Name ( RTL_CONSTASCII_USTRINGPARAM ( SHA1_1K_NAME ) )
, sSHA1_1k_URL ( RTL_CONSTASCII_USTRINGPARAM ( SHA1_1K_URL ) )
-, sSHA256_1k_URL ( RTL_CONSTASCII_USTRINGPARAM ( SHA256_1K_URL ) )
, sBlowfish_Name ( RTL_CONSTASCII_USTRINGPARAM ( BLOWFISH_NAME ) )
, sBlowfish_URL ( RTL_CONSTASCII_USTRINGPARAM ( BLOWFISH_URL ) )
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index a870cb60e63f..4827f6879853 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -159,7 +159,6 @@ uno::Reference< xml::crypto::XCipherContext > ZipFile::StaticGetCipher( const un
try
{
uno::Sequence< sal_Int8 > aDerivedKey( xEncryptionData->m_nDerivedKeySize );
- rtlDigestError nErr = rtl_Digest_E_None;
if ( rtl_Digest_E_None != rtl_digest_PBKDF2( reinterpret_cast< sal_uInt8* >( aDerivedKey.getArray() ),
aDerivedKey.getLength(),
reinterpret_cast< const sal_uInt8 * > (xEncryptionData->m_aKey.getConstArray() ),
@@ -304,7 +303,7 @@ sal_Bool ZipFile::StaticFillData ( ::rtl::Reference< BaseEncryptionData > & rDa
sal_Int32 &rStartKeyGenID,
sal_Int32 &rSize,
::rtl::OUString& aMediaType,
- uno::Reference < XInputStream > &rStream )
+ const uno::Reference< XInputStream >& rStream )
{
sal_Bool bOk = sal_False;
const sal_Int32 nHeaderSize = n_ConstHeaderSize - 4;
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 172cfff463a2..c0523c864e89 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -254,7 +254,6 @@ void SAL_CALL ZipOutputStream::finish( )
void ZipOutputStream::doDeflate()
{
sal_Int32 nLength = aDeflater.doDeflateSegment(m_aDeflateBuffer, 0, m_aDeflateBuffer.getLength());
- sal_Int32 nOldLength = m_aDeflateBuffer.getLength();
if ( nLength > 0 )
{
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 4b572df03c2f..41d944288d53 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -157,11 +157,11 @@ public:
class DummyInputStream : public ::cppu::WeakImplHelper1< XInputStream >
{
- virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >&, sal_Int32 )
+ virtual sal_Int32 SAL_CALL readBytes( uno::Sequence< sal_Int8 >&, sal_Int32 )
throw ( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException )
{ return 0; }
- virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >&, sal_Int32 )
+ virtual sal_Int32 SAL_CALL readSomeBytes( uno::Sequence< sal_Int8 >&, sal_Int32 )
throw ( NotConnectedException, BufferSizeExceededException, IOException, RuntimeException )
{ return 0; }
@@ -217,7 +217,6 @@ void ZipPackage::parseManifest()
if ( m_nFormat == embed::StorageFormats::PACKAGE )
{
sal_Bool bManifestParsed = sal_False;
- bool bStartKeyGenerationImported = false;
bool bDifferentStartKeyAlgorithm = false;
const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) );
if ( m_xRootFolder->hasByName( sMeta ) )
@@ -253,9 +252,9 @@ void ZipPackage::parseManifest()
const OUString sPropEncryptionAlgorithm ( RTL_CONSTASCII_USTRINGPARAM ( "EncryptionAlgorithm" ) );
const OUString sPropStartKeyAlgorithm ( RTL_CONSTASCII_USTRINGPARAM ( "StartKeyAlgorithm" ) );
- Sequence < Sequence < PropertyValue > > aManifestSequence = xReader->readManifestSequence ( xSink->getInputStream() );
+ uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence = xReader->readManifestSequence ( xSink->getInputStream() );
sal_Int32 nLength = aManifestSequence.getLength();
- const Sequence < PropertyValue > *pSequence = aManifestSequence.getConstArray();
+ const uno::Sequence < PropertyValue > *pSequence = aManifestSequence.getConstArray();
ZipPackageStream *pStream = NULL;
ZipPackageFolder *pFolder = NULL;
@@ -605,7 +604,7 @@ void ZipPackage::getZipFileContents()
}
//--------------------------------------------------------
-void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments )
+void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
throw( Exception, RuntimeException )
{
RTL_LOGFILE_TRACE_AUTHOR ( "package", LOGFILE_AUTHOR, "{ ZipPackage::initialize" );
@@ -981,7 +980,7 @@ uno::Reference< XInterface > SAL_CALL ZipPackage::createInstance()
return xRef;
}
//--------------------------------------------------------
-uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( const Sequence< Any >& aArguments )
+uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( const uno::Sequence< Any >& aArguments )
throw( Exception, RuntimeException )
{
sal_Bool bArg = sal_False;
@@ -1006,7 +1005,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
ZipEntry * pEntry = new ZipEntry;
sal_Int32 nBufferLength = m_pRootFolder->GetMediaType().getLength();
OString sMediaType = OUStringToOString( m_pRootFolder->GetMediaType(), RTL_TEXTENCODING_ASCII_US );
- Sequence< sal_Int8 > aType( ( sal_Int8* )sMediaType.getStr(),
+ uno::Sequence< sal_Int8 > aType( ( sal_Int8* )sMediaType.getStr(),
nBufferLength );
@@ -1035,7 +1034,7 @@ void ZipPackage::WriteMimetypeMagicFile( ZipOutputStream& aZipOut )
}
//--------------------------------------------------------
-void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence < PropertyValue > >& aManList )
+void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< uno::Sequence < PropertyValue > >& aManList )
{
// Write the manifest
uno::Reference < XOutputStream > xManOutStream;
@@ -1052,10 +1051,10 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence
pEntry->nCrc = pEntry->nSize = pEntry->nCompressedSize = -1;
pEntry->nTime = ZipOutputStream::getCurrentDosTime();
- // Convert vector into a Sequence
- Sequence < Sequence < PropertyValue > > aManifestSequence ( aManList.size() );
+ // Convert vector into a uno::Sequence
+ uno::Sequence < uno::Sequence < PropertyValue > > aManifestSequence ( aManList.size() );
sal_Int32 nInd = 0;
- for ( vector < Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end();
+ for ( vector < uno::Sequence < PropertyValue > >::const_iterator aIter = aManList.begin(), aEnd = aManList.end();
aIter != aEnd;
aIter++, nInd++ )
{
@@ -1083,7 +1082,7 @@ void ZipPackage::WriteManifest( ZipOutputStream& aZipOut, const vector< Sequence
}
//--------------------------------------------------------
-void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< Sequence < PropertyValue > >& aManList )
+void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno::Sequence < PropertyValue > >& aManList )
{
const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) );
const OUString sMediaType ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) );
@@ -1097,7 +1096,7 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< Sequ
pEntry->nCrc = pEntry->nSize = pEntry->nCompressedSize = -1;
pEntry->nTime = ZipOutputStream::getCurrentDosTime();
- // Convert vector into a Sequence
+ // Convert vector into a uno::Sequence
// TODO/LATER: use Defaulst entries in future
uno::Sequence< beans::StringPair > aDefaultsSequence;
uno::Sequence< beans::StringPair > aOverridesSequence( aManList.size() );
@@ -1236,7 +1235,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
}
// Create a vector to store data for the manifest.xml file
- vector < Sequence < PropertyValue > > aManList;
+ vector < uno::Sequence < PropertyValue > > aManList;
const OUString sMediaType ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) );
const OUString sVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) );
@@ -1244,7 +1243,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile()
if ( m_nFormat == embed::StorageFormats::PACKAGE )
{
- Sequence < PropertyValue > aPropSeq( PKG_SIZE_NOENCR_MNFST );
+ uno::Sequence < PropertyValue > aPropSeq( PKG_SIZE_NOENCR_MNFST );
aPropSeq [PKG_MNFST_MEDIATYPE].Name = sMediaType;
aPropSeq [PKG_MNFST_MEDIATYPE].Value <<= m_pRootFolder->GetMediaType();
aPropSeq [PKG_MNFST_VERSION].Name = sVersion;
@@ -1377,7 +1376,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput()
aArg.Mode = OpenMode::DOCUMENT;
aArg.Priority = 0; // unused
aArg.Sink = xSink;
- aArg.Properties = Sequence< Property >( 0 ); // unused
+ aArg.Properties = uno::Sequence< Property >( 0 ); // unused
aOriginalContent.executeCommand( OUString::createFromAscii( "open" ), makeAny( aArg ) );
}
@@ -1632,7 +1631,7 @@ sal_Bool SAL_CALL ZipPackage::hasPendingChanges()
Sequence< ElementChange > SAL_CALL ZipPackage::getPendingChanges()
throw( RuntimeException )
{
- return Sequence < ElementChange > ();
+ return uno::Sequence < ElementChange > ();
}
/**
@@ -1654,7 +1653,7 @@ OUString ZipPackage::static_getImplementationName()
//--------------------------------------------------------
Sequence< OUString > ZipPackage::static_getSupportedServiceNames()
{
- Sequence< OUString > aNames( 1 );
+ uno::Sequence< OUString > aNames( 1 );
aNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.packages.Package" ) );
return aNames;
}
@@ -1703,7 +1702,7 @@ Sequence< sal_Int8 > ZipPackage::getUnoTunnelImplementationId( void )
}
//--------------------------------------------------------
-sal_Int64 SAL_CALL ZipPackage::getSomething( const Sequence< sal_Int8 >& aIdentifier )
+sal_Int64 SAL_CALL ZipPackage::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
throw( RuntimeException )
{
if ( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) )
@@ -1740,7 +1739,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
else if ( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( STORAGE_ENCRYPTION_KEYS_PROPERTY ) ) )
{
// this property is only necessary to support raw passwords in storage API;
- // because of this support the storage has to operate with more than one key dependent on storage generation algorithm;\
+ // because of this support the storage has to operate with more than one key dependent on storage generation algorithm;
// when this support is removed, the storage will get only one key from outside
// TODO/LATER: Get rid of this property as well as of support of raw passwords in storages
uno::Sequence< beans::NamedValue > aKeys;
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 44809e5ff9ab..01cfa79d47cb 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -304,29 +304,29 @@ static void ImplSetStoredData( ZipEntry & rEntry, uno::Reference< XInputStream>
rEntry.nCrc = aCRC32.getValue();
}
-bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo &rInfo, OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool)
+bool ZipPackageFolder::saveChild( const ::rtl::OUString &rShortName, const ContentInfo &rInfo, ::rtl::OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool)
{
bool bSuccess = true;
- const OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) );
- const OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) );
- const OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) );
- const OUString sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) );
- const OUString sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) );
- const OUString sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) );
- const OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) );
- const OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) );
+ const ::rtl::OUString sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) );
+ const ::rtl::OUString sVersionProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) );
+ const ::rtl::OUString sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) );
+ const ::rtl::OUString sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) );
+ const ::rtl::OUString sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) );
+ const ::rtl::OUString sIterationCountProperty ( RTL_CONSTASCII_USTRINGPARAM ( "IterationCount" ) );
+ const ::rtl::OUString sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) );
+ const ::rtl::OUString sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) );
const ::rtl::OUString sEncryptionAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "EncryptionAlgorithm" ) );
const ::rtl::OUString sStartKeyAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "StartKeyAlgorithm" ) );
const ::rtl::OUString sDigestAlgProperty ( RTL_CONSTASCII_USTRINGPARAM ( "DigestAlgorithm" ) );
const ::rtl::OUString sDerivedKeySizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "DerivedKeySize" ) );
- Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);
+ uno::Sequence < PropertyValue > aPropSet (PKG_SIZE_NOENCR_MNFST);
OSL_ENSURE( ( rInfo.bFolder && rInfo.pFolder ) || ( !rInfo.bFolder && rInfo.pStream ), "A valid child object is expected!" );
if ( rInfo.bFolder )
{
- OUString sTempName = rPath + rShortName + OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
+ ::rtl::OUString sTempName = rPath + rShortName + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "/" ) );
if ( rInfo.pFolder->GetMediaType().getLength() )
{
@@ -381,7 +381,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
sal_Int32 nOwnStreamOrigSize = bRawStream ? rInfo.pStream->GetMagicalHackSize() : rInfo.pStream->getSize();
sal_Bool bUseNonSeekableAccess = sal_False;
- Reference < XInputStream > xStream;
+ uno::Reference < XInputStream > xStream;
if ( !rInfo.pStream->IsPackageMember() && !bRawStream && !bToBeEncrypted && bToBeCompressed )
{
// the stream is not a package member, not a raw stream,
@@ -389,7 +389,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
// in this case nonseekable access can be used
xStream = rInfo.pStream->GetOwnStreamNoWrap();
- Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
+ uno::Reference < XSeekable > xSeek ( xStream, uno::UNO_QUERY );
bUseNonSeekableAccess = ( xStream.is() && !xSeek.is() );
}
@@ -405,7 +405,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
return bSuccess;
}
- Reference < XSeekable > xSeek ( xStream, UNO_QUERY );
+ uno::Reference < XSeekable > xSeek ( xStream, uno::UNO_QUERY );
try
{
if ( xSeek.is() )
@@ -459,7 +459,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
}
}
}
- catch ( Exception& )
+ catch ( uno::Exception& )
{
VOS_ENSURE( 0, "The stream provided to the package component has problems!" );
bSuccess = false;
@@ -470,9 +470,9 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
{
if ( bToBeEncrypted && !bTransportOwnEncrStreamAsRaw )
{
- Sequence < sal_uInt8 > aSalt ( 16 ), aVector ( 8 );
+ uno::Sequence < sal_Int8 > aSalt( 16 ), aVector( rInfo.pStream->GetBlockSize() );
rtl_random_getBytes ( rRandomPool, aSalt.getArray(), 16 );
- rtl_random_getBytes ( rRandomPool, aVector.getArray(), 8 );
+ rtl_random_getBytes ( rRandomPool, aVector.getArray(), aVector.getLength() );
sal_Int32 nIterationCount = 1024;
if ( !rInfo.pStream->HasOwnKey() )
@@ -501,6 +501,10 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
if ( bRawStream || bTransportOwnEncrStreamAsRaw )
{
+ ::rtl::Reference< EncryptionData > xEncData = rInfo.pStream->GetEncryptionData();
+ if ( !xEncData.is() )
+ throw uno::RuntimeException();
+
aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
aPropSet[PKG_MNFST_DIGEST].Value <<= rInfo.pStream->getDigest();
aPropSet[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
@@ -546,7 +550,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
// the entry is provided to the ZipOutputStream that will delete it
pAutoTempEntry.release();
- Sequence < sal_Int8 > aSeq ( n_ConstBufferSize );
+ uno::Sequence < sal_Int8 > aSeq ( n_ConstBufferSize );
sal_Int32 nLength;
do
@@ -606,7 +610,7 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
pAutoTempEntry.release();
sal_Int32 nLength;
- Sequence < sal_Int8 > aSeq (n_ConstBufferSize);
+ uno::Sequence < sal_Int8 > aSeq (n_ConstBufferSize);
do
{
nLength = xStream->readBytes(aSeq, n_ConstBufferSize);
@@ -629,6 +633,10 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
if ( bToBeEncrypted )
{
+ ::rtl::Reference< EncryptionData > xEncData = rInfo.pStream->GetEncryptionData();
+ if ( !xEncData.is() )
+ throw uno::RuntimeException();
+
aPropSet[PKG_MNFST_DIGEST].Name = sDigestProperty;
aPropSet[PKG_MNFST_DIGEST].Value <<= rInfo.pStream->getDigest();
aPropSet[PKG_MNFST_ENCALG].Name = sEncryptionAlgProperty;
@@ -685,8 +693,8 @@ bool ZipPackageFolder::saveChild( const OUString &rShortName, const ContentInfo
return bSuccess;
}
-void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, Sequence < sal_Int8 > &rEncryptionKey, rtlRandomPool &rRandomPool)
- throw(RuntimeException)
+void ZipPackageFolder::saveContents( ::rtl::OUString &rPath, std::vector < uno::Sequence < PropertyValue > > &rManList, ZipOutputStream & rZipOut, const uno::Sequence < sal_Int8 >& rEncryptionKey, rtlRandomPool &rRandomPool )
+ throw( uno::RuntimeException )
{
bool bWritingFailed = false;