diff --git a/libs/libdingaling/src/libdingaling.c b/libs/libdingaling/src/libdingaling.c index 1f85fb7993..a6e794a8fb 100644 --- a/libs/libdingaling/src/libdingaling.c +++ b/libs/libdingaling/src/libdingaling.c @@ -81,7 +81,7 @@ static int opt_timeout = 30; -static void sha1_hash(char *out, char *in); +static void sha1_hash(char *out, char *in, unsigned int len); static int b64encode(unsigned char *in, size_t ilen, unsigned char *out, size_t olen); static void ldl_random_string(char *buf, uint16_t len, char *set); @@ -828,7 +828,7 @@ static ldl_avatar_t *ldl_get_avatar(ldl_handle_t *handle, char *path, char *from ap = malloc(sizeof(*ap)); assert(ap != NULL); memset(ap, 0, sizeof(*ap)); - sha1_hash(ap->hash, (char *)image); + sha1_hash(ap->hash, (char *)image, bytes); ap->path = strdup(path); key = ldl_handle_strdup(handle, from); @@ -1110,7 +1110,7 @@ static int b64encode(unsigned char *in, size_t ilen, unsigned char *out, size_t return 0; } -static void sha1_hash(char *out, char *in) +static void sha1_hash(char *out, char *in, unsigned int len) { sha_context_t sha; char *p; @@ -1119,7 +1119,7 @@ static void sha1_hash(char *out, char *in) SHA1Init(&sha); - SHA1Update(&sha, (unsigned char *) in, (unsigned int)strlen(in)); + SHA1Update(&sha, (unsigned char *) in, len); SHA1Final(digest, &sha); @@ -1146,7 +1146,7 @@ static int on_stream_component(ldl_handle_t *handle, int type, iks *node) char handshake[512] = ""; snprintf(secret, sizeof(secret), "%s%s", pak->id, handle->password); - sha1_hash(hash, secret); + sha1_hash(hash, secret, strlen(secret)); snprintf(handshake, sizeof(handshake), "%s", hash); iks_send_raw(handle->parser, handshake); handle->state = CS_START; diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 85430427f1..3aa70d8ae9 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -3429,7 +3429,7 @@ static switch_status_t conf_api_main(char *buf, switch_core_session_t *session, } } else { stream->write_function(stream, "Conference %s not found\n", argv[0]); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Conference %s not found\n", argv[0]); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Conference %s not found\n", argv[0]); } } diff --git a/src/mod/endpoints/mod_dingaling/Makefile b/src/mod/endpoints/mod_dingaling/Makefile index 01826ca395..3b9f30f052 100644 --- a/src/mod/endpoints/mod_dingaling/Makefile +++ b/src/mod/endpoints/mod_dingaling/Makefile @@ -9,7 +9,7 @@ IKS_LA=$(IKS_DIR)/src/libiksemel.la DING_DIR=$(BASE)/libs/libdingaling LOCAL_CFLAGS += -I$(DING_DIR)/src -I$(BASE)/libs/iksemel/include LOCAL_OBJS=$(DING_DIR)/src/libdingaling.o $(DING_DIR)/src/sha1.o $(IKS_LA) - +LOCAL_SOURCES=$(DING_DIR)/src/libdingaling.c $(DING_DIR)/src/sha1.c include $(BASE)/build/modmake.rules $(IKS_LA): $(IKS_DIR) $(IKS_DIR)/.update