]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Miscellaneous updates
authorViktor Krikun <v.krikun@zfoneproject.com>
Wed, 6 Jul 2011 23:39:18 +0000 (23:39 +0000)
committerTravis Cross <tc@traviscross.com>
Sat, 31 Mar 2012 22:56:16 +0000 (22:56 +0000)
include/zrtp_version.h
projects/gnu/configure.in
src/zrtp_protocol.c
src/zrtp_utils_proto.c

index 3f4640e6597e10054e82b8e5464b197f57db26e9..bcf183f9bef7b2cb5872d2ba494dbc872e5a3c0c 100644 (file)
@@ -12,8 +12,8 @@
 
 #define LIBZRTP_VERSION_MAJOR          1
 
-#define LIBZRTP_VERSION_MINOR          10
-#define LIBZRTP_VERSION_BUILD          594
-#define LIBZRTP_VERSION_STR                    "v1.10 594"
+#define LIBZRTP_VERSION_MINOR          12
+#define LIBZRTP_VERSION_BUILD          598
+#define LIBZRTP_VERSION_STR                    "v1.12 598"
 
 #endif /*__ZRTP_VERSION_H__*/
index 4e53494d6980cf75c0a64d648432b144af2c4056..1af09c172e54fe4dbd9c0f7b387adfe607e7c906 100644 (file)
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
+# Copyright (c) 2006-2011 Philip R. Zimmermann. All rights reserved.
 # Contact: http://philzimmermann.com
 # For licensing and other legal details, see the file zrtp_legal.c.
 # 
@@ -32,7 +32,7 @@ case $target_os in
 esac
 
 
-AM_INIT_AUTOMAKE([libzrtp], [0.91])
+AM_INIT_AUTOMAKE([libzrtp], [1.12])
 AX_PREFIX_CONFIG_H(../../include/zrtp_config_unix.h,ZRTP,config/config.h)
 
 CFLAGS="$CFLAGS -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1"
index f271309a0ad0e8191f6891ef7344ac9915601c2f..e50a00da7691f04b59faef42b5a74c3591a2351c 100644 (file)
@@ -314,12 +314,30 @@ static zrtp_status_t _derive_s0(zrtp_stream_t* stream, int is_initiator)
                comp_length = zrtp_hton32(1L);
                session->hash->hash_update(session->hash, hash_ctx, (const int8_t*)&comp_length, 4);
 
+               
+               switch (stream->pubkeyscheme->base.id) {
+                       case ZRTP_PKTYPE_DH2048:
+                       case ZRTP_PKTYPE_DH3072:
+                       case ZRTP_PKTYPE_DH4096:
+                               comp_length = stream->pubkeyscheme->pv_length;
+                               ZRTP_LOG(3,(_ZTU_,"DH comp_length=%u\n", comp_length));
+                               break;
+                       case ZRTP_PKTYPE_EC256P:
+                       case ZRTP_PKTYPE_EC384P:
+                       case ZRTP_PKTYPE_EC521P:
+                               comp_length = stream->pubkeyscheme->pv_length/2;
+                               ZRTP_LOG(3,(_ZTU_,"ECDH comp_length=%u\n", comp_length));
+                               break;
+                       default:
+                               break;
+               }
+               
                bnBegin(&dhresult);
-               stream->pubkeyscheme->compute( stream->pubkeyscheme,
-                                                                          &stream->dh_cc,
-                                                                          &dhresult,
-                                                                          &stream->dh_cc.peer_pv);
-               comp_length = stream->pubkeyscheme->pv_length;
+               stream->pubkeyscheme->compute(stream->pubkeyscheme,
+                                                                         &stream->dh_cc,
+                                                                         &dhresult,
+                                                                         &stream->dh_cc.peer_pv);
+                               
                bnExtractBigBytes(&dhresult, (uint8_t *)buffer, 0, comp_length);
                session->hash->hash_update(session->hash, hash_ctx, (const int8_t*)buffer, comp_length);
                bnEnd(&dhresult);
index 9e3d0e058f0ed226e558e333a1c9736d143c00f4..c7e445914801f22858307902853b3e9b5c3056fa 100644 (file)
@@ -430,14 +430,16 @@ zrtp_status_t _zrtp_compute_preshared_key( zrtp_session_t *session,
 {
        static const zrtp_string8_t presh_key_str       = ZSTR_INIT_WITH_CONST_CSTRING(ZRTP_COMMIT_HV_KEY_STR);
        zrtp_string32_t preshared_key = ZSTR_INIT_EMPTY(preshared_key);
-       static const uint32_t length_rs = ZRTP_RS_SIZE;
-       static const uint32_t length_zero = 0;
+       static uint32_t length_rs = ZRTP_RS_SIZE;
+       static const uint32_t length_zero = 0;          
        
        void *hash_ctx = session->hash->hash_begin(session->hash);
        if (!hash_ctx) {
                return zrtp_status_alloc_fail;
        }
        
+       length_rs = zrtp_hton32(length_rs);
+       
        if (rs1) {
                session->hash->hash_update(session->hash, hash_ctx, (const int8_t*)&length_rs, 4);
                session->hash->hash_update(session->hash, hash_ctx, (const int8_t*)rs1->buffer, ZRTP_RS_SIZE);
@@ -466,8 +468,8 @@ zrtp_status_t _zrtp_compute_preshared_key( zrtp_session_t *session,
        
        if (key_id) {
                session->hash->hmac_truncated( session->hash,
-                                                                          ZSTR_GV(presh_key_str),
                                                                           ZSTR_GV(preshared_key),
+                                                                          ZSTR_GV(presh_key_str),                                                                         
                                                                           ZRTP_HV_KEY_SIZE,
                                                                           ZSTR_GVP(key_id));
        }