diff options
| author | DukePyrolator <DukePyrolator@anope.org> | 2010-12-07 07:59:30 +0100 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-12-12 19:37:03 -0500 |
| commit | 099ead02a57e6081706e628b1e3d5ebf97ab7d94 (patch) | |
| tree | cbd2018711ac937b4110e0ffb2fc01308a864450 /modules/protocol/inspircd20.cpp | |
| parent | f1d04a2f8e4e9077d07a94b64478bb331b49bbc0 (diff) | |
store the ssl fingerprint in the userstruct
Diffstat (limited to 'modules/protocol/inspircd20.cpp')
| -rw-r--r-- | modules/protocol/inspircd20.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index bd020891d..20e622092 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -317,6 +317,13 @@ bool event_chghost(const Anope::string &source, const std::vector<Anope::string> return true; } + +/* + * source = numeric of the sending server + * params[0] = uuid + * params[1] = metadata name + * params[2] = data + */ bool event_metadata(const Anope::string &source, const std::vector<Anope::string> ¶ms) { if (params.size() < 3) @@ -331,6 +338,25 @@ bool event_metadata(const Anope::string &source, const std::vector<Anope::string } } +/* + * possible incoming ssl_cert messages: + * Received: :409 METADATA 409AAAAAA ssl_cert :vTrSe c38070ce96e41cc144ed6590a68d45a6 <...> <...> + * Received: :409 METADATA 409AAAAAC ssl_cert :vTrSE Could not get peer certificate: error:00000000:lib(0):func(0):reason(0) + */ + if (params[1].equals_cs("ssl_cert")) + { + User *u = finduser(params[0]); + if (!u) + return true; + std::string data = params[2].c_str(); + size_t pos1 = data.find(' ') + 1; + size_t pos2 = data.find(' ', pos1); + if ((pos2 - pos1) == 32) // fingerprints should always be 32 bytes in size + { + u->fingerprint = data.substr(pos1, pos2 - pos1); + FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); + } + } return true; } |
