aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/ssh/sshkeycreationdialog.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2015-07-22 16:26:05 +0200
committerChristian Kandeler <[email protected]>2015-07-27 13:08:44 +0000
commitac0e66d9e04e196f4b3a46cd709cb76aafbd45fe (patch)
tree7ced42883d1e6fd411eb2ab94808978593e42a84 /src/libs/ssh/sshkeycreationdialog.cpp
parent8f5618c3ecc0daf971b19780646cc14a6db12931 (diff)
SSH: Support creation of ECDSA keys.
Change-Id: Id5b5ed289a3fd86bd8b84e6429c18f417ca793a7 Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'src/libs/ssh/sshkeycreationdialog.cpp')
-rw-r--r--src/libs/ssh/sshkeycreationdialog.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libs/ssh/sshkeycreationdialog.cpp b/src/libs/ssh/sshkeycreationdialog.cpp
index 80118cde5ac..348a8423649 100644
--- a/src/libs/ssh/sshkeycreationdialog.cpp
+++ b/src/libs/ssh/sshkeycreationdialog.cpp
@@ -64,6 +64,7 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
this, &SshKeyCreationDialog::handleBrowseButtonClicked);
connect(m_ui->generateButton, &QPushButton::clicked,
this, &SshKeyCreationDialog::generateKeys);
+ keyTypeChanged();
}
SshKeyCreationDialog::~SshKeyCreationDialog()
@@ -74,8 +75,16 @@ SshKeyCreationDialog::~SshKeyCreationDialog()
void SshKeyCreationDialog::keyTypeChanged()
{
- m_ui->comboBox->setCurrentIndex(0);
- m_ui->comboBox->setEnabled(m_ui->rsa->isChecked());
+ m_ui->comboBox->clear();
+ QStringList keySizes;
+ if (m_ui->rsa->isChecked())
+ keySizes << QLatin1String("1024") << QLatin1String("2048") << QLatin1String("4096");
+ else if (m_ui->ecdsa->isChecked())
+ keySizes << QLatin1String("256") << QLatin1String("384") << QLatin1String("521");
+ m_ui->comboBox->addItems(keySizes);
+ if (!keySizes.isEmpty())
+ m_ui->comboBox->setCurrentIndex(0);
+ m_ui->comboBox->setEnabled(!keySizes.isEmpty());
}
void SshKeyCreationDialog::generateKeys()
@@ -84,8 +93,8 @@ void SshKeyCreationDialog::generateKeys()
return;
const SshKeyGenerator::KeyType keyType = m_ui->rsa->isChecked()
- ? SshKeyGenerator::Rsa
- : SshKeyGenerator::Dsa;
+ ? SshKeyGenerator::Rsa : m_ui->dsa->isChecked()
+ ? SshKeyGenerator::Dsa : SshKeyGenerator::Ecdsa;
if (!m_keyGenerator)
m_keyGenerator = new SshKeyGenerator;