diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2017-11-14 20:57:07 -0500 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2017-11-14 20:57:07 -0500 |
commit | cab73385bafb146676a7f14e0404bfeb4f9cd1ea (patch) | |
tree | 22bd63dfd63e4a76a97eee32898b1e4f22dfd4ab /win/vncconfig | |
parent | 6a7f9082fd783a1b24387cef0755426e90a0402d (diff) | |
download | tigervnc-cab73385bafb146676a7f14e0404bfeb4f9cd1ea.tar.gz tigervnc-cab73385bafb146676a7f14e0404bfeb4f9cd1ea.zip |
Move gnutls functions into SSecurityTLS
Diffstat (limited to 'win/vncconfig')
-rw-r--r-- | win/vncconfig/Authentication.h | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/win/vncconfig/Authentication.h b/win/vncconfig/Authentication.h index 2967444a..82971148 100644 --- a/win/vncconfig/Authentication.h +++ b/win/vncconfig/Authentication.h @@ -21,13 +21,6 @@ #include <windows.h> #include <commctrl.h> -#ifdef HAVE_GNUTLS -#include <assert.h> -#include <gnutls/gnutls.h> -#include <gnutls/x509.h> -#define CHECK(x) assert((x)>=0) -#endif - #include <vncconfig/PasswordDialog.h> #include <rfb_win32/Registry.h> #include <rfb_win32/SecurityPage.h> @@ -98,32 +91,8 @@ namespace rfb { #ifdef HAVE_GNUTLS if (isItemChecked(IDC_ENC_X509)) { - gnutls_certificate_credentials_t xcred; - CHECK(gnutls_global_init()); - CHECK(gnutls_certificate_allocate_credentials(&xcred)); - int ret = gnutls_certificate_set_x509_key_file (xcred, - regKey.getString("X509Cert"), - regKey.getString("X509Key"), - GNUTLS_X509_FMT_PEM); - if (ret >= 0) { - SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Cert")); - SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Key")); - } else { - if (ret == GNUTLS_E_CERTIFICATE_KEY_MISMATCH) { - MsgBox(0, _T("Private key does not match certificate.\n") - _T("X.509 security types will not be enabled!"), - MB_ICONWARNING | MB_OK); - } else if (ret == GNUTLS_E_UNSUPPORTED_CERTIFICATE_TYPE) { - MsgBox(0, _T("Unsupported certificate type.\n") - _T("X.509 security types will not be enabled!"), - MB_ICONWARNING | MB_OK); - } else { - MsgBox(0, _T("Unknown error while importing X.509 certificate or private key.\n") - _T("X.509 security types will not be enabled!"), - MB_ICONWARNING | MB_OK); - } - } - gnutls_global_deinit(); + SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Cert")); + SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Key")); } #endif |