summaryrefslogtreecommitdiffstats
blob: a72bf8e3412eae138b8a326ca307b67f9995241e (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-2016 Isode Limited.
 * All rights reserved.
 * 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 nullptr;
}