diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-03-24 00:17:38 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-03-24 00:17:38 +0000 |
commit | 7b9608daaace01f317b1b2a5f7ba0be2086d0e0c (patch) | |
tree | 0889ad0d919e4d17ff10d15cbe7bc49ad6940b09 | |
parent | split up about dialog to keep translator info independend (diff) | |
download | gpg4usb-7b9608daaace01f317b1b2a5f7ba0be2086d0e0c.tar.gz gpg4usb-7b9608daaace01f317b1b2a5f7ba0be2086d0e0c.zip |
on keygen set minimum keysize to 1024 and maximum to 4096 for RSA key and 65536 for DSA/ELgamal key
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@862 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | keygendialog.cpp | 18 | ||||
-rw-r--r-- | keygendialog.h | 5 |
3 files changed, 22 insertions, 3 deletions
@@ -65,11 +65,11 @@ Release 0.3.3 - on key generation - later - Refresh key from keyserver [DONE] +- set maximum keysize to 16384 - Upload key to keyserver - show message if verify has no valid signature - exclude translators list from about dialog [DONE] - prevent utf8 encoding for comments on keygeneration -- set maximum keysize to 16384 Release 0.3.4 - Catch bad passphrase message diff --git a/keygendialog.cpp b/keygendialog.cpp index 532afe7..67c986f 100644 --- a/keygendialog.cpp +++ b/keygendialog.cpp @@ -41,10 +41,10 @@ void KeyGenDialog::generateKeyDialog() commentEdit = new QLineEdit(this); keySizeSpinBox = new QSpinBox(this); - keySizeSpinBox->setRange(768, 65536); + keySizeSpinBox->setRange(1024, 65536); keySizeSpinBox->setValue(2048); - keySizeSpinBox->setSingleStep(256); + keySizeSpinBox->setSingleStep(1024); keyTypeComboBox = new QComboBox(this); keyTypeComboBox->addItem("DSA/Elgamal"); @@ -109,6 +109,7 @@ void KeyGenDialog::generateKeyDialog() connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(expireBoxChanged())); connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(passwordEditChanged())); + connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(keyTypeChanged())); this->setLayout(vbox2); } @@ -219,6 +220,19 @@ void KeyGenDialog::passwordEditChanged() update(); } +void KeyGenDialog::keyTypeChanged() +{ + qDebug() << "changed"; + if (keyTypeComboBox->currentText() == "RSA") { + qDebug() << "RSA"; + keySizeSpinBox->setMaximum(4096); + } else { + qDebug() << "DSA"; + keySizeSpinBox->setMaximum(65536); + } + +} + int KeyGenDialog::checkPassWordStrength() { int strength = 0; diff --git a/keygendialog.h b/keygendialog.h index 69495c9..75cda4e 100644 --- a/keygendialog.h +++ b/keygendialog.h @@ -77,6 +77,11 @@ private slots: void passwordEditChanged(); /** + * @details When passwordedit changed, set keysize appropriately + */ + void keyTypeChanged(); + + /** * @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key */ void keyGenAccept(); |