summaryrefslogtreecommitdiffstats
path: root/src/lib/asiolink/botan_tls.cc
blob: 3cd18189d0b38891e6fe6c7f173ea4beb1166adc (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

/// @file botan_tls.cc Botan fake implementation of the TLS API.

#include <config.h>

#if defined(WITH_BOTAN) && !defined(WITH_BOTAN_BOOST)

#include <asiolink/asio_wrapper.h>
#include <asiolink/crypto_tls.h>

namespace isc {
namespace asiolink {

TlsContext::TlsContext(TlsRole role)
    : TlsContextBase(role), cert_required_(true) {
}

void
TlsContext::setCertRequired(bool cert_required) {
    if (!cert_required && (getRole() == TlsRole::CLIENT)) {
        isc_throw(BadValue,
                  "'cert-required' parameter must be true for a TLS client");
    }
    cert_required_ = cert_required;
}

bool
TlsContext::getCertRequired() const {
    return (cert_required_);
}

void
TlsContext::loadCaFile(const std::string&) {
    isc_throw(NotImplemented, "Botan TLS is not yet supported");
}

void
TlsContext::loadCaPath(const std::string&) {
    isc_throw(NotImplemented, "loadCaPath is not implemented by Botan");
}

void
TlsContext::loadCertFile(const std::string&) {
    isc_throw(NotImplemented, "Botan TLS is not yet supported");
}

void
TlsContext::loadKeyFile(const std::string&) {
    isc_throw(NotImplemented, "Botan TLS is not yet supported");
}

} // namespace asiolink
} // namespace isc

#endif // WITH_BOTAN && !WITH_BOTAN_BOOST