[Libreoffice-commits] .: 2 commits - extensions/source extensions/workben forms/source xmlsecurity/source
Michael Meeks
mmeeks at kemper.freedesktop.org
Mon Nov 22 04:12:26 PST 2010
extensions/source/plugin/base/nfuncs.cxx | 17 -
extensions/source/plugin/base/xplugin.cxx | 16 -
extensions/source/plugin/unx/npnapi.cxx | 21 -
extensions/workben/testpgp.cxx | 93 -------
forms/source/xforms/xpathlib/extension.cxx | 3
forms/source/xforms/xpathlib/xpathlib.hxx | 27 --
xmlsecurity/source/helper/documentsignaturehelper.cxx | 1
xmlsecurity/source/helper/xsecctl.cxx | 56 ----
xmlsecurity/source/helper/xsecctl.hxx | 13 -
xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 45 ---
xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx | 37 --
xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx | 127 ----------
xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 6
13 files changed, 8 insertions(+), 454 deletions(-)
New commits:
commit df464b48863fe2e0229a0f4bf1076405ff3cb204
Author: Michael Meeks <michael.meeks at novell.com>
Date: Mon Nov 22 12:12:58 2010 +0000
cleanup floating comments
diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx
index 17a6f9f..496ad36 100644
--- a/extensions/source/plugin/base/nfuncs.cxx
+++ b/extensions/source/plugin/base/nfuncs.cxx
@@ -584,11 +584,6 @@ NPError SAL_CALL NP_LOADDS NPN_GetValue( NPP instance, NPNVariable variable, vo
break;
}
- /*
- provisional code should there ever be NPNVariables that we actually
- want to query from the PluginContext
- */
-
return aResult;
}
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 7eab876..fee35d0 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -723,7 +723,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
// there may be plugins that can use the file length information,
// but currently none are known. Since this file opening/seeking/closing
- // is rather costly, it is #if'ed out. If there are plugins known to
+ // is rather costly, it is not implemented. If there are plugins known to
// make use of the file length, simply put it in
PluginInputStream* pStream = new PluginInputStream( this, aURL.getStr(),
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 3ae1a7b..109b614 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -576,32 +576,14 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
if( arena == NULL )
throw RuntimeException() ;
- /*
- * mmi : because MS Crypto use the 'S' tag (equal to the 'ST' tag in NSS), but the NSS can't recognise
- * it, so the 'S' tag should be changed to 'ST' tag
- *
- * PS : it can work, but inside libxmlsec, the 'S' tag is till used to find cert in NSS engine, so it
- * is not useful at all. (comment out now)
- */
-
- /* end */
-
- //Create cert info from issue and serial
+ // Create cert info from issue and serial
rtl::OString ostr = rtl::OUStringToOString( issuerName , RTL_TEXTENCODING_UTF8 ) ;
chIssuer = PL_strndup( ( char* )ostr.getStr(), ( int )ostr.getLength() ) ;
nmIssuer = CERT_AsciiToName( chIssuer ) ;
if( nmIssuer == NULL ) {
PL_strfree( chIssuer ) ;
PORT_FreeArena( arena, PR_FALSE ) ;
-
- /*
- * i40394
- *
- * mmi : no need to throw exception
- * just return "no found"
- */
- //throw RuntimeException() ;
- return NULL;
+ return NULL; // no need for exception cf. i40394
}
derIssuer = SEC_ASN1EncodeItem( arena, NULL, ( void* )nmIssuer, SEC_ASN1_GET( CERT_NameTemplate ) ) ;
commit 3569d198e4f37041a2e83ff6897accac2b96a374
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date: Sun Nov 21 15:28:10 2010 +0100
further removing of dead code
Hello,
here in components some other pieces to delete. Again some small parts
in case I was to generous in deleting.
regards
>From 1535d5e774e7d1ef08696344be8fcdfc6828f2c3 Mon Sep 17 00:00:00 2001
From: pjacquod <pjacquod at alumni.ethz.ch>
Date: Sun, 21 Nov 2010 12:10:15 +0100
Subject: [PATCH 1/5] remove dead code components workben
diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx
index cbfc05e..17a6f9f 100644
--- a/extensions/source/plugin/base/nfuncs.cxx
+++ b/extensions/source/plugin/base/nfuncs.cxx
@@ -583,22 +583,10 @@ NPError SAL_CALL NP_LOADDS NPN_GetValue( NPP instance, NPNVariable variable, vo
*(NPBool*)value = false;
break;
}
+
/*
provisional code should there ever be NPNVariables that we actually
want to query from the PluginContext
- ::rtl::OUString aValue;
- try
- {
- pImpl->enterPluginCallback();
- aValue = pImpl->getPluginContext()->
- getValue( pImpl, (::com::sun::star::plugin::PluginVariable)variable );
- pImpl->leavePluginCallback();
- }
- catch( ::com::sun::star::plugin::PluginException& e )
- {
- pImpl->leavePluginCallback();
- return e.ErrorCode;
- }
*/
return aResult;
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 610cc8d..7eab876 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -725,20 +725,6 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype,
// but currently none are known. Since this file opening/seeking/closing
// is rather costly, it is #if'ed out. If there are plugins known to
// make use of the file length, simply put it in
-#if 0
- if( isfile && ! length )
- {
- osl::File aFile( url );
- if( aFile.open( OpenFlag_Read ) == FileBase::E_None )
- {
- aFile.setPos( Pos_End, 0 );
- sal_uInt64 nPos = 0;
- if( aFile.getPos( nPos ) == FileBase::E_None )
- length = nPos;
- aFile.close();
- }
- }
-#endif
PluginInputStream* pStream = new PluginInputStream( this, aURL.getStr(),
length, lastmodified );
diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx
index f1f58fc..35c60de 100644
--- a/extensions/source/plugin/unx/npnapi.cxx
+++ b/extensions/source/plugin/unx/npnapi.cxx
@@ -340,27 +340,6 @@ static const char* l_NPN_UserAgent( NPP instance )
return pAgent;
}
-#if 0
-static void l_NPN_Version( int* major, int* minor, int* net_major, int* net_minor )
-{
- MediatorMessage* pMes = pConnector->
- Transact( eNPN_Version,
- NULL );
-
- if( ! pMes )
- return;
-
- *major = pMes->GetUINT32();
- *minor = pMes->GetUINT32();
- *net_major = pMes->GetUINT32();
- *net_minor = pMes->GetUINT32();
-
- medDebug( 1, "pluginapp: NPN_Version: results %d %d, %d %d\n", *major, *minor, *net_major, *net_minor );
-
- delete pMes;
-}
-#endif
-
static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffer )
{
UINT32 nFileID = pConnector->GetStreamID( stream );
diff --git a/extensions/workben/testpgp.cxx b/extensions/workben/testpgp.cxx
index 1a7902c..482a832 100644
--- a/extensions/workben/testpgp.cxx
+++ b/extensions/workben/testpgp.cxx
@@ -512,75 +512,6 @@ inline rtl::OWString S2U (const sal_Char *ascii)
return rtl::OWString::createFromAscii (ascii);
}
-#if 0 /* OLD */
-
-/*
- * queryModuleActivator.
- */
-BOOL queryModuleActivator (
- const XServiceManagerRef &rxManager,
- XServiceActivatorRef &rxActivator)
-{
- XServiceProviderRef xProv;
- XInterfaceRef xProvInst;
-
- xProv = rxManager->queryServiceProvider (
- L"stardiv.uno.ServiceActivator.module");
- if (!xProv.is())
- {
- printf ("Error: no ServiceActivator service.\n");
- return FALSE;
- }
-
- xProvInst = xProv->createInstance();
- if (!xProvInst.is())
- {
- printf ("Error: no ServiceActivator instance.\n");
- return FALSE;
- }
-
- return xProvInst->queryInterface (
- XServiceActivator::getSmartUik(), rxActivator);
-}
-
-/*
- * install.
- */
-BOOL install (
- const XServiceActivatorRef &rxActivator,
- const char *prefix)
-{
- String aModule ("module://");
- char pBuffer[1024];
-
- vos:ORealDynamicLoader::computeModuleName (
- prefix, pBuffer, sizeof(pBuffer));
- aModule += pBuffer;
-
- return rxActivator->install (
- StringToUString (aModule, CHARSET_SYSTEM));
-}
-
-/*
- * uninstall.
- */
-BOOL uninstall (
- const XServiceActivatorRef &rxActivator,
- const char *prefix)
-{
- String aModule ("module://");
- char pBuffer[1024];
-
- vos::ORealDynamicLoader::computeModuleName (
- prefix, pBuffer, sizeof(pBuffer));
- aModule += pBuffer;
-
- return rxActivator->deinstall (
- StringToUString (aModule, CHARSET_SYSTEM));
-}
-
-#endif /* OLD */
-
/*
* main.
*/
@@ -675,17 +606,7 @@ int SAL_CALL main (int argc, char **argv)
if (nOptions & OPTION_INSTALL)
{
-#if 0 /* OLD */
- XServiceActivatorRef xActivator;
- if (queryModuleActivator (xManager, xActivator))
- {
- if (install (xActivator, "pgp"))
- printf ("Module PGP installed.\n");
- else
- printf ("Error: module PGP not installed.\n");
- }
- nOptions &= ~OPTION_INSTALL;
-#endif /* OLD */
+
}
if (nOptions & (OPTION_DECRYPT | OPTION_ENCRYPT | OPTION_SIGN))
@@ -823,17 +744,7 @@ int SAL_CALL main (int argc, char **argv)
if (nOptions & OPTION_UNINSTALL)
{
-#if 0 /* OLD */
- XServiceActivatorRef xActivator;
- if (queryModuleActivator (xManager, xActivator))
- {
- if (uninstall (xActivator, "pgp"))
- printf ("Module PGP uninstalled.\n");
- else
- printf ("Error: module PGP not uninstalled.\n");
- }
- nOptions &= ~OPTION_UNINSTALL;
-#endif /* OLD */
+
}
return 0;
diff --git a/forms/source/xforms/xpathlib/extension.cxx b/forms/source/xforms/xpathlib/extension.cxx
index 8c29f0f..89d8790 100644
--- a/forms/source/xforms/xpathlib/extension.cxx
+++ b/forms/source/xforms/xpathlib/extension.cxx
@@ -46,20 +46,17 @@ using com::sun::star::xml::dom::XNode;
Reference< XInterface > SAL_CALL CLibxml2XFormsExtension::Create(
const Reference< XMultiServiceFactory >& /*aFactory*/)
{
- // printf("_create_\n");
Reference< XInterface > aInstance(static_cast< XXPathExtension* >(new CLibxml2XFormsExtension(/*aFactory*/)));
return aInstance;
}
::rtl::OUString SAL_CALL CLibxml2XFormsExtension::getImplementationName_Static()
{
- // printf("_implname_\n");
return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.xml.xpath.XFormsExtension") );
}
Sequence< ::rtl::OUString > SAL_CALL CLibxml2XFormsExtension::getSupportedServiceNames_Static()
{
- // printf("_services_\n");
Sequence< ::rtl::OUString > aSequence(1);
aSequence[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.xpath.XPathExtension") );
return aSequence;
diff --git a/forms/source/xforms/xpathlib/xpathlib.hxx b/forms/source/xforms/xpathlib/xpathlib.hxx
index 109f328..2a74c18 100644
--- a/forms/source/xforms/xpathlib/xpathlib.hxx
+++ b/forms/source/xforms/xpathlib/xpathlib.hxx
@@ -16,38 +16,11 @@
* An XPath parser context. It contains pure parsing informations,
* an xmlXPathContext, and the stack of objects.
*/
-#if 0
-// for reference from xpath.h
-struct _xmlXPathParserContext {
- const xmlChar *cur; /* the current char being parsed */
- const xmlChar *base; /* the full expression */
-
- int error; /* error code */
-
- xmlXPathContextPtr context; /* the evaluation context */
- xmlXPathObjectPtr value; /* the current value */
- int valueNr; /* number of values stacked */
- int valueMax; /* max number of values stacked */
- xmlXPathObjectPtr *valueTab; /* stack of values */
-
- xmlXPathCompExprPtr comp; /* the precompiled expression */
- int xptr; /* it this an XPointer expression */
- xmlNodePtr ancestor; /* used for walking preceding axis */
-};
-
-#endif
extern "C"
{
// XForms
-/*
-void xforms_getInstanceDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs);
-void xforms_rebuildFunction(xmlXPathParserContextPtr ctxt, int nargs);
-void xforms_recalculateFunction(xmlXPathParserContextPtr ctxt, int nargs);
-void xforms_revalidateFunction(xmlXPathParserContextPtr ctxt, int nargs);
-void xforms_refreshFunction(xmlXPathParserContextPtr ctxt, int nargs);
-*/
// XForms Core Functions
// boolean functions
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index d505878..65bd34e 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -43,7 +43,6 @@
#include "rtl/uri.hxx"
using namespace ::com::sun::star::uno;
-//using namespace ::com::sun::star;
namespace css = ::com::sun::star;
using rtl::OUString;
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index 33c7fde..83f4774 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -715,57 +715,6 @@ cssu::Reference< com::sun::star::io::XInputStream >
return xObjectInputStream;
}
-#if 0
-sal_Int32 XSecController::getFastPropertyIndex(sal_Int32 nHandle) const
-/****** XSecController/getFastPropertyIndex ***********************************
- *
- * NAME
- * getFastPropertyIndex -- gets the index of a particular fast property
- *
- * SYNOPSIS
- * nIndex = getFastPropertyIndex( nHandle );
- *
- * FUNCTION
- * See NAME.
- *
- * INPUTS
- * nHandle - the key for the fast property
- *
- * RESULT
- * nIndex - the index of the fast property, or -1
- * if the key is not found.
- *
- * HISTORY
- * 05.01.2004 - implemented
- *
- * AUTHOR
- * Michael Mi
- * Email: michael.mi at sun.com
- ******************************************************************************/
-{
- std::vector< sal_Int32 >::const_iterator ii = m_vFastPropertyIndexs.begin();
- sal_Int32 nIndex = 0;
-
- bool bFound = false;
-
- for( ; ii != m_vFastPropertyIndexs.end(); ++ii,++nIndex )
- {
- if ( nHandle == (*ii))
- {
- bFound = true;
- break;
- }
- }
-
- if (!bFound)
- {
- nIndex = -1;
- }
-
- return nIndex;
-}
-#endif
-
/*
* public methods
*/
@@ -1091,11 +1040,6 @@ void XSecController::exportSignature(
rtl::OUString tag_SignatureProperties(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTIES));
rtl::OUString tag_SignatureProperty(RTL_CONSTASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY));
rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE));
-#if 0
- rtl::OUString tag_Timestamp(RTL_CONSTASCII_USTRINGPARAM(TAG_TIMESTAMP));
- rtl::OUString tag_Date(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE));
- rtl::OUString tag_Time(RTL_CONSTASCII_USTRINGPARAM(TAG_TIME));
-#endif
const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors;
SvXMLAttributeList *pAttributeList;
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 5d6135c..526969c 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -217,19 +217,6 @@ private:
com::sun::star::uno::Reference<
com::sun::star::xml::crypto::XXMLSecurityContext > m_xSecurityContext;
-#if 0
- /*
- * the signature creation result listener
- */
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSignatureCreationResultListener > m_xSignatureCreationResultListener;
- /*
- * the signature verify result listener
- */
- com::sun::star::uno::Reference<
- com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener > m_xSignatureVerifyResultListener;
-#endif
-
/*
* the security id incrementer, in order to make any security id unique
* to the SAXEventKeeper.
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 3643491..3ae1a7b 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -584,29 +584,6 @@ Reference< XCertificate > SecurityEnvironment_NssImpl :: getCertificate( const O
* is not useful at all. (comment out now)
*/
- /*
- sal_Int32 nIndex = 0;
- OUString newIssuerName;
- do
- {
- OUString aToken = issuerName.getToken( 0, ',', nIndex ).trim();
- if (aToken.compareToAscii("S=",2) == 0)
- {
- newIssuerName+=OUString::createFromAscii("ST=");
- newIssuerName+=aToken.copy(2);
- }
- else
- {
- newIssuerName+=aToken;
- }
-
- if (nIndex >= 0)
- {
- newIssuerName+=OUString::createFromAscii(",");
- }
- } while ( nIndex >= 0 );
- */
-
/* end */
//Create cert info from issue and serial
diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
index 8a5cb3c..4810902 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
@@ -99,12 +99,6 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
throw RuntimeException() ;
}
-#if 0
- XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ;
- if( pSecCtxt == NULL )
- throw RuntimeException() ;
-#endif
-
SecurityEnvironment_NssImpl* pSecEnv =
reinterpret_cast<SecurityEnvironment_NssImpl*>(
sal::static_int_cast<sal_uIntPtr>(xSecTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ))) ;
@@ -156,11 +150,6 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
throw XMLEncryptionException() ;
}
- /* MM : remove the following 2 lines
- xmlUnlinkNode(pContent);
- xmlAddNextSibling(pEncryptedData, pContent);
- */
-
//remember the position of the element to be signed
sal_Bool isParentRef = sal_True;
xmlNodePtr pParent = pEncryptedData->parent;
@@ -196,32 +185,6 @@ SAL_CALL XMLEncryption_NssImpl :: encrypt(
pEncryptedData = pTemplate->getNativeElement() ;
//Find the element to be encrypted.
- /* MM : remove the old method to get the target element
- //This element is wrapped in the CipherValue sub-element.
- xmlNodePtr pCipherData = pEncryptedData->children;
- while (pCipherData != NULL && stricmp((const char *)(pCipherData->name), "CipherData"))
- {
- pCipherData = pCipherData->next;
- }
-
- if( pCipherData == NULL ) {
- xmlSecEncCtxDestroy( pEncCtx ) ;
- throw XMLEncryptionException() ;
- }
-
- xmlNodePtr pCipherValue = pCipherData->children;
- while (pCipherValue != NULL && stricmp((const char *)(pCipherValue->name), "CipherValue"))
- {
- pCipherValue = pCipherValue->next;
- }
-
- if( pCipherValue == NULL ) {
- xmlSecEncCtxDestroy( pEncCtx ) ;
- throw XMLEncryptionException() ;
- }
-
- pContent = pCipherValue->children;
- */
//Encrypt the template
if( xmlSecEncCtxXmlEncrypt( pEncCtx , pEncryptedData , pContent ) < 0 )
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
index 9b6ed2d..386f438 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
@@ -79,11 +79,7 @@ XMLSecurityContext_NssImpl :: XMLSecurityContext_NssImpl( const Reference< XMult
}
XMLSecurityContext_NssImpl :: ~XMLSecurityContext_NssImpl() {
-#if 0 //i39448
- if( m_pKeysMngr != NULL ) {
- xmlSecKeysMngrDestroy( m_pKeysMngr ) ;
- }
-#endif
+ //i39448
xmlDisableStreamInputCallbacks() ;
xmlSecCryptoShutdown() ;
@@ -150,86 +146,7 @@ void SAL_CALL XMLSecurityContext_NssImpl::setDefaultSecurityEnvironmentIndex( sa
m_nDefaultEnvIndex = nDefaultEnvIndex;
}
-#if 0 //i39448 : old methods should be deleted
-/* XXMLSecurityContext */
-void SAL_CALL XMLSecurityContext_NssImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) {
- PK11SlotInfo* slot ;
- CERTCertDBHandle* handler ;
- //xmlSecKeyPtr key ;
- //xmlSecKeyDataPtr keyData ;
- PK11SymKey* symKey ;
- SECKEYPublicKey* pubKey ;
- SECKEYPrivateKey* priKey ;
- unsigned int i ;
-
- if( !aSecurityEnvironment.is() )
- throw RuntimeException() ;
-
- m_xSecurityEnvironment = aSecurityEnvironment ;
-
- //Clear key manager
- if( m_pKeysMngr != NULL ) {
- xmlSecKeysMngrDestroy( m_pKeysMngr ) ;
- m_pKeysMngr = NULL ;
- }
-
- //Create key manager
- Reference< XUnoTunnel > xEnvTunnel( m_xSecurityEnvironment , UNO_QUERY ) ;
- if( !xEnvTunnel.is() ) {
- throw RuntimeException() ;^1
- }
-
- SecurityEnvironment_NssImpl* pSecEnv = ( SecurityEnvironment_NssImpl* )xEnvTunnel->getSomething( SecurityEnvironment_NssImpl::getUnoTunnelId() ) ;
- if( pSecEnv == NULL )
- throw RuntimeException() ;
-
- //todo
-// slot = pSecEnv->getCryptoSlot() ;
- handler = pSecEnv->getCertDb() ;
-
- /*-
- * The following lines is based on the private version of xmlSec-NSS
- * crypto engine
- */
- m_pKeysMngr = xmlSecNssAppliedKeysMngrCreate( slot , handler ) ;
- if( m_pKeysMngr == NULL )
- throw RuntimeException() ;
-
- /*-
- * Adopt symmetric key into keys manager
- */
- for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecNssAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-
- /*-
- * Adopt asymmetric public key into keys manager
- */
- for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecNssAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-
- /*-
- * Adopt asymmetric private key into keys manager
- */
- for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecNssAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-}
-
-/* XXMLSecurityContext */
-Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_NssImpl :: getSecurityEnvironment()
- throw (RuntimeException)
-{
- return m_xSecurityEnvironment ;
-}
-#endif
+//i39448 : old methods deleted
/* XInitialization */
@@ -282,45 +199,5 @@ Reference< XSingleServiceFactory > XMLSecurityContext_NssImpl :: impl_createFact
return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ;
}
-#if 0 //not useful any longer
-/* XUnoTunnel */
-sal_Int64 SAL_CALL XMLSecurityContext_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
-throw (RuntimeException)
-{
- if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
- return ( sal_Int64 )this ;
- }
- return 0 ;
-}
-
-/* XUnoTunnel extension */
-const Sequence< sal_Int8>& XMLSecurityContext_NssImpl :: getUnoTunnelId() {
- static Sequence< sal_Int8 >* pSeq = 0 ;
- if( !pSeq ) {
- ::osl::Guard< ::osl::Mutex > aGuard( ::osl::Mutex::getGlobalMutex() ) ;
- if( !pSeq ) {
- static Sequence< sal_Int8> aSeq( 16 ) ;
- rtl_createUuid( ( sal_uInt8* )aSeq.getArray() , 0 , sal_True ) ;
- pSeq = &aSeq ;
- }
- }
- return *pSeq ;
-}
-
-/* XUnoTunnel extension */
-XMLSecurityContext_NssImpl* XMLSecurityContext_NssImpl :: getImplementation( const Reference< XInterface > xObj ) {
- Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ;
- if( xUT.is() ) {
- return ( XMLSecurityContext_NssImpl* )xUT->getSomething( getUnoTunnelId() ) ;
- } else
- return NULL ;
-}
-
-/* Native methods */
-xmlSecKeysMngrPtr XMLSecurityContext_NssImpl :: keysManager() throw( Exception, RuntimeException ) {
- return m_pKeysMngr ;
-}
-
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index 090dee7..51e8ab2 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -126,11 +126,7 @@ SAL_CALL XMLSignature_NssImpl :: generate(
throw RuntimeException() ;
}
-#if 0 //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext
- XMLSecurityContext_NssImpl* pSecCtxt = ( XMLSecurityContext_NssImpl* )xSecTunnel->getSomething( XMLSecurityContext_NssImpl::getUnoTunnelId() ) ;
- if( pSecCtxt == NULL )
- throw RuntimeException() ;
-#endif
+ //i39448 : the key manager should be retrieved from SecurityEnvironment, instead of SecurityContext
SecurityEnvironment_NssImpl* pSecEnv =
reinterpret_cast<SecurityEnvironment_NssImpl*>(
More information about the Libreoffice-commits
mailing list