summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec
diff options
context:
space:
mode:
authorPierre-André Jacquod <pjacquod@alumni.ethz.ch>2010-11-21 15:28:10 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-11-22 12:10:30 +0000
commitf3eb77586e067a46211334a78987652815f47744 (patch)
tree640886220e29602e113c0553286a70bf38e389ba /xmlsecurity/source/xmlsec
parent9140ff3adcb0d34bdaef8fb8b73c96947c592ec0 (diff)
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@alumni.ethz.ch> Date: Sun, 21 Nov 2010 12:10:15 +0100 Subject: [PATCH 1/5] remove dead code components workben
Diffstat (limited to 'xmlsecurity/source/xmlsec')
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx23
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx37
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx127
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx6
4 files changed, 3 insertions, 190 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 87b02e948d34..187cbd34c8d6 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 e2e0c943d8e2..f8f2f1384541 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 db8500fea13d..6f0a0bd1f6c4 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 9c08a4d01fce..f799d7977176 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*>(