[X2Go-Commits] [x2goclient] 229/257: src/onmainwindow.{cpp, h}: add new function check_key_type ().
git-admin at x2go.org
git-admin at x2go.org
Mon Nov 28 16:06:25 CET 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/osx
in repository x2goclient.
commit 8634fabcffa514fef39e14c2cff5c2219aa9c1b5
Author: Mihai Moldovan <ionic at ionic.de>
Date: Sat Sep 24 04:07:38 2016 +0200
src/onmainwindow.{cpp,h}: add new function check_key_type ().
Takes a key type and checks for validity/if it's known.
---
debian/changelog | 2 ++
src/onmainwindow.cpp | 27 +++++++++++++++++++++++++++
src/onmainwindow.h | 2 ++
3 files changed, 31 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 2a67fc9..0485e0c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -408,6 +408,8 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
string in generateKey ().
- src/onmainwindow.cpp: terminate sshd more correctly. First via terminate
(), then wait up to 5 seconds, then via kill ().
+ - src/onmainwindow.{cpp,h}: add new function check_key_type (). Takes a
+ key type and checks for validity/if it's known.
[ Bernard Cafarelli ]
* New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 653db50..36abf7e 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10246,6 +10246,33 @@ void ONMainWindow::generateEtcFiles()
x2goDebug<<etcDir +"/sshd_config created.";
}
+ONMainWindow::key_types ONMainWindow::check_key_type (ONMainWindow::key_types key_type) {
+ ONMainWindow::key_types ret = key_type;
+
+ switch (key_type) {
+ case RSA_KEY_TYPE:
+ break;
+ case DSA_KEY_TYPE:
+ break;
+ case ECDSA_KEY_TYPE:
+ break;
+ case ED25519_KEY_TYPE:
+ break;
+ default:
+ ret = UNKNOWN_KEY_TYPE;
+ }
+
+ if (UNKNOWN_KEY_TYPE == ret) {
+ QMessageBox::critical (this, tr ("SSH key type selection error"),
+ tr ("Unknown SSH key selected.")
+ + "\n"
+ + tr ("Terminating application."));
+ close ();
+ }
+
+ return (ret);
+}
+
QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key)
{
ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE;
diff --git a/src/onmainwindow.h b/src/onmainwindow.h
index eb8cb1c..476d4a9 100644
--- a/src/onmainwindow.h
+++ b/src/onmainwindow.h
@@ -1217,6 +1217,8 @@ private:
QString getXDisplay();
#endif
+ key_types check_key_type (key_types key_type);
+
////////////////plugin stuff////////////////////
#ifdef CFGPLUGIN
public slots:
--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list