projects
/
crypto.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged from silc_1_0_branch.
[crypto.git]
/
lib
/
silcutil
/
silcutil.c
diff --git
a/lib/silcutil/silcutil.c
b/lib/silcutil/silcutil.c
index 7898a4c94f7b518f67709d45577dbf0383873339..8c9064891527f6199d346681f9d3a38cf3cb0d53 100644
(file)
--- a/
lib/silcutil/silcutil.c
+++ b/
lib/silcutil/silcutil.c
@@
-657,15
+657,25
@@
char *silc_client_chmode(SilcUInt32 mode, const char *cipher, const char *hmac)
if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
strncat(string, "M", 1);
if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
strncat(string, "M", 1);
+
+ if (mode & SILC_CHANNEL_MODE_CIPHER)
+ strncat(string, "c", 1);
+
+ if (mode & SILC_CHANNEL_MODE_HMAC)
+ strncat(string, "h", 1);
if (mode & SILC_CHANNEL_MODE_CIPHER) {
if (mode & SILC_CHANNEL_MODE_CIPHER) {
- if (strlen(cipher) + strlen(string) < sizeof(string))
+ if (strlen(cipher) + strlen(string) + 1< sizeof(string)) {
+ strncat(string, " ", 1);
strncat(string, cipher, strlen(cipher));
strncat(string, cipher, strlen(cipher));
+ }
}
if (mode & SILC_CHANNEL_MODE_HMAC) {
}
if (mode & SILC_CHANNEL_MODE_HMAC) {
- if (strlen(hmac) + strlen(string) < sizeof(string))
+ if (strlen(hmac) + strlen(string) + 1< sizeof(string)) {
+ strncat(string, " ", 1);
strncat(string, hmac, strlen(hmac));
strncat(string, hmac, strlen(hmac));
+ }
}
/* Rest of mode is ignored */
}
/* Rest of mode is ignored */