summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorpjacquod <pjacquod@alumni.ethz.ch>2010-11-16 20:26:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2010-11-17 16:42:29 +0000
commitf0f777ecbdc9a43c22b28642f8f964b9027b9cc8 (patch)
tree54f3f780f2913e7e428dfca7e210effc3e5c850e /xmlsecurity
parent3b51872f1598cbd45a50ed984cb9501430681c55 (diff)
RTL_CONSTASCII_USTRINGPARAM in components - xmlsecurity- helpd
remove rtl::oustring::createfromascii("foo") and code clean up: suppression of commented out code
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx37
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx81
-rw-r--r--xmlsecurity/source/helper/xsecctl.hxx17
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx33
-rw-r--r--xmlsecurity/source/helper/xsecparser.hxx2
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx8
6 files changed, 9 insertions, 169 deletions
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 18fb74c6c399..9ae0cd6d7bde 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -170,11 +170,6 @@ void XMLSignatureHelper::SetX509Certificate(
void XMLSignatureHelper::SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const Time& rTime )
{
- /*
- rtl::OUString aDate = String::CreateFromInt32( rDate.GetDate() );
- rtl::OUString aTime = String::CreateFromInt32( rTime.GetTime() );
- mpXSecController->setDateTime( nSecurityId, aDate, aTime );
- */
::com::sun::star::util::DateTime stDateTime;
stDateTime.HundredthSeconds = (::sal_uInt16)rTime.Get100Sec();
stDateTime.Seconds = (::sal_uInt16)rTime.GetSec();
@@ -261,16 +256,10 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
/*
* create a signature listener
*/
-/*
- ImplXMLSignatureListener* pSignatureListener = new ImplXMLSignatureListener(
- LINK( this, XMLSignatureHelper, SignatureCreationResultListener ),
- LINK( this, XMLSignatureHelper, SignatureVerifyResultListener ),
- LINK( this, XMLSignatureHelper, StartVerifySignatureElement ) );
-*/
+
/*
* configure the signature creation listener
*/
- //mpXSecController->setSignatureCreationResultListener( pSignatureListener );
/*
* write signatures
@@ -283,7 +272,6 @@ bool XMLSignatureHelper::CreateAndWriteSignature( const uno::Reference< xml::sax
/*
* clear up the signature creation listener
*/
- //mpXSecController->setSignatureCreationResultListener( NULL );
return !mbError;
}
@@ -310,7 +298,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
* prepare ParserInputSrouce
*/
xml::sax::InputSource aParserInput;
- // aParserInput.sSystemId = ouName;
aParserInput.aInputStream = xInputStream;
/*
@@ -319,7 +306,7 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
uno::Reference< xml::sax::XParser > xParser(
xMCF->createInstanceWithContext(
- rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser"), mxCtx ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser") ), mxCtx ),
uno::UNO_QUERY );
DBG_ASSERT( xParser.is(), "Can't create parser" );
@@ -341,7 +328,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
/*
* configure the signature verify listener
*/
- //mpXSecController->setSignatureVerifyResultListener( pSignatureListener );
/*
* setup the connection:
@@ -382,7 +368,6 @@ bool XMLSignatureHelper::ReadAndVerifySignature( const com::sun::star::uno::Refe
/*
* clear up the signature verify listener
*/
- //mpXSecController->setSignatureVerifyResultListener( NULL );
/*
* release the signature reader
@@ -418,24 +403,6 @@ sal_Int32 XMLSignatureHelper::GetSecurityEnvironmentNumber()
}
-/*
-void XMLSignatureHelper::createSecurityContext( rtl::OUString tokenPath )
-{
- if ( !mxSEInitializer.is() )
- ImplCreateSEInitializer();
-
- mxSecurityContext = mxSEInitializer->createSecurityContext(tokenPath);
-}
-
-void XMLSignatureHelper::freeSecurityContext()
-{
- if ( !mxSEInitializer.is() )
- ImplCreateSEInitializer();
-
- mxSEInitializer->freeSecurityContext( mxSecurityContext );
-}
-*/
-
IMPL_LINK( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult*, pResult )
{
maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), *pResult );
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index d2af8a56c760..4bfe661dc408 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -1365,46 +1365,6 @@ SignatureInformations XSecController::getSignatureInformations() const
/*
* XFastPropertySet
*/
-/*
-void SAL_CALL XSecController::setFastPropertyValue(
- sal_Int32 nHandle,
- const cssu::Any& aValue )
- throw ( cssb::UnknownPropertyException,
- cssb::PropertyVetoException,
- cssl::IllegalArgumentException,
- cssl::WrappedTargetException,
- cssu::RuntimeException)
-{
- sal_Int32 nIndex = getFastPropertyIndex(nHandle);
- if (nIndex == -1)
- {
- m_vFastPropertyIndexs.push_back( nHandle );
- m_vFastPropertyValues.push_back( aValue );
- }
- else
- {
- m_vFastPropertyValues[nIndex] = aValue;
- }
-}
-
-cssu::Any SAL_CALL XSecController::getFastPropertyValue(
- sal_Int32 nHandle )
- throw (
- cssb::UnknownPropertyException,
- cssl::WrappedTargetException,
- cssu::RuntimeException)
-{
- cssu::Any aValue;
-
- sal_Int32 nIndex = getFastPropertyIndex(nHandle);
- if (nIndex != -1)
- {
- aValue = m_vFastPropertyValues[nIndex];
- }
-
- return aValue;
-}
-*/
/*
* XSAXEventKeeperStatusChangeListener
@@ -1413,13 +1373,6 @@ cssu::Any SAL_CALL XSecController::getFastPropertyValue(
void SAL_CALL XSecController::blockingStatusChanged( sal_Bool isBlocking )
throw (cssu::RuntimeException)
{
- /*
- showMessageBox( rtl::OUString::createFromAscii((isBlocking?
- "Blocking Status => TRUE":
- "Blocking Status => FALSE")),
- rtl::OUString::createFromAscii("SAXEventKeeper Status"));
- */
-
this->m_bIsBlocking = isBlocking;
checkChainingStatus();
}
@@ -1428,13 +1381,6 @@ void SAL_CALL XSecController::collectionStatusChanged(
sal_Bool isInsideCollectedElement )
throw (cssu::RuntimeException)
{
- /*
- showMessageBox( rtl::OUString::createFromAscii((isInsideCollectedElement?
- "Collection Status => TRUE":
- "Collection Status => FALSE")),
- rtl::OUString::createFromAscii("SAXEventKeeper Status"));
- */
-
this->m_bIsCollectingElement = isInsideCollectedElement;
checkChainingStatus();
}
@@ -1442,12 +1388,7 @@ void SAL_CALL XSecController::collectionStatusChanged(
void SAL_CALL XSecController::bufferStatusChanged( sal_Bool /*isBufferEmpty*/)
throw (cssu::RuntimeException)
{
- /*
- showMessageBox( rtl::OUString::createFromAscii((isBufferEmpty?
- "Buffer Empty => TRUE":
- "Buffer Empty => FALSE")),
- rtl::OUString::createFromAscii("SAXEventKeeper Status"));
- */
+
}
/*
@@ -1461,16 +1402,6 @@ void SAL_CALL XSecController::signatureCreated( sal_Int32 securityId, com::sun::
SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor;
- /*
- if (nResult == cssxc::sax::SignatureCreationResult_CREATIONSUCCEED)
- {
- signatureInfor.nStatus = STATUS_CREATION_SUCCEED;
- }
- else
- {
- signatureInfor.nStatus = STATUS_CREATION_FAIL;
- }
- */
signatureInfor.nStatus = nResult;
}
@@ -1485,16 +1416,6 @@ void SAL_CALL XSecController::signatureVerified( sal_Int32 securityId, com::sun:
SignatureInformation& signatureInfor = m_vInternalSignatureInformations[index].signatureInfor;
- /*
- if (nResult == cssxc::sax::SignatureVerifyResult_VERIFYSUCCEED)
- {
- signatureInfor.nStatus = STATUS_VERIFY_SUCCEED;
- }
- else
- {
- signatureInfor.nStatus = STATUS_VERIFY_FAIL;
- }
- */
signatureInfor.nStatus = nResult;
}
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 5fafb4c51fa9..7744174e15c5 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -532,23 +532,6 @@ public:
/*
* XFastPropertySet
*/
- /*
- virtual void SAL_CALL setFastPropertyValue(
- sal_Int32 nHandle,
- const com::sun::star::uno::Any& aValue )
- throw (
- com::sun::star::beans::UnknownPropertyException,
- com::sun::star::beans::PropertyVetoException,
- com::sun::star::lang::IllegalArgumentException,
- com::sun::star::lang::WrappedTargetException,
- com::sun::star::uno::RuntimeException);
- virtual com::sun::star::uno::Any SAL_CALL getFastPropertyValue(
- sal_Int32 nHandle )
- throw (
- com::sun::star::beans::UnknownPropertyException,
- com::sun::star::lang::WrappedTargetException,
- com::sun::star::uno::RuntimeException);
- */
/*
* XSAXEventKeeperStatusChangeListener
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 8d9b84132712..96272fd07416 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -75,7 +75,6 @@ void SAL_CALL XSecParser::startDocument( )
m_bInSignatureValue = false;
m_bInDigestValue = false;
m_bInDate = false;
- //m_bInTime = false;
if (m_xNextHandler.is())
{
@@ -152,27 +151,27 @@ void SAL_CALL XSecParser::startElement(
}
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME)))
{
- m_ouX509IssuerName = rtl::OUString::createFromAscii("");
+ m_ouX509IssuerName = rtl::OUString();
m_bInX509IssuerName = true;
}
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER)))
{
- m_ouX509SerialNumber = rtl::OUString::createFromAscii("");
+ m_ouX509SerialNumber = rtl::OUString();
m_bInX509SerialNumber = true;
}
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE)))
{
- m_ouX509Certificate = rtl::OUString::createFromAscii("");
+ m_ouX509Certificate = rtl::OUString();
m_bInX509Certificate = true;
}
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE)))
{
- m_ouSignatureValue = rtl::OUString::createFromAscii("");
+ m_ouSignatureValue = rtl::OUString();
m_bInSignatureValue = true;
}
else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE)))
{
- m_ouDigestValue = rtl::OUString::createFromAscii("");
+ m_ouDigestValue = rtl::OUString();
m_bInDigestValue = true;
}
else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)) )
@@ -186,16 +185,9 @@ void SAL_CALL XSecParser::startElement(
+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":"))
+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE)))
{
- m_ouDate = rtl::OUString::createFromAscii("");
+ m_ouDate = rtl::OUString();
m_bInDate = true;
}
- /*
- else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)))
- {
- m_ouTime = rtl::OUString::createFromAscii("");
- m_bInTime = true;
- }
- */
if (m_xNextHandler.is())
{
@@ -271,13 +263,6 @@ void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
m_pXSecController->setDate( m_ouDate );
m_bInDate = false;
}
- /*
- else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)) )
- {
- m_pXSecController->setTime( m_ouTime );
- m_bInTime = false;
- }
- */
if (m_xNextHandler.is())
{
@@ -327,12 +312,6 @@ void SAL_CALL XSecParser::characters( const rtl::OUString& aChars )
{
m_ouDate += aChars;
}
- /*
- else if (m_bInTime)
- {
- m_ouTime += aChars;
- }
- */
if (m_xNextHandler.is())
{
diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx
index 3cfb033be534..b246a2a92bb9 100644
--- a/xmlsecurity/source/helper/xsecparser.hxx
+++ b/xmlsecurity/source/helper/xsecparser.hxx
@@ -76,7 +76,6 @@ private:
rtl::OUString m_ouDigestValue;
rtl::OUString m_ouSignatureValue;
rtl::OUString m_ouDate;
- //rtl::OUString m_ouTime;
/*
* whether inside a particular element
@@ -87,7 +86,6 @@ private:
bool m_bInDigestValue;
bool m_bInSignatureValue;
bool m_bInDate;
- //bool m_bInTime;
/*
* the XSecController collaborating with XSecParser
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 8f903dd2053d..32f3126b4845 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -220,14 +220,6 @@ void XSecController::setDate( rtl::OUString& ouDate )
isi.signatureInfor.ouDateTime = ouDate;
}
-/*
-void XSecController::setTime( rtl::OUString& ouTime )
-{
- InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1];
- isi.signatureInfor.ouTime = ouTime;
-}
-*/
-
void XSecController::setId( rtl::OUString& ouId )
{
InternalSignatureInformation &isi = m_vInternalSignatureInformations[m_vInternalSignatureInformations.size()-1];