aboutsummaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld/discovery.cc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2025-08-04 15:38:06 -0400
committerJohn Baldwin <jhb@FreeBSD.org>2025-08-04 15:38:06 -0400
commit7f912714c53644ea18fc58ffa364918ccfa22999 (patch)
treec614000d54a406c50025f3a2faf6efd798876b5c /usr.sbin/ctld/discovery.cc
parent9a36ad4f5ada9a45492db0aea1a7cb1c77890192 (diff)
ctld: Convert struct auth to a C++ class
Use private std::string to hold secret and mutual authentication strings along with accessors to retrieve constant C versions of those strings. Add a helper function to determine if an auth object contains mutual credentials. Instead of storing the user name in the structure, use an unordered_map<> with the username as the key for the ag_auths member of auth_group. Add a parse error if multiple credentials specify the same user. Previously the code always used the first credential when verifying and ignored additional credentials silently. Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794
Diffstat (limited to 'usr.sbin/ctld/discovery.cc')
-rw-r--r--usr.sbin/ctld/discovery.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/ctld/discovery.cc b/usr.sbin/ctld/discovery.cc
index 3cf1b94a9619..c4bfb94669f9 100644
--- a/usr.sbin/ctld/discovery.cc
+++ b/usr.sbin/ctld/discovery.cc
@@ -196,7 +196,7 @@ discovery_target_filtered_out(const struct ctld_connection *conn,
return (true);
}
- error = chap_authenticate(conn->conn_chap, auth->a_secret);
+ error = chap_authenticate(conn->conn_chap, auth->secret());
if (error != 0) {
log_debugx("password for CHAP user \"%s\" doesn't "
"match target \"%s\"; skipping",