diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2014-01-03 18:41:12 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2014-01-03 18:41:12 +0000 |
commit | 28ee39f0b991d28d5357cf4a7949e8a42bbf3f08 (patch) | |
tree | 0bf1711f8db984d6f69e13142671fb0d0c3473bf | |
parent | updated gpg linux binary to 1.4.16 (diff) | |
download | gpg4usb-28ee39f0b991d28d5357cf4a7949e8a42bbf3f08.tar.gz gpg4usb-28ee39f0b991d28d5357cf4a7949e8a42bbf3f08.zip |
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
-rw-r--r-- | gpgcontext.cpp | 17 | ||||
-rw-r--r-- | gpgcontext.h | 3 |
2 files changed, 12 insertions, 8 deletions
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; } /*** diff --git a/gpgcontext.h b/gpgcontext.h index 4efc3fe..5d739a0 100644 --- a/gpgcontext.h +++ b/gpgcontext.h @@ -175,7 +175,8 @@ private: void executeGpgCommand(QStringList arguments, QByteArray *stdOut, QByteArray *stdErr); - + QString gpgBin; + QString gpgKeys; }; } // namespace GpgME |