Removed unnecessary dialog preventing boolean/check.

This commit is contained in:
dev
2011-07-27 09:59:16 +00:00
parent 5dfe3f9052
commit ddc3518c72

View File

@ -14,7 +14,6 @@ import net.i2p.itoopie.security.CertificateHelper;
import net.i2p.itoopie.security.CertificateManager;
public class CertificateGUI {
private static boolean isVerifying = false;
public static void main(String[] args){
System.out.println("Save new cert: " + saveNewCert(null,null));
@ -22,8 +21,6 @@ public class CertificateGUI {
}
public static synchronized boolean saveNewCert(String hostname, X509Certificate cert){
if (!isVerifying){
isVerifying = true;
JFrame frame = new JFrame();
frame.setLayout(new BorderLayout());
JButton bt = new JButton();
@ -62,12 +59,7 @@ public class CertificateGUI {
if (n == JOptionPane.YES_OPTION){
CertificateManager.forcePutServerCert(hostname, CertificateHelper.convert(cert));
updateUI();
isVerifying = false;
return true;
} else {
isVerifying = false;
return false;
}
} else {
return false;
}
@ -75,8 +67,6 @@ public class CertificateGUI {
public static boolean overwriteCert(String hostname, X509Certificate cert){
if (!isVerifying){
isVerifying = true;
JFrame frame = new JFrame();
String title = Transl._("Warning, new remote host detected");
@ -119,18 +109,13 @@ public class CertificateGUI {
if (n == JOptionPane.YES_OPTION){
CertificateManager.forcePutServerCert(hostname, CertificateHelper.convert(cert));
updateUI();
isVerifying = false;
return true; // Confirmation positive
} else {
isVerifying = false;
return false; // Confirmation negative
}
} else {
return false; // No
}
} else {
return false;
}
}
/**