xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 41 ---------- xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx | 35 +++----- 2 files changed, 16 insertions(+), 60 deletions(-)
New commits: commit 0b719cd36d57a628fd1ab79d0371fb46e6c1bf1d Author: Tor Lillqvist <t...@collabora.com> Date: Fri Nov 25 17:31:50 2016 +0200 No reason for these member functions to be virtual Not sure what the author was thinking, or what the comment '//Native methods' was supposed to mean. Change-Id: I9e45de6f24531a99770d98f415fea6a1cfd7d2c2 diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 444cf93..47435d7 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -239,7 +239,6 @@ SecurityEnvironment_MSCryptImpl* SecurityEnvironment_MSCryptImpl::getImplementat return nullptr ; } -/* Native methods */ HCRYPTPROV SecurityEnvironment_MSCryptImpl::getCryptoProvider() throw( css::uno::Exception , css::uno::RuntimeException ) { return m_hProv ; } @@ -1119,7 +1118,6 @@ OUString SecurityEnvironment_MSCryptImpl::getSecurityEnvironmentInformation() th return OUString("Microsoft Crypto API"); } -/* Native methods */ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() throw( Exception, RuntimeException ) { unsigned int i ; diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx index 0c66ab3..e439b44 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -155,31 +155,29 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper< static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() ; static SecurityEnvironment_MSCryptImpl* getImplementation( const css::uno::Reference< css::uno::XInterface >& rObj ) ; - //Native methods - virtual HCRYPTPROV getCryptoProvider() throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void setCryptoProvider( HCRYPTPROV aProv ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + HCRYPTPROV getCryptoProvider() throw( css::uno::Exception , css::uno::RuntimeException ) ; + void setCryptoProvider( HCRYPTPROV aProv ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual LPCTSTR getKeyContainer() throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void setKeyContainer( LPCTSTR aKeyContainer ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + LPCTSTR getKeyContainer() throw( css::uno::Exception , css::uno::RuntimeException ) ; + void setKeyContainer( LPCTSTR aKeyContainer ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual HCERTSTORE getCryptoSlot() throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void setCryptoSlot( HCERTSTORE aKeyStore ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + HCERTSTORE getCryptoSlot() throw( css::uno::Exception , css::uno::RuntimeException ) ; + void setCryptoSlot( HCERTSTORE aKeyStore ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual HCERTSTORE getCertDb() throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void setCertDb( HCERTSTORE aCertDb ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + HCERTSTORE getCertDb() throw( css::uno::Exception , css::uno::RuntimeException ) ; + void setCertDb( HCERTSTORE aCertDb ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void adoptSymKey( HCRYPTKEY aSymKey ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual HCRYPTKEY getSymKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + void adoptSymKey( HCRYPTKEY aSymKey ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + HCRYPTKEY getSymKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual HCRYPTKEY getPubKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + HCRYPTKEY getPubKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void enableDefaultCrypt( bool enable ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual bool defaultEnabled() throw( css::uno::Exception , css::uno::RuntimeException ) ; + void enableDefaultCrypt( bool enable ) throw( css::uno::Exception , css::uno::RuntimeException ) ; + bool defaultEnabled() throw( css::uno::Exception , css::uno::RuntimeException ) ; - //Native methods - virtual xmlSecKeysMngrPtr createKeysManager() throw( css::uno::Exception , css::uno::RuntimeException ) ; + xmlSecKeysMngrPtr createKeysManager() throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( css::uno::Exception , css::uno::RuntimeException ) ; + void destroyKeysManager(xmlSecKeysMngrPtr pKeysMngr) throw( css::uno::Exception , css::uno::RuntimeException ) ; } ; #endif // INCLUDED_XMLSECURITY_SOURCE_XMLSEC_MSCRYPT_SECURITYENVIRONMENT_MSCRYPTIMPL_HXX commit ed22c0cdb1f92ad93ed33069bdb3153b323ca025 Author: Tor Lillqvist <t...@collabora.com> Date: Fri Nov 25 17:26:41 2016 +0200 Bin SecurityEnvironment_MSCryptImpl::getPriKey() as it always returns NULL Fallout from my previous commit. Change-Id: I4436721e719514d6ecf7847113957827c910d65a diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index bdc8a8e..444cf93 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -345,10 +345,6 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl::getPubKey( unsigned int position ) th return pubkey ; } -HCRYPTKEY SecurityEnvironment_MSCryptImpl::getPriKey( unsigned int ) throw( Exception , RuntimeException ) { - return NULL ; -} - #ifdef SAL_LOG_INFO // Based on sample code from MSDN @@ -1129,7 +1125,6 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() throw( Ex unsigned int i ; HCRYPTKEY symKey ; HCRYPTKEY pubKey ; - HCRYPTKEY priKey ; xmlSecKeysMngrPtr pKeysMngr = nullptr ; /*- @@ -1158,15 +1153,6 @@ xmlSecKeysMngrPtr SecurityEnvironment_MSCryptImpl::createKeysManager() throw( Ex } /*- - * Adopt asymmetric private key into keys manager - */ - for( i = 0 ; ( priKey = getPriKey( i ) ) != NULL ; i ++ ) { - if( xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( pKeysMngr, priKey ) < 0 ) { - throw RuntimeException() ; - } - } - - /*- * Adopt system default certificate store. */ if( defaultEnabled() ) { diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx index d4cdab6..0c66ab3 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -173,8 +173,6 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper< virtual HCRYPTKEY getPubKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual HCRYPTKEY getPriKey( unsigned int position ) throw( css::uno::Exception , css::uno::RuntimeException ) ; - virtual void enableDefaultCrypt( bool enable ) throw( css::uno::Exception , css::uno::RuntimeException ) ; virtual bool defaultEnabled() throw( css::uno::Exception , css::uno::RuntimeException ) ; commit fb414a04fc38e0cf77a0e8d5cb65542d1df8dae8 Author: Tor Lillqvist <t...@collabora.com> Date: Fri Nov 25 17:16:59 2016 +0200 Bin SecurityEnvironment_MSCryptImpl::m_tPriKeyList as it was always empty Change-Id: I5f35c702ff9a613c6601cd0c3c42e9fc4f4e26a6 diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 2ae6251..bdc8a8e 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -105,7 +105,7 @@ void traceTrustStatus(DWORD err) } } -SecurityEnvironment_MSCryptImpl::SecurityEnvironment_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_hProv( NULL ) , m_pszContainer( nullptr ) , m_hKeyStore( nullptr ), m_hCertStore( nullptr ), m_hMySystemStore(nullptr), m_hRootSystemStore(nullptr), m_hTrustSystemStore(nullptr), m_hCaSystemStore(nullptr), m_bEnableDefault( false ), m_tSymKeyList() , m_tPubKeyList() , m_tPriKeyList(), m_xServiceManager( aFactory ){ +SecurityEnvironment_MSCryptImpl::SecurityEnvironment_MSCryptImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_hProv( NULL ) , m_pszContainer( nullptr ) , m_hKeyStore( nullptr ), m_hCertStore( nullptr ), m_hMySystemStore(nullptr), m_hRootSystemStore(nullptr), m_hTrustSystemStore(nullptr), m_hCaSystemStore(nullptr), m_bEnableDefault( false ), m_tSymKeyList() , m_tPubKeyList() , m_xServiceManager( aFactory ){ } @@ -165,14 +165,6 @@ SecurityEnvironment_MSCryptImpl::~SecurityEnvironment_MSCryptImpl() { for( pubKeyIt = m_tPubKeyList.begin() ; pubKeyIt != m_tPubKeyList.end() ; ++pubKeyIt ) CryptDestroyKey( *pubKeyIt ) ; } - - if( !m_tPriKeyList.empty() ) { - std::list< HCRYPTKEY >::iterator priKeyIt ; - - for( priKeyIt = m_tPriKeyList.begin() ; priKeyIt != m_tPriKeyList.end() ; ++priKeyIt ) - CryptDestroyKey( *priKeyIt ) ; - } - } /* XServiceInfo */ @@ -353,18 +345,8 @@ HCRYPTKEY SecurityEnvironment_MSCryptImpl::getPubKey( unsigned int position ) th return pubkey ; } -HCRYPTKEY SecurityEnvironment_MSCryptImpl::getPriKey( unsigned int position ) throw( Exception , RuntimeException ) { - HCRYPTKEY prikey ; - std::list< HCRYPTKEY >::iterator keyIt ; - unsigned int pos ; - - prikey = NULL ; - for( pos = 0, keyIt = m_tPriKeyList.begin() ; pos < position && keyIt != m_tPriKeyList.end() ; ++pos , ++keyIt ) ; - - if( pos == position && keyIt != m_tPriKeyList.end() ) - prikey = *keyIt ; - - return prikey ; +HCRYPTKEY SecurityEnvironment_MSCryptImpl::getPriKey( unsigned int ) throw( Exception , RuntimeException ) { + return NULL ; } #ifdef SAL_LOG_INFO @@ -452,11 +434,6 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_MSCryptImpl::getPerso } } - //secondly, we try to find certificate from registered private keys. - if( !m_tPriKeyList.empty() ) { - //TODO: Don't know whether or not it is necessary ans possible. - } - //Thirdly, we try to find certificate from system default key store. if( m_bEnableDefault ) { HCERTSTORE hSystemKeyStore ; diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx index e345c1e..d4cdab6 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -78,7 +78,6 @@ class SecurityEnvironment_MSCryptImpl : public ::cppu::WeakImplHelper< //External keys std::list< HCRYPTKEY > m_tSymKeyList ; std::list< HCRYPTKEY > m_tPubKeyList ; - std::list< HCRYPTKEY > m_tPriKeyList ; //Service manager css::uno::Reference< css::lang::XMultiServiceFactory > m_xServiceManager ; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits