[X2Go-Commits] [x2goclient] 219/219: src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey ().

git-admin at x2go.org git-admin at x2go.org
Thu Sep 22 04:37:42 CEST 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 700a820d999311c34690a1ae4578db39e56b0995
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Sep 22 04:08:45 2016 +0200

    src/onmainwindow.cpp: add support for explicitly setting the private key bit size based on type and use values (currently) regarded as secure to generateHostKey ().
---
 debian/changelog     |    3 +++
 src/onmainwindow.cpp |    9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 01898e8..c59e723 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -378,6 +378,9 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
     - src/{unixhelper.cpp,x2goclient.cpp}: fix errno usage - save before use.
     - src/onmainwindow.cpp: document createRSAKey () because what it does is
       completely non-obvious.
+    - src/onmainwindow.cpp: add support for explicitly setting the private key
+      bit size based on type and use values (currently) regarded as secure to
+      generateHostKey ().
 
  -- X2Go Release Manager <git-admin at x2go.org>  Mon, 19 Sep 2016 09:07:07 +0200
 
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index 380c2d6..44c895c 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10297,26 +10297,33 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type)
 {
     ONMainWindow::key_types sanitized_key_type = UNKNOWN_KEY_TYPE;
     QString stringified_key_type = "";
+    std::size_t key_bits = 0;
     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) {
@@ -10343,6 +10350,8 @@ void ONMainWindow::generateHostKey(ONMainWindow::key_types key_type)
         QStringList args;
         args << "-t"
              << stringified_key_type
+             << "-b"
+             << QString::number (key_bits)
              << "-N"
              << ""
              << "-C"

--
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