From 5a3f6d5e0046e2e4995b5abaff6383d423c1fc0e Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 5 Mar 2012 21:42:48 +0000 Subject: show password dialog in middle of app window git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@843 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 52d493d..3762e58 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -485,9 +485,9 @@ gpgme_error_t GpgContext::passphrase(const char *uid_hint, } if (mPasswordCache.isEmpty()) { - QString password = QInputDialog::getText(0, tr("Enter Password"), + QString password = QInputDialog::getText(QApplication::activeWindow(), tr("Enter Password"), passwordDialogMessage, QLineEdit::Password, - "", &result, Qt::Window); + "", &result); if (result) mPasswordCache = password.toAscii(); } else { -- cgit v1.2.3 From 58bb02114f47976f5a716af9ee00207b112a4bd9 Mon Sep 17 00:00:00 2001 From: nils Date: Wed, 7 Mar 2012 21:00:53 +0000 Subject: set maximum keysize of elgamal subkey to 65536 git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@850 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 3762e58..3b21514 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -769,7 +769,6 @@ GpgKey GpgContext::getKeyByFpr(QString fpr) { return GpgKey(); } - /** * note: privkey status is not returned */ -- cgit v1.2.3 From 2344929c3914aabf9c7bc2e05fcb290412871c9a Mon Sep 17 00:00:00 2001 From: nils Date: Wed, 7 Mar 2012 21:25:52 +0000 Subject: added missing tr in password dialog git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@851 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 3b21514..7aaf35b 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -481,7 +481,7 @@ gpgme_error_t GpgContext::passphrase(const char *uid_hint, if (!gpgHint.isEmpty()) { // remove UID, leave only username & email gpgHint.remove(0, gpgHint.indexOf(" ")); - passwordDialogMessage += "Enter Password for
\n" + gpgHint + "\n"; + passwordDialogMessage += ""+tr("Enter Password for")+"
" + gpgHint + "
"; } if (mPasswordCache.isEmpty()) { -- cgit v1.2.3 From a71a1b189f00eda87aaf3d4c19936e377b5061dd Mon Sep 17 00:00:00 2001 From: ubbo Date: Sat, 31 Mar 2012 16:57:01 +0000 Subject: fix some issues with utf8 strings in keys git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@871 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 7aaf35b..4ee6cdd 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -254,8 +254,8 @@ GpgKeyList GpgContext::listKeys() gpgkey.revoked = (key->revoked != 0); if (key->uids) { - gpgkey.name = key->uids->name; - gpgkey.email = key->uids->email; + gpgkey.name = QString::fromUtf8(key->uids->name); + gpgkey.email = QString::fromUtf8(key->uids->email); } keys.append(gpgkey); gpgme_key_unref(key); -- cgit v1.2.3 From b461e668f89ac12737ac65a31f6ac6068a6c7449 Mon Sep 17 00:00:00 2001 From: ubbo Date: Sat, 31 Mar 2012 16:57:04 +0000 Subject: fix some issues with utf8 strings in keys git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@872 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 4ee6cdd..bc4e1ef 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -465,7 +465,7 @@ gpgme_error_t GpgContext::passphrase(const char *uid_hint, { gpgme_error_t returnValue = GPG_ERR_CANCELED; QString passwordDialogMessage; - QString gpgHint = uid_hint; + QString gpgHint = QString::fromUtf8(uid_hint); bool result; #ifdef _WIN32 DWORD written; -- cgit v1.2.3 From 715221276b46d27db69efdcc414b76e277e26428 Mon Sep 17 00:00:00 2001 From: ubbo Date: Mon, 2 Apr 2012 21:09:10 +0000 Subject: also drop pwcache after signing if confset git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2@878 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index bc4e1ef..2eef101 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -705,6 +705,10 @@ bool GpgContext::sign(QStringList *uidList, const QByteArray &inBuffer, QByteArr gpgme_data_release(in); gpgme_data_release(out); + if (! settings.value("general/rememberPassword").toBool()) { + clearPasswordCache(); + } + return (err == GPG_ERR_NO_ERROR); } -- cgit v1.2.3 From 28ee39f0b991d28d5357cf4a7949e8a42bbf3f08 Mon Sep 17 00:00:00 2001 From: nils Date: Fri, 3 Jan 2014 18:41:12 +0000 Subject: BUGFIX: export of private key in non-ascii path fixed git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.2-1@1076 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 2eef101..d459f37 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -67,11 +67,11 @@ GpgContext::GpgContext() * also lin/win must be checked, for calling gpg.exe if needed */ #ifdef _WIN32 - QString gpgBin = appPath + "/bin/gpg.exe"; + gpgBin = appPath + "/bin/gpg.exe"; #else - QString gpgBin = appPath + "/bin/gpg"; + gpgBin = appPath + "/bin/gpg"; #endif - QString gpgKeys = appPath + "/keydb"; + gpgKeys = appPath + "/keydb"; /* err = gpgme_ctx_set_engine_info(mCtx, GPGME_PROTOCOL_OpenPGP, gpgBin.toUtf8().constData(), gpgKeys.toUtf8().constData());*/ @@ -559,6 +559,7 @@ QString GpgContext::gpgErrString(gpgme_error_t err) { void GpgContext::exportSecretKey(QString uid, QByteArray *outBuffer) { + qDebug() << *outBuffer; // export private key to outBuffer QStringList arguments; arguments << "--armor" << "--export-secret-key" << uid; @@ -576,17 +577,19 @@ void GpgContext::exportSecretKey(QString uid, QByteArray *outBuffer) /** return type should be gpgme_error_t*/ void GpgContext::executeGpgCommand(QStringList arguments, QByteArray *stdOut, QByteArray *stdErr) { - gpgme_engine_info_t engine = gpgme_ctx_get_engine_info(mCtx); - QStringList args; - args << "--homedir" << engine->home_dir << "--batch" << arguments; + args << "--homedir" << gpgKeys << "--batch" << arguments; + qDebug() << args; QProcess gpg; - gpg.start(engine->file_name, args); + // qDebug() << "engine->file_name" << engine->file_name; + + gpg.start(gpgBin, args); gpg.waitForFinished(); *stdOut = gpg.readAllStandardOutput(); *stdErr = gpg.readAllStandardError(); + qDebug() << *stdOut; } /*** -- cgit v1.2.3