tigervnc/u_tigervnc-add-autoaccept-parameter.patch
Michal Srb a8036d64a3 Accepting request 511645 from home:michalsrb:branches:X11:XOrg
- U_allow_multiple_certs_with_same_dn_in_saved_certs_file.patch,
  U_handle_certificate_verification_for_saved_certs_correctly.patch
  * Fix certificate handling in the java client. (bnc#1041847)
- Refresh u_tigervnc-add-autoaccept-parameter.patch and apply it
  last.
- Make sure CN in generated certificate doesn't exceed 64
  characters. (bnc#1041847)

OBS-URL: https://build.opensuse.org/request/show/511645
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=114
2017-07-20 12:12:06 +00:00

56 lines
2.3 KiB
Diff

Index: tigervnc-1.8.0/java/com/tigervnc/rfb/CSecurityTLS.java
===================================================================
--- tigervnc-1.8.0.orig/java/com/tigervnc/rfb/CSecurityTLS.java
+++ tigervnc-1.8.0/java/com/tigervnc/rfb/CSecurityTLS.java
@@ -64,6 +64,9 @@ public class CSecurityTLS extends CSecur
public static StringParameter X509CRL
= new StringParameter("X509CRL",
"X509 CRL file", "", Configuration.ConfigurationObject.ConfViewer);
+ public static StringParameter x509autoaccept
+ = new StringParameter("x509autoaccept",
+ "X509 Certificate SHA-1 fingerprint", "", Configuration.ConfigurationObject.ConfViewer);
private void initGlobal()
{
@@ -82,6 +85,7 @@ public class CSecurityTLS extends CSecur
setDefaults();
cafile = X509CA.getData();
crlfile = X509CRL.getData();
+ certautoaccept = x509autoaccept.getData();
}
public static String getDefaultCA() {
@@ -270,6 +274,10 @@ public class CSecurityTLS extends CSecur
tm.checkServerTrusted(chain, authType);
} catch (java.lang.Exception e) {
if (e.getCause() instanceof CertPathBuilderException) {
+ if (certautoaccept != null && thumbprint.equalsIgnoreCase(certautoaccept)) {
+ return;
+ }
+
Object[] answer = {"YES", "NO"};
int ret = JOptionPane.showOptionDialog(null,
"This certificate has been signed by an unknown authority\n"+
@@ -466,7 +474,7 @@ public class CSecurityTLS extends CSecur
private SSLEngineManager manager;
private boolean anon;
- private String cafile, crlfile;
+ private String cafile, crlfile, certautoaccept;
private FdInStream is;
private FdOutStream os;
Index: tigervnc-1.8.0/java/com/tigervnc/vncviewer/VncViewer.java
===================================================================
--- tigervnc-1.8.0.orig/java/com/tigervnc/vncviewer/VncViewer.java
+++ tigervnc-1.8.0/java/com/tigervnc/vncviewer/VncViewer.java
@@ -368,6 +368,8 @@ public class VncViewer extends javax.swi
// Called right after zero-arg constructor in applet mode
setLookAndFeel();
setBackground(Color.white);
+
+ SecurityClient.setDefaults();
applet = this;
vncServerName.put(loadAppletParameters(applet).toCharArray()).flip();
if (embed.getValue()) {