Remove the ZrtpConfigure plugin and move its functions into the neomedia package. The

neomedia activator registers the ZrtpConfigurePanel.
cusax-fix
Werner Dittmann 16 years ago
parent 9fd3ba181c
commit 05e909ec9d

@ -839,7 +839,7 @@
bundle-argdelegation,bundle-zrtp4j,
bundle-filehistory,bundle-metahistory,bundle-metahistory-slick,
bundle-facebook,bundle-plugin-facebookaccregwizz,
bundle-bouncycastle,bundle-plugin-otr,bundle-plugin-zrtpconfigure"/>
bundle-bouncycastle,bundle-plugin-otr"/>
<!--BUNDLE-SC-LAUNCHER-->
<target name="bundle-sc-launcher">
@ -2216,14 +2216,6 @@ org.apache.http.util"/>
<zipfileset dir="${dest}/net/java/sip/communicator/slick/metahistory"
prefix="net/java/sip/communicator/slick/metahistory"/>
</jar>
</target>
<target name="bundle-plugin-zrtpconfigure">
<jar compress="false" destfile="${bundles.dest}/zrtpconfigure.jar"
manifest="${src}/net/java/sip/communicator/plugin/zrtpconfigure/zrtp.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/plugin/zrtpconfigure"
prefix="net/java/sip/communicator/plugin/zrtpconfigure"/>
</jar>
</target>
</target>
</project>

@ -167,8 +167,7 @@ felix.auto.start.67= \
reference:file:sc-bundles/generalconfig.jar \
reference:file:sc-bundles/dictaccregwizz.jar \
reference:file:sc-bundles/otr.jar \
reference:file:sc-bundles/facebookaccregwizz.jar \
reference:file:sc-bundles/zrtpconfigure.jar
reference:file:sc-bundles/facebookaccregwizz.jar
#level 68 is for profiler, don't use it or change the build.xml file accordingly

@ -119,8 +119,7 @@ felix.auto.start.6= \
reference:file:sc-bundles/filehistory.jar \
reference:file:sc-bundles/metahistory.jar \
reference:file:sc-bundles/notification.jar \
reference:file:sc-bundles/osdependent.jar \
reference:file:sc-bundles/zrtpconfigure.jar
reference:file:sc-bundles/osdependent.jar
felix.auto.start.7= \
reference:file:sc-bundles/slickless.jar \

