diff --git a/include/zrtp_version.h b/include/zrtp_version.h index 3f4640e659..bcf183f9be 100644 --- a/include/zrtp_version.h +++ b/include/zrtp_version.h @@ -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__*/ diff --git a/projects/gnu/configure.in b/projects/gnu/configure.in index 4e53494d69..1af09c172e 100644 --- a/projects/gnu/configure.in +++ b/projects/gnu/configure.in @@ -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" diff --git a/src/zrtp_protocol.c b/src/zrtp_protocol.c index f271309a0a..e50a00da76 100644 --- a/src/zrtp_protocol.c +++ b/src/zrtp_protocol.c @@ -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); diff --git a/src/zrtp_utils_proto.c b/src/zrtp_utils_proto.c index 9e3d0e058f..c7e4459148 100644 --- a/src/zrtp_utils_proto.c +++ b/src/zrtp_utils_proto.c @@ -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)); }