aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2014-05-01 19:11:40 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2014-05-01 19:11:40 +0000
commitbab3f96772f44dbe9d153f4ca0575956405a4a9c (patch)
tree48fe9fda0791dd2437849847c6b3e94d6a83f061
parentopen localized help file if available (diff)
parentupdated gpg-mac to 1.4.16 (diff)
downloadgpg4usb-bab3f96772f44dbe9d153f4ca0575956405a4a9c.tar.gz
gpg4usb-bab3f96772f44dbe9d153f4ca0575956405a4a9c.zip
merge 0.4-beta branch into trunk
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1100 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--TODO2
-rw-r--r--gpg4usb.pro2
-rw-r--r--keygendialog.cpp80
-rw-r--r--keygendialog.h10
-rw-r--r--kgpg/kprocess.cpp2
-rw-r--r--kgpg/transactions/kgpggeneratekey.cpp7
-rw-r--r--kgpg/transactions/kgpgtransaction.cpp2
-rw-r--r--macbuild.txt4
-rw-r--r--qmake-mac.sh4
-rwxr-xr-xrelease/bin/gpgbin754720 -> 702872 bytes
-rwxr-xr-xrelease/bin/gpg-macbin2714192 -> 1211808 bytes
-rw-r--r--release/bin/gpg.exebin440320 -> 441344 bytes
-rwxr-xr-xrelease/keydb/gpg.conf4
-rwxr-xr-xsettingsdialog.cpp2
-rw-r--r--textedit.cpp2
15 files changed, 42 insertions, 79 deletions
diff --git a/TODO b/TODO
index 2871448..5082921 100644
--- a/TODO
+++ b/TODO
@@ -46,6 +46,8 @@ Release 0.4
- Check, ig gpg is initialized correctly
- On key import, check if key creation date is in the future
- progress dialog for file encryption
+- sign with multiple keys
+- expire date in keygenerating needs to be implemented
BUG:
- check PGP-Mime
diff --git a/gpg4usb.pro b/gpg4usb.pro
index 7c75718..300d112 100644
--- a/gpg4usb.pro
+++ b/gpg4usb.pro
@@ -5,7 +5,7 @@ TEMPLATE = app
# unix:TARGET = start_linux
# win32:TARGET = start_windows
-mac:TARGET = start_mac
+#mac:TARGET = start_mac
DESTDIR = release
DEPENDPATH += .
INCLUDEPATH += .
diff --git a/keygendialog.cpp b/keygendialog.cpp
index 35bf93a..0396004 100644
--- a/keygendialog.cpp
+++ b/keygendialog.cpp
@@ -21,6 +21,7 @@
*/
#include "keygendialog.h"
+#include "qdebug.h"
KeyGenDialog::KeyGenDialog(GpgME::GpgContext *ctx, QWidget *parent)
: QDialog(parent)
@@ -41,23 +42,23 @@ void KeyGenDialog::generateKeyDialog()
commentEdit = new QLineEdit(this);
keySizeSpinBox = new QSpinBox(this);
- keySizeSpinBox->setRange(768, 16384);
+ keySizeSpinBox->setRange(1024, 4096);
keySizeSpinBox->setValue(2048);
- keySizeSpinBox->setSingleStep(256);
+ keySizeSpinBox->setSingleStep(1024);
keyTypeComboBox = new QComboBox(this);
- keyTypeComboBox->addItem("DSA/Elgamal");
keyTypeComboBox->addItem("RSA");
+ keyTypeComboBox->addItem("DSA/Elgamal");
keyTypeComboBox->setCurrentIndex(0);
dateEdit = new QDateEdit(QDate::currentDate().addYears(5), this);
dateEdit->setMinimumDate(QDate::currentDate());
dateEdit->setDisplayFormat("dd/MM/yyyy");
dateEdit->setCalendarPopup(true);
- dateEdit->setEnabled(false);
+ dateEdit->setEnabled(true);
expireCheckBox = new QCheckBox(this);
- expireCheckBox->setCheckState(Qt::Checked);
+ expireCheckBox->setCheckState(Qt::Unchecked);
passwordEdit = new QLineEdit(this);
repeatpwEdit = new QLineEdit(this);
@@ -109,15 +110,14 @@ void KeyGenDialog::generateKeyDialog()
connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotExpireBoxChanged()));
connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(slotPasswordEditChanged()));
- connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotKeyTypeChanged()));
- connect(keySizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotKeySizeChanged()));
+// connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotKeyTypeChanged()));
+// connect(keySizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(slotKeySizeChanged()));
this->setLayout(vbox2);
}
void KeyGenDialog::slotKeyGenAccept()
{
QString errorString = "";
- QString keyGenParams = "";
/**
* check for errors in keygen dialog input
*/
@@ -129,50 +129,29 @@ void KeyGenDialog::slotKeyGenAccept()
}
if (errorString.isEmpty()) {
- /**
- * create the string for key generation
- */
- /*keyGenParams = "<GnupgKeyParms format=\"internal\">\n"
- "Key-Type: DSA\n"
- "Key-Length: 1024\n"
- "Subkey-Type: ELG-E\n"
- "Subkey-Length: "
- + keySizeSpinBox->cleanText() + "\n"
- "Name-Real: " + nameEdit->text().toUtf8() + "\n";
- if (!(commentEdit->text().isEmpty())) {
- keyGenParams += "Name-Comment: " + commentEdit->text().toUtf8() + "\n";
- }
- if (!(emailEdit->text().isEmpty())) {
- keyGenParams += "Name-Email: " + emailEdit->text().toUtf8() + "\n";
- }
- if (expireCheckBox->checkState()) {
- keyGenParams += "Expire-Date: 0\n";
- } else {
- keyGenParams += "Expire-Date: " + dateEdit->sectionText(QDateTimeEdit::YearSection) + "-" + dateEdit->sectionText(QDateTimeEdit::MonthSection) + "-" + dateEdit->sectionText(QDateTimeEdit::DaySection) + "\n";
- }
- if (!(passwordEdit->text().isEmpty())) {
- keyGenParams += "Passphrase: " + passwordEdit->text() + "\n";
- }
- keyGenParams += "</GnupgKeyParms>";
- KeyGenThread *kg = new KeyGenThread(keyGenParams, mCtx);
- kg->start();*/
+ KgpgCore::KgpgKeyAlgo algo;
+ if(keyTypeComboBox->currentText() == "RSA") {
+ algo = KgpgCore::ALGO_RSA_RSA;
+ } else if (keyTypeComboBox->currentText() == "DSA/Elgamal") {
+ algo = KgpgCore::ALGO_DSA_ELGAMAL;
+ }
+ int expiredays = 0;
+ if (!expireCheckBox->checkState()) {
+ expiredays = QDate::currentDate().daysTo(dateEdit->date());
+ }
- // TODO: expdate
KGpgGenerateKey *genkey = new KGpgGenerateKey(this,
nameEdit->text(),
emailEdit->text(),
commentEdit->text(),
- KgpgCore::ALGO_RSA_RSA,
+ algo,
keySizeSpinBox->cleanText().toInt(),
- 0,
+ expiredays,
'd',
passwordEdit->text());
- // m_genkey = new KGpgTransactionJob(genkey);
-
- //connect(m_genkey, SIGNAL(result(KJob*)), SLOT(slotGenerateKeyDone(KJob*)));
connect(genkey, SIGNAL(done(int)), SLOT(slotGenkeyDone(int)));
connect(genkey, SIGNAL(infoProgress(qulonglong,qulonglong)), SLOT(slotInfoProgress(qulonglong,qulonglong)));
@@ -263,25 +242,6 @@ void KeyGenDialog::slotPasswordEditChanged()
pwStrengthSlider->setValue(checkPassWordStrength());
update();
}
-void KeyGenDialog::slotKeySizeChanged()
-{
- if (keySizeSpinBox->value() > 2048 && lastKeySize <=2048) {
- QMessageBox::warning(this, tr("Key size warning"),
- tr("You've set the keysize to more than 2048 bits. This setting is for advanced users only. The key generation may take a very, very long time."));
- }
- lastKeySize=keySizeSpinBox->value();
-}
-
-void KeyGenDialog::slotKeyTypeChanged()
-{
- if (keyTypeComboBox->currentText() == "RSA") {
- keySizeSpinBox->setMaximum(16384);
- keySizeSpinBox->setMinimum(1024);
- } else {
- keySizeSpinBox->setMaximum(16384);
- keySizeSpinBox->setMinimum(768);
- }
-}
int KeyGenDialog::checkPassWordStrength()
{
diff --git a/keygendialog.h b/keygendialog.h
index 325c6f4..bb4c186 100644
--- a/keygendialog.h
+++ b/keygendialog.h
@@ -79,16 +79,6 @@ private slots:
void slotPasswordEditChanged();
/**
- * @details When keysize changed, show message, when too large
- */
- void slotKeySizeChanged();
-
- /**
- * @details When passwordedit changed, set keysize appropriately
- */
- void slotKeyTypeChanged();
-
- /**
* @details check all lineedits for false entries. Show error, when there is one, otherwise generate the key
*/
void slotKeyGenAccept();
diff --git a/kgpg/kprocess.cpp b/kgpg/kprocess.cpp
index 907c75c..ba71ebd 100644
--- a/kgpg/kprocess.cpp
+++ b/kgpg/kprocess.cpp
@@ -341,7 +341,7 @@ QStringList KProcess::program() const
void KProcess::start()
{
Q_D(KProcess);
- qDebug() << "prog: " << d->prog << " | args: " << d->args;
+ //qDebug() << "prog: " << d->prog << " | args: " << d->args;
QProcess::start(d->prog, d->args, d->openMode);
}
diff --git a/kgpg/transactions/kgpggeneratekey.cpp b/kgpg/transactions/kgpggeneratekey.cpp
index 55ab8ba..e863a5d 100644
--- a/kgpg/transactions/kgpggeneratekey.cpp
+++ b/kgpg/transactions/kgpggeneratekey.cpp
@@ -106,9 +106,10 @@ KGpgGenerateKey::postStart()
keymessage.append(m_expireunit);
}
-
- keymessage.append("\nPassphrase: ");
- keymessage.append(m_password.toUtf8());
+ if(!m_password.isEmpty()) {
+ keymessage.append("\nPassphrase: ");
+ keymessage.append(m_password.toUtf8());
+ }
write(keymessage, true);
write("%commit");
diff --git a/kgpg/transactions/kgpgtransaction.cpp b/kgpg/transactions/kgpgtransaction.cpp
index 241252c..8660e87 100644
--- a/kgpg/transactions/kgpgtransaction.cpp
+++ b/kgpg/transactions/kgpgtransaction.cpp
@@ -215,7 +215,7 @@ KGpgTransactionPrivate::write(const QByteArray &a)
#ifdef KGPG_DEBUG_TRANSACTIONS
qDebug() << m_parent << a;
#endif /* KGPG_DEBUG_TRANSACTIONS */
- qDebug() << "trans-write: " << m_parent << a;
+ //qDebug() << "trans-write: " << m_parent << a;
}
void
diff --git a/macbuild.txt b/macbuild.txt
index aeef1e1..223780d 100644
--- a/macbuild.txt
+++ b/macbuild.txt
@@ -1,5 +1,7 @@
build gpg:
http://macgpg.sourceforge.net/docs/howto-build-gpg-osx.txt.asc
+$ ./configure --prefix=/usr --exec-prefix=/usr --without-libusb
+$ make
check dll inclusion:
-$ otool -L release/bin/gpg-mac
+$ otool -L g10/gpg
diff --git a/qmake-mac.sh b/qmake-mac.sh
new file mode 100644
index 0000000..0b6c8f3
--- /dev/null
+++ b/qmake-mac.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+export PATH=/Users/gpg4usb/qt-everywhere-opensource-src-4.8.1/bin/:$PATH
+qmake
+make
diff --git a/release/bin/gpg b/release/bin/gpg
index 4dbd085..9a3cbad 100755
--- a/release/bin/gpg
+++ b/release/bin/gpg
Binary files differ
diff --git a/release/bin/gpg-mac b/release/bin/gpg-mac
index fe9fe0e..40e5c2d 100755
--- a/release/bin/gpg-mac
+++ b/release/bin/gpg-mac
Binary files differ
diff --git a/release/bin/gpg.exe b/release/bin/gpg.exe
index 46d2527..e12f0e0 100644
--- a/release/bin/gpg.exe
+++ b/release/bin/gpg.exe
Binary files differ
diff --git a/release/keydb/gpg.conf b/release/keydb/gpg.conf
new file mode 100755
index 0000000..e7c3ce1
--- /dev/null
+++ b/release/keydb/gpg.conf
@@ -0,0 +1,4 @@
+lock-never
+personal-digest-preferences SHA512
+cert-digest-algo SHA512
+default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB ZIP Uncompressed
diff --git a/settingsdialog.cpp b/settingsdialog.cpp
index 973a147..160a3e3 100755
--- a/settingsdialog.cpp
+++ b/settingsdialog.cpp
@@ -35,7 +35,7 @@ SettingsDialog::SettingsDialog(GpgME::GpgContext *ctx, QWidget *parent)
tabWidget->addTab(generalTab, tr("General"));
tabWidget->addTab(appearanceTab, tr("Appearance"));
- tabWidget->addTab(mimeTab, tr("PGP/Mime"));
+ //tabWidget->addTab(mimeTab, tr("PGP/Mime"));
tabWidget->addTab(keyserverTab, tr("Keyserver"));
tabWidget->addTab(gpgPathsTab, tr("Gpg paths"));
tabWidget->addTab(advancedTab, tr("Advanced"));
diff --git a/textedit.cpp b/textedit.cpp
index 4dabfd1..5a5216c 100644
--- a/textedit.cpp
+++ b/textedit.cpp
@@ -38,7 +38,7 @@ TextEdit::TextEdit()
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(removeTab(int)));
slotNewEditorPageTab();
setAcceptDrops(false);
- QPushButton *newButton = new QPushButton(QIcon(":button_plus.png"), "");
+ QPushButton *newButton = new QPushButton(QIcon(":button_plus.png").pixmap(QSize(16,16)), "");
tabWidget->setCornerWidget(newButton,Qt::TopLeftCorner);
connect(newButton, SIGNAL(clicked()), this, SLOT(slotNewEditorPageTab()));