diff options
author | Martin Gallwey <mtg@openoffice.org> | 2001-09-05 18:23:48 +0000 |
---|---|---|
committer | Martin Gallwey <mtg@openoffice.org> | 2001-09-05 18:23:48 +0000 |
commit | ae2ba0d8d9d924b0c031de2d33f5244f086146cd (patch) | |
tree | 505ace8e1ce1582a2023212a4777f45de99de52d /package/source/manifest | |
parent | 2b0c30410b27d0d3d3ed474d43eb11a3c8ae60b1 (diff) |
#90699# import MD5 of unencrypted stream
Diffstat (limited to 'package/source/manifest')
-rw-r--r-- | package/source/manifest/ManifestImport.cxx | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index 82a019b7ccf7..c0b9fda331f9 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ManifestImport.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mtg $ $Date: 2001-05-17 13:03:42 $ + * last change: $Author: mtg $ $Date: 2001-09-05 19:23:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,15 +85,17 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV , sAlgorithmElement ( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_ALGORITHM ) ) , sKeyDerivationElement( RTL_CONSTASCII_USTRINGPARAM ( ELEMENT_KEY_DERIVATION ) ) -, sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ) -, sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ) -, sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ) -, sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ) -, sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ) +, sCdataAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CDATA ) ) +, sMediaTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_MEDIA_TYPE ) ) +, sFullPathAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_FULL_PATH ) ) +, sSizeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SIZE ) ) +, sSaltAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_SALT ) ) , sInitialisationVectorAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_INITIALISATION_VECTOR ) ) -, sIterationCountAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ITERATION_COUNT ) ) -, sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ) +, sIterationCountAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ITERATION_COUNT ) ) +, sAlgorithmNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_ALGORITHM_NAME ) ) , sKeyDerivationNameAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_KEY_DERIVATION_NAME ) ) +, sChecksumTypeAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM_TYPE ) ) +, sChecksumAttribute ( RTL_CONSTASCII_USTRINGPARAM ( ATTRIBUTE_CHECKSUM ) ) , sFullPathProperty ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ) , sMediaTypeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "MediaType" ) ) @@ -101,10 +103,12 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV , sSaltProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Salt" ) ) , sInitialisationVectorProperty ( RTL_CONSTASCII_USTRINGPARAM ( "InitialisationVector" ) ) , sSizeProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Size" ) ) +, sDigestProperty ( RTL_CONSTASCII_USTRINGPARAM ( "Digest" ) ) -, sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ) -, sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ) -, sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ) +, sWhiteSpace ( RTL_CONSTASCII_USTRINGPARAM ( " " ) ) +, sBlowfish ( RTL_CONSTASCII_USTRINGPARAM ( "Blowfish CFB" ) ) +, sPBKDF2 ( RTL_CONSTASCII_USTRINGPARAM ( "PBKDF2" ) ) +, sMD5 ( RTL_CONSTASCII_USTRINGPARAM ( "MD5" ) ) { } ManifestImport::~ManifestImport (void ) @@ -124,11 +128,13 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re if (aName == sFileEntryElement) { aStack.push( e_FileEntry ); - aSequence.realloc ( 6 ); // Can have at most 6 entries (currently, will realloc to actual number in endElement) - aSequence[nNumProperty].Name = sMediaTypeProperty; - aSequence[nNumProperty++].Value <<= xAttribs->getValueByName( sMediaTypeAttribute ); + aSequence.realloc ( 7 ); // Can have at most 6 entries (currently, will realloc to actual number in endElement) + + // Put full-path property first for MBA aSequence[nNumProperty].Name = sFullPathProperty; aSequence[nNumProperty++].Value <<= xAttribs->getValueByName( sFullPathAttribute ); + aSequence[nNumProperty].Name = sMediaTypeProperty; + aSequence[nNumProperty++].Value <<= xAttribs->getValueByName( sMediaTypeAttribute ); OUString sSize = xAttribs->getValueByName ( sSizeAttribute ); if (sSize.getLength()) @@ -146,6 +152,15 @@ void SAL_CALL ManifestImport::startElement( const OUString& aName, const uno::Re // If this element exists, then this stream is encrypted and we need // to store the initialisation vector, salt and iteration count used aStack.push (e_EncryptionData ); + OUString aString = xAttribs->getValueByName ( sChecksumTypeAttribute ); + if (aString == sMD5 && !bIgnoreEncryptData) + { + aString = xAttribs->getValueByName ( sChecksumAttribute ); + Sequence < sal_uInt8 > aDecodeBuffer; + Base64Codec::decodeBase64 (aDecodeBuffer, aString); + aSequence[nNumProperty].Name = sDigestProperty; + aSequence[nNumProperty++].Value <<= aDecodeBuffer; + } } else if (aStack.top() == e_EncryptionData && aName == sAlgorithmElement) { |