diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-07 02:25:11 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-07 02:51:14 +0100 |
commit | f217d3ef94724a84a87ef72db893c2b8380151e8 (patch) | |
tree | 976d14b9665fb2a9c6f11b29360bb291f244f312 | |
parent | c23564adaadf64c8f22c8d0e73977f18b53a09d5 (diff) |
fixup manifest export
Change-Id: I9d7eb45c0b7c829769c5258ff3ccff28555691ae
-rw-r--r-- | package/source/manifest/ManifestExport.cxx | 21 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 9 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageStream.cxx | 2 |
3 files changed, 15 insertions, 17 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 48c8eedffce3..02ea5a016270 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/xml/crypto/DigestID.hpp> #include <com/sun/star/xml/crypto/CipherID.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/uno/RuntimeException.hpp> #include "ManifestDefines.hxx" @@ -240,24 +241,24 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con xHandler->startElement( sManifestKeyInfoElement, nullptr ); xHandler->ignorableWhitespace ( sWhiteSpace ); - uno::Sequence< uno::Sequence < beans::PropertyValue > > aKeyInfoSequence; + uno::Sequence< uno::Sequence < beans::NamedValue > > aKeyInfoSequence; *pKeyInfoProperty >>= aKeyInfoSequence; - const uno::Sequence < beans::PropertyValue > *pKeyInfoSequence = aKeyInfoSequence.getConstArray(); + const uno::Sequence < beans::NamedValue > *pKeyInfoSequence = aKeyInfoSequence.getConstArray(); const sal_uInt32 nKeyInfoLength = aKeyInfoSequence.getLength(); for (sal_uInt32 nInd = 0; nInd < nKeyInfoLength ; nInd++ ) { uno::Sequence < sal_Int8 > aPgpKeyID; uno::Sequence < sal_Int8 > aPgpKeyPacket; uno::Sequence < sal_Int8 > aCipherValue; - pValue = pKeyInfoSequence[nInd].getConstArray(); - for (sal_uInt32 j = 0, nNum = pKeyInfoSequence[nInd].getLength(); j < nNum; j++, pValue++) + const beans::NamedValue *pNValue = pKeyInfoSequence[nInd].getConstArray(); + for (sal_uInt32 j = 0, nNum = pKeyInfoSequence[nInd].getLength(); j < nNum; j++, pNValue++) { - if (pValue->Name == sPgpKeyIDProperty ) - pValue->Value >>= aPgpKeyID; - else if (pValue->Name == sPgpKeyPacketProperty ) - pValue->Value >>= aPgpKeyPacket; - else if (pValue->Name == sCipherValueProperty ) - pValue->Value >>= aCipherValue; + if (pNValue->Name == sPgpKeyIDProperty ) + pNValue->Value >>= aPgpKeyID; + else if (pNValue->Name == sPgpKeyPacketProperty ) + pNValue->Value >>= aPgpKeyPacket; + else if (pNValue->Name == sCipherValueProperty ) + pNValue->Value >>= aCipherValue; } if (!aPgpKeyID.hasElements() && !aPgpKeyPacket.hasElements() && !aCipherValue.hasElements() ) diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 63faf73f326a..cfca8a27280f 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1197,7 +1197,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() { bool bIsGpgEncrypt = m_aGpgProps.hasElements(); uno::Sequence < PropertyValue > aPropSeq( - bIsGpgEncrypt ? PKG_SIZE_ENCR_MNFST : PKG_SIZE_GPG_ENCR_MNFST ); + bIsGpgEncrypt ? PKG_SIZE_NOENCR_MNFST+1 : PKG_SIZE_NOENCR_MNFST ); aPropSeq [PKG_MNFST_MEDIATYPE].Name = sMediaType; aPropSeq [PKG_MNFST_MEDIATYPE].Value <<= m_xRootFolder->GetMediaType(); aPropSeq [PKG_MNFST_VERSION].Name = sVersion; @@ -1207,11 +1207,8 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() if( bIsGpgEncrypt ) { - for ( sal_Int32 nInd = 0; nInd < m_aGpgProps.getLength(); nInd++ ) - { - aPropSeq[PKG_MNFST_KEYID+nInd].Name = m_aGpgProps[nInd].Name; - aPropSeq[PKG_MNFST_KEYID+nInd].Value = m_aGpgProps[nInd].Value; - } + aPropSeq[PKG_SIZE_NOENCR_MNFST].Name = "KeyInfo"; + aPropSeq[PKG_SIZE_NOENCR_MNFST].Value <<= m_aGpgProps; } aManList.push_back( aPropSeq ); } diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 20122fe19973..c87d000f21f5 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -665,7 +665,7 @@ bool ZipPackageStream::saveChild( // last property is digest, which is inserted later if we didn't have // a magic header - aPropSet.realloc(PKG_SIZE_GPG_ENCR_MNFST); + aPropSet.realloc(PKG_SIZE_ENCR_MNFST); aPropSet[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty; aPropSet[PKG_MNFST_INIVECTOR].Value <<= m_xBaseEncryptionData->m_aInitVector; |