summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx28
1 files changed, 16 insertions, 12 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d5ab2898ee5a..ea2f8ce27e73 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -29,9 +29,10 @@
// 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"
#include "oid.hxx"
@@ -387,7 +388,13 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
for( unsigned int i = 0; i < m_pCertContext->pCertInfo->cExtension; i++ ) {
pExtn = &(m_pCertContext->pCertInfo->rgExtension[i]) ;
- xExtn = new CertificateExtension_XmlSecImpl() ;
+
+ ::rtl::OUString objId = ::rtl::OUString::createFromAscii( pExtn->pszObjId );
+
+ if ( objId.equalsAscii("2.5.29.17") )
+ xExtn = (CertificateExtension_XmlSecImpl*) new SanExtensionImpl() ;
+ else
+ xExtn = new CertificateExtension_XmlSecImpl() ;
if( xExtn == NULL )
throw RuntimeException() ;
@@ -482,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 */