aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-07-11 01:21:35 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-07-11 01:21:35 +0000
commitc672e2b17f14c8df54cfe9b43de44de1e445684a (patch)
treec4cdfcc5826ddb7dc403469d2b08dedb64e67d3a
parentadded Qlabel at the buttom of textedit for verify (diff)
downloadgpg4usb-c672e2b17f14c8df54cfe9b43de44de1e445684a.tar.gz
gpg4usb-c672e2b17f14c8df54cfe9b43de44de1e445684a.zip
added preventnodataerr for verifying
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@492 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--gpgwin.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/gpgwin.cpp b/gpgwin.cpp
index ba448ff..ec2c509 100644
--- a/gpgwin.cpp
+++ b/gpgwin.cpp
@@ -631,6 +631,10 @@ void GpgWin::preventNoDataErr(QByteArray *in)
if (block_start > 0 && in->at(block_start - 1) != '\n') {
in->insert(block_start, '\n');
}
+ block_start = in->indexOf("-----BEGIN PGP SIGNED MESSAGE-----");
+ if (block_start > 0 && in->at(block_start - 1) != '\n') {
+ in->insert(block_start, '\n');
+ }
}
void GpgWin::importKeyFromEdit()
@@ -694,7 +698,10 @@ void GpgWin::sign()
void GpgWin::verify()
{
- int error = mCtx->verify(edit->curTextPage()->toPlainText().toUtf8());
+ QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here?
+ preventNoDataErr(&text);
+
+ int error = mCtx->verify(text);
if (error == 0) {
edit->curPage()->showVerifyLabel(true);
} else {