diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-12 16:17:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-13 15:47:06 +0200 |
commit | 943fbfad668da76f7d0ebd4f4d8cdd67224d2f01 (patch) | |
tree | 2aeb561967e15e2d82b254e34d9e1359f607342a /xmlsecurity | |
parent | 6edcbde02520500812d969dd5bcba5ff68d59c58 (diff) |
expand out some namespace aliases
Change-Id: I5fdb554a1b116824843f35645bc1cea3ca91e0f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94093
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/framework/buffernode.cxx | 28 | ||||
-rw-r--r-- | xmlsecurity/source/framework/elementcollector.cxx | 13 | ||||
-rw-r--r-- | xmlsecurity/source/framework/elementmark.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 75 | ||||
-rw-r--r-- | xmlsecurity/source/framework/signaturecreatorimpl.cxx | 30 | ||||
-rw-r--r-- | xmlsecurity/source/framework/signatureengine.cxx | 19 | ||||
-rw-r--r-- | xmlsecurity/source/framework/signatureverifierimpl.cxx | 25 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 120 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.cxx | 39 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecsign.cxx | 26 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecverify.cxx | 44 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx | 10 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/saxhelper.cxx | 15 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx | 67 |
14 files changed, 232 insertions, 283 deletions
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx index dfffa6650c5b..0a0a58421dbb 100644 --- a/xmlsecurity/source/framework/buffernode.cxx +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -25,11 +25,7 @@ #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> -namespace cssu = com::sun::star::uno; -namespace cssxw = com::sun::star::xml::wrapper; -namespace cssxc = com::sun::star::xml::crypto; - -BufferNode::BufferNode( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement ) +BufferNode::BufferNode( const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& xXMLElement ) :m_pParent(nullptr), m_pBlocker(nullptr), m_bAllReceived(false), @@ -65,9 +61,9 @@ bool BufferNode::isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const { return std::any_of(m_vElementCollectors.cbegin(), m_vElementCollectors.cend(), [nIgnoredSecurityId](const ElementCollector* pElementCollector) { - return (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + return (nIgnoredSecurityId == css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || pElementCollector->getSecurityId() != nIgnoredSecurityId) && - (pElementCollector->getPriority() == cssxc::sax::ElementMarkPriority_BEFOREMODIFY); + (pElementCollector->getPriority() == css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY); }); } @@ -215,10 +211,10 @@ OUString BufferNode::printChildren() const switch (ii->getPriority()) { - case cssxc::sax::ElementMarkPriority_BEFOREMODIFY: + case css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY: rc.append("BEFOREMODIFY"); break; - case cssxc::sax::ElementMarkPriority_AFTERMODIFY: + case css::xml::crypto::sax::ElementMarkPriority_AFTERMODIFY: rc.append("AFTERMODIFY"); break; default: @@ -618,7 +614,7 @@ const BufferNode* BufferNode::getNextNodeByTreeOrder() const } -void BufferNode::setXMLElement( const cssu::Reference< cssxw::XXMLElementWrapper >& xXMLElement ) +void BufferNode::setXMLElement( const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& xXMLElement ) { m_xXMLElement = xXMLElement; } @@ -672,8 +668,8 @@ void BufferNode::elementCollectorNotify() { if (!m_vElementCollectors.empty()) { - cssxc::sax::ElementMarkPriority nMaxPriority = cssxc::sax::ElementMarkPriority_MINIMUM; - cssxc::sax::ElementMarkPriority nPriority; + css::xml::crypto::sax::ElementMarkPriority nMaxPriority = css::xml::crypto::sax::ElementMarkPriority_MINIMUM; + css::xml::crypto::sax::ElementMarkPriority nPriority; /* * get the max priority among ElementCollectors on this BufferNode @@ -703,7 +699,7 @@ void BufferNode::elementCollectorNotify() * unless its priority is BEFOREMODIFY. */ if (nPriority == nMaxPriority && - (nPriority == cssxc::sax::ElementMarkPriority_BEFOREMODIFY || + (nPriority == css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY || !isBlockerInSubTreeIncluded(pElementCollector->getSecurityId()))) { /* @@ -716,7 +712,7 @@ void BufferNode::elementCollectorNotify() * will destroy the buffered element, in turn, ElementCollectors * mentioned above can't perform their mission. */ - //if (!(nMaxPriority == cssxc::sax::ElementMarkPriority_PRI_MODIFY && + //if (!(nMaxPriority == css::xml::crypto::sax::ElementMarkPriority_PRI_MODIFY && if (!(bToModify && (isECInSubTreeIncluded(pElementCollector->getSecurityId()) || isECOfBeforeModifyInAncestorIncluded(pElementCollector->getSecurityId())) @@ -755,7 +751,7 @@ bool BufferNode::isECInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const { bool rc = std::any_of(m_vElementCollectors.begin(), m_vElementCollectors.end(), [nIgnoredSecurityId](const ElementCollector* pElementCollector) { - return nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + return nIgnoredSecurityId == css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || pElementCollector->getSecurityId() != nIgnoredSecurityId; }); @@ -841,7 +837,7 @@ bool BufferNode::isBlockerInSubTreeIncluded(sal_Int32 nIgnoredSecurityId) const [nIgnoredSecurityId](const std::unique_ptr<BufferNode>& pBufferNode) { ElementMark* pBlocker = pBufferNode->getBlocker(); return (pBlocker != nullptr && - (nIgnoredSecurityId == cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || + (nIgnoredSecurityId == css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID || pBlocker->getSecurityId() != nIgnoredSecurityId )) || pBufferNode->isBlockerInSubTreeIncluded(nIgnoredSecurityId); }); diff --git a/xmlsecurity/source/framework/elementcollector.cxx b/xmlsecurity/source/framework/elementcollector.cxx index 80581d1c2029..7801d6328b7f 100644 --- a/xmlsecurity/source/framework/elementcollector.cxx +++ b/xmlsecurity/source/framework/elementcollector.cxx @@ -23,15 +23,12 @@ #include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> -namespace cssu = com::sun::star::uno; -namespace cssxc = com::sun::star::xml::crypto; - ElementCollector::ElementCollector( sal_Int32 nBufferId, - cssxc::sax::ElementMarkPriority nPriority, + css::xml::crypto::sax::ElementMarkPriority nPriority, bool bToModify, const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& xReferenceResolvedListener) - :ElementMark(cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, nBufferId), + :ElementMark(css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, nBufferId), m_nPriority(nPriority), m_bToModify(bToModify), m_bAbleToNotify(false), @@ -67,7 +64,7 @@ ElementCollector::ElementCollector( * - the listener that this ElementCollector notifies to. ******************************************************************************/ { - m_type = cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR; + m_type = css::xml::crypto::sax::ElementMarkType_ELEMENTCOLLECTOR; } @@ -89,7 +86,7 @@ void ElementCollector::notifyListener() } void ElementCollector::setReferenceResolvedListener( - const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& xReferenceResolvedListener) + const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& xReferenceResolvedListener) /****** ElementCollector/setReferenceResolvedListener ************************* * * NAME @@ -130,7 +127,7 @@ void ElementCollector::doNotify() if (!m_bNotified && m_bAbleToNotify && m_xReferenceResolvedListener.is() && - m_nSecurityId != cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID) + m_nSecurityId != css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID) { m_bNotified = true; m_xReferenceResolvedListener->referenceResolved(m_nBufferId); diff --git a/xmlsecurity/source/framework/elementmark.cxx b/xmlsecurity/source/framework/elementmark.cxx index c333527f42b2..71444d7cd33b 100644 --- a/xmlsecurity/source/framework/elementmark.cxx +++ b/xmlsecurity/source/framework/elementmark.cxx @@ -20,13 +20,11 @@ #include "elementmark.hxx" -namespace cssxc = com::sun::star::xml::crypto; - ElementMark::ElementMark(sal_Int32 nSecurityId, sal_Int32 nBufferId) :m_pBufferNode(nullptr), m_nSecurityId(nSecurityId), m_nBufferId(nBufferId), - m_type(cssxc::sax::ElementMarkType_ELEMENTMARK) + m_type(css::xml::crypto::sax::ElementMarkType_ELEMENTMARK) /****** ElementMark/ElementMark *********************************************** * * NAME diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx index 7356de79a5d4..cde39d929959 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -30,13 +30,6 @@ #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> -namespace cssu = com::sun::star::uno; -namespace cssl = com::sun::star::lang; -namespace cssxc = com::sun::star::xml::crypto; -namespace cssxcsax = com::sun::star::xml::csax; -namespace cssxw = com::sun::star::xml::wrapper; -namespace cssxs = com::sun::star::xml::sax; - #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SAXEventKeeperImpl" SAXEventKeeperImpl::SAXEventKeeperImpl( ) @@ -331,7 +324,7 @@ OUString SAXEventKeeperImpl::printBufferNode( return rc.makeStringAndClear(); } -cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > +css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > SAXEventKeeperImpl::collectChildWorkingElement(BufferNode const * pBufferNode) /****** SAXEventKeeperImpl/collectChildWorkingElement ************************ * @@ -351,8 +344,8 @@ cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > { std::vector< std::unique_ptr<BufferNode> > const & vChildren = pBufferNode->getChildren(); - cssu::Sequence < cssu::Reference< - cssxw::XXMLElementWrapper > > aChildrenCollection ( vChildren.size()); + css::uno::Sequence < css::uno::Reference< + css::xml::wrapper::XXMLElementWrapper > > aChildrenCollection ( vChildren.size()); sal_Int32 nIndex = 0; for( const auto& i : vChildren ) @@ -416,7 +409,7 @@ void SAXEventKeeperImpl::smashBufferNode( */ if (bClearRoot) { - cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > + css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > aChildElements = collectChildWorkingElement(m_pRootBufferNode.get()); /* @@ -467,7 +460,7 @@ void SAXEventKeeperImpl::smashBufferNode( */ if ( bIsNotBlocking || bIsBlockInside || bIsBlockingAfterward ) { - cssu::Sequence< cssu::Reference< cssxw::XXMLElementWrapper > > + css::uno::Sequence< css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > > aChildElements = collectChildWorkingElement(pBufferNode); /* @@ -595,7 +588,7 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer() if (pElementMark != nullptr) { - if (cssxc::sax::ElementMarkType_ELEMENTCOLLECTOR + if (css::xml::crypto::sax::ElementMarkType_ELEMENTCOLLECTOR == pElementMark->getType()) /* * it is a EC @@ -603,14 +596,14 @@ void SAXEventKeeperImpl::releaseElementMarkBuffer() { ElementCollector* pElementCollector = static_cast<ElementCollector*>(pElementMark); - cssxc::sax::ElementMarkPriority nPriority = pElementCollector->getPriority(); + css::xml::crypto::sax::ElementMarkPriority nPriority = pElementCollector->getPriority(); /* * Delete the EC from the buffer node. */ BufferNode* pBufferNode = pElementCollector->getBufferNode(); pBufferNode->removeElementCollector(pElementCollector); - if ( nPriority == cssxc::sax::ElementMarkPriority_BEFOREMODIFY) + if ( nPriority == css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY) { pBufferNode->notifyBranch(); } @@ -737,9 +730,9 @@ void SAXEventKeeperImpl::markElementMarkBuffer(sal_Int32 nId) } sal_Int32 SAXEventKeeperImpl::createElementCollector( - cssxc::sax::ElementMarkPriority nPriority, + css::xml::crypto::sax::ElementMarkPriority nPriority, bool bModifyElement, - const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& xReferenceResolvedListener) + const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& xReferenceResolvedListener) /****** SAXEventKeeperImpl/createElementCollector **************************** * * NAME @@ -805,7 +798,7 @@ sal_Int32 SAXEventKeeperImpl::createBlocker() OSL_ASSERT(m_pNewBlocker == nullptr); - m_pNewBlocker = new ElementMark(cssxc::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, nId); + m_pNewBlocker = new ElementMark(css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, nId); m_vElementMarkBuffers.push_back( std::unique_ptr<const ElementMark>(m_pNewBlocker)); @@ -816,7 +809,7 @@ sal_Int32 SAXEventKeeperImpl::createBlocker() sal_Int32 SAL_CALL SAXEventKeeperImpl::addElementCollector( ) { return createElementCollector( - cssxc::sax::ElementMarkPriority_AFTERMODIFY, + css::xml::crypto::sax::ElementMarkPriority_AFTERMODIFY, false, nullptr); } @@ -841,10 +834,10 @@ sal_Bool SAL_CALL SAXEventKeeperImpl::isBlocking( ) return (m_pCurrentBlockingBufferNode != nullptr); } -cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL +css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getElement( sal_Int32 id ) { - cssu::Reference< cssxw::XXMLElementWrapper > rc; + css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > rc; ElementMark* pElementMark = findElementMarkBuffer(id); if (pElementMark != nullptr) @@ -857,7 +850,7 @@ cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL void SAL_CALL SAXEventKeeperImpl::setElement( sal_Int32 id, - const cssu::Reference< cssxw::XXMLElementWrapper >& aElement ) + const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& aElement ) { if (aElement.is()) { @@ -886,10 +879,10 @@ void SAL_CALL SAXEventKeeperImpl::setElement( } } -cssu::Reference< cssxs::XDocumentHandler > SAL_CALL SAXEventKeeperImpl::setNextHandler( - const cssu::Reference< cssxs::XDocumentHandler >& xNewHandler ) +css::uno::Reference< css::xml::sax::XDocumentHandler > SAL_CALL SAXEventKeeperImpl::setNextHandler( + const css::uno::Reference< css::xml::sax::XDocumentHandler >& xNewHandler ) { - cssu::Reference< cssxs::XDocumentHandler > xOldHandler = m_xNextHandler; + css::uno::Reference< css::xml::sax::XDocumentHandler > xOldHandler = m_xNextHandler; m_xNextHandler = xNewHandler; return xOldHandler; @@ -906,9 +899,9 @@ OUString SAL_CALL SAXEventKeeperImpl::printBufferNodeTree() return rc; } -cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getCurrentBlockingNode() +css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getCurrentBlockingNode() { - cssu::Reference< cssxw::XXMLElementWrapper > rc; + css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > rc; if (m_pCurrentBlockingBufferNode != nullptr) { @@ -920,7 +913,7 @@ cssu::Reference< cssxw::XXMLElementWrapper > SAL_CALL SAXEventKeeperImpl::getCur /* XSecuritySAXEventKeeper */ sal_Int32 SAL_CALL SAXEventKeeperImpl::addSecurityElementCollector( - cssxc::sax::ElementMarkPriority priority, + css::xml::crypto::sax::ElementMarkPriority priority, sal_Bool modifyElement ) { return createElementCollector( @@ -942,7 +935,7 @@ void SAL_CALL SAXEventKeeperImpl::setSecurityId( sal_Int32 id, sal_Int32 securit /* XReferenceResolvedBroadcaster */ void SAL_CALL SAXEventKeeperImpl::addReferenceResolvedListener( sal_Int32 referenceId, - const cssu::Reference< cssxc::sax::XReferenceResolvedListener >& listener ) + const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& listener ) { ElementCollector* pElementCollector = static_cast<ElementCollector*>(findElementMarkBuffer(referenceId)); if (pElementCollector != nullptr) @@ -953,19 +946,19 @@ void SAL_CALL SAXEventKeeperImpl::addReferenceResolvedListener( void SAL_CALL SAXEventKeeperImpl::removeReferenceResolvedListener( sal_Int32 /*referenceId*/, - const cssu::Reference< cssxc::sax::XReferenceResolvedListener >&) + const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >&) { } /* XSAXEventKeeperStatusChangeBroadcaster */ void SAL_CALL SAXEventKeeperImpl::addSAXEventKeeperStatusChangeListener( - const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >& listener ) + const css::uno::Reference< css::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >& listener ) { m_xSAXEventKeeperStatusChangeListener = listener; } void SAL_CALL SAXEventKeeperImpl::removeSAXEventKeeperStatusChangeListener( - const cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >&) + const css::uno::Reference< css::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >&) { } @@ -988,7 +981,7 @@ void SAL_CALL SAXEventKeeperImpl::endDocument( ) void SAL_CALL SAXEventKeeperImpl::startElement( const OUString& aName, - const cssu::Reference< cssxs::XAttributeList >& xAttribs ) + const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) { /* * If there is a following handler and no blocking now, then @@ -1007,7 +1000,7 @@ void SAL_CALL SAXEventKeeperImpl::startElement( if (!m_bIsForwarding) { sal_Int32 nLength = xAttribs->getLength(); - cssu::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength); + css::uno::Sequence< css::xml::csax::XMLAttribute > aAttributes (nLength); for ( int i = 0; i<nLength; ++i ) { @@ -1117,18 +1110,18 @@ void SAL_CALL SAXEventKeeperImpl::processingInstruction( } } -void SAL_CALL SAXEventKeeperImpl::setDocumentLocator( const cssu::Reference< cssxs::XLocator >&) +void SAL_CALL SAXEventKeeperImpl::setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >&) { } /* XInitialization */ -void SAL_CALL SAXEventKeeperImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) +void SAL_CALL SAXEventKeeperImpl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) { OSL_ASSERT(aArguments.getLength() == 1); aArguments[0] >>= m_xXMLDocument; - m_xDocumentHandler.set( m_xXMLDocument, cssu::UNO_QUERY ); - m_xCompressedDocumentHandler.set( m_xXMLDocument, cssu::UNO_QUERY ); + m_xDocumentHandler.set( m_xXMLDocument, css::uno::UNO_QUERY ); + m_xCompressedDocumentHandler.set( m_xXMLDocument, css::uno::UNO_QUERY ); m_pRootBufferNode.reset( new BufferNode(m_xXMLDocument->getCurrentElement()) ); m_pCurrentBufferNode = m_pRootBufferNode.get(); @@ -1139,9 +1132,9 @@ OUString SAXEventKeeperImpl_getImplementationName () return IMPLEMENTATION_NAME; } -cssu::Sequence< OUString > SAXEventKeeperImpl_getSupportedServiceNames( ) +css::uno::Sequence< OUString > SAXEventKeeperImpl_getSupportedServiceNames( ) { - cssu::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SAXEventKeeper" }; + css::uno::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SAXEventKeeper" }; return aRet; } @@ -1156,7 +1149,7 @@ sal_Bool SAL_CALL SAXEventKeeperImpl::supportsService( const OUString& rServiceN return cppu::supportsService(this, rServiceName); } -cssu::Sequence< OUString > SAL_CALL SAXEventKeeperImpl::getSupportedServiceNames( ) +css::uno::Sequence< OUString > SAL_CALL SAXEventKeeperImpl::getSupportedServiceNames( ) { return SAXEventKeeperImpl_getSupportedServiceNames(); } diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx index 131365ac9fb0..a3d8cd45814e 100644 --- a/xmlsecurity/source/framework/signaturecreatorimpl.cxx +++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx @@ -28,10 +28,6 @@ namespace com::sun::star::xml::wrapper { class XXMLElementWrapper; } using namespace com::sun::star::uno; -namespace cssu = com::sun::star::uno; -namespace cssl = com::sun::star::lang; -namespace cssxc = com::sun::star::xml::crypto; -namespace cssxw = com::sun::star::xml::wrapper; #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureCreatorImpl" @@ -52,8 +48,8 @@ void SignatureCreatorImpl::notifyResultListener() const * creation result. ******************************************************************************/ { - cssu::Reference< cssxc::sax::XSignatureCreationResultListener > - xSignatureCreationResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + css::uno::Reference< css::xml::crypto::sax::XSignatureCreationResultListener > + xSignatureCreationResultListener ( m_xResultListener , css::uno::UNO_QUERY ) ; xSignatureCreationResultListener->signatureCreated( m_nSecurityId, m_nStatus ); } @@ -74,20 +70,20 @@ void SignatureCreatorImpl::startEngine(const rtl::Reference<XMLSignatureTemplate * elements) to be signed. ******************************************************************************/ { - cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate; + css::uno::Reference< css::xml::crypto::XXMLSignatureTemplate > xResultTemplate; try { xResultTemplate = m_xXMLSignature->generate(css::uno::Reference<css::xml::crypto::XXMLSignatureTemplate>(xSignatureTemplate.get()), m_xSecurityEnvironment); m_nStatus = xResultTemplate->getStatus(); } - catch( cssu::Exception& ) + catch( css::uno::Exception& ) { - m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + m_nStatus = css::xml::crypto::SecurityOperationStatus_RUNTIMEERROR_FAILED; } - if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED) + if (m_nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED) { - cssu::Reference < cssxw::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate(); + css::uno::Reference < css::xml::wrapper::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate(); m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature); } } @@ -124,19 +120,19 @@ void SAL_CALL SignatureCreatorImpl::setBlockerId( sal_Int32 id ) /* XSignatureCreationResultBroadcaster */ void SAL_CALL SignatureCreatorImpl::addSignatureCreationResultListener( - const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >& listener ) + const css::uno::Reference< css::xml::crypto::sax::XSignatureCreationResultListener >& listener ) { m_xResultListener = listener; tryToPerform(); } void SAL_CALL SignatureCreatorImpl::removeSignatureCreationResultListener( - const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >&) + const css::uno::Reference< css::xml::crypto::sax::XSignatureCreationResultListener >&) { } /* XInitialization */ -void SAL_CALL SignatureCreatorImpl::initialize( const cssu::Sequence< cssu::Any >& aArguments ) +void SAL_CALL SignatureCreatorImpl::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) { OSL_ASSERT(aArguments.getLength() == 5); @@ -157,9 +153,9 @@ OUString SignatureCreatorImpl_getImplementationName () return IMPLEMENTATION_NAME; } -cssu::Sequence< OUString > SignatureCreatorImpl_getSupportedServiceNames( ) +css::uno::Sequence< OUString > SignatureCreatorImpl_getSupportedServiceNames( ) { - cssu::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SignatureCreator" }; + css::uno::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SignatureCreator" }; return aRet; } @@ -174,7 +170,7 @@ sal_Bool SAL_CALL SignatureCreatorImpl::supportsService( const OUString& rServic return cppu::supportsService(this, rServiceName); } -cssu::Sequence< OUString > SAL_CALL SignatureCreatorImpl::getSupportedServiceNames( ) +css::uno::Sequence< OUString > SAL_CALL SignatureCreatorImpl::getSupportedServiceNames( ) { return SignatureCreatorImpl_getSupportedServiceNames(); } diff --git a/xmlsecurity/source/framework/signatureengine.cxx b/xmlsecurity/source/framework/signatureengine.cxx index ff1025e9d783..095b2d04d4d7 100644 --- a/xmlsecurity/source/framework/signatureengine.cxx +++ b/xmlsecurity/source/framework/signatureengine.cxx @@ -25,9 +25,6 @@ namespace com::sun::star::xml::wrapper { class XXMLElementWrapper; } using namespace com::sun::star::uno; -namespace cssu = com::sun::star::uno; -namespace cssxc = com::sun::star::xml::crypto; -namespace cssxw = com::sun::star::xml::wrapper; SignatureEngine::SignatureEngine() : m_nTotalReferenceNumber(-1) @@ -93,7 +90,7 @@ void SignatureEngine::tryToPerform( ) { rtl::Reference<XMLSignatureTemplateImpl> xSignatureTemplate = new XMLSignatureTemplateImpl(); - cssu::Reference< cssxw::XXMLElementWrapper > + css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > xXMLElement = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC ); xSignatureTemplate->setTemplate(xXMLElement); @@ -135,11 +132,11 @@ void SignatureEngine::clearUp( ) const * 3. releases the ElementCollector for the key element, if there is one. ******************************************************************************/ { - cssu::Reference < cssxc::sax::XReferenceResolvedBroadcaster > - xReferenceResolvedBroadcaster( m_xSAXEventKeeper, cssu::UNO_QUERY ); + css::uno::Reference < css::xml::crypto::sax::XReferenceResolvedBroadcaster > + xReferenceResolvedBroadcaster( m_xSAXEventKeeper, css::uno::UNO_QUERY ); xReferenceResolvedBroadcaster->removeReferenceResolvedListener( m_nIdOfTemplateEC, - static_cast<const cssu::Reference < cssxc::sax::XReferenceResolvedListener > >(static_cast<SecurityEngine *>(const_cast<SignatureEngine *>(this)))); + static_cast<const css::uno::Reference < css::xml::crypto::sax::XReferenceResolvedListener > >(static_cast<SecurityEngine *>(const_cast<SignatureEngine *>(this)))); m_xSAXEventKeeper->removeElementCollector(m_nIdOfTemplateEC); @@ -147,7 +144,7 @@ void SignatureEngine::clearUp( ) const { xReferenceResolvedBroadcaster->removeReferenceResolvedListener( i, - static_cast<const cssu::Reference < cssxc::sax::XReferenceResolvedListener > >(static_cast<SecurityEngine *>(const_cast<SignatureEngine *>(this)))); + static_cast<const css::uno::Reference < css::xml::crypto::sax::XReferenceResolvedListener > >(static_cast<SecurityEngine *>(const_cast<SignatureEngine *>(this)))); m_xSAXEventKeeper->removeElementCollector(i); } @@ -172,15 +169,15 @@ void SAL_CALL SignatureEngine::setReferenceId( sal_Int32 id ) /* XUriBinding */ void SAL_CALL SignatureEngine::setUriBinding( const OUString& uri, - const cssu::Reference< css::io::XInputStream >& aInputStream ) + const css::uno::Reference< css::io::XInputStream >& aInputStream ) { m_vUris.push_back(uri); m_vXInputStreams.push_back(aInputStream); } -cssu::Reference< css::io::XInputStream > SAL_CALL SignatureEngine::getUriBinding( const OUString& uri ) +css::uno::Reference< css::io::XInputStream > SAL_CALL SignatureEngine::getUriBinding( const OUString& uri ) { - cssu::Reference< css::io::XInputStream > xInputStream; + css::uno::Reference< css::io::XInputStream > xInputStream; int size = m_vUris.size(); diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx index 7a697f355b0c..4daf8d203c6a 100644 --- a/xmlsecurity/source/framework/signatureverifierimpl.cxx +++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx @@ -25,9 +25,6 @@ #include <osl/diagnose.h> #include <rtl/ref.hxx> -namespace cssu = com::sun::star::uno; -namespace cssl = com::sun::star::lang; -namespace cssxc = com::sun::star::xml::crypto; #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureVerifierImpl" @@ -47,8 +44,8 @@ void SignatureVerifierImpl::notifyResultListener() const * notifyResultListener -- notifies the listener about the verify result. ******************************************************************************/ { - cssu::Reference< cssxc::sax::XSignatureVerifyResultListener > - xSignatureVerifyResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; + css::uno::Reference< css::xml::crypto::sax::XSignatureVerifyResultListener > + xSignatureVerifyResultListener ( m_xResultListener , css::uno::UNO_QUERY ) ; xSignatureVerifyResultListener->signatureVerified( m_nSecurityId, m_nStatus ); } @@ -64,34 +61,34 @@ void SignatureVerifierImpl::startEngine( const rtl::Reference<XMLSignatureTempla * elements) to be verified. ******************************************************************************/ { - cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate; + css::uno::Reference< css::xml::crypto::XXMLSignatureTemplate > xResultTemplate; try { xResultTemplate = m_xXMLSignature->validate(css::uno::Reference<css::xml::crypto::XXMLSignatureTemplate>(xSignatureTemplate.get()), m_xXMLSecurityContext); m_nStatus = xResultTemplate->getStatus(); } - catch( cssu::Exception& ) + catch( css::uno::Exception& ) { - m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED; + m_nStatus = css::xml::crypto::SecurityOperationStatus_RUNTIMEERROR_FAILED; } } /* XSignatureVerifyResultBroadcaster */ void SAL_CALL SignatureVerifierImpl::addSignatureVerifyResultListener( - const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >& listener ) + const css::uno::Reference< css::xml::crypto::sax::XSignatureVerifyResultListener >& listener ) { m_xResultListener = listener; tryToPerform(); } void SAL_CALL SignatureVerifierImpl::removeSignatureVerifyResultListener( - const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >&) + const css::uno::Reference< css::xml::crypto::sax::XSignatureVerifyResultListener >&) { } /* XInitialization */ void SAL_CALL SignatureVerifierImpl::initialize( - const cssu::Sequence< cssu::Any >& aArguments ) + const css::uno::Sequence< css::uno::Any >& aArguments ) { OSL_ASSERT(aArguments.getLength() == 5); @@ -112,9 +109,9 @@ OUString SignatureVerifierImpl_getImplementationName () return IMPLEMENTATION_NAME; } -cssu::Sequence< OUString > SignatureVerifierImpl_getSupportedServiceNames( ) +css::uno::Sequence< OUString > SignatureVerifierImpl_getSupportedServiceNames( ) { - cssu::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SignatureVerifier" }; + css::uno::Sequence<OUString> aRet { "com.sun.star.xml.crypto.sax.SignatureVerifier" }; return aRet; } @@ -129,7 +126,7 @@ sal_Bool SAL_CALL SignatureVerifierImpl::supportsService( const OUString& rServi return cppu::supportsService(this, rServiceName); } -cssu::Sequence< OUString > SAL_CALL SignatureVerifierImpl::getSupportedServiceNames( ) +css::uno::Sequence< OUString > SAL_CALL SignatureVerifierImpl::getSupportedServiceNames( ) { return SignatureVerifierImpl_getSupportedServiceNames(); } 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 c6a1539f2ac0..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); @@ -519,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); diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx index 22ad88f24fc5..3e59efa48e0d 100644 --- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx @@ -28,8 +28,6 @@ #include <cert.h> -namespace cssxc = css::xml::crypto; - using namespace com::sun::star; @@ -43,7 +41,7 @@ SEInitializer_NssImpl::~SEInitializer_NssImpl() } /* XSEInitializer */ -uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL +uno::Reference< css::xml::crypto::XXMLSecurityContext > SAL_CALL SEInitializer_NssImpl::createSecurityContext( const OUString& ) { CERTCertDBHandle *pCertHandle = nullptr ; @@ -56,9 +54,9 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL try { /* Build XML Security Context */ - uno::Reference< cssxc::XXMLSecurityContext > xSecCtx = cssxc::XMLSecurityContext::create( m_xContext ); + uno::Reference< css::xml::crypto::XXMLSecurityContext > xSecCtx = css::xml::crypto::XMLSecurityContext::create( m_xContext ); - uno::Reference< cssxc::XSecurityEnvironment > xSecEnv = cssxc::SecurityEnvironment::create( m_xContext ); + uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = css::xml::crypto::SecurityEnvironment::create( m_xContext ); uno::Reference< lang::XUnoTunnel > xSecEnvTunnel(xSecEnv, uno::UNO_QUERY_THROW); SecurityEnvironment_NssImpl* pSecEnv = reinterpret_cast<SecurityEnvironment_NssImpl*>( sal::static_int_cast<sal_uIntPtr>( @@ -78,7 +76,7 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL } } -void SAL_CALL SEInitializer_NssImpl::freeSecurityContext( const uno::Reference< cssxc::XXMLSecurityContext >& ) +void SAL_CALL SEInitializer_NssImpl::freeSecurityContext( const uno::Reference< css::xml::crypto::XXMLSecurityContext >& ) { /* * because the security context will free all its content when it diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index 1410eb5b0874..f34766666cd1 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -30,9 +30,6 @@ #include "libxslt/xslt.h" #endif -namespace cssu = com::sun::star::uno; -namespace cssxcsax = com::sun::star::xml::csax; - /** * The return value is NULL terminated. The application has the responsibility to * deallocate the return value. @@ -59,7 +56,7 @@ static xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) * The return value and the referenced value must be NULL terminated. * The application has the responsibility to deallocate the return value. */ -static const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) +static const xmlChar** attrlist_to_nxmlstr( const css::uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes ) { xmlChar* attname = nullptr ; xmlChar* attvalue = nullptr ; @@ -132,7 +129,7 @@ SAXHelper::SAXHelper( ) // in other parts of the office. // xmlCleanupParser() ; // and neither can we call xsltCleanupGlobals() - throw cssu::RuntimeException() ; + throw css::uno::RuntimeException() ; } xmlSAXVersion(m_pParserCtxt->sax, 1); @@ -151,7 +148,7 @@ SAXHelper::SAXHelper( ) // xmlCleanupParser() ; // and neither can we call xsltCleanupGlobals() m_pParserCtxt = nullptr ; - throw cssu::RuntimeException() ; + throw css::uno::RuntimeException() ; } else { @@ -218,7 +215,7 @@ void SAXHelper::startDocument() { if( m_pParserCtxt == nullptr) { - throw cssu::RuntimeException() ; + throw css::uno::RuntimeException() ; } /* * Adjust inputTab @@ -235,7 +232,7 @@ void SAXHelper::startDocument() if( m_pParserCtxt->myDoc == nullptr ) { - throw cssu::RuntimeException() ; + throw css::uno::RuntimeException() ; } } @@ -252,7 +249,7 @@ void SAXHelper::endDocument() */ void SAXHelper::startElement( const OUString& aName, - const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) + const css::uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes ) { const xmlChar* fullName = nullptr ; const xmlChar** attrs = nullptr ; diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index 2f01b464471d..2d98e44d0908 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -33,11 +33,6 @@ #endif using namespace com::sun::star; -namespace cssl = com::sun::star::lang; -namespace cssxc = com::sun::star::xml::crypto; -namespace cssxcsax = com::sun::star::xml::csax; -namespace cssxs = com::sun::star::xml::sax; -namespace cssxw = com::sun::star::xml::wrapper; #define STRXMLNS "xmlns" @@ -58,7 +53,7 @@ XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl() /* * creates the virtual root element */ - saxHelper.startElement("root", uno::Sequence<cssxcsax::XMLAttribute>()); + saxHelper.startElement("root", uno::Sequence<css::xml::csax::XMLAttribute>()); m_pRootElement = saxHelper.getCurrentNode(); m_pCurrentElement = m_pRootElement; @@ -156,8 +151,8 @@ void XMLDocumentWrapper_XmlSecImpl::getNextSAXEvent() } void XMLDocumentWrapper_XmlSecImpl::sendStartElement( - const uno::Reference< cssxs::XDocumentHandler >& xHandler, - const uno::Reference< cssxs::XDocumentHandler >& xHandler2, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler2, const xmlNodePtr pNode) /****** XMLDocumentWrapper_XmlSecImpl/sendStartElement ************************ * @@ -179,7 +174,7 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement( ******************************************************************************/ { SvXMLAttributeList* pAttributeList = new SvXMLAttributeList(); - uno::Reference < cssxs::XAttributeList > xAttrList(pAttributeList); + uno::Reference < css::xml::sax::XAttributeList > xAttrList(pAttributeList); xmlNsPtr pNsDef = pNode->nsDef; @@ -244,8 +239,8 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement( } void XMLDocumentWrapper_XmlSecImpl::sendEndElement( - const uno::Reference< cssxs::XDocumentHandler >& xHandler, - const uno::Reference< cssxs::XDocumentHandler >& xHandler2, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler2, const xmlNodePtr pNode) /****** XMLDocumentWrapper_XmlSecImpl/sendEndElement ************************** * @@ -277,8 +272,8 @@ void XMLDocumentWrapper_XmlSecImpl::sendEndElement( } void XMLDocumentWrapper_XmlSecImpl::sendNode( - const uno::Reference< cssxs::XDocumentHandler >& xHandler, - const uno::Reference< cssxs::XDocumentHandler >& xHandler2, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler, + const uno::Reference< css::xml::sax::XDocumentHandler >& xHandler2, const xmlNodePtr pNode) /****** XMLDocumentWrapper_XmlSecImpl/sendNode ******************************** * @@ -357,7 +352,7 @@ OString XMLDocumentWrapper_XmlSecImpl::getNodeQName(const xmlNodePtr pNode) return sNodeName; } -xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const uno::Reference< cssxw::XXMLElementWrapper >& xXMLElement) +xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& xXMLElement) /****** XMLDocumentWrapper_XmlSecImpl/checkElement **************************** * * NAME @@ -375,7 +370,7 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( const uno::Reference< cs if (xXMLElement.is()) { - uno::Reference< cssl::XUnoTunnel > xNodTunnel( xXMLElement, uno::UNO_QUERY_THROW ) ; + uno::Reference< css::lang::XUnoTunnel > xNodTunnel( xXMLElement, uno::UNO_QUERY_THROW ) ; XMLElementWrapper_XmlSecImpl* pElement = reinterpret_cast<XMLElementWrapper_XmlSecImpl*>( sal::static_int_cast<sal_uIntPtr>( @@ -581,13 +576,13 @@ void XMLDocumentWrapper_XmlSecImpl::rebuildIDLink(xmlNodePtr pNode) const } /* XXMLDocumentWrapper */ -uno::Reference< cssxw::XXMLElementWrapper > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getCurrentElement( ) +uno::Reference< css::xml::wrapper::XXMLElementWrapper > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getCurrentElement( ) { XMLElementWrapper_XmlSecImpl* pElement = new XMLElementWrapper_XmlSecImpl(m_pCurrentElement); - return uno::Reference< cssxw::XXMLElementWrapper >(pElement); + return uno::Reference< css::xml::wrapper::XXMLElementWrapper >(pElement); } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setCurrentElement( const uno::Reference< cssxw::XXMLElementWrapper >& element ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setCurrentElement( const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& element ) { m_pCurrentElement = checkElement( element ); saxHelper.setCurrentNode( m_pCurrentElement ); @@ -614,7 +609,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::removeCurrentElement( ) removeNode(pOldCurrentElement); } -sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrent( const uno::Reference< cssxw::XXMLElementWrapper >& node ) +sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrent( const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& node ) { xmlNodePtr pNode = checkElement(node); return (pNode == m_pCurrentElement); @@ -632,16 +627,16 @@ sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::isCurrentElementEmpty( ) return rc; } -OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const uno::Reference< cssxw::XXMLElementWrapper >& node ) +OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getNodeName( const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& node ) { xmlNodePtr pNode = checkElement(node); return OUString::fromUtf8(reinterpret_cast<char const *>(pNode->name)); } void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData( - const uno::Reference< cssxw::XXMLElementWrapper >& node, - const uno::Sequence< uno::Reference< cssxw::XXMLElementWrapper > >& reservedDescendants, - const uno::Reference< cssxw::XXMLElementWrapper >& stopAtNode ) + const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& node, + const uno::Sequence< uno::Reference< css::xml::wrapper::XXMLElementWrapper > >& reservedDescendants, + const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& stopAtNode ) { xmlNodePtr pTargetNode = checkElement(node); @@ -654,7 +649,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::clearUselessData( recursiveDelete(pTargetNode); } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::collapse( const uno::Reference< cssxw::XXMLElementWrapper >& node ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::collapse( const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& node ) { xmlNodePtr pTargetNode = checkElement(node); xmlNodePtr pParent; @@ -672,7 +667,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::collapse( const uno::Reference< css } } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const uno::Reference< cssxs::XDocumentHandler >& handler ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const uno::Reference< css::xml::sax::XDocumentHandler >& handler ) { if (m_pRootElement != nullptr) { @@ -712,10 +707,10 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::getTree( const uno::Reference< cssx } void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents( - const uno::Reference< cssxs::XDocumentHandler >& handler, - const uno::Reference< cssxs::XDocumentHandler >& xEventKeeperHandler, - const uno::Reference< cssxw::XXMLElementWrapper >& startNode, - const uno::Reference< cssxw::XXMLElementWrapper >& endNode ) + const uno::Reference< css::xml::sax::XDocumentHandler >& handler, + const uno::Reference< css::xml::sax::XDocumentHandler >& xEventKeeperHandler, + const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& startNode, + const uno::Reference< css::xml::wrapper::XXMLElementWrapper >& endNode ) { /* * The first SAX event is the startElement of the startNode @@ -738,9 +733,9 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::generateSAXEvents( xmlNodePtr pEndNode = checkElement(endNode); - uno::Reference < cssxc::sax::XSAXEventKeeper > xSAXEventKeeper( xEventKeeperHandler, uno::UNO_QUERY ); + uno::Reference < css::xml::crypto::sax::XSAXEventKeeper > xSAXEventKeeper( xEventKeeperHandler, uno::UNO_QUERY ); - uno::Reference< cssxs::XDocumentHandler > xHandler = handler; + uno::Reference< css::xml::sax::XDocumentHandler > xHandler = handler; while(true) { @@ -795,7 +790,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::rebuildIDLink( } -/* cssxs::XDocumentHandler */ +/* css::xml::sax::XDocumentHandler */ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startDocument( ) { } @@ -804,10 +799,10 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::endDocument( ) { } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startElement( const OUString& aName, const uno::Reference< cssxs::XAttributeList >& xAttribs ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::startElement( const OUString& aName, const uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) { sal_Int32 nLength = xAttribs->getLength(); - uno::Sequence< cssxcsax::XMLAttribute > aAttributes (nLength); + uno::Sequence< css::xml::csax::XMLAttribute > aAttributes (nLength); for (int i = 0; i < nLength; ++i) { @@ -839,7 +834,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::processingInstruction( const OUStri saxHelper.processingInstruction(aTarget, aData); } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setDocumentLocator( const uno::Reference< cssxs::XLocator >& ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::setDocumentLocator( const uno::Reference< css::xml::sax::XLocator >& ) { } @@ -852,7 +847,7 @@ void SAL_CALL XMLDocumentWrapper_XmlSecImpl::compressedEndDocument( ) { } -void SAL_CALL XMLDocumentWrapper_XmlSecImpl::compressedStartElement( const OUString& aName, const uno::Sequence< cssxcsax::XMLAttribute >& aAttributes ) +void SAL_CALL XMLDocumentWrapper_XmlSecImpl::compressedStartElement( const OUString& aName, const uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes ) { saxHelper.startElement(aName, aAttributes); m_pCurrentElement = saxHelper.getCurrentNode(); |