/src/kea/src/lib/cc/default_credentials.cc
Line | Count | Source |
1 | | // Copyright (C) 2024-2025 Internet Systems Consortium, Inc. ("ISC") |
2 | | // |
3 | | // This Source Code Form is subject to the terms of the Mozilla Public |
4 | | // License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
6 | | |
7 | | #include <config.h> |
8 | | #include <cc/default_credentials.h> |
9 | | |
10 | | namespace isc { |
11 | | namespace data { |
12 | | |
13 | | const std::unordered_set<std::string> |
14 | | DefaultCredentials::DEFAULT_CREDENTIALS = { |
15 | | #ifndef IGNORE_KEA_DEFAULT_CREDENTIALS |
16 | | #ifndef ALLOW_KEATEST |
17 | | "keatest", |
18 | | #endif |
19 | | "1234", "*****" |
20 | | #endif |
21 | | #ifdef EXTRA_KEA_DEFAULT_CREDENTIALS |
22 | | EXTRA_KEA_DEFAULT_CREDENTIALS |
23 | | #endif |
24 | | }; |
25 | | |
26 | | void |
27 | 592 | DefaultCredentials::check(const std::string& value) { |
28 | 592 | if (DEFAULT_CREDENTIALS.count(value)) { |
29 | 17 | isc_throw(DefaultCredential, |
30 | 17 | "illegal use of a default value as credential"); |
31 | 17 | } |
32 | 592 | } |
33 | | |
34 | | } // end of isc::dhcp namespace |
35 | | } // end of isc namespace |