Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Ptaszkiewicz2013-11-26 11:45:07 -0500
committerSzymon Ptaszkiewicz2013-11-26 11:45:07 -0500
commit3dcd6f48b6c0918050a1dc1cbf714dcca39df5a0 (patch)
treebb2d5f4f2d249f8368d69665156924a3862ec8da
parent6876456d6b72f131f6bfa580068cef894f57dd09 (diff)
downloadeclipse.platform.team-3dcd6f48b6c0918050a1dc1cbf714dcca39df5a0.tar.gz
eclipse.platform.team-3dcd6f48b6c0918050a1dc1cbf714dcca39df5a0.tar.xz
eclipse.platform.team-3dcd6f48b6c0918050a1dc1cbf714dcca39df5a0.zip
Bug 418835 - [Backport] Add JSch 0.1.50 to Platform
This commit backports the following commits: http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=7e0b232400cb860bb566abe97003da0408e5e219 http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=805f2a92afb44d1a67f991c16d050a4c9506400f http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=a71e56373a4b873af521839c8795b2fde71e1180 http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=1d601b81aaeb31ba9c28b520b31693dbfe395742
-rw-r--r--bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.jsch.core/pom.xml2
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java8
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java83
-rw-r--r--bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF13
-rw-r--r--bundles/org.eclipse.jsch.ui/pom.xml2
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java8
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties8
-rw-r--r--bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java321
-rw-r--r--bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.team.cvs.core/pom.xml2
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.team.cvs.ssh2/pom.xml2
13 files changed, 435 insertions, 28 deletions
diff --git a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
index f32547728..8c5d6977b 100644
--- a/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.core/META-INF/MANIFEST.MF
@@ -2,14 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.core;singleton:=true
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.450.qualifier
Bundle-Activator: org.eclipse.jsch.internal.core.JSchCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
- com.jcraft.jsch;bundle-version="[0.1.28,1.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jsch.core,
+Export-Package: org.eclipse.jsch.core;uses:="org.eclipse.core.runtime,com.jcraft.jsch",
org.eclipse.jsch.internal.core;x-friends:="org.eclipse.jsch.ui"
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.jsch.core/pom.xml b/bundles/org.eclipse.jsch.core/pom.xml
index 2935e1099..f219cb4bf 100644
--- a/bundles/org.eclipse.jsch.core/pom.xml
+++ b/bundles/org.eclipse.jsch.core/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.core</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.450-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java
index 5ec77eb89..872c79b31 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,4 +54,10 @@ public interface IConstants{
public static final String PREF_PREFERRED_AUTHENTICATION_METHODS="CVSSSH2PreferencePage.PREF_AUTH_METHODS"; //$NON-NLS-1$
public static final String PREF_PREFERRED_AUTHENTICATION_METHODS_ORDER="CVSSSH2PreferencePage.PREF_AUTH_METHODS_ORDER"; //$NON-NLS-1$
+
+ public static final String PREF_PREFERRED_KEYEXCHANGE_METHODS="CVSSSH2PreferencePage.PREF_KEX_METHODS"; //$NON-NLS-1$
+ public static final String PREF_PREFERRED_KEYEXCHANGE_METHODS_ORDER="CVSSSH2PreferencePage.PREF_KEX_METHODS_ORDER"; //$NON-NLS-1$
+
+ public static final String PREF_PREFERRED_MAC_METHODS="CVSSSH2PreferencePage.PREF_MAC_METHODS"; //$NON-NLS-1$
+ public static final String PREF_PREFERRED_MAC_METHODS_ORDER="CVSSSH2PreferencePage.PREF_MAC_METHODS_ORDER"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
index 26d71ba22..08b547e8e 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,9 +38,36 @@ public class Utils{
"gssapi-with-mic", "publickey", "password", "keyboard-interactive"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
public static String getDefaultAuthMethods(){
- String defaultValue = PREFERRED_AUTH_METHODS[0];
- for(int i = 1; i < PREFERRED_AUTH_METHODS.length; i++){
- defaultValue += "," + PREFERRED_AUTH_METHODS[i]; //$NON-NLS-1$
+ return getDefaultMethods(PREFERRED_AUTH_METHODS);
+ }
+
+ private static final String[] PREFERRED_KEX_METHODS=new String[] {
+ "diffie-hellman-group1-sha1", //$NON-NLS-1$
+ "diffie-hellman-group14-sha1", //$NON-NLS-1$
+ "diffie-hellman-group-exchange-sha1", //$NON-NLS-1$
+ "diffie-hellman-group-exchange-sha256" //$NON-NLS-1$
+ };
+
+ public static String getDefaultKEXMethods(){
+ return getDefaultMethods(PREFERRED_KEX_METHODS);
+ }
+
+ private static final String[] PREFERRED_MAC_METHODS=new String[] {
+ "hmac-md5", //$NON-NLS-1$
+ "hmac-sha1", //$NON-NLS-1$
+ "hmac-sha2-256", //$NON-NLS-1$
+ "hmac-sha1-96", //$NON-NLS-1$
+ "hmac-md5-96" //$NON-NLS-1$
+ };
+
+ public static String getDefaultMACMethods(){
+ return getDefaultMethods(PREFERRED_MAC_METHODS);
+ }
+
+ private static String getDefaultMethods(String[] methods){
+ String defaultValue = methods[0];
+ for(int i = 1; i < methods.length; i++){
+ defaultValue += "," + methods[i]; //$NON-NLS-1$
}
return defaultValue;
}
@@ -97,7 +124,13 @@ public class Utils{
setProxy(session);
Hashtable config=new Hashtable();
config.put("PreferredAuthentications", //$NON-NLS-1$
- getEnabledPreferredAuthMethods());
+ getEnabledPreferredAuthMethods());
+ config.put("kex", //$NON-NLS-1$
+ getEnabledPreferredKEXMethods());
+ config.put("mac.c2s", //$NON-NLS-1$
+ getEnabledPreferredMACMethods());
+ config.put("mac.s2c", //$NON-NLS-1$
+ getEnabledPreferredMACMethods());
session.setConfig(config);
return session;
}
@@ -226,5 +259,43 @@ public class Utils{
service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put(
IConstants.PREF_PREFERRED_AUTHENTICATION_METHODS_ORDER, order);}
-
+ public static String getEnabledPreferredKEXMethods(){
+ IPreferencesService service = Platform.getPreferencesService();
+ return service.getString(JSchCorePlugin.ID,
+ IConstants.PREF_PREFERRED_KEYEXCHANGE_METHODS, getDefaultKEXMethods(), null);
+ }
+
+ public static String getKEXMethodsOrder(){
+ IPreferencesService service = Platform.getPreferencesService();
+ return service.getString(JSchCorePlugin.ID,
+ IConstants.PREF_PREFERRED_KEYEXCHANGE_METHODS_ORDER, getDefaultKEXMethods(), null);
+ }
+
+ public static void setEnabledPreferredKEXMethods(String methods, String order){
+ IPreferencesService service=Platform.getPreferencesService();
+ service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put(
+ IConstants.PREF_PREFERRED_KEYEXCHANGE_METHODS, methods);
+ service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put(
+ IConstants.PREF_PREFERRED_KEYEXCHANGE_METHODS_ORDER, order);
+ }
+
+ public static String getEnabledPreferredMACMethods(){
+ IPreferencesService service = Platform.getPreferencesService();
+ return service.getString(JSchCorePlugin.ID,
+ IConstants.PREF_PREFERRED_MAC_METHODS, getDefaultMACMethods(), null);
+ }
+
+ public static String getMACMethodsOrder(){
+ IPreferencesService service = Platform.getPreferencesService();
+ return service.getString(JSchCorePlugin.ID,
+ IConstants.PREF_PREFERRED_MAC_METHODS_ORDER, getDefaultMACMethods(), null);
+ }
+
+ public static void setEnabledPreferredMACMethods(String methods, String order){
+ IPreferencesService service=Platform.getPreferencesService();
+ service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put(
+ IConstants.PREF_PREFERRED_MAC_METHODS, methods);
+ service.getRootNode().node(InstanceScope.SCOPE).node(JSchCorePlugin.ID).put(
+ IConstants.PREF_PREFERRED_MAC_METHODS_ORDER, order);
+ }
}
diff --git a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
index 23cf8bf09..612048223 100644
--- a/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
@@ -2,16 +2,17 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jsch.ui;singleton:=true
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.450.qualifier
Bundle-Activator: org.eclipse.jsch.internal.ui.JSchUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.jsch.core,
- com.jcraft.jsch
+Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)",
+ org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)"
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Export-Package: org.eclipse.jsch.internal.ui;x-internal:=true,
+ org.eclipse.jsch.internal.ui.authenticator;x-internal:=true,
org.eclipse.jsch.internal.ui.preference;x-internal:=true,
- org.eclipse.jsch.ui
+ org.eclipse.jsch.ui;uses:="com.jcraft.jsch"
diff --git a/bundles/org.eclipse.jsch.ui/pom.xml b/bundles/org.eclipse.jsch.ui/pom.xml
index 7e4d4bcd5..0fe68d51a 100644
--- a/bundles/org.eclipse.jsch.ui/pom.xml
+++ b/bundles/org.eclipse.jsch.ui/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.jsch</groupId>
<artifactId>org.eclipse.jsch.ui</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.450-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java
index a0e1ba854..cfc1a61e5 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -88,6 +88,12 @@ public class Messages extends NLS{
public static String CVSSSH2PreferencePage_137;
public static String CVSSSH2PreferencePage_138;
public static String CVSSSH2PreferencePage_139;
+ public static String CVSSSH2PreferencePage_140;
+ public static String CVSSSH2PreferencePage_141;
+ public static String CVSSSH2PreferencePage_142;
+ public static String CVSSSH2PreferencePage_143;
+ public static String CVSSSH2PreferencePage_144;
+ public static String CVSSSH2PreferencePage_145;
public static String KeyboardInteractiveDialog_0;
public static String KeyboardInteractiveDialog_1;
public static String KeyboardInteractiveDialog_2;
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
index 243e9d953..d228d5665 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
+# Copyright (c) 2000, 2013 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -78,6 +78,12 @@ CVSSSH2PreferencePage_136=Fingerprint
CVSSSH2PreferencePage_137=&Authentication Methods
CVSSSH2PreferencePage_138=&Remove
CVSSSH2PreferencePage_139=Keys of known hosts:
+CVSSSH2PreferencePage_140=Select preferred key exchange methods
+CVSSSH2PreferencePage_141=Select preferred MAC methods
+CVSSSH2PreferencePage_142=You must select at least one key exchange method.
+CVSSSH2PreferencePage_143=You must select at least one MAC method.
+CVSSSH2PreferencePage_144=Key Exchange &Methods
+CVSSSH2PreferencePage_145=MA&C Methods
UserInfoPrompter_0=SSH2 Message
UserInfoPrompter_1=SSH2 Message
KeyboardInteractiveDialog_0=Keyboard Interactive authentication for {0}: {1}
diff --git a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
index d3c371688..1945516f2 100644
--- a/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
+++ b/bundles/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -146,6 +146,14 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
tabItem=new TabItem(tabFolder, SWT.NONE);
tabItem.setText(Messages.CVSSSH2PreferencePage_137);
tabItem.setControl(createPreferredAuthenticationPage(tabFolder));
+
+ tabItem=new TabItem(tabFolder, SWT.NONE);
+ tabItem.setText(Messages.CVSSSH2PreferencePage_144);
+ tabItem.setControl(createPreferredKeyExchangePage(tabFolder));
+
+ tabItem=new TabItem(tabFolder, SWT.NONE);
+ tabItem.setText(Messages.CVSSSH2PreferencePage_145);
+ tabItem.setControl(createPreferredMACPage(tabFolder));
initControls();
@@ -807,10 +815,15 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
private Button removeHostKeyButton;
Table preferedAuthMethodTable;
+ Table preferedKeyExchangeMethodTable;
+ Table preferedMACMethodTable;
Button up;
-
Button down;
+ Button kex_up;
+ Button kex_down;
+ Button mac_up;
+ Button mac_down;
class TableLabelProvider extends LabelProvider implements ITableLabelProvider{
public String getColumnText(Object element, int columnIndex){
@@ -1063,7 +1076,259 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
}
}
}
+
+ private Control createPreferredKeyExchangePage(Composite parent){
+ Composite root = new Composite(parent, SWT.NONE);
+ GridLayout layout=new GridLayout();
+ layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ layout.numColumns = 2;
+ root.setLayout(layout);
+
+ Label label=new Label(root, SWT.NONE);
+ GridData textLayoutData=new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false);
+ textLayoutData.horizontalSpan = 2;
+ label.setLayoutData(textLayoutData);
+ label.setText(Messages.CVSSSH2PreferencePage_140);
+
+ preferedKeyExchangeMethodTable=new Table(root, SWT.CHECK | SWT.BORDER);
+ GridData layoutData=new GridData(SWT.FILL, SWT.BEGINNING, true, true);
+ layoutData.verticalSpan = 3;
+ preferedKeyExchangeMethodTable.setLayoutData(layoutData);
+ layoutData.minimumHeight = 150;
+ layoutData.minimumWidth = 200;
+ populateAuthMethods();
+
+ kex_up=new Button(root, SWT.PUSH);
+ kex_up.setText(Messages.CVSSSH2PreferencePage_2);
+ kex_up.setEnabled(false);
+ setButtonLayoutData(kex_up);
+
+ kex_down=new Button(root, SWT.PUSH);
+ kex_down.setText(Messages.CVSSSH2PreferencePage_3);
+ kex_down.setEnabled(false);
+ setButtonLayoutData(kex_down);
+
+ preferedKeyExchangeMethodTable.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ boolean anySelected = false;
+ for(int i = 0; i < preferedKeyExchangeMethodTable.getItemCount(); i++){
+ anySelected |= preferedKeyExchangeMethodTable.getItem(i).getChecked();
+ }
+
+ if(anySelected){
+ setErrorMessage(null);
+ setValid(true);
+ }
+ else{
+ setErrorMessage(Messages.CVSSSH2PreferencePage_142);
+ setValid(false);
+ }
+ kex_up.setEnabled(preferedKeyExchangeMethodTable.getSelectionIndex()>0);
+ kex_down
+ .setEnabled(preferedKeyExchangeMethodTable.getSelectionIndex()<preferedKeyExchangeMethodTable
+ .getItemCount()-1);
+ }
+
+ });
+ kex_up.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ int selectedIndex=preferedKeyExchangeMethodTable.getSelectionIndex();
+ if(selectedIndex == 1){ //this is the last possible swap
+ kex_up.setEnabled(false);
+ }
+ kex_down.setEnabled(true);
+ TableItem sourceItem = preferedKeyExchangeMethodTable.getItem(selectedIndex);
+ TableItem targetItem = preferedKeyExchangeMethodTable.getItem(selectedIndex-1);
+
+ //switch text
+ String stemp = targetItem.getText();
+ targetItem.setText(sourceItem.getText());
+ sourceItem.setText(stemp);
+
+ //switch selection
+ boolean btemp = targetItem.getChecked();
+ targetItem.setChecked(sourceItem.getChecked());
+ sourceItem.setChecked(btemp);
+
+ preferedKeyExchangeMethodTable.setSelection(targetItem);
+ }
+ });
+
+ kex_down.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ int selectedIndex=preferedKeyExchangeMethodTable.getSelectionIndex();
+ if(selectedIndex == preferedKeyExchangeMethodTable.getItemCount()-2){ //this is the last possible swap
+ kex_down.setEnabled(false);
+ }
+ kex_up.setEnabled(true);
+ TableItem sourceItem = preferedKeyExchangeMethodTable.getItem(selectedIndex);
+ TableItem targetItem = preferedKeyExchangeMethodTable.getItem(selectedIndex+1);
+
+ //switch text
+ String stemp = targetItem.getText();
+ targetItem.setText(sourceItem.getText());
+ sourceItem.setText(stemp);
+
+ //switch selection
+ boolean btemp = targetItem.getChecked();
+ targetItem.setChecked(sourceItem.getChecked());
+ sourceItem.setChecked(btemp);
+
+ preferedKeyExchangeMethodTable.setSelection(targetItem);
+ }
+ });
+
+ return root;
+ }
+
+ private void populateKeyExchangeMethods(){
+ preferedKeyExchangeMethodTable.removeAll();
+ String[] methods = Utils.getEnabledPreferredKEXMethods().split(","); //$NON-NLS-1$
+ Set smethods = new HashSet(Arrays.asList(methods));
+
+ String[] order = Utils.getKEXMethodsOrder().split(","); //$NON-NLS-1$
+
+ for(int i=0; i<order.length; i++){
+ TableItem tableItem= new TableItem(preferedKeyExchangeMethodTable, SWT.NONE);
+ tableItem.setText(0, order[i]);
+ if(smethods.contains(order[i])){
+ tableItem.setChecked(true);
+ }
+ }
+ }
+
+ private Control createPreferredMACPage(Composite parent){
+ Composite root = new Composite(parent, SWT.NONE);
+ GridLayout layout=new GridLayout();
+ layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ layout.numColumns = 2;
+ root.setLayout(layout);
+
+ Label label=new Label(root, SWT.NONE);
+ GridData textLayoutData=new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false);
+ textLayoutData.horizontalSpan = 2;
+ label.setLayoutData(textLayoutData);
+ label.setText(Messages.CVSSSH2PreferencePage_141);
+
+ preferedMACMethodTable=new Table(root, SWT.CHECK | SWT.BORDER);
+ GridData layoutData=new GridData(SWT.FILL, SWT.BEGINNING, true, true);
+ layoutData.verticalSpan = 3;
+ preferedMACMethodTable.setLayoutData(layoutData);
+ layoutData.minimumHeight = 150;
+ layoutData.minimumWidth = 200;
+ populateMACMethods();
+
+ mac_up=new Button(root, SWT.PUSH);
+ mac_up.setText(Messages.CVSSSH2PreferencePage_2);
+ mac_up.setEnabled(false);
+ setButtonLayoutData(mac_up);
+
+ mac_down=new Button(root, SWT.PUSH);
+ mac_down.setText(Messages.CVSSSH2PreferencePage_3);
+ mac_down.setEnabled(false);
+ setButtonLayoutData(mac_down);
+
+ preferedMACMethodTable.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ boolean anySelected = false;
+ for(int i = 0; i < preferedMACMethodTable.getItemCount(); i++){
+ anySelected |= preferedMACMethodTable.getItem(i).getChecked();
+ }
+
+ if(anySelected){
+ setErrorMessage(null);
+ setValid(true);
+ }
+ else{
+ setErrorMessage(Messages.CVSSSH2PreferencePage_143);
+ setValid(false);
+ }
+ mac_up.setEnabled(preferedMACMethodTable.getSelectionIndex()>0);
+ mac_down
+ .setEnabled(preferedMACMethodTable.getSelectionIndex()<preferedMACMethodTable
+ .getItemCount()-1);
+ }
+
+ });
+ mac_up.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ int selectedIndex=preferedMACMethodTable.getSelectionIndex();
+ if(selectedIndex == 1){ //this is the last possible swap
+ mac_up.setEnabled(false);
+ }
+ mac_down.setEnabled(true);
+ TableItem sourceItem = preferedMACMethodTable.getItem(selectedIndex);
+ TableItem targetItem = preferedMACMethodTable.getItem(selectedIndex-1);
+
+ //switch text
+ String stemp = targetItem.getText();
+ targetItem.setText(sourceItem.getText());
+ sourceItem.setText(stemp);
+
+ //switch selection
+ boolean btemp = targetItem.getChecked();
+ targetItem.setChecked(sourceItem.getChecked());
+ sourceItem.setChecked(btemp);
+
+ preferedMACMethodTable.setSelection(targetItem);
+ }
+ });
+
+ mac_down.addSelectionListener(new SelectionAdapter(){
+
+ public void widgetSelected(SelectionEvent e){
+ int selectedIndex=preferedMACMethodTable.getSelectionIndex();
+ if(selectedIndex == preferedMACMethodTable.getItemCount()-2){ //this is the last possible swap
+ mac_down.setEnabled(false);
+ }
+ mac_up.setEnabled(true);
+ TableItem sourceItem = preferedMACMethodTable.getItem(selectedIndex);
+ TableItem targetItem = preferedMACMethodTable.getItem(selectedIndex+1);
+
+ //switch text
+ String stemp = targetItem.getText();
+ targetItem.setText(sourceItem.getText());
+ sourceItem.setText(stemp);
+
+ //switch selection
+ boolean btemp = targetItem.getChecked();
+ targetItem.setChecked(sourceItem.getChecked());
+ sourceItem.setChecked(btemp);
+
+ preferedMACMethodTable.setSelection(targetItem);
+ }
+ });
+
+ return root;
+ }
+ private void populateMACMethods(){
+ preferedMACMethodTable.removeAll();
+ String[] methods = Utils.getEnabledPreferredMACMethods().split(","); //$NON-NLS-1$
+ Set smethods = new HashSet(Arrays.asList(methods));
+
+ String[] order = Utils.getMACMethodsOrder().split(","); //$NON-NLS-1$
+
+ for(int i=0; i<order.length; i++){
+ TableItem tableItem= new TableItem(preferedMACMethodTable, SWT.NONE);
+ tableItem.setText(0, order[i]);
+ if(smethods.contains(order[i])){
+ tableItem.setChecked(true);
+ }
+ }
+ }
+
void handleSelection(){
boolean empty=viewer.getSelection().isEmpty();
removeHostKeyButton.setEnabled(!empty);
@@ -1177,8 +1442,14 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
keyExport.setEnabled(enable);
saveKeyPair.setEnabled(enable);
populateAuthMethods();
+ populateKeyExchangeMethods();
+ populateMACMethods();
up.setEnabled(false);
down.setEnabled(false);
+ kex_up.setEnabled(false);
+ kex_down.setEnabled(false);
+ mac_up.setEnabled(false);
+ mac_down.setEnabled(false);
}
public void init(IWorkbench workbench){
@@ -1202,6 +1473,8 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
public boolean performOk(){
boolean result=super.performOk();
storeAuthenticationMethodSettings();
+ storeKeyExchangeMethodSettings();
+ storeMACMethodSettings();
if(result){
setErrorMessage(null);
String home=ssh2HomeText.getText();
@@ -1251,6 +1524,50 @@ public class PreferencePage extends org.eclipse.jface.preference.PreferencePage
}
Utils.setEnabledPreferredAuthMethods(selected, order);
}
+
+ private void storeKeyExchangeMethodSettings(){
+ String selected = null;
+ String order = null;
+ for(int i = 0; i < preferedKeyExchangeMethodTable.getItemCount(); i++){
+ TableItem item=preferedKeyExchangeMethodTable.getItem(i);
+ if(item.getChecked()){
+ if(selected==null){
+ selected=item.getText();
+ }
+ else{
+ selected+=","+item.getText(); //$NON-NLS-1$
+ }
+ }
+ if(order == null){
+ order = item.getText();
+ } else {
+ order += "," + item.getText(); //$NON-NLS-1$
+ }
+ }
+ Utils.setEnabledPreferredKEXMethods(selected, order);
+ }
+
+ private void storeMACMethodSettings(){
+ String selected = null;
+ String order = null;
+ for(int i = 0; i < preferedMACMethodTable.getItemCount(); i++){
+ TableItem item=preferedMACMethodTable.getItem(i);
+ if(item.getChecked()){
+ if(selected==null){
+ selected=item.getText();
+ }
+ else{
+ selected+=","+item.getText(); //$NON-NLS-1$
+ }
+ }
+ if(order == null){
+ order = item.getText();
+ } else {
+ order += "," + item.getText(); //$NON-NLS-1$
+ }
+ }
+ Utils.setEnabledPreferredMACMethods(selected, order);
+ }
public void performApply(){
performOk();
diff --git a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
index ce69f15ab..e6d6a76c8 100644
--- a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.core; singleton:=true
-Bundle-Version: 3.3.500.qualifier
+Bundle-Version: 3.3.550.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.core.CVSProviderPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.3.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.6.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)",
- com.jcraft.jsch;bundle-version="[0.1.27,2.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)",
org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)",
org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)"
diff --git a/bundles/org.eclipse.team.cvs.core/pom.xml b/bundles/org.eclipse.team.cvs.core/pom.xml
index 327942bca..0cad5b438 100644
--- a/bundles/org.eclipse.team.cvs.core/pom.xml
+++ b/bundles/org.eclipse.team.cvs.core/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.core</artifactId>
- <version>3.3.500-SNAPSHOT</version>
+ <version>3.3.550-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
index 76a465844..0d694ef5c 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ssh2/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ssh2; singleton:=true
-Bundle-Version: 3.2.300.qualifier
+Bundle-Version: 3.2.350.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ssh2.CVSSSH2Plugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.team.cvs.core;bundle-version="[3.3.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.3.0,4.0.0)",
org.eclipse.team.cvs.ssh;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
- com.jcraft.jsch;bundle-version="[0.1.27,2.0.0)",
+ com.jcraft.jsch;bundle-version="[0.1.50,1.0.0)",
org.eclipse.jsch.core;bundle-version="[1.1.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/bundles/org.eclipse.team.cvs.ssh2/pom.xml b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
index a8aeab090..5c21ee7ab 100644
--- a/bundles/org.eclipse.team.cvs.ssh2/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ssh2/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.ssh2</artifactId>
- <version>3.2.300-SNAPSHOT</version>
+ <version>3.2.350-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

Back to the top