@ -19,11 +19,11 @@
/ * *
* The user callback class for ZRTP4J .
*
*
* This class constructs and sends events to the ZRTP GUI implementation . The
* < code > showMessage ( ) < code > function implements a specific check to start
* < code > showMessage ( ) < code > function implements a specific check to start
* associated ZRTP multi - stream sessions .
*
*
* Coordinate this callback class with the associated GUI implementation class
* net . java . sip . communicator . impl . gui . main . call . ZrtpPanel
*
@ -46,11 +46,11 @@ public class SecurityEventManager extends ZrtpUserCallback
. getResources ( ) . getI18NString (
"impl.media.security.WARNING_NO_EXPECTED_RS_MATCH" ) ;
private CallPeer callP articipant ;
private CallPeer callP eer ;
private final CallSession callSession ;
private final SessionCreatorCallback p articipant SecurityCallback;
private final SessionCreatorCallback p eer SecurityCallback;
/ * *
* Is this a ZRTP DH ( Master ) session ?
@ -84,24 +84,24 @@ public SecurityEventManager(CallSession callSession)
{
this . callSession = callSession ;
this . p articipant SecurityCallback
this . p eer SecurityCallback
= callSession . getSessionCreatorCallback ( ) ;
// At this moment we're supporting a security call between only two
// p articipants. In the future the call participant would be passed
// p eers. In the future the call peer would be passed
// as a parameter to the SecurityEventManager.
Iterator < CallPeer > callP articipant s
Iterator < CallPeer > callP eer s
= callSession . getCall ( ) . getCallPeers ( ) ;
while ( callP articipant s. hasNext ( ) )
while ( callP eer s. hasNext ( ) )
{
this . callP articipant = callParticipant s. next ( ) ;
this . callP eer = callPeer s. next ( ) ;
}
}
/ * *
* Set the type of this session .
*
*
* @param type the session type . The session type could be either
* CallSessionImpl . AUDIO_SESSION or CallSessionImpl . VIDEO_SESSION .
* /
@ -115,7 +115,7 @@ else if (type.equals(CallSessionImpl.VIDEO_SESSION))
/ * *
* Set the DH session flag .
*
*
* @param isDHSession the DH session flag .
* /
public void setDHSession ( boolean isDHSession )
@ -129,7 +129,7 @@ public void setDHSession(boolean isDHSession)
/ * *
* Reports the security algorithm that the ZRTP protocol negotiated .
*
*
* @see gnu . java . zrtp . ZrtpUserCallback # secureOn ( java . lang . String )
* /
public void secureOn ( String cipher )
@ -144,7 +144,7 @@ public void secureOn(String cipher)
/ * *
* ZRTP computes the SAS string after nearly all the negotiation
* and computations are done internally .
*
*
* @see gnu . java . zrtp . ZrtpUserCallback # showSAS ( java . lang . String , boolean )
* /
public void showSAS ( String sas , boolean isVerified )
@ -180,8 +180,8 @@ public void showMessage(ZrtpCodes.MessageSeverity sev,
// Use the following fields if INFORMATION type messages shall be
// shown to the user via SecurityMessageEvent, i.e. if
// sendEvent is set to true
// severity = CallP articipant SecurityMessageEvent.INFORMATION;
// sendEvent is set to true
// severity = CallP eer SecurityMessageEvent.INFORMATION;
// Don't spam user with info messages, only internal processing
// or logging.
@ -198,12 +198,12 @@ public void showMessage(ZrtpCodes.MessageSeverity sev,
multiStreams = ( ( CallSessionImpl ) callSession )
. startZrtpMultiStreams ( ) ;
p articipant SecurityCallback. securityOn ( sessionType , cipher ,
p eer SecurityCallback. securityOn ( sessionType , cipher ,
sas , isSasVerified ) ;
}
else
{
p articipant SecurityCallback. securityOn ( sessionType , cipher ,
p eer SecurityCallback. securityOn ( sessionType , cipher ,
null , false ) ;
}
}
@ -231,7 +231,7 @@ else if (warn == ZrtpCodes.WarningCodes.WarningCRCmismatch)
i18nMessage = MediaActivator . getResources ( ) . getI18NString (
"impl.media.security.CHECKSUM_MISMATCH" ) ;
}
else
else
{
// Other warnings are internal only, no user action required
sendEvent = false ;
@ -283,14 +283,14 @@ else if (msgCode instanceof ZrtpCodes.ZrtpErrorCodes)
"impl.media.security.ZRTP_GENERIC_MSG" ,
new String [ ] { msgCode . toString ( ) } ) ;
}
else
else
{
// Other warnings are internal only, no user action required
sendEvent = false ;
}
if ( sendEvent )
p articipant SecurityCallback
p eer SecurityCallback
. securityMessage ( message , i18nMessage , severity ) ;
if ( logger . isInfoEnabled ( ) )
@ -327,11 +327,11 @@ public void secureOff()
// If this event has been triggered because of a call end event and the
// call is already ended we don't need to alert the user for
// security off.
if ( callP articipant . getCall ( ) ! = null
& & ! callP articipant . getCall ( ) . getCallState ( )
if ( callP eer . getCall ( ) ! = null
& & ! callP eer . getCall ( ) . getCallState ( )
. equals ( CallState . CALL_ENDED ) )
{
p articipant SecurityCallback. securityOff ( sessionType ) ;
p eer SecurityCallback. securityOff ( sessionType ) ;
}
}