aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-02-19 18:46:05 +0000
committerGravatar Sadie Powell2024-02-19 18:46:05 +0000
commitebd03383f856bfaa72b1700a96561396e6f8f6cc (patch)
tree47651f7a9c8567ae020c6b8750db58a7d3c2da2b /src/modules/m_spanningtree
parentFix more issues with the v3 compat layer. (diff)
Allow using multiple SSL fingerprint algorithms.
Closes #1804.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/compat.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 917b1e480..5d61272ea 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -71,6 +71,35 @@ void TreeSocket::WriteLine(const std::string& original_line)
// FRHOST was introduced in PROTO_INSPIRCD_4; drop it.
return;
}
+ else if (irc::equals(command, "METADATA"))
+ {
+ // :<sid> METADATA <uuid|chan|*|@> <name> :<value>
+ size_t targetend = NextToken(line, cmdend);
+ size_t nameend = NextToken(line, targetend);
+ size_t flagend = NextToken(line, nameend);
+ if (flagend != std::string::npos)
+ {
+ std::string extname(line, targetend + 1, nameend - targetend - 1);
+ if (irc::equals(extname, "ssl_cert"))
+ {
+ // Check we have the "e" flag (no error).
+ if (line.find('e', nameend + 1) < flagend)
+ {
+ size_t fpend = NextToken(line, flagend);
+ if (fpend != std::string::npos)
+ {
+ size_t commapos = line.find(',', flagend + 1);
+ if (commapos < fpend)
+ {
+ // Multiple fingerprints in ssl_cert was introduced in PROTO_INSPIRCD_4; drop it.
+ line.erase(commapos, fpend - commapos);
+ }
+
+ }
+ }
+ }
+ }
+ }
else if (irc::equals(command, "SQUERY"))
{
// SQUERY was introduced in PROTO_INSPIRCD_4; convert to PRIVMSG.