From 253438e698d4e7f69b97dcc11c07426c03fbc416 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 3 Sep 2014 15:33:44 +0200 Subject: more openpgp bug fixes --- src/eu/siacs/conversations/crypto/PgpEngine.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/eu') diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 71282c44..2f678279 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -171,8 +171,10 @@ public class PgpEngine { os.flush(); StringBuilder encryptedMessageBody = new StringBuilder(); String[] lines = os.toString().split("\n"); - for (int i = 3; i < lines.length - 1; ++i) { - encryptedMessageBody.append(lines[i].trim()); + for (int i = 2; i < lines.length - 1; ++i) { + if (!lines[i].contains("Version")) { + encryptedMessageBody.append(lines[i].trim()); + } } message.setEncryptedBody(encryptedMessageBody .toString()); @@ -304,7 +306,9 @@ public class PgpEngine { if (line.contains("END PGP SIGNATURE")) { sig = false; } else { - signatureBuilder.append(line.trim()); + if (!line.contains("Version")) { + signatureBuilder.append(line.trim()); + } } } if (line.contains("BEGIN PGP SIGNATURE")) { -- cgit v1.2.3