aboutsummaryrefslogtreecommitdiffstats
path: root/gpgcontext.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-06 20:44:53 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-06 20:44:53 +0000
commit77245b9b30abac6c364025f4919b931b1fdad082 (patch)
tree80bc4e9e6833ac885494f7db8101c72fbec79b7e /gpgcontext.cpp
parentadd class for constants (diff)
downloadgpg4usb-77245b9b30abac6c364025f4919b931b1fdad082.tar.gz
gpg4usb-77245b9b30abac6c364025f4919b931b1fdad082.zip
use gpgconstants
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@671 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'gpgcontext.cpp')
-rw-r--r--gpgcontext.cpp8
1 files changed, 4 insertions, 4 deletions
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;