Kaydet (Commit) 27beb321 authored tarafından Miklos Vajna's avatar Miklos Vajna

xmlsecurity: stop linking to libxmlsec's mscrypto backend

This was only useful when the mscrypto to mscng porting was in progress.

Change-Id: I5a062cae744489e5ad311ab6b531d00ea21f4e0a
Reviewed-on: https://gerrit.libreoffice.org/57699
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 99a74aaf
......@@ -90,7 +90,6 @@ $(eval $(call gb_Library_add_defs,xsec_xmlsec,\
))
$(eval $(call gb_Library_add_libs,xsec_xmlsec,\
$(call gb_UnpackedTarball_get_dir,xmlsec)/win32/binaries/libxmlsec-mscrypto.lib \
$(call gb_UnpackedTarball_get_dir,xmlsec)/win32/binaries/libxmlsec-mscng.lib \
$(call gb_UnpackedTarball_get_dir,xmlsec)/win32/binaries/libxmlsec.lib \
))
......
......@@ -24,9 +24,6 @@
#include <xmlsec/transforms.h>
#include <xmlsec/errors.h>
#include <xmlsec/mscrypto/crypto.h>
#include <xmlsec/mscrypto/keysstore.h>
#include <xmlsec/mscrypto/x509.h>
#include <xmlsec/mscng/crypto.h>
#include <xmlsec/mscng/keysstore.h>
#include <xmlsec/mscng/x509.h>
......@@ -47,9 +44,6 @@ xmlSecKeysMngrPtr MSCryptoAppliedKeysMngrCreate()
xmlSecKeysMngrPtr keyMngr = nullptr ;
xmlSecKeyStorePtr keyStore = nullptr ;
if (!svl::crypto::isMSCng())
keyStore = xmlSecKeyStoreCreate(xmlSecMSCryptoKeysStoreId) ;
else
keyStore = xmlSecKeyStoreCreate(xmlSecMSCngKeysStoreId);
if (keyStore == nullptr)
{
......@@ -102,22 +96,6 @@ xmlSecKeysMngrPtr MSCryptoAppliedKeysMngrCreate()
/*-
* Initialize crypto library specific data in keys manager
*/
if (!svl::crypto::isMSCng())
{
if (xmlSecMSCryptoKeysMngrInit(keyMngr) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
nullptr,
"xmlSecMSCryptoKeysMngrInit",
XMLSEC_ERRORS_R_XMLSEC_FAILED,
XMLSEC_ERRORS_NO_MESSAGE) ;
xmlSecKeysMngrDestroy(keyMngr) ;
return nullptr ;
}
}
else
{
if (xmlSecMSCngKeysMngrInit(keyMngr) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
......@@ -129,7 +107,6 @@ xmlSecKeysMngrPtr MSCryptoAppliedKeysMngrCreate()
xmlSecKeysMngrDestroy(keyMngr);
return nullptr;
}
}
/*-
* Set certificate database to X509 key data store
......@@ -157,9 +134,6 @@ MSCryptoAppliedKeysMngrAdoptKeyStore(
xmlSecAssert2(mngr != nullptr, -1) ;
xmlSecAssert2(keyStore != nullptr, -1) ;
if (!svl::crypto::isMSCng())
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCryptoX509StoreId) ;
else
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCngX509StoreId);
if (x509Store == nullptr)
{
......@@ -171,20 +145,6 @@ MSCryptoAppliedKeysMngrAdoptKeyStore(
return -1 ;
}
if (!svl::crypto::isMSCng())
{
if (xmlSecMSCryptoX509StoreAdoptKeyStore(x509Store, keyStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(x509Store)),
"xmlSecMSCryptoX509StoreAdoptKeyStore",
XMLSEC_ERRORS_R_XMLSEC_FAILED,
XMLSEC_ERRORS_NO_MESSAGE) ;
return -1 ;
}
}
else
{
if (xmlSecMSCngX509StoreAdoptKeyStore(x509Store, keyStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
......@@ -194,7 +154,6 @@ MSCryptoAppliedKeysMngrAdoptKeyStore(
XMLSEC_ERRORS_NO_MESSAGE);
return -1;
}
}
return 0 ;
}
......@@ -210,9 +169,6 @@ MSCryptoAppliedKeysMngrAdoptTrustedStore(
xmlSecAssert2(mngr != nullptr, -1) ;
xmlSecAssert2(trustedStore != nullptr, -1) ;
if (!svl::crypto::isMSCng())
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCryptoX509StoreId) ;
else
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCngX509StoreId);
if (x509Store == nullptr)
{
......@@ -224,20 +180,6 @@ MSCryptoAppliedKeysMngrAdoptTrustedStore(
return -1 ;
}
if (!svl::crypto::isMSCng())
{
if (xmlSecMSCryptoX509StoreAdoptTrustedStore(x509Store, trustedStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(x509Store)),
"xmlSecMSCryptoX509StoreAdoptKeyStore",
XMLSEC_ERRORS_R_XMLSEC_FAILED,
XMLSEC_ERRORS_NO_MESSAGE) ;
return -1 ;
}
}
else
{
if (xmlSecMSCngX509StoreAdoptTrustedStore(x509Store, trustedStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
......@@ -247,7 +189,6 @@ MSCryptoAppliedKeysMngrAdoptTrustedStore(
XMLSEC_ERRORS_NO_MESSAGE);
return -1;
}
}
return 0 ;
}
......@@ -263,9 +204,6 @@ MSCryptoAppliedKeysMngrAdoptUntrustedStore(
xmlSecAssert2(mngr != nullptr, -1) ;
xmlSecAssert2(untrustedStore != nullptr, -1) ;
if (!svl::crypto::isMSCng())
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCryptoX509StoreId) ;
else
x509Store = xmlSecKeysMngrGetDataStore(mngr, xmlSecMSCngX509StoreId);
if (x509Store == nullptr)
{
......@@ -277,20 +215,6 @@ MSCryptoAppliedKeysMngrAdoptUntrustedStore(
return -1 ;
}
if (!svl::crypto::isMSCng())
{
if (xmlSecMSCryptoX509StoreAdoptUntrustedStore(x509Store, untrustedStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(x509Store)),
"xmlSecMSCryptoX509StoreAdoptKeyStore",
XMLSEC_ERRORS_R_XMLSEC_FAILED,
XMLSEC_ERRORS_NO_MESSAGE) ;
return -1 ;
}
}
else
{
if (xmlSecMSCngX509StoreAdoptUntrustedStore(x509Store, untrustedStore) < 0)
{
xmlSecError(XMLSEC_ERRORS_HERE,
......@@ -300,7 +224,6 @@ MSCryptoAppliedKeysMngrAdoptUntrustedStore(
XMLSEC_ERRORS_NO_MESSAGE);
return -1;
}
}
return 0 ;
}
......
......@@ -23,7 +23,6 @@
#include "securityenvironment_mscryptimpl.hxx"
#include <xmlsec-wrapper.h>
#include <xmlsec/mscrypto/app.h>
#include <xmlsec/mscng/app.h>
#include <com/sun/star/xml/crypto/SecurityEnvironment.hpp>
#include <com/sun/star/xml/crypto/XMLSecurityContext.hpp>
......@@ -71,9 +70,6 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL
n_hStoreHandle = nullptr ;
}
if (!svl::crypto::isMSCng())
xmlSecMSCryptoAppInit( n_pCertStore ) ;
else
xmlSecMSCngAppInit(n_pCertStore);
try {
......@@ -90,9 +86,6 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
if (!svl::crypto::isMSCng())
xmlSecMSCryptoAppShutdown() ;
else
xmlSecMSCngAppShutdown();
return nullptr;
}
......@@ -120,9 +113,6 @@ uno::Reference< cssxc::XXMLSecurityContext > SAL_CALL
CertCloseStore( n_hStoreHandle, CERT_CLOSE_STORE_FORCE_FLAG ) ;
}
if (!svl::crypto::isMSCng())
xmlSecMSCryptoAppShutdown() ;
else
xmlSecMSCngAppShutdown();
return nullptr;
}
......@@ -154,9 +144,6 @@ void SAL_CALL SEInitializer_MSCryptImpl::freeSecurityContext( const uno::Referen
}
*/
if (!svl::crypto::isMSCng())
xmlSecMSCryptoAppShutdown() ;
else
xmlSecMSCngAppShutdown();
}
......
......@@ -15,7 +15,6 @@
#include <xmlsec-wrapper.h>
#include <svl/cryptosign.hxx>
#ifdef XMLSEC_CRYPTO_MSCRYPTO
#include <xmlsec/mscrypto/crypto.h>
#include <xmlsec/mscng/crypto.h>
#else
#include <xmlsec/nss/crypto.h>
......@@ -32,20 +31,10 @@ XSECXMLSEC_DLLPUBLIC void initXmlSec()
//Init xmlsec crypto engine library
#ifdef XMLSEC_CRYPTO_MSCRYPTO
if (!svl::crypto::isMSCng())
{
if( xmlSecMSCryptoInit() < 0 ) {
xmlSecShutdown() ;
throw RuntimeException() ;
}
}
else
{
if( xmlSecMSCngInit() < 0 ) {
xmlSecShutdown();
throw RuntimeException();
}
}
#else
if( xmlSecNssInit() < 0 ) {
xmlSecShutdown();
......@@ -56,9 +45,6 @@ XSECXMLSEC_DLLPUBLIC void initXmlSec()
//Enable external stream handlers
if( xmlEnableStreamInputCallbacks() < 0 ) {
#ifdef XMLSEC_CRYPTO_MSCRYPTO
if (!svl::crypto::isMSCng())
xmlSecMSCryptoShutdown();
else
xmlSecMSCngShutdown();
#else
xmlSecNssShutdown();
......@@ -72,9 +58,6 @@ XSECXMLSEC_DLLPUBLIC void deInitXmlSec()
{
xmlDisableStreamInputCallbacks();
#ifdef XMLSEC_CRYPTO_MSCRYPTO
if (!svl::crypto::isMSCng())
xmlSecMSCryptoShutdown();
else
xmlSecMSCngShutdown();
#else
xmlSecNssShutdown();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment