Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve DSA and RSA key generation bit size. #1600

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.TabFolderLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.TabFolderLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ant.internal.ui.preferences;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Layout;

public class TabFolderLayout extends Layout {

@Override
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
return new Point(wHint, hHint);

Control[] children = composite.getChildren();
int count = children.length;
int maxWidth = 0, maxHeight = 0;
for (int i = 0; i < count; i++) {
Control child = children[i];
Point pt = child.computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache);
maxWidth = Math.max(maxWidth, pt.x);
maxHeight = Math.max(maxHeight, pt.y);
}

if (wHint != SWT.DEFAULT)
maxWidth = wHint;
if (hHint != SWT.DEFAULT)
maxHeight = hHint;

return new Point(maxWidth, maxHeight);

}

@Override
protected void layout(Composite composite, boolean flushCache) {
Rectangle rect = composite.getClientArea();

for (Control element : composite.getChildren()) {
element.setBounds(rect);
}
}
}
2 changes: 1 addition & 1 deletion ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)";resolution:=op
org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.ui.editors;bundle-version="[3.19.0,4.0.0)";resolution:=optional,
org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
org.apache.ant;bundle-version="1.9.4",
org.eclipse.ant.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.0.0,2.0.0)",
Expand Down
2 changes: 1 addition & 1 deletion team/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.206.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.19.0,4.0.0)",
org.eclipse.ui.editors;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
org.eclipse.compare.core;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.TabFolderLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.compare.internal;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Layout;

public class TabFolderLayout extends Layout {

@Override
protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
return new Point(wHint, hHint);

Control [] children = composite.getChildren ();
int count = children.length;
int maxWidth = 0, maxHeight = 0;
for (int i=0; i<count; i++) {
Control child = children [i];
Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
maxWidth = Math.max (maxWidth, pt.x);
maxHeight = Math.max (maxHeight, pt.y);
}

if (wHint != SWT.DEFAULT)
maxWidth= wHint;
if (hHint != SWT.DEFAULT)
maxHeight= hHint;

return new Point(maxWidth, maxHeight);

}

@Override
protected void layout (Composite composite, boolean flushCache) {
Rectangle rect= composite.getClientArea();

Control[] children = composite.getChildren();
for (Control c : children) {
c.setBounds(rect);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,11 @@ else if(e.widget==keyGenerateRSA){
final JSchException[] _e=new JSchException[1];
BusyIndicator.showWhile(getShell().getDisplay(), () -> {
try {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type);
if (__type == KeyPair.RSA) {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type, 4096);
} else {
_kpair[0] = KeyPair.genKeyPair(getJSch(), __type, 3072);
}
} catch (JSchException e1) {
_e[0] = e1;
}
Expand All @@ -508,7 +512,11 @@ else if(e.widget==keyGenerateRSA){
kpair=_kpair[0];

ByteArrayOutputStream out=new ByteArrayOutputStream();
kpairComment=_type+"-1024"; //$NON-NLS-1$
if (__type == KeyPair.RSA) {
kpairComment = _type + "-4096"; //$NON-NLS-1$
} else {
kpairComment = _type + "-3072"; //$NON-NLS-1$
}
kpair.writePublicKey(out, kpairComment);
out.close();
publicKeyText.setText(out.toString());
Expand Down
2 changes: 1 addition & 1 deletion ua/org.eclipse.help.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Export-Package: org.eclipse.help.ui,
org.eclipse.help.ui.internal.util;x-friends:="org.eclipse.ua.tests",
org.eclipse.help.ui.internal.views;x-friends:="org.eclipse.ui.cheatsheets,org.eclipse.ua.tests"
Require-Bundle: org.eclipse.help.base;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.ui;bundle-version="[3.206.200,4.0.0)";visibility:=reexport,
org.eclipse.ui;bundle-version="[3.206.0,4.0.0)";visibility:=reexport,
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.forms;bundle-version="[3.5.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*******************************************************************************
* Copyright (c) 2008, 2016 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.help.ui.internal.preferences;


import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Layout;

public class TabFolderLayout extends Layout {

@Override
protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
return new Point(wHint, hHint);

Control [] children = composite.getChildren ();
int count = children.length;
int maxWidth = 0, maxHeight = 0;
for (int i=0; i<count; i++) {
Control child = children [i];
Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
maxWidth = Math.max (maxWidth, pt.x);
maxHeight = Math.max (maxHeight, pt.y);
}

if (wHint != SWT.DEFAULT)
maxWidth= wHint;
if (hHint != SWT.DEFAULT)
maxHeight= hHint;

return new Point(maxWidth, maxHeight);

}

@Override
protected void layout (Composite composite, boolean flushCache) {
Rectangle rect= composite.getClientArea();

Control[] children = composite.getChildren();
for (int i = 0; i < children.length; i++) {
children[i].setBounds(rect);
}
}
}
Loading