X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Fsilcd%2Fcommand.c;h=fce57cfd6b9035b898aadf9fd0d2925ccf7d025a;hp=82bc2f6ee035a5af7853e0b511cfaa9b37af9b7d;hb=0f0340b9fbce9704cc7171f8f0104ce9103d2de6;hpb=d60003d3019371d4ce834a6cbfbf41c257f5a5f7 diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 82bc2f6e..fce57cfd 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -2966,6 +2966,10 @@ SILC_SERVER_CMD_FUNC(cmode) new channel key. Clients are not using private channel keys anymore after this. */ + /* if we don't remove the flag from the mode + * silc_server_create_channel_key won't create a new key */ + channel->mode &= ~SILC_CHANNEL_MODE_PRIVKEY; + /* Re-generate channel key */ if (!silc_server_create_channel_key(server, channel, 0)) goto out; @@ -3107,7 +3111,7 @@ SILC_SERVER_CMD_FUNC(cmode) if (mode_mask & SILC_CHANNEL_MODE_HMAC) { if (!(channel->mode & SILC_CHANNEL_MODE_HMAC)) { /* HMAC to use protect the traffic */ - unsigned char hash[32]; + unsigned char hash[SILC_HASH_MAXLEN]; SilcHmac newhmac; /* Get hmac */ @@ -3143,7 +3147,7 @@ SILC_SERVER_CMD_FUNC(cmode) /* Hmac mode is unset. Remove the hmac and revert back to default hmac */ SilcHmac newhmac; - unsigned char hash[32]; + unsigned char hash[SILC_HASH_MAXLEN]; hmac = channel->hmac_name; /* Delete old hmac and allocate default one */ @@ -4108,7 +4112,7 @@ SILC_SERVER_CMD_FUNC(watch) SilcServer server = cmd->server; char *add_nick, *del_nick; SilcUInt32 add_nick_len, del_nick_len, tmp_len, pk_len; - unsigned char hash[16], *tmp, *pk, *nick; + unsigned char hash[SILC_HASH_MAXLEN], *tmp, *pk, *nick; SilcClientEntry client; SilcClientID *client_id = NULL; SilcUInt16 old_ident;