]> sjero.net Git - linphone/commitdiff
Revert "Send ZRTP hello hash in SIP SDP."
authorSylvain Berfini <sylvain.berfini@linphone.org>
Fri, 22 Mar 2013 15:34:09 +0000 (16:34 +0100)
committerSylvain Berfini <sylvain.berfini@linphone.org>
Fri, 22 Mar 2013 15:34:09 +0000 (16:34 +0100)
This reverts commit 71f31347fcddaa5f0e9e329a7320efe60bc7c281.

Conflicts:
coreapi/linphonecall.c
mediastreamer2

coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/offeranswer.c
coreapi/sal.h
coreapi/sal_eXosip2_sdp.c
oRTP

index 2770d4ada315a26c9fbf52c7f2f191a34d2fce7b..6c01c65bd73073500c65690787d5883d7b07345c 100644 (file)
@@ -254,14 +254,6 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
        l=ms_list_append(l,pt);
        md->streams[0].payloads=l;
 
-       // if ZRTP is enabled, put the hello hash into the audiostream's desc
-       if (call->audiostream && call->audiostream->ms.zrtp_context!=NULL){
-               ortp_zrtp_get_hello_hash(call->audiostream->ms.zrtp_context,
-                       md->streams[0].zrtp_hello_hash,
-                       sizeof(md->streams[0].zrtp_hello_hash));
-               ms_message("Audio stream zrtp hash: %s", md->streams[0].zrtp_hello_hash);
-       }
-
        if (call->params.has_video){
                md->n_active_streams++;
                md->streams[1].rtp_port=call->video_port;
@@ -270,13 +262,6 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
                md->streams[1].type=SalVideo;
                l=make_codec_list(lc,lc->codecs_conf.video_codecs,0,NULL,-1);
                md->streams[1].payloads=l;
-               // if ZRTP is enabled, put the hello hash into the audiostream's desc
-               if (call->videostream && call->videostream->ms.zrtp_context!=NULL){
-                       ortp_zrtp_get_hello_hash(call->videostream->ms.zrtp_context,
-                               md->streams[1].zrtp_hello_hash,
-                               sizeof(md->streams[1].zrtp_hello_hash));
-                       ms_message("Video stream zrtp hash: %s", md->streams[1].zrtp_hello_hash);
-               }
        }
        if (md->n_total_streams < md->n_active_streams)
                md->n_total_streams = md->n_active_streams;
