[X2Go-Commits] [x2goclient] 232/257: src/onmainwindow.cpp: use the new functions in generateKey ().
git-admin at x2go.org
git-admin at x2go.org
Mon Nov 28 16:06:26 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 5950e4995d7c25775f3a35253a009fd36529a03b
Author: Mihai Moldovan <ionic at ionic.de>
Date: Sat Sep 24 04:19:42 2016 +0200
src/onmainwindow.cpp: use the new functions in generateKey ().
---
debian/changelog | 1 +
src/onmainwindow.cpp | 41 +++--------------------------------------
2 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 4d829eb..30f2057 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -416,6 +416,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
- src/onmainwindow.{cpp,h}: add new function default_size_for_key_type ().
Returns the default key size in bits for the selected key type, after
checking for validity.
+ - src/onmainwindow.cpp: use the new functions in generateKey ().
[ Bernard Cafarelli ]
* New upstream version (4.0.5.3):
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 0680725..707b6d8 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10324,45 +10324,10 @@ std::size_t ONMainWindow::default_size_for_key_type (ONMainWindow::key_types key
QString ONMainWindow::generateKey(ONMainWindow::key_types key_type, bool host_key)
{
- ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE;
- QString stringified_key_type ("");
- std::size_t key_bits = 0;
+ QString stringified_key_type (key_type_to_string (key_type));
+ std::size_t key_bits = default_size_for_key_type (key_type);
+
QString ret ("");
- switch (key_type) {
- case RSA_KEY_TYPE:
- sanitized_key_type = key_type;
- stringified_key_type = "rsa";
- key_bits = 4096;
- break;
- case DSA_KEY_TYPE:
- sanitized_key_type = key_type;
- stringified_key_type = "dsa";
- key_bits = 1024;
- break;
- case ECDSA_KEY_TYPE:
- sanitized_key_type = key_type;
- stringified_key_type = "ecdsa";
- key_bits = 384;
- break;
- case ED25519_KEY_TYPE:
- sanitized_key_type = key_type;
- stringified_key_type = "ed25519";
- /* Fixed key length, flag will be unused. */
- key_bits = 0;
- break;
- default:
- sanitized_key_type = UNKNOWN_KEY_TYPE;
- stringified_key_type = "unknown";
- key_bits = 0;
- }
-
- if (sanitized_key_type == UNKNOWN_KEY_TYPE) {
- QMessageBox::critical (this, tr ("SSH key type selection error"),
- tr ("Unknown SSH key selected.")
- + "\n"
- + tr ("Terminating application."));
- close ();
- }
QString base_dir (homeDir);
QString private_key_file ("");
--
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