From 8568b45ca98b2f13d4e9a836bf63af2f702a525a Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 27 Mar 2001 11:08:03 +0000 Subject: [PATCH] updates. --- lib/silcclient/client.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index ae08c2ff..4ea2a2d8 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -1254,9 +1254,9 @@ void silc_client_replace_from_channels(SilcClient client, /* Parses mode mask and returns the mode as string. */ -char *silc_client_chmode(unsigned int mode) +char *silc_client_chmode(unsigned int mode, SilcChannelEntry channel) { - char string[20]; + char string[100]; if (!mode) return NULL; @@ -1284,6 +1284,22 @@ char *silc_client_chmode(unsigned int mode) if (mode & SILC_CHANNEL_MODE_PASSPHRASE) strncat(string, "a", 1); + if (mode & SILC_CHANNEL_MODE_CIPHER) { + char cipher[50]; + memset(cipher, 0, sizeof(cipher)); + snprintf(cipher, sizeof(cipher), "c (%s)", + channel->channel_key->cipher->name); + strncat(string, cipher, strlen(cipher)); + } + + if (mode & SILC_CHANNEL_MODE_HMAC) { + char hmac[50]; + memset(hmac, 0, sizeof(hmac)); + snprintf(hmac, sizeof(hmac), "h (%s)", + channel->hmac->hmac->name); + strncat(string, hmac, strlen(hmac)); + } + /* Rest of mode is ignored */ return strdup(string); -- 2.43.0