@@ -1309,20 +1294,6 @@ void linphone_call_init_video_stream(LinphoneCall *call){
 void linphone_call_init_media_streams(LinphoneCall *call){
        linphone_call_init_audio_stream(call);
        linphone_call_init_video_stream(call);
-
-       // moved from linphone_call_start_media_streams, because ZRTP needs to be
-       // at least partially initialized so that the SDP can contain 'zrtp-hash'
-       if (call->params.media_encryption==LinphoneMediaEncryptionZRTP) {
-               OrtpZrtpParams params;
-               /*will be set later when zrtp is activated*/
-               call->current_params.media_encryption=LinphoneMediaEncryptionNone;
-
-               params.zid_file=call->core->zrtp_secrets_cache;
-               audio_stream_enable_zrtp(call->audiostream,&params);
-       } else if (call->params.media_encryption==LinphoneMediaEncryptionSRTP){
-               call->current_params.media_encryption=linphone_call_are_all_streams_encrypted(call) ?
-                       LinphoneMediaEncryptionSRTP : LinphoneMediaEncryptionNone;
-       }
 }
 
 
@@ -1765,10 +1736,16 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
        call->playing_ringbacktone=send_ringbacktone;
        call->up_bw=linphone_core_get_upload_bandwidth(lc);
 
-       // ZRTP was initialized in linphone_call_init_media_streams with a
-       // partially iniitalized RtpSession, and now needs to get an update
        if (call->params.media_encryption==LinphoneMediaEncryptionZRTP) {
-               ortp_zrtp_start_engine(call->audiostream->ms.zrtp_context,call->audiostream->ms.session);
+               OrtpZrtpParams params;
+               /*will be set later when zrtp is activated*/
+               call->current_params.media_encryption=LinphoneMediaEncryptionNone;
+               
+               params.zid_file=lc->zrtp_secrets_cache;
+               audio_stream_enable_zrtp(call->audiostream,&params);
+       }else if (call->params.media_encryption==LinphoneMediaEncryptionSRTP){
+               call->current_params.media_encryption=linphone_call_are_all_streams_encrypted(call) ?
+                       LinphoneMediaEncryptionSRTP : LinphoneMediaEncryptionNone;
        }
 
        /*also reflect the change if the "wished" params, in order to avoid to propose SAVP or video again
index 54224126247c7e1f703ed7f211c08cf4db1eb873..0089dd0fb423d317ce7190377fb317384ed9eb8a 100644 (file)
@@ -3126,14 +3126,8 @@ int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call,
                sal_call_set_local_media_description(call->op,call->localdesc);
        }
        
-       if (call->audiostream==NULL){
+       if (call->audiostream==NULL)
                linphone_call_init_media_streams(call);
-               // the local media description must be regenerated after the audiostream 
-               // is initialized, otherwise the ZRTP hello hash will not be available
-               linphone_call_make_local_media_description(lc,call);
-               sal_call_set_local_media_description(call->op,call->localdesc);
-       }
-
        if (!was_ringing && call->audiostream->ms.ticker==NULL){
                audio_stream_prepare_sound(call->audiostream,lc->sound_conf.play_sndcard,lc->sound_conf.capt_sndcard);
        }
index eefe34d45bf97e86647b2279b738c261a0bf1e9b..9823c24a69f12f6b448d4b687d85436249c9fdb7 100644 (file)
@@ -261,7 +261,6 @@ static void initiate_incoming(const SalStreamDescription *local_cap,
        result->ice_completed = local_cap->ice_completed;
        memcpy(result->ice_candidates, local_cap->ice_candidates, sizeof(result->ice_candidates));
        memcpy(result->ice_remote_candidates, local_cap->ice_remote_candidates, sizeof(result->ice_remote_candidates));
-       memcpy(result->zrtp_hello_hash,local_cap->zrtp_hello_hash, sizeof(result->zrtp_hello_hash));
 }
 
 /**
index 5f38c15abb8e8338090548439ee402b607f6a3ae..25d8d20bcc38b2c58836a636a25d36d3c25d2443 100644 (file)
@@ -140,7 +140,7 @@ typedef struct SalIceRemoteCandidate {
 } SalIceRemoteCandidate;
 
 #define SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES 2
-#define SAL_MEDIA_DESCRIPTION_MAX_ZRTP_HELLO_HASH 128
+
 #define SAL_MEDIA_DESCRIPTION_MAX_ICE_UFRAG_LEN 256
 #define SAL_MEDIA_DESCRIPTION_MAX_ICE_PWD_LEN 256
 
@@ -172,7 +172,6 @@ typedef struct SalStreamDescription{
        SalIceRemoteCandidate ice_remote_candidates[SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES];
        char ice_ufrag[SAL_MEDIA_DESCRIPTION_MAX_ICE_UFRAG_LEN];
        char ice_pwd[SAL_MEDIA_DESCRIPTION_MAX_ICE_PWD_LEN];
-       char zrtp_hello_hash[SAL_MEDIA_DESCRIPTION_MAX_ZRTP_HELLO_HASH];
        bool_t ice_mismatch;
        bool_t ice_completed;
 } SalStreamDescription;
index 139446448a71da5ccd5ab3d977aaf53e3f73145b..debd8550f63e35fb288286946d6e17616ce4041a 100644 (file)
@@ -108,17 +108,6 @@ static int _sdp_message_get_a_ptime(sdp_message_t *sdp, int mline){
        return 0;
 }
 
-static char * _sdp_message_get_a_zrtp_hash(sdp_message_t *sdp, int mline){
-       int i;
-       sdp_attribute_t *attr;
-       for (i=0;(attr=sdp_message_attribute_get(sdp,mline,i))!=NULL;i++){
-               if (keywordcmp("zrtp-hash",attr->a_att_field)==0){
-                       return attr->a_att_value;
-               }
-       }
-       return NULL;
-}
-
 static int _sdp_message_get_mline_dir(sdp_message_t *sdp, int mline){
        int i;
        sdp_attribute_t *attr;
@@ -348,11 +337,6 @@ static void add_line(sdp_message_t *msg, int lineno, const SalStreamDescription
                                     int_2char(desc->bandwidth));
        if (desc->ptime>0) sdp_message_a_attribute_add(msg,lineno,osip_strdup("ptime"),
                                int_2char(desc->ptime));
-
-       // if the ZRTP hello hash is available, create an a attribute for it
-       if (desc->zrtp_hello_hash[0])
-               sdp_message_a_attribute_add(msg,lineno,osip_strdup("zrtp-hash"), osip_strdup(desc->zrtp_hello_hash));
-
        strip_well_known_rtpmaps=ms_list_size(desc->payloads)>5;
        if (desc->payloads){
                for(elem=desc->payloads;elem!=NULL;elem=elem->next){
@@ -449,7 +433,7 @@ static int payload_type_fill_from_rtpmap(PayloadType *pt, const char *rtpmap){
 
 int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){
        int i,j;
-       const char *mtype,*proto,*rtp_port,*rtp_addr,*number,*zrtp_info;
+       const char *mtype,*proto,*rtp_port,*rtp_addr,*number;
        const char *sess;
        sdp_bandwidth_t *sbw=NULL;
        sdp_attribute_t *attr;
@@ -506,12 +490,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){
                        stream->rtp_port=atoi(rtp_port);
                if (stream->rtp_port > 0)
                        desc->n_active_streams++;
-
-               // if the SDP contains a zrtp-hash, add it to the StreamDesc
-               zrtp_info = _sdp_message_get_a_zrtp_hash(msg, i);
-               if (zrtp_info != NULL)
-                       strncpy(stream->zrtp_hello_hash, zrtp_info, sizeof(stream->zrtp_hello_hash));
-
+               
                stream->ptime=_sdp_message_get_a_ptime(msg,i);
                if (strcasecmp("audio", mtype) == 0){
                        stream->type=SalAudio;
@@ -549,8 +528,7 @@ int sdp_to_media_description(sdp_message_t *msg, SalMediaDescription *desc){
                for (j = 0; ((attr = sdp_message_attribute_get(msg, i, j)) != NULL); j++) {
                        if ((keywordcmp("rtcp", attr->a_att_field) == 0) && (attr->a_att_value != NULL)) {
                                char tmp[256];
-                               // added bounds check
-                               int nb = sscanf(attr->a_att_value, "%d IN IP4 %256s", &stream->rtcp_port, tmp);
+                               int nb = sscanf(attr->a_att_value, "%d IN IP4 %s", &stream->rtcp_port, tmp);
                                if (nb == 1) {
                                        /* SDP rtcp attribute only contains the port */
                                } else if (nb == 2) {
diff --git a/oRTP b/oRTP
index c702c0ea0e66bbe1f27c79690003d9748b01560f..dbb75fb00c65ce0102385f235c1da2873e9f6c2e 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit c702c0ea0e66bbe1f27c79690003d9748b01560f
+Subproject commit dbb75fb00c65ce0102385f235c1da2873e9f6c2e