]> jfr.im git - solanum.git/commitdiff
WHOIS: use cipher string if available
authorWilliam Pitcock <redacted>
Fri, 11 Dec 2015 14:20:11 +0000 (08:20 -0600)
committerWilliam Pitcock <redacted>
Fri, 11 Dec 2015 14:20:11 +0000 (08:20 -0600)
include/messages.h
modules/m_whois.c

index c5c399efbd53d6f2f06024b4370ab8df8f0bfe77..f78069491a91d9af00a8d73969ca307755f212c1 100644 (file)
 #define NUMERIC_STR_517      "%s :This command has been administratively disabled"
 #define NUMERIC_STR_524      ":%s 524 %s %s :Help not found"
 #define NUMERIC_STR_670      ":STARTTLS successful, proceed with TLS handshake"
-#define NUMERIC_STR_671      "%s :is using a secure connection"
+#define NUMERIC_STR_671      "%s :%s"
 #define NUMERIC_STR_691      ":%s"
 #define NUMERIC_STR_702      ":%s 702 %s %s 0x%lx %s %s"
 #define NUMERIC_STR_703      ":%s 703 %s :End of /MODLIST."
index a5515ed0934619eae193d6a0115b85b182ad2165..1fec224699a67f63184bcabd069cf124161df985 100644 (file)
@@ -320,13 +320,20 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
        }
 
        if(IsSSLClient(target_p))
+       {
+               char cbuf[256] = "is using a secure connection";
+
+               if (MyClient(target_p) && target_p->localClient->cipher_string != NULL)
+                       rb_snprintf_append(cbuf, sizeof(cbuf), " [%s]", target_p->localClient->cipher_string);
+
                sendto_one_numeric(source_p, RPL_WHOISSECURE, form_str(RPL_WHOISSECURE),
-                                  target_p->name);
-       if((source_p == target_p || IsOper(source_p)) &&
-                       target_p->certfp != NULL)
-               sendto_one_numeric(source_p, RPL_WHOISCERTFP,
-                               form_str(RPL_WHOISCERTFP),
-                               target_p->name, target_p->certfp);
+                                  target_p->name, cbuf);
+               if((source_p == target_p || IsOper(source_p)) &&
+                               target_p->certfp != NULL)
+                       sendto_one_numeric(source_p, RPL_WHOISCERTFP,
+                                       form_str(RPL_WHOISCERTFP),
+                                       target_p->name, target_p->certfp);
+       }
 
        if(MyClient(target_p))
        {