Include (somehow missed) support for send/receive encrypted MMS.

fork-5.53.8
Moxie Marlinspike 2013-05-16 13:48:44 -07:00
rodzic e5f634ba45
commit c86e414c5f
4 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -795,11 +795,11 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
if (attachmentManager.isAttachmentPresent()) {
allocatedThreadId = MessageSender.sendMms(ConversationActivity.this, masterSecret, recipients,
threadId, attachmentManager.getSlideDeck(), body,
distributionType, forcePlaintext);
distributionType, isEncryptedConversation && !forcePlaintext);
} else if (recipients.isEmailRecipient() || !recipients.isSingleRecipient()) {
allocatedThreadId = MessageSender.sendMms(ConversationActivity.this, masterSecret, recipients,
threadId, new SlideDeck(), body, distributionType,
forcePlaintext);
isEncryptedConversation && !forcePlaintext);
} else {
OutgoingTextMessage message;

Wyświetl plik

@ -46,6 +46,7 @@ import ws.com.google.android.mms.MmsException;
import ws.com.google.android.mms.pdu.MultimediaMessagePdu;
import ws.com.google.android.mms.pdu.PduParser;
import ws.com.google.android.mms.pdu.RetrieveConf;
import ws.com.google.android.mms.pdu.SendReq;
/**
* A work queue for processing a number of encryption operations.
@ -192,7 +193,9 @@ public class DecryptingQueue {
plaintextPduBytes = cipher.decryptMessage(ciphertextPduBytes);
}
RetrieveConf plaintextPdu = (RetrieveConf)new PduParser(plaintextPduBytes).parse();
MultimediaMessagePdu plaintextGenericPdu = (MultimediaMessagePdu)new PduParser(plaintextPduBytes).parse();
RetrieveConf plaintextPdu = new RetrieveConf(plaintextGenericPdu.getPduHeaders(),
plaintextGenericPdu.getBody());
Log.w("DecryptingQueue", "Successfully decrypted MMS!");
database.insertSecureDecryptedMessageInbox(masterSecret, plaintextPdu, threadId);
database.delete(messageId);

Wyświetl plik

@ -40,7 +40,7 @@ public class MessageSender {
public static long sendMms(Context context, MasterSecret masterSecret, Recipients recipients,
long threadId, SlideDeck slideDeck, String message, int distributionType,
boolean forcePlaintext)
boolean secure)
throws MmsException
{
if (threadId == -1)
@ -68,7 +68,7 @@ public class MessageSender {
// sendMms(context, insecureRecipients, masterSecret, sendRequest, threadId, false);
// }
sendMms(context, recipients, masterSecret, sendRequest, threadId, distributionType, false);
sendMms(context, recipients, masterSecret, sendRequest, threadId, distributionType, secure);
return threadId;
}

Wyświetl plik

@ -51,7 +51,7 @@ public class RetrieveConf extends MultimediaMessagePdu {
* @param headers Headers for this PDU.
* @param body Body of this PDu.
*/
RetrieveConf(PduHeaders headers, PduBody body) {
public RetrieveConf(PduHeaders headers, PduBody body) {
super(headers, body);
}