diff options
author | Adam Tkac <atkac@redhat.com> | 2010-11-18 13:33:57 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2010-11-18 13:33:57 +0000 |
commit | 27b2f773be4db49762d78635c2c322a95bd141ce (patch) | |
tree | 82a977c761d1e7c5ab55925fe51c80c4ed293c92 /unix | |
parent | 779dbb03473e9ad9b7d83c4d41515366b229a4c3 (diff) | |
download | tigervnc-27b2f773be4db49762d78635c2c322a95bd141ce.tar.gz tigervnc-27b2f773be4db49762d78635c2c322a95bd141ce.zip |
[Development] client: Add dialog window to accept/save invalid X509
certificates. (Guillaume Destuynder)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4198 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix')
-rw-r--r-- | unix/vncviewer/CConn.cxx | 15 | ||||
-rw-r--r-- | unix/vncviewer/CConn.h | 6 | ||||
-rw-r--r-- | unix/vncviewer/vncviewer.cxx | 3 |
3 files changed, 21 insertions, 3 deletions
diff --git a/unix/vncviewer/CConn.cxx b/unix/vncviewer/CConn.cxx index 1a75a11d..8a647870 100644 --- a/unix/vncviewer/CConn.cxx +++ b/unix/vncviewer/CConn.cxx @@ -75,7 +75,10 @@ CConn::CConn(Display* dpy_, int argc_, char** argv_, network::Socket* sock_, menuKeysym = XStringToKeysym(menuKeyStr.buf); setShared(shared); - CSecurity::upg = this; /* Security instance is created in CConnection costructor. */ + CSecurity::upg = this; /* Security instance is created in CConnection constructor. */ +#ifdef HAVE_GNUTLS + CSecurityTLS::msg = this; +#endif CharArray encStr(preferredEncoding.getData()); int encNum = encodingNum(encStr.buf); @@ -125,6 +128,15 @@ CConn::~CConn() { delete sock; } +bool CConn::showMsgBox(int flags, const char* title, const char* text) +{ + CharArray titleText(strlen(title) + 12); + sprintf(titleText.buf, "VNC Viewer: %s", title); + + TXMsgBox msgBox(dpy,text,flags,titleText.buf); + return msgBox.show(); +} + // deleteWindow() is called when the user closes the desktop or menu windows. void CConn::deleteWindow(TXWindow* w) { @@ -232,7 +244,6 @@ void CConn::getUserPasswd(char** user, char** password) *password = strDup(dlg.passwdEntry.getText()); } - // CConnection callback methods // serverInit() is called when the serverInit message has been received. At diff --git a/unix/vncviewer/CConn.h b/unix/vncviewer/CConn.h index ac889637..929e5b55 100644 --- a/unix/vncviewer/CConn.h +++ b/unix/vncviewer/CConn.h @@ -26,6 +26,7 @@ #include <rfb/CConnection.h> #include <rfb/Exception.h> #include <rfb/UserPasswdGetter.h> +#include <rfb/UserMsgBox.h> #include <rdr/FdInStream.h> #include <list> @@ -44,7 +45,7 @@ class CConn : public rfb::CConnection, public rfb::UserPasswdGetter, public TXDeleteWindowCallback, public rdr::FdInStreamBlockCallback, public TXMenuCallback , public OptionsDialogCallback, - public TXEventHandler + public TXEventHandler, public rfb::UserMsgBox { public: @@ -61,6 +62,9 @@ public: // UserPasswdGetter methods virtual void getUserPasswd(char** user, char** password); + // UserMsgBox methods + virtual bool showMsgBox(int flags, const char* title, const char* text); + // TXMenuCallback methods void menuSelect(long id, TXMenu* m); diff --git a/unix/vncviewer/vncviewer.cxx b/unix/vncviewer/vncviewer.cxx index 9edb80d3..f3a5e01a 100644 --- a/unix/vncviewer/vncviewer.cxx +++ b/unix/vncviewer/vncviewer.cxx @@ -33,6 +33,7 @@ #include <locale.h> #include <os/os.h> #include <rfb/Logger_stdio.h> +#include <rfb/SecurityClient.h> #include <rfb/LogWriter.h> #include <network/TcpSocket.h> #include "TXWindow.h" @@ -278,6 +279,8 @@ int main(int argc, char** argv) "Copyright (C) 2004-2009 Peter Astrand for Cendio AB\n" "See http://www.tigervnc.org for information on TigerVNC."); + rfb::SecurityClient::setDefaults(); + // Write about text to console, still using normal locale codeset snprintf(aboutText, sizeof(aboutText), gettext(englishAbout), PACKAGE_VERSION, buildtime); |