aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlang/python/tests/t-callbacks.py2
-rw-r--r--lang/qt/Makefile.am8
-rw-r--r--lang/qt/src/qgpgmenewcryptoconfig.cpp6
-rw-r--r--src/engine-gpgsm.c11
-rw-r--r--src/gpgme-json.c22
5 files changed, 35 insertions, 14 deletions
diff --git a/lang/python/tests/t-callbacks.py b/lang/python/tests/t-callbacks.py
index 9a70cdae..b311e3d4 100755
--- a/lang/python/tests/t-callbacks.py
+++ b/lang/python/tests/t-callbacks.py
@@ -88,7 +88,7 @@ Name-Real: Joe Tester
Name-Comment: with stupid passphrase
Name-Email: [email protected]
Passphrase: Crypt0R0cks
-Expire-Date: 2020-12-31
+Expire-Date: 2099-12-31
</GnupgKeyParms>
"""
diff --git a/lang/qt/Makefile.am b/lang/qt/Makefile.am
index ab859609..a1b83e8d 100644
--- a/lang/qt/Makefile.am
+++ b/lang/qt/Makefile.am
@@ -19,6 +19,12 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA
-SUBDIRS = src tests doc
+if RUN_GPG_TESTS
+tests = tests
+else
+tests =
+endif
+
+SUBDIRS = src ${tests} doc
EXTRA_DIST = README
diff --git a/lang/qt/src/qgpgmenewcryptoconfig.cpp b/lang/qt/src/qgpgmenewcryptoconfig.cpp
index ba028a97..070ab697 100644
--- a/lang/qt/src/qgpgmenewcryptoconfig.cpp
+++ b/lang/qt/src/qgpgmenewcryptoconfig.cpp
@@ -42,6 +42,7 @@
#include "gpgme_backend_debug.h"
#include <QFile>
+#include <QDir>
#include "global.h"
#include "error.h"
@@ -521,8 +522,7 @@ QUrl QGpgMENewCryptoConfigEntry::urlValue() const
Q_ASSERT(type == FilenameType || type == LdapServerType);
Q_ASSERT(!isList());
if (type == FilenameType) {
- QUrl url;
- url.setPath(QFile::decodeName(m_option.currentValue().stringValue()));
+ QUrl url = QUrl::fromLocalFile(m_option.currentValue().stringValue());
return url;
}
return parseURL(type, stringValue());
@@ -635,7 +635,7 @@ void QGpgMENewCryptoConfigEntry::setURLValue(const QUrl &url)
if (str.isEmpty() && !isOptional()) {
m_option.resetToDefaultValue();
} else if (type == FilenameType) {
- m_option.setNewValue(m_option.createStringArgument(QFile::encodeName(str).constData()));
+ m_option.setNewValue(m_option.createStringArgument(QDir::toNativeSeparators(url.toLocalFile()).toUtf8().constData()));
} else {
m_option.setNewValue(m_option.createStringArgument(str.toUtf8().constData()));
}
diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c
index da7e524f..7b221831 100644
--- a/src/engine-gpgsm.c
+++ b/src/engine-gpgsm.c
@@ -1013,8 +1013,17 @@ status_handler (void *opaque, int fd)
*(rest++) = 0;
r = _gpgme_parse_status (line + 2);
+ if (gpgsm->status.mon_cb && r != GPGME_STATUS_PROGRESS)
+ {
+ /* Note that we call the monitor even if we do
+ * not know the status code (r < 0). */
+ err = gpgsm->status.mon_cb (gpgsm->status.mon_cb_value,
+ line + 2, rest);
+ }
+ else
+ err = 0;
- if (r >= 0)
+ if (r >= 0 && !err)
{
if (gpgsm->status.fnc)
{
diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index f1e9f256..fb5f149b 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -610,7 +610,8 @@ make_data_object (cjson_t result, gpgme_data_t data, size_t chunksize,
{
gpg_error_t err;
char *buffer;
- size_t buflen;
+ const char *s;
+ size_t buflen, n;
int c;
if (!base64 || base64 == -1) /* Make sure that we really have a string. */
@@ -629,13 +630,18 @@ make_data_object (cjson_t result, gpgme_data_t data, size_t chunksize,
base64 = 0;
if (!buflen)
log_fatal ("Appended Nul byte got lost\n");
- if (memchr (buffer, 0, buflen-1))
- {
- buflen--; /* Adjust for the extra nul byte. */
- base64 = 1;
- }
- /* Fixme: We might want to do more advanced heuristics than to
- * only look for a Nul. */
+ /* Figure out if there is any Nul octet in the buffer. In that
+ * case we need to Base-64 the buffer. Due to problems with the
+ * browser's Javascript we use Base-64 also in case an UTF-8
+ * character is in the buffer. This is because the chunking may
+ * split an UTF-8 characters and JS can't handle this. */
+ for (s=buffer, n=0; n < buflen -1; s++, n++)
+ if (!*s || (*s & 0x80))
+ {
+ buflen--; /* Adjust for the extra nul byte. */
+ base64 = 1;
+ break;
+ }
}
/* Adjust the chunksize if we need to do base64 conversion. */