From 2b941d19f8cc9a517806a27d1ac976afbaa1677a Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 3 Sep 2014 15:33:44 +0200 Subject: [PATCH] more openpgp bug fixes --- libs/openpgp-api-lib | 2 +- src/eu/siacs/conversations/crypto/PgpEngine.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/openpgp-api-lib b/libs/openpgp-api-lib index 650e1ebda..6bec5eedd 160000 --- a/libs/openpgp-api-lib +++ b/libs/openpgp-api-lib @@ -1 +1 @@ -Subproject commit 650e1ebda82596cd4fbfaae406e6eccf189f4f63 +Subproject commit 6bec5eedde31bacbafcb541a728719eeff99d3b7 diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java index 7b5ef905c..d8222ac54 100644 --- a/src/eu/siacs/conversations/crypto/PgpEngine.java +++ b/src/eu/siacs/conversations/crypto/PgpEngine.java @@ -168,8 +168,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()); @@ -301,7 +303,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")) {