From 77245b9b30abac6c364025f4919b931b1fdad082 Mon Sep 17 00:00:00 2001 From: ubbo Date: Tue, 6 Dec 2011 20:44:53 +0000 Subject: use gpgconstants git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@671 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgcontext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gpgcontext.cpp') diff --git a/gpgcontext.cpp b/gpgcontext.cpp index 46edbe8..c632266 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -637,11 +637,11 @@ bool GpgContext::sign(QStringList *uidList, const QByteArray &inBuffer, QByteArr */ void GpgContext::preventNoDataErr(QByteArray *in) { - int block_start = in->indexOf("-----BEGIN PGP MESSAGE-----"); + int block_start = in->indexOf(GpgConstants::PGP_CRYPT_BEGIN); if (block_start > 0 && in->at(block_start - 1) != '\n') { in->insert(block_start, '\n'); } - block_start = in->indexOf("-----BEGIN PGP SIGNED MESSAGE-----"); + block_start = in->indexOf(GpgConstants::PGP_SIGNED_BEGIN); if (block_start > 0 && in->at(block_start - 1) != '\n') { in->insert(block_start, '\n'); } @@ -654,10 +654,10 @@ void GpgContext::preventNoDataErr(QByteArray *in) * - 2, if text is completly signed */ int GpgContext::textIsSigned(const QByteArray &text) { - if (text.trimmed().startsWith("-----BEGIN PGP SIGNED MESSAGE-----") && text.trimmed().endsWith("-----END PGP SIGNATURE-----")) { + if (text.trimmed().startsWith(GpgConstants::PGP_SIGNED_BEGIN) && text.trimmed().endsWith(GpgConstants::PGP_SIGNED_END)) { return 2; } - if (text.contains("-----BEGIN PGP SIGNED MESSAGE-----") && text.contains("-----END PGP SIGNATURE-----")) { + if (text.contains(GpgConstants::PGP_SIGNED_BEGIN) && text.contains(GpgConstants::PGP_SIGNED_END)) { return 1; } return 0; -- cgit v1.2.3