@ -27,7 +27,6 @@
import net.java.sip.communicator.impl.media.keyshare.*;
import net.java.sip.communicator.impl.media.transform.*;
import net.java.sip.communicator.impl.media.transform.zrtp.*;
import net.java.sip.communicator.plugin.zrtpconfigure.ZrtpConfigureUtils;
import net.java.sip.communicator.service.media.*;
import net.java.sip.communicator.service.media.MediaException;
import net.java.sip.communicator.service.media.event.*;
@ -2375,8 +2374,7 @@ else if (rtpManager.equals(videoRtpManager))
// the account registration wizard
if (this.getCall().isDefaultEncrypted())
{
ZrtpConfigure config = ZrtpConfigureUtils.getZrtpConfiguration();
if (engine.initialize("GNUZRTP4J.zid", zrtpAutoStart, config))
if (engine.initialize("GNUZRTP4J.zid", zrtpAutoStart))
{
usingZRTP = true;
engine.sendInfo(

@ -28,7 +28,6 @@ Import-Package: org.osgi.framework,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
net.java.sip.communicator.util.swing,
net.java.sip.communicator.plugin.zrtpconfigure,
quicktime,
quicktime.std.sg,
quicktime.qd,

@ -122,6 +122,18 @@ public void start(BundleContext bundleContext)
41),
null);
// ZRTPConfiguration panel
bundleContext
.registerService(
ConfigurationForm.class.getName(),
new LazyConfigurationForm(
"net.java.sip.communicator.impl.neomedia.ZrtpConfigurePanel",
getClass().getClassLoader(),
"impl.media.security.zrtp.CONF_ICON",
"impl.media.security.zrtp.TITLE",
1100),
null);
//we use the nist-sdp stack to make parse sdp and we need to set the
//following property to make sure that it would accept java generated
//IPv6 addresses that contain address scope zones.

@ -3,7 +3,7 @@
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.zrtpconfigure;
package net.java.sip.communicator.impl.neomedia;
import gnu.java.zrtp.ZrtpConfigure;
import gnu.java.zrtp.ZrtpConstants;
@ -48,15 +48,15 @@ public ZrtpConfigurePanel() {
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.setLayout(new GridLayout(5, 1));
final JButton stdButton = new JButton(ZrtpConfigureActivator.resourceService
final JButton stdButton = new JButton(NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.STANDARD"));
stdButton.setOpaque(false);
final JButton mandButton = new JButton(ZrtpConfigureActivator.resourceService
final JButton mandButton = new JButton(NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.MANDATORY"));
mandButton.setOpaque(false);
final JButton saveButton = new JButton(ZrtpConfigureActivator.resourceService
final JButton saveButton = new JButton(NeomediaActivator.getResources()
.getI18NString("service.gui.SAVE"));
saveButton.setOpaque(false);
@ -68,13 +68,13 @@ public ZrtpConfigurePanel() {
mainPanel.add(buttonBar);
mainPanel.add(Box.createVerticalStrut(7));
boolean trusted = ZrtpConfigureActivator.configService.getBoolean(TRUSTED_PROP, false);
boolean sasSign = ZrtpConfigureActivator.configService.getBoolean(SASSIGN_PROP, false);
boolean trusted = NeomediaActivator.getConfigurationService().getBoolean(TRUSTED_PROP, false);
boolean sasSign = NeomediaActivator.getConfigurationService().getBoolean(SASSIGN_PROP, false);
JPanel checkBar = new JPanel(new GridLayout(1,2));
final JCheckBox trustedMitM = new JCheckBox(ZrtpConfigureActivator.resourceService
final JCheckBox trustedMitM = new JCheckBox(NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.TRUSTED"), trusted);
final JCheckBox sasSignature = new JCheckBox(ZrtpConfigureActivator.resourceService
final JCheckBox sasSignature = new JCheckBox(NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.SASSIGNATURE"), sasSign);
checkBar.add(trustedMitM);
checkBar.add(sasSignature);
@ -106,8 +106,8 @@ else if (source == mandButton) {
else if (source == saveButton) {
Boolean t = new Boolean(active.isTrustedMitM());
Boolean s = new Boolean(active.isSasSignature());
ZrtpConfigureActivator.configService.setProperty(TRUSTED_PROP, t);
ZrtpConfigureActivator.configService.setProperty(SASSIGN_PROP, s);
NeomediaActivator.getConfigurationService().setProperty(TRUSTED_PROP, t);
NeomediaActivator.getConfigurationService().setProperty(SASSIGN_PROP, s);
pkc.saveConfig();
hc.saveConfig();
sc.saveConfig();
@ -166,13 +166,13 @@ class PublicKeyControls extends JPanel {
PublicKeyControls() {
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedPubKeys.DH2K);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";
dataModel = new ZrtpConfigureTableModel<ZrtpConstants.SupportedPubKeys>(
ZrtpConstants.SupportedPubKeys.DH2K, active, inActive, savedConf);
createControls(this, dataModel, ZrtpConfigureActivator.resourceService
createControls(this, dataModel, NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.PUB_KEYS"));
}
@ -183,7 +183,7 @@ void setStandard() {
void saveConfig() {
String value = getPropertyValue(ZrtpConstants.SupportedPubKeys.DH2K);
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedPubKeys.DH2K);
ZrtpConfigureActivator.configService.setProperty(id, value);
NeomediaActivator.getConfigurationService().setProperty(id, value);
}
}
@ -193,13 +193,13 @@ class HashControls extends JPanel {
HashControls() {
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedHashes.S256);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";
dataModel = new ZrtpConfigureTableModel<ZrtpConstants.SupportedHashes>(
ZrtpConstants.SupportedHashes.S256, active, inActive, savedConf);
createControls(this, dataModel, ZrtpConfigureActivator.resourceService
createControls(this, dataModel, NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.HASHES"));
}
@ -210,7 +210,7 @@ void setStandard() {
void saveConfig() {
String value = getPropertyValue(ZrtpConstants.SupportedHashes.S256);
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedHashes.S256);
ZrtpConfigureActivator.configService.setProperty(id, value);
NeomediaActivator.getConfigurationService().setProperty(id, value);
}
}
@ -220,13 +220,13 @@ class CipherControls extends JPanel {
CipherControls() {
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedSymCiphers.AES1);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";
dataModel = new ZrtpConfigureTableModel<ZrtpConstants.SupportedSymCiphers>(
ZrtpConstants.SupportedSymCiphers.AES1, active, inActive, savedConf);
createControls(this, dataModel, ZrtpConfigureActivator.resourceService
createControls(this, dataModel, NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.SYM_CIPHERS"));
}
@ -237,7 +237,7 @@ void setStandard() {
void saveConfig() {
String value = getPropertyValue(ZrtpConstants.SupportedSymCiphers.AES1);
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedSymCiphers.AES1);
ZrtpConfigureActivator.configService.setProperty(id, value);
NeomediaActivator.getConfigurationService().setProperty(id, value);
}
}
@ -247,13 +247,13 @@ class SasControls extends JPanel {
SasControls() {
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedSASTypes.B32);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";
dataModel = new ZrtpConfigureTableModel<ZrtpConstants.SupportedSASTypes>(
ZrtpConstants.SupportedSASTypes.B32, active, inActive, savedConf);
createControls(this, dataModel, ZrtpConfigureActivator.resourceService
createControls(this, dataModel, NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.SAS_TYPES"));
}
@ -264,7 +264,7 @@ void setStandard() {
void saveConfig() {
String value = getPropertyValue(ZrtpConstants.SupportedSASTypes.B32);
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedSASTypes.B32);
ZrtpConfigureActivator.configService.setProperty(id, value);
NeomediaActivator.getConfigurationService().setProperty(id, value);
}
}
@ -274,13 +274,13 @@ class LengthControls extends JPanel {
LengthControls() {
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedAuthLengths.HS32);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";
dataModel = new ZrtpConfigureTableModel<ZrtpConstants.SupportedAuthLengths>(
ZrtpConstants.SupportedAuthLengths.HS32, active, inActive, savedConf);
createControls(this, dataModel, ZrtpConfigureActivator.resourceService
createControls(this, dataModel, NeomediaActivator.getResources()
.getI18NString("impl.media.security.zrtp.SRTP_LENGTHS"));
}
@ -291,18 +291,18 @@ void setStandard() {
void saveConfig() {
String value = getPropertyValue(ZrtpConstants.SupportedAuthLengths.HS32);
String id = ZrtpConfigureUtils.getPropertyID(ZrtpConstants.SupportedAuthLengths.HS32);
ZrtpConfigureActivator.configService.setProperty(id, value);
NeomediaActivator.getConfigurationService().setProperty(id, value);
}
}
private <T extends Enum<T>> void createControls(JPanel panel,
ZrtpConfigureTableModel<T> model, String title) {
final JButton upButton = new JButton(ZrtpConfigureActivator.resourceService
final JButton upButton = new JButton(NeomediaActivator.getResources()
.getI18NString("impl.media.configform.UP"));
upButton.setOpaque(false);
final JButton downButton = new JButton(ZrtpConfigureActivator.resourceService
final JButton downButton = new JButton(NeomediaActivator.getResources()
.getI18NString("impl.media.configform.DOWN"));
downButton.setOpaque(false);

@ -1,4 +1,4 @@
package net.java.sip.communicator.plugin.zrtpconfigure;
package net.java.sip.communicator.impl.neomedia;
import java.util.ArrayList;

@ -1,4 +1,4 @@
package net.java.sip.communicator.plugin.zrtpconfigure;
package net.java.sip.communicator.impl.neomedia;
import gnu.java.zrtp.ZrtpConfigure;
import gnu.java.zrtp.ZrtpConstants;
@ -24,7 +24,7 @@ private static <T extends Enum<T>> void setupConfigure(T algo, ZrtpConfigure act
String id = ZrtpConfigureUtils.getPropertyID(algo);
String savedConf = ZrtpConfigureActivator.configService.getString(id);
String savedConf = NeomediaActivator.getConfigurationService().getString(id);
if (savedConf == null)
savedConf = "";

@ -123,7 +123,8 @@ public ZRTPTransformEngine getZrtpEngine()
if(zrtpEngine == null)
{
zrtpEngine = new ZRTPTransformEngine();
zrtpEngine.initialize("GNUZRTP4J.zid", false);
ZrtpConfigure config = ZrtpConfigureUtils.getZrtpConfiguration();
zrtpEngine.initialize("GNUZRTP4J.zid", false, config);
}
return zrtpEngine;
@ -159,8 +160,8 @@ public void start(boolean masterSession)
zrtpAutoStart = true;
securityEventManager.setDHSession(true);
// we now that audio is considered as master for zrtp
securityEventManager.setSessionType(
// we know that audio is considered as master for zrtp
securityEventManager.setSessionType(
SecurityEventManager.AUDIO_SESSION);
}
else
@ -168,7 +169,7 @@ public void start(boolean masterSession)
// check whether video was not already started
// it may happen when using multistreams, audio has inited
// and started video
// initially engins has value enableZrtp = false
// initially engine has value enableZrtp = false
zrtpAutoStart = zrtpEngine.isEnableZrtp();
securityEventManager.setSessionType(
SecurityEventManager.VIDEO_SESSION);

@ -28,7 +28,6 @@ Import-Package: org.osgi.framework,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
net.java.sip.communicator.util.swing,
net.java.sip.communicator.plugin.zrtpconfigure,
quicktime,
quicktime.std.sg,
quicktime.qd,

@ -1,153 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.zrtpconfigure;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.resources.ResourceManagementService;
import net.java.sip.communicator.service.resources.ResourceManagementServiceUtils;
import org.osgi.framework.*;
/**
* The <tt>BundleActivator</tt> for ZrtpConfigure.
*
* @author Werner Dittmann
*/
public class ZrtpConfigureActivator
implements BundleActivator
{
public static BundleContext bundleContext;
/**
* The {@link ResourceManagementService} of the {@link ZrtpConfigureActivator}.
*/
public static ResourceManagementService resourceService;
/**
* The {@link UIService} of the {@link ZrtpConfigureActivator}.
*/
private static UIService uiService;
/**
* The {@link ConfigurationService} of the {@link ZrtpConfigureActivator}.
*/
protected static ConfigurationService configService;
/**
* Starts this bundle and adds the <td>ZrtpConfigurePanel</tt>.
*/
public void start(BundleContext bc) throws Exception
{
bundleContext = bc;
bundleContext
.registerService(
ConfigurationForm.class.getName(),
new LazyConfigurationForm(
"net.java.sip.communicator.plugin.zrtpconfigure.ZrtpConfigurePanel",
getClass().getClassLoader(),
"impl.media.security.zrtp.CONF_ICON",
"impl.media.security.zrtp.TITLE",
1100),
null);
resourceService =
ResourceManagementServiceUtils
.getService(bundleContext);
if (resourceService == null)
return;
ServiceReference refConfigService =
bundleContext
.getServiceReference(ConfigurationService.class.getName());
if (refConfigService == null)
return;
configService =
(ConfigurationService)bundleContext
.getService(refConfigService);
}
/**
* Stops this bundles.
*/
public void stop(BundleContext arg0) throws Exception
{
resourceService = null;
configService = null;
uiService = null;
}
/**
* Returns the <tt>UIService</tt> obtained from the bundle context.
*
* @return the <tt>UIService</tt> obtained from the bundle context
*/
public static UIService getUIService()
{
if (uiService == null)
{
ServiceReference uiReference =
bundleContext.getServiceReference(UIService.class.getName());
uiService =
(UIService) bundleContext
.getService(uiReference);
}
return uiService;
}
/**
* Returns the <tt>ConfigurationService</tt> obtained from the bundle
* context.
*
* @return the <tt>ConfigurationService</tt> obtained from the bundle
* context
*/
public static ConfigurationService getConfigurationService()
{
if (configService == null)
{
ServiceReference configReference =
bundleContext.getServiceReference(ConfigurationService.class
.getName());
configService =
(ConfigurationService) bundleContext
.getService(configReference);
}
return configService;
}
/**
* Determines whether <tt>bundle</tt> is system or not. We consider system
* bundles those that we have explicitly marked as such with the
* <tt>System-Bundle</tt> manifest property or those that belong to the
* Apache framework itself.
*
* @param bundle the bundle that we need to determine as system or not.
* @return true if <tt>bundle</tt> is a system bundle and <tt>false</tt>
* otherwise.
*/
public static boolean isSystemBundle(Bundle bundle)
{
if (bundle.getBundleId() <= 1)
{
//this is one of the felix bundles
return true;
}
Object sysBundleProp = bundle.getHeaders().get("System-Bundle");
//ignore if this is a system bundle
return (sysBundleProp != null && sysBundleProp.equals("yes"));
}
}

@ -1,29 +0,0 @@
Bundle-Activator: net.java.sip.communicator.plugin.zrtpconfigure.ZrtpConfigureActivator
Bundle-Name: ZRTP configuration plugin
Bundle-Description: Provides ZRTP configuration functions.
Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.service.configuration,
net.java.sip.communicator.service.gui,
net.java.sip.communicator.service.gui.event,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.util,
net.java.sip.communicator.util.swing,
javax.swing,
javax.swing.event,
javax.swing.table,
javax.swing.text,
javax.swing.text.html,
javax.accessibility,
javax.swing.plaf,
javax.swing.plaf.metal,
javax.swing.plaf.basic,
javax.imageio,
javax.swing.filechooser,
javax.swing.tree,
javax.swing.undo,
javax.swing.border,
gnu.java.zrtp
Export-Package: net.java.sip.communicator.plugin.zrtpconfigure
Loading…
Cancel
Save