summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 12:19:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-05 14:25:02 +0100
commitddd43218e9900536381733735adf8681d345e775 (patch)
tree5bb211e63d9b739d20eb248f1ab9f0fb481e118d /package
parent9c036b1d3db253a1fd43ce76ce1d919e2029af59 (diff)
drop sax::tools::*base64 methods
and use the underlying comphelper methods rather. This is so that I can break the dependency that tools has on sax, and can add methods that make sax depend on tools. Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5 Reviewed-on: https://gerrit.libreoffice.org/50767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/source/manifest/ManifestExport.cxx13
-rw-r--r--package/source/manifest/ManifestImport.cxx13
2 files changed, 14 insertions, 12 deletions
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index a43eafdbd7be..46ace993b581 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -32,6 +32,7 @@
#include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
+#include <comphelper/base64.hxx>
#include <comphelper/documentconstants.hxx>
#include <comphelper/attributelist.hxx>
@@ -281,7 +282,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sPgpKeyIDElement, nullptr );
- ::sax::Converter::encodeBase64(aBuffer, aPgpKeyID);
+ ::comphelper::Base64::encode(aBuffer, aPgpKeyID);
xHandler->characters( aBuffer.makeStringAndClear() );
xHandler->endElement( sPgpKeyIDElement );
xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -290,7 +291,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
if (aPgpKeyPacket.hasElements())
{
xHandler->startElement( sPGPKeyPacketElement, nullptr );
- ::sax::Converter::encodeBase64(aBuffer, aPgpKeyPacket);
+ ::comphelper::Base64::encode(aBuffer, aPgpKeyPacket);
xHandler->characters( aBuffer.makeStringAndClear() );
xHandler->endElement( sPGPKeyPacketElement );
xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -306,7 +307,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sCipherValueElement, nullptr );
- ::sax::Converter::encodeBase64(aBuffer, aCipherValue);
+ ::comphelper::Base64::encode(aBuffer, aCipherValue);
xHandler->characters( aBuffer.makeStringAndClear() );
xHandler->endElement( sCipherValueElement );
xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -402,7 +403,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
pNewAttrList->AddAttribute ( sChecksumTypeAttribute, sCdataAttribute, sChecksumType );
*pDigest >>= aSequence;
- ::sax::Converter::encodeBase64(aBuffer, aSequence);
+ ::comphelper::Base64::encode(aBuffer, aSequence);
pNewAttrList->AddAttribute ( sChecksumAttribute, sCdataAttribute, aBuffer.makeStringAndClear() );
xHandler->startElement( sEncryptionDataElement , xNewAttrList);
@@ -435,7 +436,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
pNewAttrList->AddAttribute ( sAlgorithmNameAttribute, sCdataAttribute, sEncAlgName );
*pVector >>= aSequence;
- ::sax::Converter::encodeBase64(aBuffer, aSequence);
+ ::comphelper::Base64::encode(aBuffer, aSequence);
pNewAttrList->AddAttribute ( sInitialisationVectorAttribute, sCdataAttribute, aBuffer.makeStringAndClear() );
xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -474,7 +475,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
pNewAttrList->AddAttribute ( sIterationCountAttribute, sCdataAttribute, aBuffer.makeStringAndClear() );
*pSalt >>= aSequence;
- ::sax::Converter::encodeBase64(aBuffer, aSequence);
+ ::comphelper::Base64::encode(aBuffer, aSequence);
pNewAttrList->AddAttribute ( sSaltAttribute, sCdataAttribute, aBuffer.makeStringAndClear() );
}
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 98a9d61128b5..916db4c3c694 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -25,6 +25,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 <comphelper/base64.hxx>
#include <comphelper/sequence.hxx>
using namespace com::sun::star::uno;
@@ -176,7 +177,7 @@ void ManifestImport::doEncryptedCipherValue()
{
aKeyInfoSequence[2].Name = "CipherValue";
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aCurrentCharacters);
+ ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters);
aKeyInfoSequence[2].Value <<= aDecodeBuffer;
aCurrentCharacters = ""; // consumed
}
@@ -190,7 +191,7 @@ void ManifestImport::doEncryptedKeyId()
{
aKeyInfoSequence[0].Name = "KeyId";
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aCurrentCharacters);
+ ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters);
aKeyInfoSequence[0].Value <<= aDecodeBuffer;
aCurrentCharacters = ""; // consumed
}
@@ -204,7 +205,7 @@ void ManifestImport::doEncryptedKeyPacket()
{
aKeyInfoSequence[1].Name = "KeyPacket";
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aCurrentCharacters);
+ ::comphelper::Base64::decode(aDecodeBuffer, aCurrentCharacters);
aKeyInfoSequence[1].Value <<= aDecodeBuffer;
aCurrentCharacters = ""; // consumed
}
@@ -231,7 +232,7 @@ void ManifestImport::doEncryptionData(StringHashMap &rConvertedAttribs)
if ( !bIgnoreEncryptData ) {
aString = rConvertedAttribs[sChecksumAttribute];
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
+ ::comphelper::Base64::decode(aDecodeBuffer, aString);
aSequence[PKG_MNFST_DIGEST].Name = sDigestProperty;
aSequence[PKG_MNFST_DIGEST].Value <<= aDecodeBuffer;
}
@@ -266,7 +267,7 @@ void ManifestImport::doAlgorithm(StringHashMap &rConvertedAttribs)
if ( !bIgnoreEncryptData ) {
aString = rConvertedAttribs[sInitialisationVectorAttribute];
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
+ ::comphelper::Base64::decode(aDecodeBuffer, aString);
aSequence[PKG_MNFST_INIVECTOR].Name = sInitialisationVectorProperty;
aSequence[PKG_MNFST_INIVECTOR].Value <<= aDecodeBuffer;
}
@@ -280,7 +281,7 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs)
if ( aString == sPBKDF2_Name || aString == sPBKDF2_URL ) {
aString = rConvertedAttribs[sSaltAttribute];
uno::Sequence < sal_Int8 > aDecodeBuffer;
- ::sax::Converter::decodeBase64(aDecodeBuffer, aString);
+ ::comphelper::Base64::decode(aDecodeBuffer, aString);
aSequence[PKG_MNFST_SALT].Name = sSaltProperty;
aSequence[PKG_MNFST_SALT].Value <<= aDecodeBuffer;