[Libreoffice-commits] .: 3 commits - accessibility/inc accessibility/source xmlsecurity/source
Caolán McNamara
caolan at kemper.freedesktop.org
Tue Jun 7 03:32:56 PDT 2011
accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx | 5
accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx | 5
accessibility/source/extended/AccessibleBrowseBoxBase.cxx | 24 -
accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx | 11
accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx | 11
accessibility/source/extended/AccessibleGridControlBase.cxx | 22 -
accessibility/source/extended/AccessibleGridControlHeader.cxx | 11
accessibility/source/extended/AccessibleGridControlTableBase.cxx | 11
xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 20 -
xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 19 -
xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx | 161 ----------
xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 19 -
xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx | 21 -
13 files changed, 76 insertions(+), 264 deletions(-)
New commits:
commit fcd04d83e47d23d9464553dd8ee75458ee73d93f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jun 5 15:23:14 2011 +0100
use standard pattern for this
diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx
index b246918..9120805 100644
--- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx
@@ -353,11 +353,6 @@ protected:
Rectangle getBoundingBoxOnScreen()
throw ( ::com::sun::star::lang::DisposedException );
- /** Creates a new UUID, if rId is empty.
- @attention This method requires locked global mutex to prevent double
- creation of an UUID. */
- static void implCreateUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rId );
-
::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; }
void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; }
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
index 60bdd0b..8cb2764 100644
--- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
+++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx
@@ -322,11 +322,6 @@ protected:
Rectangle getBoundingBoxOnScreen()
throw ( ::com::sun::star::lang::DisposedException );
- /** Creates a new UUID, if rId is empty.
- @attention This method requires locked global mutex to prevent double
- creation of an UUID. */
- static void implCreateUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rId );
-
::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; }
void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; }
diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
index 56f8c2d..98ed28c 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
@@ -30,8 +30,8 @@
#include "precompiled_accessibility.hxx"
#include "accessibility/extended/AccessibleBrowseBoxBase.hxx"
#include <svtools/accessibletableprovider.hxx>
-#include <rtl/uuid.h>
-//
+#include <comphelper/servicehelper.hxx>
+
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblerelationsethelper.hxx>
@@ -344,13 +344,15 @@ void SAL_CALL AccessibleBrowseBoxBase::removeEventListener(
// XTypeProvider --------------------------------------------------------------
+namespace
+{
+ class theAccessibleBrowseBoxBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleBrowseBoxBaseImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleBrowseBoxBase::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleBrowseBoxBaseImplementationId::get().getSeq();
}
// XServiceInfo ---------------------------------------------------------------
@@ -508,17 +510,7 @@ void AccessibleBrowseBoxBase::commitEvent(
AccessibleEventNotifier::addEvent( getClientId( ), aEvent );
}
-// -----------------------------------------------------------------------------
-void AccessibleBrowseBoxBase::implCreateUuid( Sequence< sal_Int8 >& rId )
-{
- if( !rId.hasElements() )
- {
- rId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( rId.getArray() ), 0, sal_True );
- }
-}
-// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleBrowseBoxBase::getAccessibleRole()
throw ( uno::RuntimeException )
{
diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx
index 2ba0e93..55aa3a4 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx
@@ -32,6 +32,7 @@
#include "accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx"
#include <svtools/accessibletableprovider.hxx>
+#include <comphelper/servicehelper.hxx>
// ============================================================================
@@ -344,13 +345,15 @@ OUString SAL_CALL AccessibleBrowseBoxHeaderBar::getImplementationName()
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svtools.AccessibleBrowseBoxHeaderBar" ) );
}
+namespace
+{
+ class theAccessibleBrowseBoxHeaderBarImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleBrowseBoxHeaderBarImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleBrowseBoxHeaderBar::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleBrowseBoxHeaderBarImplementationId::get().getSeq();
}
// internal virtual methods ---------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
index ca02551..7c8355f 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx
@@ -34,6 +34,7 @@
#include <svtools/accessibletableprovider.hxx>
#include <tools/multisel.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
// ============================================================================
@@ -206,13 +207,15 @@ Sequence< uno::Type > SAL_CALL AccessibleBrowseBoxTableBase::getTypes()
AccessibleBrowseBoxTableImplHelper::getTypes() );
}
+namespace
+{
+ class theAccessibleBrowseBoxTableBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleBrowseBoxTableBaseImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleBrowseBoxTableBase::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleBrowseBoxTableBaseImplementationId::get().getSeq();
}
// internal virtual methods ---------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx
index db0cf33..cdf0db3 100644
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -30,7 +30,7 @@
#include "precompiled_accessibility.hxx"
#include "accessibility/extended/AccessibleGridControlBase.hxx"
#include <svtools/accessibletable.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
//
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -280,13 +280,15 @@ void SAL_CALL AccessibleGridControlBase::removeEventListener(
// XTypeProvider --------------------------------------------------------------
+namespace
+{
+ class theAccessibleGridControlBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleGridControlBaseImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleGridControlBase::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleGridControlBaseImplementationId::get().getSeq();
}
// XServiceInfo ---------------------------------------------------------------
@@ -409,17 +411,7 @@ void AccessibleGridControlBase::commitEvent(
AccessibleEventNotifier::addEvent( getClientId( ), aEvent );
}
-// -----------------------------------------------------------------------------
-void AccessibleGridControlBase::implCreateUuid( Sequence< sal_Int8 >& rId )
-{
- if( !rId.hasElements() )
- {
- rId.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( rId.getArray() ), 0, sal_True );
- }
-}
-// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole()
throw ( uno::RuntimeException )
{
diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx
index d217d53..6684179 100644
--- a/accessibility/source/extended/AccessibleGridControlHeader.cxx
+++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx
@@ -34,6 +34,7 @@
#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx"
#include "accessibility/extended/AccessibleGridControlTableCell.hxx"
#include <svtools/accessibletable.hxx>
+#include <comphelper/servicehelper.hxx>
// ============================================================================
@@ -227,13 +228,15 @@ OUString SAL_CALL AccessibleGridControlHeader::getImplementationName()
return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.accessibility.AccessibleGridControlHeader" ) );
}
+namespace
+{
+ class theAccessibleGridControlHeaderImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleGridControlHeaderImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleGridControlHeader::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleGridControlHeaderImplementationId::get().getSeq();
}
// internal virtual methods ---------------------------------------------------
diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
index 81bc042..4c3ef18 100644
--- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx
@@ -34,6 +34,7 @@
#include <svtools/accessibletable.hxx>
#include <tools/multisel.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
// ============================================================================
@@ -210,13 +211,15 @@ Sequence< uno::Type > SAL_CALL AccessibleGridControlTableBase::getTypes()
AccessibleGridControlTableImplHelper::getTypes() );
}
+namespace
+{
+ class theAccessibleGridControlTableBaseImplementationId : public rtl::Static< UnoTunnelIdInit, theAccessibleGridControlTableBaseImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL AccessibleGridControlTableBase::getImplementationId()
throw ( uno::RuntimeException )
{
- ::osl::MutexGuard aGuard( getOslGlobalMutex() );
- static Sequence< sal_Int8 > aId;
- implCreateUuid( aId );
- return aId;
+ return theAccessibleGridControlTableBaseImplementationId::get().getSeq();
}
// internal helper methods ----------------------------------------------------
commit eabf861d0e2a7a269132fefa099845d5e61d2d1e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jun 4 00:17:31 2011 +0100
use standard pattern for this
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 0327d9b..db0cb9c 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -43,7 +43,7 @@
#include "securityenvironment_mscryptimpl.hxx"
#include "x509certificate_mscryptimpl.hxx"
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <xmlsec/xmlsec.h>
#include <xmlsec/keysmngr.h>
@@ -230,17 +230,15 @@ sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequen
}
/* XUnoTunnel extension */
+
+
+namespace
+{
+ class theSecurityEnvironment_MSCryptImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSecurityEnvironment_MSCryptImplUnoTunnelId > {};
+}
+
const Sequence< sal_Int8>& SecurityEnvironment_MSCryptImpl :: 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 ;
+ return theSecurityEnvironment_MSCryptImplUnoTunnelId::get().getSeq();
}
/* XUnoTunnel extension */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index a53b604..1c608af 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmlsecurity.hxx"
#include <sal/config.h>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include "x509certificate_mscryptimpl.hxx"
#include "certificateextension_xmlsecimpl.hxx"
#include "sanextension_mscryptimpl.hxx"
@@ -489,17 +489,14 @@ sal_Int64 SAL_CALL X509Certificate_MSCryptImpl :: getSomething( const Sequence<
}
/* XUnoTunnel extension */
+
+namespace
+{
+ class theX509Certificate_MSCryptImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theX509Certificate_MSCryptImplUnoTunnelId > {};
+}
+
const Sequence< sal_Int8>& X509Certificate_MSCryptImpl :: 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 ;
+ return theX509Certificate_MSCryptImplUnoTunnelId::get().getSeq();
}
/* XUnoTunnel extension */
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index e128faf..9928d59 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -40,7 +40,7 @@
#include <sal/macros.h>
#include "securityenvironment_nssimpl.hxx"
#include "x509certificate_nssimpl.hxx"
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include "../diagnose.hxx"
#include <sal/types.h>
@@ -242,17 +242,14 @@ sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence<
}
/* XUnoTunnel extension */
+
+namespace
+{
+ class theSecurityEnvironment_NssImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSecurityEnvironment_NssImplUnoTunnelId > {};
+}
+
const Sequence< sal_Int8>& SecurityEnvironment_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 ;
+ return theSecurityEnvironment_NssImplUnoTunnelId::get().getSeq();
}
/* XUnoTunnel extension */
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index ada771b..2e2836a 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -41,14 +41,12 @@
#include "pk11func.h"
#include <sal/config.h>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include "x509certificate_nssimpl.hxx"
#include "certificateextension_xmlsecimpl.hxx"
-#ifndef _SANEXTENSION_NSSIMPL_HXX_
#include "sanextension_nssimpl.hxx"
-#endif
using namespace ::com::sun::star::uno ;
using namespace ::com::sun::star::security ;
@@ -327,17 +325,14 @@ sal_Int64 SAL_CALL X509Certificate_NssImpl :: getSomething( const Sequence< sal_
}
/* XUnoTunnel extension */
+
+namespace
+{
+ class theX509Certificate_NssImplUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theX509Certificate_NssImplUnoTunnelId > {};
+}
+
const Sequence< sal_Int8>& X509Certificate_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 ;
+ return theX509Certificate_NssImplUnoTunnelId::get().getSeq();
}
/* XUnoTunnel extension */
commit ecc1e89faa2cc64792ab9e7617348c043761aba2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jun 4 00:12:59 2011 +0100
remove ifdef zeroed code
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
index e6c3b20..30cbc3a 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmlsecurity.hxx"
#include <sal/config.h>
-#include <rtl/uuid.h>
#include "securityenvironment_mscryptimpl.hxx"
#include "xmlsecuritycontext_mscryptimpl.hxx"
@@ -132,126 +131,6 @@ void SAL_CALL XMLSecurityContext_MSCryptImpl::setDefaultSecurityEnvironmentIndex
//dummy
}
-#if 0
-/* XXMLSecurityContext */
-void SAL_CALL XMLSecurityContext_MSCryptImpl :: setSecurityEnvironment( const Reference< XSecurityEnvironment >& aSecurityEnvironment ) throw( com::sun::star::security::SecurityInfrastructureException ) {
- HCERTSTORE hkeyStore ;
- HCERTSTORE hCertStore ;
- HCRYPTKEY symKey ;
- HCRYPTKEY pubKey ;
- HCRYPTKEY 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() ;
- }
-
- SecurityEnvironment_MSCryptImpl* pSecEnv = ( SecurityEnvironment_MSCryptImpl* )xEnvTunnel->getSomething( SecurityEnvironment_MSCryptImpl::getUnoTunnelId() ) ;
- if( pSecEnv == NULL )
- throw RuntimeException() ;
-
- hkeyStore = pSecEnv->getCryptoSlot() ;
- hCertStore = pSecEnv->getCertDb() ;
-
- /*-
- * The following lines is based on the of xmlsec-mscrypto crypto engine
- */
- m_pKeysMngr = xmlSecMSCryptoAppliedKeysMngrCreate( hkeyStore , hCertStore ) ;
- if( m_pKeysMngr == NULL )
- throw RuntimeException() ;
-
- /*-
- * Adopt symmetric key into keys manager
- */
- for( i = 0 ; ( symKey = pSecEnv->getSymKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( m_pKeysMngr, symKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-
- /*-
- * Adopt asymmetric public key into keys manager
- */
- for( i = 0 ; ( pubKey = pSecEnv->getPubKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( m_pKeysMngr, pubKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-
- /*-
- * Adopt asymmetric private key into keys manager
- */
- for( i = 0 ; ( priKey = pSecEnv->getPriKey( i ) ) != NULL ; i ++ ) {
- if( xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( m_pKeysMngr, priKey ) < 0 ) {
- throw RuntimeException() ;
- }
- }
-
- /*-
- * Adopt system default certificate store.
- */
- if( pSecEnv->defaultEnabled() ) {
- HCERTSTORE hSystemStore ;
-
- //Add system key store into the keys manager.
- hSystemStore = CertOpenSystemStore( 0, "MY" ) ;
- if( hSystemStore != NULL ) {
- if( xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore( m_pKeysMngr, hSystemStore ) < 0 ) {
- CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
- throw RuntimeException() ;
- }
- }
-
- //Add system root store into the keys manager.
- hSystemStore = CertOpenSystemStore( 0, "Root" ) ;
- if( hSystemStore != NULL ) {
- if( xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) {
- CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
- throw RuntimeException() ;
- }
- }
-
- //Add system trusted store into the keys manager.
- hSystemStore = CertOpenSystemStore( 0, "Trust" ) ;
- if( hSystemStore != NULL ) {
- if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) {
- CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
- throw RuntimeException() ;
- }
- }
-
- //Add system CA store into the keys manager.
- hSystemStore = CertOpenSystemStore( 0, "CA" ) ;
- if( hSystemStore != NULL ) {
- if( xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore( m_pKeysMngr, hSystemStore ) < 0 ) {
- CertCloseStore( hSystemStore, CERT_CLOSE_STORE_CHECK_FLAG ) ;
- throw RuntimeException() ;
- }
- }
- }
-}
-
-/* XXMLSecurityContext */
-Reference< XSecurityEnvironment > SAL_CALL XMLSecurityContext_MSCryptImpl :: getSecurityEnvironment()
- throw (RuntimeException)
-{
- return m_xSecurityEnvironment ;
-}
-#endif
-
/* XInitialization */
void SAL_CALL XMLSecurityContext_MSCryptImpl :: initialize( const Sequence< Any >& /*aArguments*/ ) throw( Exception, RuntimeException ) {
// TBD
@@ -302,44 +181,4 @@ Reference< XSingleServiceFactory > XMLSecurityContext_MSCryptImpl :: impl_create
return ::cppu::createSingleFactory( aServiceManager , impl_getImplementationName() , impl_createInstance , impl_getSupportedServiceNames() ) ;
}
-#if 0
-/* XUnoTunnel */
-sal_Int64 SAL_CALL XMLSecurityContext_MSCryptImpl :: 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_MSCryptImpl :: 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_MSCryptImpl* XMLSecurityContext_MSCryptImpl :: getImplementation( const Reference< XInterface > xObj ) {
- Reference< XUnoTunnel > xUT( xObj , UNO_QUERY ) ;
- if( xUT.is() ) {
- return ( XMLSecurityContext_MSCryptImpl* )xUT->getSomething( getUnoTunnelId() ) ;
- } else
- return NULL ;
-}
-
-/* Native methods */
-xmlSecKeysMngrPtr XMLSecurityContext_MSCryptImpl :: keysManager() throw( Exception, RuntimeException ) {
- return m_pKeysMngr ;
-}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list