summaryrefslogtreecommitdiff
path: root/package/source
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2001-09-05 18:13:50 +0000
committerMartin Gallwey <mtg@openoffice.org>2001-09-05 18:13:50 +0000
commitdab95c2c4711e17d70258a827a76b7de8421079a (patch)
tree53aa9927cbff56e6d8464ccf437187e5e101c79c /package/source
parente9e01272e3acc47abd5b4e2995aa705f0f65cb79 (diff)
#90699# Export a digest of the unencrypted stream
Diffstat (limited to 'package/source')
-rw-r--r--package/source/zippackage/ZipPackageFolder.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 233b777279a3..9d3137400208 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipPackageFolder.cxx,v $
*
- * $Revision: 1.47 $
+ * $Revision: 1.48 $
*
- * last change: $Author: mtg $ $Date: 2001-08-30 13:45:19 $
+ * last change: $Author: mtg $ $Date: 2001-09-05 19:13:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -292,6 +292,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
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" ) );
sal_Bool bHaveEncryptionKey = rEncryptionKey.getLength() ? sal_True : sal_False;
@@ -369,7 +370,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
pStream->setIterationCount ( nIterationCount );
pStream->setKey ( aKey );
- aPropSet.realloc(6); // 6th property is size, below
+ aPropSet.realloc(7); // 6th property is size, below, 7th is Digest
pValue = aPropSet.getArray();
pValue[2].Name = sInitialisationVectorProperty;
pValue[2].Value <<= aVector;
@@ -457,6 +458,12 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr
{
VOS_ENSURE( 0, "Error writing ZipOutputStream" );
}
+ if (bToBeEncrypted)
+ {
+ // Need to store the uncompressed size in the manifest
+ pValue[6].Name = sDigestProperty;
+ pValue[6].Value <<= pStream->getDigest();
+ }
}
// Then copy it back afterwards...