summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx120
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx39
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx26
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx45
4 files changed, 107 insertions, 123 deletions
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index ab108d13c224..cac30006b6a7 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -41,10 +41,6 @@
#include "ooxmlsecexporter.hxx"
#include <xmlsignaturehelper2.hxx>
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
using namespace com::sun::star;
namespace
@@ -53,11 +49,11 @@ OUString getDigestURI(sal_Int32 nID)
{
switch( nID )
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
return ALGO_XMLDSIGSHA1;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
return ALGO_XMLDSIGSHA256;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
return ALGO_XMLDSIGSHA512;
default:
return ALGO_XMLDSIGSHA1;
@@ -71,13 +67,13 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
{
switch (nDigestID)
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
aRet = ALGO_ECDSASHA1;
break;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
aRet = ALGO_ECDSASHA256;
break;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
aRet = ALGO_ECDSASHA512;
break;
default:
@@ -90,11 +86,11 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
switch (nDigestID)
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
return ALGO_RSASHA1;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
return ALGO_RSASHA256;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
return ALGO_RSASHA512;
default:
return ALGO_RSASHA1;
@@ -102,7 +98,7 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
}
}
-XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx )
+XSecController::XSecController( const css::uno::Reference<css::uno::XComponentContext>& rxCtx )
: mxCtx(rxCtx)
, m_nNextSecurityId(1)
, m_bIsPreviousNodeInitializable(false)
@@ -177,15 +173,15 @@ void XSecController::createXSecComponent( )
m_xXMLDocumentWrapper = nullptr;
m_xSAXEventKeeper = nullptr;
- cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ css::uno::Reference< css::lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
#if HAVE_FEATURE_GPGME
- uno::Reference< lang::XServiceInfo > xServiceInfo( m_xSecurityContext, cssu::UNO_QUERY );
+ uno::Reference< lang::XServiceInfo > xServiceInfo( m_xSecurityContext, css::uno::UNO_QUERY );
if (xServiceInfo->getImplementationName() == "com.sun.star.xml.security.gpg.XMLSecurityContext_GpgImpl")
m_xXMLSignature.set(new XMLSignature_GpgImpl());
else // xmlsec or mscrypt
#endif
- m_xXMLSignature.set(xMCF->createInstanceWithContext("com.sun.star.xml.crypto.XMLSignature", mxCtx), cssu::UNO_QUERY);
+ m_xXMLSignature.set(xMCF->createInstanceWithContext("com.sun.star.xml.crypto.XMLSignature", mxCtx), css::uno::UNO_QUERY);
bool bSuccess = m_xXMLSignature.is();
if ( bSuccess )
@@ -205,11 +201,11 @@ void XSecController::createXSecComponent( )
* SAXEventKeeper created successfully.
*/
{
- cssu::Sequence <cssu::Any> arg(1);
+ css::uno::Sequence <css::uno::Any> arg(1);
arg[0] <<= uno::Reference<xml::wrapper::XXMLDocumentWrapper>(m_xXMLDocumentWrapper.get());
m_xSAXEventKeeper->initialize(arg);
- cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >
+ css::uno::Reference< css::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >
xStatusChangeListener = this;
m_xSAXEventKeeper->addSAXEventKeeperStatusChangeListener( xStatusChangeListener );
@@ -272,7 +268,7 @@ bool XSecController::chainOn()
*/
m_xSAXEventKeeper->setNextHandler( nullptr );
- cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), css::uno::UNO_QUERY);
/*
* connects the previous document handler on the SAX chain
@@ -281,17 +277,17 @@ bool XSecController::chainOn()
{
if ( m_bIsPreviousNodeInitializable )
{
- cssu::Reference< cssl::XInitialization > xInitialization
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> aArgs( 1 );
+ css::uno::Sequence<css::uno::Any> aArgs( 1 );
aArgs[0] <<= xSEKHandler;
xInitialization->initialize(aArgs);
}
else
{
- cssu::Reference< cssxs::XParser > xParser
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XParser > xParser
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
xParser->setDocumentHandler( xSEKHandler );
}
}
@@ -327,16 +323,16 @@ void XSecController::chainOff()
{
if ( m_bIsPreviousNodeInitializable )
{
- cssu::Reference< cssl::XInitialization > xInitialization
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> aArgs( 1 );
+ css::uno::Sequence<css::uno::Any> aArgs( 1 );
aArgs[0] <<= uno::Reference<xml::sax::XDocumentHandler>();
xInitialization->initialize(aArgs);
}
else
{
- cssu::Reference< cssxs::XParser > xParser(m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XParser > xParser(m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
xParser->setDocumentHandler(uno::Reference<xml::sax::XDocumentHandler>());
}
}
@@ -393,7 +389,7 @@ void XSecController::initializeSAXChain()
chainOff();
}
-cssu::Reference< css::io::XInputStream >
+css::uno::Reference< css::io::XInputStream >
XSecController::getObjectInputStream( const OUString& objectURL )
/****** XSecController/getObjectInputStream ************************************
*
@@ -410,7 +406,7 @@ cssu::Reference< css::io::XInputStream >
* xInputStream - the XInputStream interface
******************************************************************************/
{
- cssu::Reference< css::io::XInputStream > xObjectInputStream;
+ css::uno::Reference< css::io::XInputStream > xObjectInputStream;
SAL_WARN_IF( !m_xUriBinding.is(), "xmlsecurity.helper", "Need XUriBinding!" );
@@ -430,7 +426,7 @@ sal_Int32 XSecController::getNewSecurityId( )
return nId;
}
-void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBinding, const cssu::Reference< cssxc::XXMLSecurityContext >& xSecurityContext )
+void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBinding, const css::uno::Reference< css::xml::crypto::XXMLSecurityContext >& xSecurityContext )
/****** XSecController/startMission *******************************************
*
* NAME
@@ -456,7 +452,7 @@ void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBi
m_bVerifyCurrentSignature = false;
}
-void XSecController::setSAXChainConnector(const cssu::Reference< cssl::XInitialization >& xInitialization)
+void XSecController::setSAXChainConnector(const css::uno::Reference< css::lang::XInitialization >& xInitialization)
/****** XSecController/setSAXChainConnector ***********************************
*
* NAME
@@ -507,8 +503,8 @@ void XSecController::endMission()
* ResolvedListener only exist when the security components are created.
*/
{
- cssu::Reference< cssxc::sax::XMissionTaker > xMissionTaker
- ( m_vInternalSignatureInformations[i].xReferenceResolvedListener, cssu::UNO_QUERY );
+ css::uno::Reference< css::xml::crypto::sax::XMissionTaker > xMissionTaker
+ ( m_vInternalSignatureInformations[i].xReferenceResolvedListener, css::uno::UNO_QUERY );
/*
* asks the SignatureCreator/SignatureVerifier to release
@@ -567,7 +563,7 @@ void writeUnsignedProperties(
}
void XSecController::exportSignature(
- const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler,
+ const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler,
const SignatureInformation& signatureInfo,
bool bXAdESCompliantIfODF )
/****** XSecController/exportSignature ****************************************
@@ -601,19 +597,19 @@ void XSecController::exportSignature(
signatureInfo.ouSignatureId);
}
- xDocumentHandler->startElement( "Signature", cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ xDocumentHandler->startElement( "Signature", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write SignedInfo element */
xDocumentHandler->startElement(
"SignedInfo",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write CanonicalizationMethod element */
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
"Algorithm",
ALGO_C14N);
- xDocumentHandler->startElement( "CanonicalizationMethod", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "CanonicalizationMethod", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "CanonicalizationMethod" );
/* Write SignatureMethod element */
@@ -627,7 +623,7 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute(
"Algorithm",
getSignatureURI(signatureInfo.eAlgorithmID, vReferenceInfors[0].nDigestID));
- xDocumentHandler->startElement( "SignatureMethod", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "SignatureMethod", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "SignatureMethod" );
/* Write Reference element */
@@ -666,7 +662,7 @@ void XSecController::exportSignature(
}
}
- xDocumentHandler->startElement( "Reference", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "Reference", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
{
/* Write Transforms element */
if (refInfor.nType == SignatureReferenceType::XMLSTREAM)
@@ -676,7 +672,7 @@ void XSecController::exportSignature(
{
xDocumentHandler->startElement(
"Transforms",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
@@ -684,7 +680,7 @@ void XSecController::exportSignature(
ALGO_C14N);
xDocumentHandler->startElement(
"Transform",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "Transform" );
}
xDocumentHandler->endElement( "Transforms" );
@@ -697,13 +693,13 @@ void XSecController::exportSignature(
getDigestURI(refInfor.nDigestID));
xDocumentHandler->startElement(
"DigestMethod",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "DigestMethod" );
/* Write DigestValue element */
xDocumentHandler->startElement(
"DigestValue",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( refInfor.ouDigestValue );
xDocumentHandler->endElement( "DigestValue" );
}
@@ -715,14 +711,14 @@ void XSecController::exportSignature(
/* Write SignatureValue element */
xDocumentHandler->startElement(
"SignatureValue",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouSignatureValue );
xDocumentHandler->endElement( "SignatureValue" );
/* Write KeyInfo element */
xDocumentHandler->startElement(
"KeyInfo",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
// GPG or X509 key?
if (!signatureInfo.ouGpgCertificate.isEmpty())
@@ -732,12 +728,12 @@ void XSecController::exportSignature(
/* Write PGPData element */
xDocumentHandler->startElement(
"PGPData",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write keyid element */
xDocumentHandler->startElement(
"PGPKeyID",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouCertDigest );
xDocumentHandler->endElement( "PGPKeyID" );
@@ -746,7 +742,7 @@ void XSecController::exportSignature(
{
xDocumentHandler->startElement(
"PGPKeyPacket",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouGpgCertificate );
xDocumentHandler->endElement( "PGPKeyPacket" );
}
@@ -754,7 +750,7 @@ void XSecController::exportSignature(
/* Write PGPOwner element */
xDocumentHandler->startElement(
"loext:PGPOwner",
- cssu::Reference< cssxs::XAttributeList >(new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList >(new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouGpgOwner );
xDocumentHandler->endElement( "loext:PGPOwner" );
}
@@ -765,24 +761,24 @@ void XSecController::exportSignature(
/* Write X509Data element */
xDocumentHandler->startElement(
"X509Data",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write X509IssuerSerial element */
xDocumentHandler->startElement(
"X509IssuerSerial",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write X509IssuerName element */
xDocumentHandler->startElement(
"X509IssuerName",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509IssuerName );
xDocumentHandler->endElement( "X509IssuerName" );
/* Write X509SerialNumber element */
xDocumentHandler->startElement(
"X509SerialNumber",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509SerialNumber );
xDocumentHandler->endElement( "X509SerialNumber" );
}
@@ -793,7 +789,7 @@ void XSecController::exportSignature(
{
xDocumentHandler->startElement(
"X509Certificate",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouX509Certificate );
xDocumentHandler->endElement( "X509Certificate" );
}
@@ -808,12 +804,12 @@ void XSecController::exportSignature(
/* Write Object element */
xDocumentHandler->startElement(
"Object",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write SignatureProperties element */
xDocumentHandler->startElement(
"SignatureProperties",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write SignatureProperty element */
pAttributeList = new SvXMLAttributeList();
@@ -825,7 +821,7 @@ void XSecController::exportSignature(
"#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement(
"SignatureProperty",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write timestamp element */
@@ -836,7 +832,7 @@ void XSecController::exportSignature(
xDocumentHandler->startElement(
"dc:date",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
OUStringBuffer buffer;
//If the xml signature was already contained in the document,
@@ -894,13 +890,13 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute("xmlns:xd", NS_XD);
xDocumentHandler->startElement(
"Object",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement(
"xd:QualifyingProperties",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
DocumentSignatureHelper::writeSignedProperties(xDocumentHandler, signatureInfo, sDate, true);
writeUnsignedProperties(xDocumentHandler, signatureInfo);
xDocumentHandler->endElement( "xd:QualifyingProperties" );
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 82f347bff976..9f2bbe074a1b 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -25,9 +25,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
-namespace cssu = com::sun::star::uno;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
XSecParser::XSecParser(XMLSignatureHelper& rXMLSignatureHelper,
XSecController* pXSecController)
@@ -49,12 +46,12 @@ XSecParser::XSecParser(XMLSignatureHelper& rXMLSignatureHelper,
, m_bInSignatureLineInvalidImage(false)
, m_pXSecController(pXSecController)
, m_bReferenceUnresolved(false)
- , m_nReferenceDigestID(cssxc::DigestID::SHA1)
+ , m_nReferenceDigestID(css::xml::crypto::DigestID::SHA1)
, m_rXMLSignatureHelper(rXMLSignatureHelper)
{
}
-OUString XSecParser::getIdAttr(const cssu::Reference< cssxs::XAttributeList >& xAttribs )
+OUString XSecParser::getIdAttr(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
{
OUString ouIdAttr = xAttribs->getValueByName("id");
@@ -98,7 +95,7 @@ void SAL_CALL XSecParser::endDocument( )
void SAL_CALL XSecParser::startElement(
const OUString& aName,
- const cssu::Reference< cssxs::XAttributeList >& xAttribs )
+ const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
{
try
{
@@ -158,11 +155,11 @@ void SAL_CALL XSecParser::startElement(
&& ouAlgorithm != ALGO_XMLDSIGSHA512,
"xmlsecurity.helper", "Algorithm neither SHA1, SHA256 nor SHA512");
if (ouAlgorithm == ALGO_XMLDSIGSHA1)
- m_nReferenceDigestID = cssxc::DigestID::SHA1;
+ m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
else if (ouAlgorithm == ALGO_XMLDSIGSHA256)
- m_nReferenceDigestID = cssxc::DigestID::SHA256;
+ m_nReferenceDigestID = css::xml::crypto::DigestID::SHA256;
else if (ouAlgorithm == ALGO_XMLDSIGSHA512)
- m_nReferenceDigestID = cssxc::DigestID::SHA512;
+ m_nReferenceDigestID = css::xml::crypto::DigestID::SHA512;
else
m_nReferenceDigestID = 0;
}
@@ -285,18 +282,18 @@ void SAL_CALL XSecParser::startElement(
m_xNextHandler->startElement(aName, xAttribs);
}
}
- catch (cssu::Exception& )
+ catch (css::uno::Exception& )
{//getCaughtException MUST be the first line in the catch block
- cssu::Any exc = cppu::getCaughtException();
- throw cssxs::SAXException(
+ css::uno::Any exc = cppu::getCaughtException();
+ throw css::xml::sax::SAXException(
"xmlsecurity: Exception in XSecParser::startElement",
nullptr, exc);
}
catch (...)
{
- throw cssxs::SAXException(
+ throw css::xml::sax::SAXException(
"xmlsecurity: unexpected exception in XSecParser::startElement", nullptr,
- cssu::Any());
+ css::uno::Any());
}
}
@@ -409,18 +406,18 @@ void SAL_CALL XSecParser::endElement( const OUString& aName )
m_xNextHandler->endElement(aName);
}
}
- catch (cssu::Exception& )
+ catch (css::uno::Exception& )
{//getCaughtException MUST be the first line in the catch block
- cssu::Any exc = cppu::getCaughtException();
- throw cssxs::SAXException(
+ css::uno::Any exc = cppu::getCaughtException();
+ throw css::xml::sax::SAXException(
"xmlsecurity: Exception in XSecParser::endElement",
nullptr, exc);
}
catch (...)
{
- throw cssxs::SAXException(
+ throw css::xml::sax::SAXException(
"xmlsecurity: unexpected exception in XSecParser::endElement", nullptr,
- cssu::Any());
+ css::uno::Any());
}
}
@@ -513,7 +510,7 @@ void SAL_CALL XSecParser::processingInstruction( const OUString& aTarget, const
}
}
-void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator )
+void SAL_CALL XSecParser::setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
{
if (m_xNextHandler.is())
{
@@ -525,7 +522,7 @@ void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLoc
* XInitialization
*/
void SAL_CALL XSecParser::initialize(
- const cssu::Sequence< cssu::Any >& aArguments )
+ const css::uno::Sequence< css::uno::Any >& aArguments )
{
aArguments[0] >>= m_xNextHandler;
}
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 4d1b89949feb..b9648ed64397 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -33,10 +33,6 @@ namespace com::sun::star::graphic { class XGraphic; }
using namespace css;
using namespace css::uno;
using namespace css::graphic;
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
/* protected: for signature generation */
OUString XSecController::createId()
@@ -54,7 +50,7 @@ OUString XSecController::createId()
return OUString::createFromAscii(str);
}
-cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToWrite(
+css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > XSecController::prepareSignatureToWrite(
InternalSignatureInformation& internalSignatureInfor,
sal_Int32 nStorageFormat,
bool bXAdESCompliantIfODF)
@@ -65,13 +61,13 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
sal_Int32 nIdOfSignatureElementCollector;
nIdOfSignatureElementCollector =
- m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_AFTERMODIFY, true );
+ m_xSAXEventKeeper->addSecurityElementCollector( css::xml::crypto::sax::ElementMarkPriority_AFTERMODIFY, true );
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
rtl::Reference<SignatureCreatorImpl> xSignatureCreator(new SignatureCreatorImpl);
- cssu::Sequence<cssu::Any> args(5);
+ css::uno::Sequence<css::uno::Any> args(5);
args[0] <<= OUString::number(nSecurityId);
args[1] <<= uno::Reference<xml::crypto::sax::XSecuritySAXEventKeeper>(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
args[2] <<= OUString::number(nIdOfSignatureElementCollector);
@@ -116,7 +112,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
{
const SignatureReferenceInformation& refInfor = vReferenceInfors[i];
- cssu::Reference< css::io::XInputStream > xInputStream
+ css::uno::Reference< css::io::XInputStream > xInputStream
= getObjectInputStream( refInfor.ouURI );
if (xInputStream.is())
@@ -127,7 +123,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
// use sha512 for gpg signing unconditionally
const sal_Int32 digestID = !internalSignatureInfor.signatureInfor.ouGpgCertificate.isEmpty()?
- cssxc::DigestID::SHA512 : (bXAdESCompliantIfODF ? cssxc::DigestID::SHA256 : cssxc::DigestID::SHA1);
+ css::xml::crypto::DigestID::SHA512 : (bXAdESCompliantIfODF ? css::xml::crypto::DigestID::SHA256 : css::xml::crypto::DigestID::SHA1);
if (nStorageFormat != embed::StorageFormats::OFOPXML)
{
@@ -178,7 +174,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
void XSecController::signAStream( sal_Int32 securityId, const OUString& uri, bool isBinary, bool bXAdESCompliantIfODF)
{
const SignatureReferenceType type = isBinary ? SignatureReferenceType::BINARYSTREAM : SignatureReferenceType::XMLSTREAM;
- sal_Int32 digestID = bXAdESCompliantIfODF ? cssxc::DigestID::SHA256 : cssxc::DigestID::SHA1;
+ sal_Int32 digestID = bXAdESCompliantIfODF ? css::xml::crypto::DigestID::SHA256 : css::xml::crypto::DigestID::SHA1;
int index = findSignatureInfor( securityId );
@@ -192,7 +188,7 @@ void XSecController::signAStream( sal_Int32 securityId, const OUString& uri, boo
{
// use sha512 for gpg signing unconditionally
if (!m_vInternalSignatureInformations[index].signatureInfor.ouGpgCertificate.isEmpty())
- digestID = cssxc::DigestID::SHA512;
+ digestID = css::xml::crypto::DigestID::SHA512;
m_vInternalSignatureInformations[index].addReference(type, digestID, uri, -1, OUString());
}
}
@@ -347,7 +343,7 @@ void XSecController::setSignatureLineInvalidGraphic(
}
bool XSecController::WriteSignature(
- const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler,
+ const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler,
bool bXAdESCompliantIfODF )
{
bool rc = false;
@@ -373,7 +369,7 @@ bool XSecController::WriteSignature(
/*
* export the signature template
*/
- cssu::Reference<cssxs::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()),cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()),css::uno::UNO_QUERY);
int i;
int sigNum = m_vInternalSignatureInformations.size();
@@ -394,7 +390,7 @@ bool XSecController::WriteSignature(
rc = true;
}
- catch( cssu::Exception& )
+ catch( css::uno::Exception& )
{
}
@@ -422,7 +418,7 @@ bool XSecController::WriteOOXMLSignature(const uno::Reference<embed::XStorage>&
try
{
// Export the signature template.
- cssu::Reference<xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
+ css::uno::Reference<xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
for (InternalSignatureInformation & rInformation : m_vInternalSignatureInformations)
{
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 1f7fa9ac8ca8..c826971b1c7d 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -46,13 +46,9 @@ namespace com::sun::star::graphic { class XGraphic; }
using namespace css;
using namespace css::uno;
using namespace css::beans;
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
/* protected: for signature verify */
-cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead(
+css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead(
sal_Int32 nSecurityId)
{
if ( m_eStatusOfSecurityComponents != InitializationState::INITIALIZED )
@@ -61,10 +57,10 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
}
sal_Int32 nIdOfSignatureElementCollector;
- cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
+ css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener;
nIdOfSignatureElementCollector =
- m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_BEFOREMODIFY, false);
+ m_xSAXEventKeeper->addSecurityElementCollector( css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY, false);
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
@@ -73,9 +69,9 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
*/
xReferenceResolvedListener = new SignatureVerifierImpl;
- cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::lang::XInitialization> xInitialization(xReferenceResolvedListener, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> args(5);
+ css::uno::Sequence<css::uno::Any> args(5);
args[0] <<= OUString::number(nSecurityId);
args[1] <<= uno::Reference<xml::crypto::sax::XSecuritySAXEventKeeper>(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
args[2] <<= OUString::number(nIdOfSignatureElementCollector);
@@ -83,8 +79,8 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
args[4] <<= m_xXMLSignature;
xInitialization->initialize(args);
- cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster >
- signatureVerifyResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::crypto::sax::XSignatureVerifyResultBroadcaster >
+ signatureVerifyResultBroadcaster(xReferenceResolvedListener, css::uno::UNO_QUERY);
signatureVerifyResultBroadcaster->addSignatureVerifyResultListener( this );
@@ -92,7 +88,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
nIdOfSignatureElementCollector,
xReferenceResolvedListener);
- cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, css::uno::UNO_QUERY);
keyCollector->setKeyId(0);
return xReferenceResolvedListener;
@@ -100,7 +96,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
void XSecController::addSignature()
{
- cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
+ css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener;
sal_Int32 nSignatureId = 0;
@@ -177,13 +173,13 @@ void XSecController::addStreamReference(
/*
* get the input stream
*/
- cssu::Reference< css::io::XInputStream > xObjectInputStream
+ css::uno::Reference< css::io::XInputStream > xObjectInputStream
= getObjectInputStream( ouUri );
if ( xObjectInputStream.is() )
{
- cssu::Reference<cssxc::XUriBinding> xUriBinding
- (isi.xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::XUriBinding> xUriBinding
+ (isi.xReferenceResolvedListener, css::uno::UNO_QUERY);
xUriBinding->setUriBinding(ouUri, xObjectInputStream);
}
}
@@ -219,8 +215,8 @@ void XSecController::setReferenceCount() const
}
}
- cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
- (isi.xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::sax::XReferenceCollector> xReferenceCollector
+ (isi.xReferenceResolvedListener, css::uno::UNO_QUERY);
xReferenceCollector->setReferenceCount( referenceCount );
}
}
@@ -465,7 +461,7 @@ void XSecController::collectToVerify( const OUString& referenceId )
*/
{
bool bJustChainingOn = false;
- cssu::Reference< cssxs::XDocumentHandler > xHandler;
+ css::uno::Reference< css::xml::sax::XDocumentHandler > xHandler;
int i,j;
int sigNum = m_vInternalSignatureInformations.size();
@@ -489,10 +485,10 @@ void XSecController::collectToVerify( const OUString& referenceId )
}
sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
- cssxc::sax::ElementMarkPriority_BEFOREMODIFY, false );
+ css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY, false );
- cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
- ( isi.xReferenceResolvedListener, cssu::UNO_QUERY );
+ css::uno::Reference<css::xml::crypto::sax::XReferenceCollector> xReferenceCollector
+ ( isi.xReferenceResolvedListener, css::uno::UNO_QUERY );
m_xSAXEventKeeper->setSecurityId(nKeeperId, isi.signatureInfor.nSecurityId);
m_xSAXEventKeeper->addReferenceResolvedListener( nKeeperId, isi.xReferenceResolvedListener);
@@ -506,7 +502,6 @@ void XSecController::collectToVerify( const OUString& referenceId )
if ( bJustChainingOn )
{
- cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), cssu::UNO_QUERY);
m_xSAXEventKeeper->setNextHandler(xHandler);
}
}
@@ -520,13 +515,13 @@ void XSecController::addSignature( sal_Int32 nSignatureId )
m_bVerifyCurrentSignature = true;
}
-cssu::Reference< cssxs::XDocumentHandler > const & XSecController::createSignatureReader(XMLSignatureHelper& rXMLSignatureHelper, sal_Int32 nType)
+css::uno::Reference< css::xml::sax::XDocumentHandler > const & XSecController::createSignatureReader(XMLSignatureHelper& rXMLSignatureHelper, sal_Int32 nType)
{
if (nType == embed::StorageFormats::OFOPXML)
m_xSecParser = new OOXMLSecParser(rXMLSignatureHelper, this);
else
m_xSecParser = new XSecParser(rXMLSignatureHelper, this);
- cssu::Reference< cssl::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
setSAXChainConnector(xInitialization);