Added ZRTP4J bundle

Added the boucycastle lib
Renamed OperationSetSecuredTelephony  to OperationSetSecureTelephony
Renamed the isSecured/setSecured method to isSecure/setSecure
Fixed some identations
cusax-fix
Romain Kuntz 18 years ago
parent b0f7b08de6
commit 5e3ce7bb17

@ -751,7 +751,7 @@
bundle-dict,bundle-plugin-dictaccregwizz,
bundle-plugin-simpleaccreg,bundle-plugin-generalconfig,
bundle-plugin-googletalkaccregwizz,bundle-argdelegation-service,
bundle-argdelegation"/>
bundle-argdelegation,bundle-zrtp4j"/>
<!--BUNDLE-SC-LAUNCHER-->
<target name="bundle-sc-launcher">
@ -1838,4 +1838,18 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/impl/argdelegation/"/>
</jar>
</target>
<!--BUNDLE-ZRTP4J -->
<target name="bundle-zrtp4j">
<jar compress="true" destfile="lib/bundle/zrtp4j.jar"
filesetmanifest="merge">
<zipfileset src="${lib.noinst}/zrtp4j-0.9.0.jar" prefix=""/>
<manifest>
<attribute name="Export-Package" value="gnu.java.zrtp"/>
<attribute name="Bundle-Name" value="ZRTP4J"/>
<attribute name="Bundle-Description" value="ZRTP for Java library."/>
</manifest>
</jar>
</target>
</project>

