Don't remote-encrypt key exchange messages

This commit is contained in:
Moxie Marlinspike 2013-05-06 19:09:36 -07:00
parent 81107a98eb
commit 7090ca4a42

View File

@ -40,11 +40,14 @@ public class SmsTransport {
} }
private void deliverSecureMessage(SmsMessageRecord message) throws UndeliverableMessageException { private void deliverSecureMessage(SmsMessageRecord message) throws UndeliverableMessageException {
MultipartSmsMessageHandler multipartMessageHandler = new MultipartSmsMessageHandler();
OutgoingTextMessage transportMessage = OutgoingTextMessage.from(message);
if (message.isSecure()) {
String encryptedMessage = getAsymmetricEncrypt(masterSecret, message.getBody().getBody(), String encryptedMessage = getAsymmetricEncrypt(masterSecret, message.getBody().getBody(),
message.getIndividualRecipient()); message.getIndividualRecipient());
transportMessage = transportMessage.withBody(encryptedMessage);
OutgoingTextMessage transportMessage = OutgoingTextMessage.from(message).withBody(encryptedMessage); }
MultipartSmsMessageHandler multipartMessageHandler = new MultipartSmsMessageHandler();
ArrayList<String> messages = multipartMessageHandler.divideMessage(transportMessage); ArrayList<String> messages = multipartMessageHandler.divideMessage(transportMessage);
ArrayList<PendingIntent> sentIntents = constructSentIntents(message.getId(), message.getType(), messages); ArrayList<PendingIntent> sentIntents = constructSentIntents(message.getId(), message.getType(), messages);