[Freeswitch-svn] [commit] r4864 - in freeswitch/trunk: libs/libdingaling/src src/mod/applications/mod_conference src/mod/endpoints/mod_dingaling

Freeswitch SVN anthm at freeswitch.org
Thu Apr 5 16:29:14 EDT 2007


Author: anthm
Date: Thu Apr  5 16:29:14 2007
New Revision: 4864

Modified:
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/Makefile

Log:
fix

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Thu Apr  5 16:29:14 2007
@@ -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 @@
 	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 @@
 	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 @@
 
 	SHA1Init(&sha);
 	
-	SHA1Update(&sha, (unsigned char *) in, (unsigned int)strlen(in));
+	SHA1Update(&sha, (unsigned char *) in, len);
 
 	SHA1Final(digest, &sha);
 
@@ -1146,7 +1146,7 @@
 			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), "<handshake>%s</handshake>", hash);
 			iks_send_raw(handle->parser, handshake);
 			handle->state = CS_START;

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Thu Apr  5 16:29:14 2007
@@ -3429,7 +3429,7 @@
 				}
 			} 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]);
 			}
 		}
 

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/Makefile	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/Makefile	Thu Apr  5 16:29:14 2007
@@ -9,7 +9,7 @@
 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



More information about the Freeswitch-svn mailing list