LibreOffice Module package (master) 1
ManifestImport.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "ManifestImport.hxx"
21#include "ManifestDefines.hxx"
22#include <PackageConstants.hxx>
23#include <osl/diagnose.h>
24#include <com/sun/star/xml/sax/XAttributeList.hpp>
25#include <com/sun/star/xml/crypto/DigestID.hpp>
26#include <com/sun/star/xml/crypto/CipherID.hpp>
27#include <com/sun/star/beans/PropertyValue.hpp>
28#include <comphelper/base64.hxx>
30
31using namespace com::sun::star::uno;
32using namespace com::sun::star::beans;
33using namespace com::sun::star;
34
35constexpr OUStringLiteral gsFullPathProperty ( u"FullPath" );
36constexpr OUStringLiteral gsMediaTypeProperty ( u"MediaType" );
37constexpr OUStringLiteral gsVersionProperty ( u"Version" );
38constexpr OUStringLiteral gsIterationCountProperty ( u"IterationCount" );
39constexpr OUStringLiteral gsDerivedKeySizeProperty ( u"DerivedKeySize" );
40constexpr OUStringLiteral gsSaltProperty ( u"Salt" );
41constexpr OUStringLiteral gsInitialisationVectorProperty ( u"InitialisationVector" );
42constexpr OUStringLiteral gsSizeProperty ( u"Size" );
43constexpr OUStringLiteral gsDigestProperty ( u"Digest" );
44constexpr OUStringLiteral gsEncryptionAlgProperty ( u"EncryptionAlgorithm" );
45constexpr OUStringLiteral gsStartKeyAlgProperty ( u"StartKeyAlgorithm" );
46constexpr OUStringLiteral gsDigestAlgProperty ( u"DigestAlgorithm" );
47
49 : bIgnoreEncryptData ( false )
50 , bPgpEncryption ( false )
51 , nDerivedKeySize( 0 )
52 , rManVector ( rNewManVector )
53{
54 aStack.reserve( 10 );
55}
56
58{
59}
60
62{
63}
64
66{
67}
68
70{
72
74 aSequence[PKG_MNFST_FULLPATH].Value <<= rConvertedAttribs[ATTRIBUTE_FULL_PATH];
76 aSequence[PKG_MNFST_MEDIATYPE].Value <<= rConvertedAttribs[ATTRIBUTE_MEDIA_TYPE];
77
78 OUString sVersion = rConvertedAttribs[ATTRIBUTE_VERSION];
79 if ( sVersion.getLength() ) {
81 aSequence[PKG_MNFST_VERSION].Value <<= sVersion;
82 }
83
84 OUString sSize = rConvertedAttribs[ATTRIBUTE_SIZE];
85 if ( sSize.getLength() ) {
86 sal_Int64 nSize = sSize.toInt64();
88 aSequence[PKG_MNFST_UCOMPSIZE].Value <<= nSize;
89 }
90}
91
93{
94 aKeyInfoSequence.clear();
95 aKeyInfoSequence.resize(3);
96}
97
99 const OUString& rAlgoAttrName)
100{
101 OUString aString = rConvertedAttribs[rAlgoAttrName];
102 if ( aKeyInfoSequence.size() != 3
103 || aString != "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" )
104 {
105 bIgnoreEncryptData = true;
106 }
107}
108
110{
111 if ( aKeyInfoSequence.size() == 3 )
112 {
113 aKeyInfoSequence[2].Name = "CipherValue";
114 uno::Sequence < sal_Int8 > aDecodeBuffer;
116 aKeyInfoSequence[2].Value <<= aDecodeBuffer;
117 aCurrentCharacters.setLength(0); // consumed
118 }
119 else
120 bIgnoreEncryptData = true;
121}
122
124{
125 if ( aKeyInfoSequence.size() == 3 )
126 {
127 aKeyInfoSequence[0].Name = "KeyId";
128 uno::Sequence < sal_Int8 > aDecodeBuffer;
130 aKeyInfoSequence[0].Value <<= aDecodeBuffer;
131 aCurrentCharacters.setLength(0); // consumed
132 }
133 else
134 bIgnoreEncryptData = true;
135}
136
138{
139 if ( aKeyInfoSequence.size() == 3 )
140 {
141 aKeyInfoSequence[1].Name = "KeyPacket";
142 uno::Sequence < sal_Int8 > aDecodeBuffer;
144 aKeyInfoSequence[1].Value <<= aDecodeBuffer;
145 aCurrentCharacters.setLength(0); // consumed
146 }
147 else
148 bIgnoreEncryptData = true;
149}
150
152{
153 // If this element exists, then this stream is encrypted and we need
154 // to import the initialisation vector, salt and iteration count used
155 nDerivedKeySize = 0;
156 OUString aString = rConvertedAttribs[ATTRIBUTE_CHECKSUM_TYPE];
157 if ( bIgnoreEncryptData )
158 return;
159
160 if ( aString == SHA1_1K_NAME || aString == SHA1_1K_URL ) {
162 aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA1_1K;
163 } else if ( aString == SHA256_1K_URL ) {
165 aSequence[PKG_MNFST_DIGESTALG].Value <<= xml::crypto::DigestID::SHA256_1K;
166 } else
167 bIgnoreEncryptData = true;
168
169 if ( !bIgnoreEncryptData ) {
170 aString = rConvertedAttribs[ATTRIBUTE_CHECKSUM];
171 uno::Sequence < sal_Int8 > aDecodeBuffer;
172 ::comphelper::Base64::decode(aDecodeBuffer, aString);
174 aSequence[PKG_MNFST_DIGEST].Value <<= aDecodeBuffer;
175 }
176}
177
179{
180 if ( bIgnoreEncryptData )
181 return;
182
183 OUString aString = rConvertedAttribs[ATTRIBUTE_ALGORITHM_NAME];
184 if ( aString == BLOWFISH_NAME || aString == BLOWFISH_URL ) {
186 aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8;
187 } else if ( aString == AES256_URL ) {
189 aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
190 OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 32, "Unexpected derived key length!" );
191 nDerivedKeySize = 32;
192 } else if ( aString == AES192_URL ) {
194 aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
195 OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 24, "Unexpected derived key length!" );
196 nDerivedKeySize = 24;
197 } else if ( aString == AES128_URL ) {
199 aSequence[PKG_MNFST_ENCALG].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
200 OSL_ENSURE( !nDerivedKeySize || nDerivedKeySize == 16, "Unexpected derived key length!" );
201 nDerivedKeySize = 16;
202 } else
203 bIgnoreEncryptData = true;
204
205 if ( !bIgnoreEncryptData ) {
206 aString = rConvertedAttribs[ATTRIBUTE_INITIALISATION_VECTOR];
207 uno::Sequence < sal_Int8 > aDecodeBuffer;
208 ::comphelper::Base64::decode(aDecodeBuffer, aString);
210 aSequence[PKG_MNFST_INIVECTOR].Value <<= aDecodeBuffer;
211 }
212}
213
215{
216 if ( bIgnoreEncryptData )
217 return;
218
219 OUString aString = rConvertedAttribs[ATTRIBUTE_KEY_DERIVATION_NAME];
220 if ( aString == PBKDF2_NAME || aString == PBKDF2_URL ) {
221 aString = rConvertedAttribs[ATTRIBUTE_SALT];
222 uno::Sequence < sal_Int8 > aDecodeBuffer;
223 ::comphelper::Base64::decode(aDecodeBuffer, aString);
225 aSequence[PKG_MNFST_SALT].Value <<= aDecodeBuffer;
226
227 aString = rConvertedAttribs[ATTRIBUTE_ITERATION_COUNT];
229 aSequence[PKG_MNFST_ITERATION].Value <<= aString.toInt32();
230
231 aString = rConvertedAttribs[ATTRIBUTE_KEY_SIZE];
232 if ( aString.getLength() ) {
233 sal_Int32 nKey = aString.toInt32();
234 OSL_ENSURE( !nDerivedKeySize || nKey == nDerivedKeySize , "Provided derived key length differs from the expected one!" );
235 nDerivedKeySize = nKey;
236 } else if ( !nDerivedKeySize )
237 nDerivedKeySize = 16;
238 else if ( nDerivedKeySize != 16 )
239 OSL_ENSURE( false, "Default derived key length differs from the expected one!" );
240
243 } else if ( bPgpEncryption ) {
244 if ( aString != "PGP" )
245 bIgnoreEncryptData = true;
246 } else
247 bIgnoreEncryptData = true;
248}
249
251{
252 OUString aString = rConvertedAttribs[ATTRIBUTE_START_KEY_GENERATION_NAME];
253 if (aString == SHA256_URL || aString == SHA256_URL_ODF12) {
255 aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA256;
256 } else if ( aString == SHA1_NAME || aString == SHA1_URL ) {
258 aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA1;
259 } else
260 bIgnoreEncryptData = true;
261}
262
263void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs )
264{
265 StringHashMap aConvertedAttribs;
266 OUString aConvertedName = PushNameAndNamespaces( aName, xAttribs, aConvertedAttribs );
267
268 size_t nLevel = aStack.size();
269
270 assert(nLevel >= 1);
271
272 switch (nLevel) {
273 case 1: {
274 if (aConvertedName != ELEMENT_MANIFEST) //manifest:manifest
275 aStack.back().m_bValid = false;
276 break;
277 }
278 case 2: {
279 if (aConvertedName == ELEMENT_FILE_ENTRY) //manifest:file-entry
280 doFileEntry(aConvertedAttribs);
281 else if (aConvertedName == ELEMENT_MANIFEST_KEYINFO) //loext:keyinfo
282 ;
283 else if (aConvertedName == ELEMENT_ENCRYPTEDKEY13) //manifest:encrypted-key
284 doEncryptedKey(aConvertedAttribs);
285 else
286 aStack.back().m_bValid = false;
287 break;
288 }
289 case 3: {
290 ManifestStack::reverse_iterator aIter = aStack.rbegin();
291 ++aIter;
292
293 if (!aIter->m_bValid)
294 aStack.back().m_bValid = false;
295 else if (aConvertedName == ELEMENT_ENCRYPTION_DATA) //manifest:encryption-data
296 doEncryptionData(aConvertedAttribs);
297 else if (aConvertedName == ELEMENT_ENCRYPTEDKEY) //loext:encrypted-key
298 doEncryptedKey(aConvertedAttribs);
299 else if (aConvertedName == ELEMENT_ENCRYPTIONMETHOD13) //manifest:encryption-method
300 doEncryptionMethod(aConvertedAttribs, ATTRIBUTE_ALGORITHM13);
301 else if (aConvertedName == ELEMENT_MANIFEST13_KEYINFO) //manifest:keyinfo
302 ;
303 else if (aConvertedName == ELEMENT_CIPHERDATA13) //manifest:CipherData
304 ;
305 else
306 aStack.back().m_bValid = false;
307 break;
308 }
309 case 4: {
310 ManifestStack::reverse_iterator aIter = aStack.rbegin();
311 ++aIter;
312
313 if (!aIter->m_bValid)
314 aStack.back().m_bValid = false;
315 else if (aConvertedName == ELEMENT_ALGORITHM) //manifest:algorithm,
316 doAlgorithm(aConvertedAttribs);
317 else if (aConvertedName == ELEMENT_KEY_DERIVATION) //manifest:key-derivation,
318 doKeyDerivation(aConvertedAttribs);
319 else if (aConvertedName == ELEMENT_START_KEY_GENERATION) //manifest:start-key-generation
320 doStartKeyAlg(aConvertedAttribs);
321 else if (aConvertedName == ELEMENT_ENCRYPTIONMETHOD) //loext:encryption-method
322 doEncryptionMethod(aConvertedAttribs, ATTRIBUTE_ALGORITHM);
323 else if (aConvertedName == ELEMENT_ENCRYPTED_KEYINFO) //loext:KeyInfo
324 ;
325 else if (aConvertedName == ELEMENT_CIPHERDATA) //loext:CipherData
326 ;
327 else if (aConvertedName == ELEMENT_PGPDATA13) //manifest:PGPData
328 ;
329 else if (aConvertedName == ELEMENT_CIPHERVALUE13) //manifest:CipherValue
330 // ciphervalue action happens on endElement
332 else
333 aStack.back().m_bValid = false;
334 break;
335 }
336 case 5: {
337 ManifestStack::reverse_iterator aIter = aStack.rbegin();
338 ++aIter;
339
340 if (!aIter->m_bValid)
341 aStack.back().m_bValid = false;
342 else if (aConvertedName == ELEMENT_PGPDATA) //loext:PGPData
343 ;
344 else if (aConvertedName == ELEMENT_CIPHERVALUE) //loext:CipherValue
345 // ciphervalue action happens on endElement
347 else if (aConvertedName == ELEMENT_PGPKEYID13) //manifest:PGPKeyID
348 // ciphervalue action happens on endElement
350 else if (aConvertedName == ELEMENT_PGPKEYPACKET13) //manifest:PGPKeyPacket
351 // ciphervalue action happens on endElement
353 else
354 aStack.back().m_bValid = false;
355 break;
356 }
357 case 6: {
358 ManifestStack::reverse_iterator aIter = aStack.rbegin();
359 ++aIter;
360
361 if (!aIter->m_bValid)
362 aStack.back().m_bValid = false;
363 else if (aConvertedName == ELEMENT_PGPKEYID) //loext:PGPKeyID
364 // ciphervalue action happens on endElement
366 else if (aConvertedName == ELEMENT_PGPKEYPACKET) //loext:PGPKeyPacket
367 // ciphervalue action happens on endElement
369 else
370 aStack.back().m_bValid = false;
371 break;
372 }
373 default:
374 aStack.back().m_bValid = false;
375 break;
376 }
377}
378
379namespace
380{
381bool isEmpty(const css::beans::PropertyValue &rProp)
382{
383 return rProp.Name.isEmpty();
384}
385}
386
387void SAL_CALL ManifestImport::endElement( const OUString& aName )
388{
389 size_t nLevel = aStack.size();
390
391 assert(nLevel >= 1);
392
393 OUString aConvertedName = ConvertName( aName );
394 if ( aStack.empty() || aStack.rbegin()->m_aConvertedName != aConvertedName )
395 return;
396
397 if ( aConvertedName == ELEMENT_FILE_ENTRY && aStack.back().m_bValid ) {
398 // root folder gets KeyInfo entry if any, for PGP encryption
399 if (!bIgnoreEncryptData && !aKeys.empty() && aSequence[PKG_MNFST_FULLPATH].Value.get<OUString>() == "/" )
400 {
401 aSequence[PKG_SIZE_NOENCR_MNFST].Name = "KeyInfo";
403 }
404 aSequence.erase(std::remove_if(aSequence.begin(), aSequence.end(),
405 isEmpty), aSequence.end());
406
407 bIgnoreEncryptData = false;
409
410 aSequence.clear();
411 }
412 else if ( (aConvertedName == ELEMENT_ENCRYPTEDKEY
413 || aConvertedName == ELEMENT_ENCRYPTEDKEY13)
414 && aStack.back().m_bValid ) {
415 if ( !bIgnoreEncryptData )
416 {
418 bPgpEncryption = true;
419 }
420 aKeyInfoSequence.clear();
421 }
422
423 // end element handling for elements with cdata
424 switch (nLevel) {
425 case 4: {
426 if (aConvertedName == ELEMENT_CIPHERVALUE13) //manifest:CipherValue
428 else
429 aStack.back().m_bValid = false;
430 break;
431 }
432 case 5: {
433 if (aConvertedName == ELEMENT_CIPHERVALUE) //loext:CipherValue
435 else if (aConvertedName == ELEMENT_PGPKEYID13) //manifest:PGPKeyID
437 else if (aConvertedName == ELEMENT_PGPKEYPACKET13) //manifest:PGPKeyPacket
439 else
440 aStack.back().m_bValid = false;
441 break;
442 }
443 case 6: {
444 if (aConvertedName == ELEMENT_PGPKEYID) //loext:PGPKeyID
446 else if (aConvertedName == ELEMENT_PGPKEYPACKET) //loext:PGPKeyPacket
448 else
449 aStack.back().m_bValid = false;
450 break;
451 }
452 }
453
454 aStack.pop_back();
455}
456
457void SAL_CALL ManifestImport::characters( const OUString& aChars )
458{
459 aCurrentCharacters.append(aChars);
460}
461
462void SAL_CALL ManifestImport::ignorableWhitespace( const OUString& /*aWhitespaces*/ )
463{
464}
465
466void SAL_CALL ManifestImport::processingInstruction( const OUString& /*aTarget*/, const OUString& /*aData*/ )
467{
468}
469
470void SAL_CALL ManifestImport::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& /*xLocator*/ )
471{
472}
473
474OUString ManifestImport::PushNameAndNamespaces( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs, StringHashMap& o_aConvertedAttribs )
475{
476 StringHashMap aNamespaces;
477 ::std::vector< ::std::pair< OUString, OUString > > aAttribsStrs;
478
479 if ( xAttribs.is() ) {
480 sal_Int16 nAttrCount = xAttribs.is() ? xAttribs->getLength() : 0;
481 aAttribsStrs.reserve( nAttrCount );
482
483 for( sal_Int16 nInd = 0; nInd < nAttrCount; nInd++ ) {
484 OUString aAttrName = xAttribs->getNameByIndex( nInd );
485 OUString aAttrValue = xAttribs->getValueByIndex( nInd );
486 if ( aAttrName.getLength() >= 5
487 && aAttrName.startsWith("xmlns")
488 && ( aAttrName.getLength() == 5 || aAttrName[5] == ':' ) ) {
489 // this is a namespace declaration
490 OUString aNsName( ( aAttrName.getLength() == 5 ) ? OUString() : aAttrName.copy( 6 ) );
491 aNamespaces[aNsName] = aAttrValue;
492 } else {
493 // this is no namespace declaration
494 aAttribsStrs.emplace_back( aAttrName, aAttrValue );
495 }
496 }
497 }
498
499 OUString aConvertedName = ConvertNameWithNamespace( aName, aNamespaces );
500 if ( !aConvertedName.getLength() )
501 aConvertedName = ConvertName( aName );
502
503 aStack.emplace_back( aConvertedName, std::move(aNamespaces) );
504
505 for (const std::pair<OUString,OUString> & rAttribsStr : aAttribsStrs) {
506 // convert the attribute names on filling
507 o_aConvertedAttribs[ConvertName( rAttribsStr.first )] = rAttribsStr.second;
508 }
509
510 return aConvertedName;
511}
512
513OUString ManifestImport::ConvertNameWithNamespace( const OUString& aName, const StringHashMap& aNamespaces )
514{
515 OUString aNsAlias;
516 OUString aPureName = aName;
517
518 sal_Int32 nInd = aName.indexOf( ':' );
519 if ( nInd != -1 && nInd < aName.getLength() ) {
520 aNsAlias = aName.copy( 0, nInd );
521 aPureName = aName.copy( nInd + 1 );
522 }
523
524 OUString aResult;
525
526 StringHashMap::const_iterator aIter = aNamespaces.find( aNsAlias );
527 if ( aIter != aNamespaces.end()
528 && ( aIter->second == MANIFEST_NAMESPACE || aIter->second == MANIFEST_OASIS_NAMESPACE ) ) {
529 // no check for manifest.xml consistency currently since the old versions have supported inconsistent documents as well
530 aResult = MANIFEST_NSPREFIX + aPureName;
531 }
532
533 return aResult;
534}
535
536OUString ManifestImport::ConvertName( const OUString& aName )
537{
538 OUString aConvertedName;
539 for ( ManifestStack::reverse_iterator aIter = aStack.rbegin(); !aConvertedName.getLength() && aIter != aStack.rend(); ++aIter ) {
540 if ( !aIter->m_aNamespaces.empty() )
541 aConvertedName = ConvertNameWithNamespace( aName, aIter->m_aNamespaces );
542 }
543
544 if ( !aConvertedName.getLength() )
545 aConvertedName = aName;
546
547 return aConvertedName;
548}
549
550/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral MANIFEST_OASIS_NAMESPACE
constexpr OUStringLiteral SHA1_URL
constexpr OUStringLiteral ELEMENT_ENCRYPTIONMETHOD
constexpr OUStringLiteral SHA256_1K_URL
constexpr OUStringLiteral ATTRIBUTE_MEDIA_TYPE
constexpr OUStringLiteral ATTRIBUTE_INITIALISATION_VECTOR
constexpr OUStringLiteral ELEMENT_PGPDATA
constexpr OUStringLiteral SHA1_1K_NAME
constexpr OUStringLiteral ELEMENT_MANIFEST_KEYINFO
constexpr OUStringLiteral ATTRIBUTE_ALGORITHM_NAME
constexpr OUStringLiteral SHA1_NAME
constexpr OUStringLiteral ATTRIBUTE_VERSION
constexpr OUStringLiteral ELEMENT_MANIFEST13_KEYINFO
constexpr OUStringLiteral ELEMENT_PGPKEYPACKET13
constexpr OUStringLiteral SHA1_1K_URL
constexpr OUStringLiteral ELEMENT_FILE_ENTRY
constexpr OUStringLiteral ATTRIBUTE_CHECKSUM_TYPE
constexpr OUStringLiteral ELEMENT_ENCRYPTEDKEY13
constexpr OUStringLiteral ATTRIBUTE_KEY_DERIVATION_NAME
constexpr OUStringLiteral ELEMENT_ENCRYPTION_DATA
constexpr OUStringLiteral SHA256_URL
constexpr OUStringLiteral ELEMENT_CIPHERDATA
constexpr OUStringLiteral BLOWFISH_NAME
constexpr OUStringLiteral ATTRIBUTE_ITERATION_COUNT
constexpr OUStringLiteral ATTRIBUTE_FULL_PATH
constexpr OUStringLiteral ATTRIBUTE_SIZE
constexpr OUStringLiteral ELEMENT_ENCRYPTIONMETHOD13
constexpr OUStringLiteral ELEMENT_PGPDATA13
constexpr OUStringLiteral PBKDF2_NAME
constexpr OUStringLiteral ELEMENT_KEY_DERIVATION
constexpr OUStringLiteral ELEMENT_PGPKEYPACKET
constexpr OUStringLiteral ELEMENT_START_KEY_GENERATION
constexpr OUStringLiteral AES256_URL
constexpr OUStringLiteral ELEMENT_ENCRYPTED_KEYINFO
constexpr OUStringLiteral BLOWFISH_URL
constexpr OUStringLiteral SHA256_URL_ODF12
OFFICE-3708: wrong URL cited in ODF 1.2 and used since OOo 3.4 beta.
constexpr OUStringLiteral ATTRIBUTE_SALT
constexpr OUStringLiteral ATTRIBUTE_ALGORITHM
constexpr OUStringLiteral ELEMENT_ENCRYPTEDKEY
constexpr OUStringLiteral MANIFEST_NAMESPACE
constexpr OUStringLiteral AES128_URL
constexpr OUStringLiteral ATTRIBUTE_CHECKSUM
constexpr OUStringLiteral ELEMENT_CIPHERVALUE13
constexpr OUStringLiteral AES192_URL
constexpr OUStringLiteral ATTRIBUTE_ALGORITHM13
constexpr OUStringLiteral MANIFEST_NSPREFIX
constexpr OUStringLiteral ATTRIBUTE_START_KEY_GENERATION_NAME
constexpr OUStringLiteral ELEMENT_PGPKEYID13
constexpr OUStringLiteral PBKDF2_URL
constexpr OUStringLiteral ATTRIBUTE_KEY_SIZE
constexpr OUStringLiteral ELEMENT_CIPHERDATA13
constexpr OUStringLiteral ELEMENT_MANIFEST
constexpr OUStringLiteral ELEMENT_ALGORITHM
constexpr OUStringLiteral ELEMENT_PGPKEYID
constexpr OUStringLiteral ELEMENT_CIPHERVALUE
constexpr OUStringLiteral gsMediaTypeProperty(u"MediaType")
constexpr OUStringLiteral gsVersionProperty(u"Version")
constexpr OUStringLiteral gsInitialisationVectorProperty(u"InitialisationVector")
constexpr OUStringLiteral gsFullPathProperty(u"FullPath")
constexpr OUStringLiteral gsSaltProperty(u"Salt")
constexpr OUStringLiteral gsDigestProperty(u"Digest")
constexpr OUStringLiteral gsDerivedKeySizeProperty(u"DerivedKeySize")
constexpr OUStringLiteral gsStartKeyAlgProperty(u"StartKeyAlgorithm")
constexpr OUStringLiteral gsSizeProperty(u"Size")
constexpr OUStringLiteral gsIterationCountProperty(u"IterationCount")
constexpr OUStringLiteral gsDigestAlgProperty(u"DigestAlgorithm")
constexpr OUStringLiteral gsEncryptionAlgProperty(u"EncryptionAlgorithm")
#define PKG_MNFST_SALT
#define PKG_MNFST_DERKEYSIZE
#define PKG_MNFST_DIGEST
#define PKG_MNFST_DIGESTALG
#define PKG_MNFST_UCOMPSIZE
#define PKG_SIZE_NOENCR_MNFST
#define PKG_MNFST_ITERATION
#define PKG_MNFST_MEDIATYPE
#define PKG_MNFST_STARTALG
#define PKG_MNFST_ENCALG
#define PKG_MNFST_VERSION
#define PKG_SIZE_ENCR_MNFST
#define PKG_MNFST_FULLPATH
#define PKG_MNFST_INIVECTOR
virtual void SAL_CALL startElement(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
ManifestStack aStack
virtual ~ManifestImport() override
void doStartKeyAlg(StringHashMap &rConvertedAttribs)
void doFileEntry(StringHashMap &rConvertedAttribs)
std::vector< css::beans::PropertyValue > aSequence
OUString ConvertName(const OUString &aName)
virtual void SAL_CALL ignorableWhitespace(const OUString &aWhitespaces) override
sal_Int32 nDerivedKeySize
std::vector< css::beans::NamedValue > aKeyInfoSequence
virtual void SAL_CALL endElement(const OUString &aName) override
void doEncryptedKeyPacket()
void doEncryptionData(StringHashMap &rConvertedAttribs)
virtual void SAL_CALL processingInstruction(const OUString &aTarget, const OUString &aData) override
virtual void SAL_CALL characters(const OUString &aChars) override
ManifestImport(std::vector< css::uno::Sequence< css::beans::PropertyValue > > &rNewVector)
OUStringBuffer aCurrentCharacters
void doKeyDerivation(StringHashMap &rConvertedAttribs)
static OUString ConvertNameWithNamespace(const OUString &aName, const StringHashMap &aNamespaces)
virtual void SAL_CALL startDocument() override
::std::vector< css::uno::Sequence< css::beans::PropertyValue > > & rManVector
void doEncryptionMethod(StringHashMap &, const OUString &)
virtual void SAL_CALL endDocument() override
void doAlgorithm(StringHashMap &rConvertedAttribs)
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &xLocator) override
OUString PushNameAndNamespaces(const OUString &aName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs, StringHashMap &o_aConvertedAttribs)
std::vector< css::uno::Sequence< css::beans::NamedValue > > aKeys
void doEncryptedKey(StringHashMap &)
void doEncryptedCipherValue()
static void decode(css::uno::Sequence< sal_Int8 > &aPass, std::u16string_view sBuffer)
std::unordered_map< OUString, OUString > StringHashMap
OUString aName
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)