diff options
author | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-06-30 22:12:16 +0530 |
---|---|---|
committer | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-06-30 22:12:16 +0530 |
commit | a5257ec71d41532ac62594f59c10ba47d6a9ca38 (patch) | |
tree | 6771ba3e13df96574e093668c77e34678511b5f7 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | |
parent | 51d3daeccdc697d948c597931d804d738132b8ed (diff) | |
parent | 677afa90fce133b81c195488e07f07a5a83e2f0b (diff) | |
download | open-keychain-a5257ec71d41532ac62594f59c10ba47d6a9ca38.tar.gz open-keychain-a5257ec71d41532ac62594f59c10ba47d6a9ca38.tar.bz2 open-keychain-a5257ec71d41532ac62594f59c10ba47d6a9ca38.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 6a85ce251..a6d260d22 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -70,7 +70,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.URLConnection; import java.security.SignatureException; import java.util.Date; import java.util.Iterator; @@ -676,8 +675,6 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel> || literalData.getFormat() == PGPLiteralData.UTF8) { mimeType = "text/plain"; } else { - // TODO: better would be: https://github.com/open-keychain/open-keychain/issues/753 - // try to guess from file ending String extension = MimeTypeMap.getFileExtensionFromUrl(originalFilename); if (extension != null) { @@ -685,10 +682,7 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel> mimeType = mime.getMimeTypeFromExtension(extension); } if (mimeType == null) { - mimeType = URLConnection.guessContentTypeFromName(originalFilename); - } - if (mimeType == null) { - mimeType = "*/*"; + mimeType = "application/octet-stream"; } } @@ -944,7 +938,14 @@ public class PgpDecryptVerify extends BaseOperation<PgpDecryptVerifyInputParcel> log.add(LogType.MSG_DC_OK, indent); + OpenPgpMetadata metadata = new OpenPgpMetadata( + "", + "text/plain", + -1, + clearText.length); + DecryptVerifyResult result = new DecryptVerifyResult(DecryptVerifyResult.RESULT_OK, log); + result.setDecryptMetadata(metadata); result.setSignatureResult(signatureResultBuilder.build()); return result; } |