summaryrefslogtreecommitdiffstats
blob: ab0fa7b93da90a9f5e5147b31a1304b82c295ad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Copyright (c) 2013 Remko Tronçon
 * Licensed under the GNU General Public License.
 * See the COPYING file for more information.
 */

#include <Swiften/Crypto/PlatformCryptoProvider.h>

#include <cassert>

#include <Swiften/Base/Platform.h>
#if defined(SWIFTEN_PLATFORM_WIN32)
#include <Swiften/Crypto/WindowsCryptoProvider.h>
#elif defined(HAVE_COMMONCRYPTO_CRYPTO_PROVIDER)
#include <Swiften/Crypto/CommonCryptoCryptoProvider.h>
#elif defined(HAVE_OPENSSL_CRYPTO_PROVIDER)
#include <Swiften/Crypto/OpenSSLCryptoProvider.h>
#endif

using namespace Swift;

CryptoProvider* PlatformCryptoProvider::create() {
#if defined(SWIFTEN_PLATFORM_WIN32)
	return new WindowsCryptoProvider();
#elif defined(HAVE_COMMONCRYPTO_CRYPTO_PROVIDER)
	return new CommonCryptoCryptoProvider();
#elif defined(HAVE_OPENSSL_CRYPTO_PROVIDER)
	return new OpenSSLCryptoProvider();
#endif
	assert(false);
	return NULL;
}