@ -211,11 +211,11 @@ private Component createTransferCallButton()
/**
* Creates a new <code>Component</code> representing a UI means to secure
* the <code>Call</code> of the associated <code>callParticipant</code> or
* <tt>null</tt> if secured call is unsupported.
* <tt>null</tt> if secure call is unsupported.
*
* @return a new <code>Component</code> representing the UI means to
* secure the <code>Call</code> of <code>callParticipant</code> or
* <tt>null</tt> if secured call is unsupported
* <tt>null</tt> if secure call is unsupported
*/
private Component createSecureCallButton()
{
@ -223,11 +223,11 @@ private Component createSecureCallButton()
if (call != null)
{
OperationSetSecuredTelephony secured =
(OperationSetSecuredTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetSecuredTelephony.class);
OperationSetSecureTelephony secure =
(OperationSetSecureTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetSecureTelephony.class);
if (secured != null)
if (secure != null)
{
return new SecureButton(callParticipant);
}

@ -43,25 +43,25 @@ public void actionPerformed(ActionEvent evt)
String command = evt.getActionCommand();
if (command.equals("startSecureMode"))
{
OperationSetSecuredTelephony telephony =
(OperationSetSecuredTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetSecuredTelephony.class);
OperationSetSecureTelephony telephony =
(OperationSetSecureTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetSecureTelephony.class);
if (telephony != null && telephony.isSecured(callParticipant))
if (telephony != null && telephony.isSecure(callParticipant))
{
updateSecureButton(false);
telephony.setSecured(callParticipant,
telephony.setSecure(callParticipant,
false,
OperationSetSecuredTelephony.
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
else if (telephony != null)
{
updateSecureButton(true);
telephony.setSecured(callParticipant,
telephony.setSecure(callParticipant,
true,
OperationSetSecuredTelephony.
OperationSetSecureTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
@ -73,11 +73,11 @@ else if (telephony != null)
/**
* The method used to update the secure button state (pressed or not pressed)
*
* @param isSecured parameter reflecting the current button state
* @param isSecure parameter reflecting the current button state
*/
public void updateSecureButton(boolean isSecured)
public void updateSecureButton(boolean isSecure)
{
if(isSecured)
if(isSecure)
{
this.setIcon(
new ImageIcon(

@ -2065,7 +2065,7 @@ private void initializeRtpManager(RTPManager rtpManager,
"manager initialized through connector");
}
// No key management solution - unsecured communication branch
// No key management solution - unsecure communication branch
else
{
rtpManager.initialize(bindAddress);
@ -2624,14 +2624,14 @@ public boolean getSecureCommunicationStatus()
/**
* Method for setting the default secure status value for communication
* Also has the role to trigger going secure from not secured or viceversa
* Also has the role to trigger going secure from not secure or viceversa
* Notifies any present CallSession of change in the status value for this purpose
*
* @param activator setting for default communication securing
* @param source the source of changing the secure status (local or remote)
*/
public void setSecureCommunicationStatus(boolean activator,
OperationSetSecuredTelephony.
OperationSetSecureTelephony.
SecureStatusChangeSource source)
{
@ -2643,7 +2643,7 @@ public void setSecureCommunicationStatus(boolean activator,
// Fire the change event to notify any present CallSession of security change status
// if not the case of a reverted secure state
// (usually case of previous change rejected due to an error)
if (source != OperationSetSecuredTelephony.
if (source != OperationSetSecureTelephony.
SecureStatusChangeSource.SECURE_STATUS_REVERTED)
fireSecureStatusChanged(activator, source);
@ -2656,7 +2656,7 @@ public void setSecureCommunicationStatus(boolean activator,
* @param source the source of changing the secure status (local or remote)
*/
private synchronized void fireSecureStatusChanged(boolean activator,
OperationSetSecuredTelephony.
OperationSetSecureTelephony.
SecureStatusChangeSource source)
{
if (activator)
@ -2681,13 +2681,13 @@ private synchronized void fireSecureStatusChanged(boolean activator,
* Called when a new SecureEvent is received.
*
* @param manager The RTP manager for which the media streams
* will be secured or unsecured
* will be secure or unsecure
* @param event The secure status changed event
*/
public void ZRTPChangeStatus(RTPManager manager, SecureEvent event)
{
int newStatus = event.getEventID();
OperationSetSecuredTelephony.SecureStatusChangeSource source = event.getSource();
OperationSetSecureTelephony.SecureStatusChangeSource source = event.getSource();
TransformConnector transConnector =
(TransformConnector) this.transConnectors.get(manager);
@ -2697,7 +2697,7 @@ public void ZRTPChangeStatus(RTPManager manager, SecureEvent event)
// Perform ZRTP engine actions only if triggered by local peer - user commands;
// If the remote peer caused the event only general call session security status
// is changed (done before event processing)
if (source == OperationSetSecuredTelephony.
if (source == OperationSetSecureTelephony.
SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL)
{
if (newStatus == SecureEvent.SECURE_COMMUNICATION)

@ -389,130 +389,119 @@ public void actionPerformed(ActionEvent e)
if (command.equals("defaultZRTPAction"))
{
if(callSession.getSecureCommunicationStatus())
if(callSession.getSecureCommunicationStatus())
{
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_LOCAL);
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_LOCAL);
}
else
{
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_LOCAL);
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_LOCAL);
}
}
else
if (command.equals("firstZRTPTrigger"))
else if (command.equals("firstZRTPTrigger"))
{
ToolTipManager.sharedInstance().mouseMoved(
ToolTipManager.sharedInstance().mouseMoved(
new MouseEvent(zrtpButton, 0, 0, 0,
0, 0,
0, false));
}
else
if (command.equals("revertFromAllowClearFailure"))
else if (command.equals("revertFromAllowClearFailure"))
{
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
zrtpButton.setToolTipText(SCCallbackResources.GOCLEAR_REQUEST_AC_FLAG_FAILURE);
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
zrtpButton.setToolTipText(SCCallbackResources.GOCLEAR_REQUEST_AC_FLAG_FAILURE);
}
else
if (command.equals("zrtpInitFail"))
else if (command.equals("zrtpInitFail"))
{
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
zrtpButton.setToolTipText(SCCallbackResources.ZRTP_ENGINE_INIT_FAILURE);
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
zrtpButton.setToolTipText(SCCallbackResources.ZRTP_ENGINE_INIT_FAILURE);
}
else
if (command.equals("revertToSecured"))
else if (command.equals("revertToSecured"))
{
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
}
else
if (command.equals("revertToUnsecured"))
else if (command.equals("revertToUnsecured"))
{
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_REVERTED);
}
else
if (command.equals("goClearRemoteToggle"))
else if (command.equals("goClearRemoteToggle"))
{
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_REMOTE);
updateSecureButton(false);
callSession.
setSecureCommunicationStatus(false,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_REMOTE);
}
else
if (command.equals("goSecureRemoteToggle"))
else if (command.equals("goSecureRemoteToggle"))
{
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecuredTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_REMOTE);
updateSecureButton(true);
callSession.
setSecureCommunicationStatus(true,
OperationSetSecureTelephony.
SecureStatusChangeSource.
SECURE_STATUS_CHANGE_BY_REMOTE);
}
}
/**
* The method used to update the secure button state (pressed or not pressed)
*
* @param isSecured parameter reflecting the current button state
* @param isSecure parameter reflecting the current button state
*/
public void updateSecureButton(boolean isSecured)
public void updateSecureButton(boolean isSecure)
{
if(isSecured)
if(isSecure)
{
zrtpButton.setIcon(
new ImageIcon(SCCallbackResources.getImage
(SCCallbackResources.SECURE_ON_ICON)));
(SCCallbackResources.SECURE_ON_ICON)));
zrtpButton.setToolTipText(SCCallbackResources.TOGGLE_OFF_SECURITY);
}
else
{
zrtpButton.setIcon(
new ImageIcon(SCCallbackResources.getImage
(SCCallbackResources.SECURE_OFF_ICON)));
(SCCallbackResources.SECURE_OFF_ICON)));
zrtpButton.setToolTipText(SCCallbackResources.TOGGLE_ON_SECURITY);
}
}

@ -32,7 +32,7 @@ public class OperationSetBasicTelephonySipImpl
extends AbstractOperationSetBasicTelephony
implements MethodProcessor,
OperationSetAdvancedTelephony,
OperationSetSecuredTelephony
OperationSetSecureTelephony
{
private static final Logger logger =
Logger.getLogger(OperationSetBasicTelephonySipImpl.class);
@ -2948,20 +2948,20 @@ public void setMute(CallParticipant participant, boolean mute)
/*
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetSecuredTelephony#setSecured(net.java.sip.communicator.service.protocol.CallParticipant, boolean, net.java.sip.communicator.service.protocol.OperationSetSecuredTelephony.SecureStatusChangeSource)
* @see net.java.sip.communicator.service.protocol.OperationSetSecureTelephony#setSecure(net.java.sip.communicator.service.protocol.CallParticipant, boolean, net.java.sip.communicator.service.protocol.OperationSetSecureTelephony.SecureStatusChangeSource)
*/
public void setSecured(CallParticipant participant, boolean secured,
public void setSecure(CallParticipant participant, boolean secure,
SecureStatusChangeSource source)
{
((CallSipImpl) participant.getCall()).getMediaCallSession().
setSecureCommunicationStatus(secured, source);
setSecureCommunicationStatus(secure, source);
}
/*
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetSecuredTelephony#getSecured(net.java.sip.communicator.service.protocol.CallParticipant)
* @see net.java.sip.communicator.service.protocol.OperationSetSecureTelephony#isSecure(net.java.sip.communicator.service.protocol.CallParticipant)
*/
public boolean isSecured(CallParticipant participant)
public boolean isSecure(CallParticipant participant)
{
return ((CallSipImpl) participant.getCall()).getMediaCallSession().
getSecureCommunicationStatus();

@ -686,7 +686,7 @@ protected void initialize(String sipAddress,
// init ZRTP (OperationSetBasicTelephonySipImpl implements
// OperationSetSecureTelephony)
this.supportedOperationSets.put(
OperationSetSecuredTelephony.class.getName()
OperationSetSecureTelephony.class.getName()
, opSetAdvancedTelephony);
//init presence op set.

@ -200,7 +200,7 @@ public void processSdpAnswer(CallParticipant responder, String sdpAnswer)
* @param source the initiator of the secure status change (can be local or remote)
*/
public void setSecureCommunicationStatus(boolean activator,
OperationSetSecuredTelephony.
OperationSetSecureTelephony.
SecureStatusChangeSource source);
/**

@ -14,29 +14,29 @@
* @author Emanuel Onica
* @author Romain Kuntz
*/
public interface OperationSetSecuredTelephony
public interface OperationSetSecureTelephony
extends OperationSet
{
/**
* Sets the secured state of the call session in which a specific participant
* Sets the secure state of the call session in which a specific participant
* is involved
*
* @param participant the participant who toggled (or for whom is remotely
* toggled) the secure status change for the call
* @param secured the new secure status
* @param secure the new secure status
* @param source the source who generated the call change
*/
public void setSecured(CallParticipant participant, boolean secured,
public void setSecure(CallParticipant participant, boolean secure,
SecureStatusChangeSource source);
/**
* Gets the secured state of the call session in which a specific participant
* Gets the secure state of the call session in which a specific participant
* is involved
*
* @param participant the participant for who the call state is required
* @return the call state
*/
public boolean isSecured(CallParticipant participant);
public boolean isSecure(CallParticipant participant);
/**
* Use this to indicate the source of setting the secure status

@ -41,7 +41,7 @@ public class SecureEvent
/**
* The source that triggered the event - local or remote peer
*/
private OperationSetSecuredTelephony.SecureStatusChangeSource source;
private OperationSetSecureTelephony.SecureStatusChangeSource source;
/**
* The event constructor
@ -51,7 +51,7 @@ public class SecureEvent
*/
public SecureEvent(CallSessionImpl callSession,
int eventID,
OperationSetSecuredTelephony.SecureStatusChangeSource source)
OperationSetSecureTelephony.SecureStatusChangeSource source)
{
super(callSession);
this.eventID = eventID;
@ -72,7 +72,7 @@ public int getEventID()
* Retrieves the source that triggered the event
* (change by local peer or remote peer or reverting a previous change)
*/
public OperationSetSecuredTelephony.SecureStatusChangeSource getSource()
public OperationSetSecureTelephony.SecureStatusChangeSource getSource()
{
return source;
}

Loading…
Cancel
Save