]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix mistaken NO_ZRTP_QUICK events after Hello received
authorViktor Krikun <v.krikun@zfoneproject.com>
Mon, 22 Feb 2010 15:13:53 +0000 (15:13 +0000)
committerTravis Cross <tc@traviscross.com>
Sat, 31 Mar 2012 18:51:46 +0000 (18:51 +0000)
(closes #20)

include/zrtp_config_user.h
include/zrtp_types.h
include/zrtp_version.h
src/zrtp.c
src/zrtp_engine.c

index 660e341937d85b5171a1f9b965ca1ef1d37397fb..707349ed1cc3f9a8d4cd8f6c6a98e1252a98506d 100644 (file)
  * over CSD channels. This option affect enterprise version of the library only.
  */
 #ifndef ZRTP_BUILD_FOR_CSD
-#define        ZRTP_BUILD_FOR_CSD                      1
+#define        ZRTP_BUILD_FOR_CSD                      0
 #endif
 
 /**
index abbba0dce4212b4a5bdcdfcbc7f0002ada7ba499..674a2c91bf73bca79ccd21f7e9dfdd2218ee1c74 100644 (file)
@@ -698,6 +698,9 @@ struct zrtp_stream_t
         */
        zrtp_state_t                    prev_state;
        
+       /** 1 means that peer Hello have been raceived within current ZRTP session */
+       uint8_t                                 is_hello_received;
+       
        /*!< Reflects current state of ZRTP protocol */
        zrtp_state_t                    state;
        
index 8ddb68b1938ead034138a53ab6be4b3c7acd7bef..62c6e0c49f767039ca3e5138ff80e30e91e35bbe 100644 (file)
@@ -12,8 +12,8 @@
 
 #define LIBZRTP_VERSION_MAJOR          1
 
-#define LIBZRTP_VERSION_MINOR          0
-#define LIBZRTP_VERSION_BUILD          591
-#define LIBZRTP_VERSION_STR                    "v1.00 590"
+#define LIBZRTP_VERSION_MINOR          10
+#define LIBZRTP_VERSION_BUILD          593
+#define LIBZRTP_VERSION_STR                    "v1.10 593"
 
 #endif /*__ZRTP_VERSION_H__*/
index a9c583a1d8e42ef99ff132ea0c96f625ecbb35ad..6c5470cca877a810efa067d56779ee8792f9c95f 100644 (file)
@@ -428,6 +428,7 @@ zrtp_status_t zrtp_stream_attach(zrtp_session_t *session, zrtp_stream_t** stream
        new_stream->session = session;
        new_stream->zrtp        = session->zrtp;
        new_stream->mitm_mode = ZRTP_MITM_MODE_UNKN;
+       new_stream->is_hello_received = 0;
        
        ZSTR_SET_EMPTY(new_stream->cc.hmackey);
        ZSTR_SET_EMPTY(new_stream->cc.peer_hmackey);
index 35d01d84abc5b164c3e262c17ad650f4afe6aff0..07d14f185b60c6b0ea4127e109f6de2bbd70866d 100644 (file)
@@ -1226,6 +1226,7 @@ zrtp_status_t _zrtp_machine_process_hello(zrtp_stream_t* stream, zrtp_rtp_info_t
        
        /* Copy packet for future hashing */
        zrtp_memcpy(&stream->messages.peer_hello, peer_hello, zrtp_ntoh16(peer_hello->hdr.length)*4);
+       stream->is_hello_received = 1;
 
        /*
         * Choose PK exchange scheme and PK mode.
@@ -1250,7 +1251,7 @@ zrtp_status_t _zrtp_machine_process_hello(zrtp_stream_t* stream, zrtp_rtp_info_t
 /*---------------------------------------------------------------------------*/
 static void _send_and_resend_hello(zrtp_stream_t* stream, zrtp_retry_task_t* task)
 {      
-       if (task->_retrys == ZRTP_NO_ZRTP_FAST_COUNT) {
+       if ((task->_retrys == ZRTP_NO_ZRTP_FAST_COUNT) && !stream->is_hello_received) {
                ZRTP_LOG(2,(_ZTU_,"WARNING! HELLO have been resent %d times without a response."
                                        " Raising ZRTP_EVENT_NO_ZRTP_QUICK event. ID=%u\n", task->_retrys, stream->id));