mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-26 09:32:51 +00:00
Rename EncryptedMessage
This commit is contained in:
@@ -6,10 +6,9 @@ import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
|
||||
import org.whispersystems.textsecure.crypto.IdentityKey;
|
||||
import org.whispersystems.textsecure.crypto.IdentityKeyPair;
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
import org.whispersystems.textsecure.crypto.SessionCipher;
|
||||
import org.whispersystems.textsecure.crypto.MessageCipher;
|
||||
import org.thoughtcrime.securesms.database.MmsDatabase;
|
||||
import org.thoughtcrime.securesms.mms.MmsRadio;
|
||||
import org.thoughtcrime.securesms.mms.MmsRadioException;
|
||||
@@ -17,7 +16,6 @@ import org.thoughtcrime.securesms.mms.MmsSendHelper;
|
||||
import org.thoughtcrime.securesms.mms.TextTransport;
|
||||
import org.thoughtcrime.securesms.protocol.WirePrefix;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.whispersystems.textsecure.crypto.protocol.EncryptedMessage;
|
||||
import org.whispersystems.textsecure.util.Hex;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -138,7 +136,7 @@ public class MmsTransport {
|
||||
|
||||
private byte[] getEncryptedPdu(MasterSecret masterSecret, String recipient, byte[] pduBytes) {
|
||||
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context, masterSecret);
|
||||
EncryptedMessage message = new EncryptedMessage(context, masterSecret, identityKey, new TextTransport());
|
||||
MessageCipher message = new MessageCipher(context, masterSecret, identityKey, new TextTransport());
|
||||
return message.encrypt(new Recipient(null, recipient, null, null), pduBytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,9 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.textsecure.crypto.IdentityKey;
|
||||
import org.whispersystems.textsecure.crypto.IdentityKeyPair;
|
||||
import org.whispersystems.textsecure.crypto.InvalidKeyException;
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
import org.whispersystems.textsecure.crypto.MessageCipher;
|
||||
import org.whispersystems.textsecure.crypto.protocol.PreKeyBundleMessage;
|
||||
import org.whispersystems.textsecure.crypto.protocol.EncryptedMessage;
|
||||
import org.whispersystems.textsecure.push.PreKeyEntity;
|
||||
import org.whispersystems.textsecure.push.PushAttachmentData;
|
||||
import org.whispersystems.textsecure.push.PushServiceSocket;
|
||||
@@ -120,7 +119,7 @@ public class PushTransport extends BaseTransport {
|
||||
|
||||
processor.processKeyExchangeMessage(preKey);
|
||||
|
||||
EncryptedMessage message = new EncryptedMessage(context, masterSecret, identityKeyPair, new RawTransportDetails());
|
||||
MessageCipher message = new MessageCipher(context, masterSecret, identityKeyPair, new RawTransportDetails());
|
||||
byte[] bundledMessage = message.encrypt(recipient, plaintext.getBytes());
|
||||
|
||||
PreKeyBundleMessage preKeyBundleMessage = new PreKeyBundleMessage(identityKey, bundledMessage);
|
||||
@@ -131,7 +130,7 @@ public class PushTransport extends BaseTransport {
|
||||
throws IOException
|
||||
{
|
||||
IdentityKeyPair identityKeyPair = IdentityKeyUtil.getIdentityKeyPair(context, masterSecret);
|
||||
EncryptedMessage message = new EncryptedMessage(context, masterSecret, identityKeyPair, new TextTransport());
|
||||
MessageCipher message = new MessageCipher(context, masterSecret, identityKeyPair, new TextTransport());
|
||||
return message.encrypt(recipient, plaintext.getBytes());
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.util.Log;
|
||||
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
|
||||
import org.whispersystems.textsecure.crypto.IdentityKeyPair;
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
import org.whispersystems.textsecure.crypto.SessionCipher;
|
||||
import org.whispersystems.textsecure.crypto.MessageCipher;
|
||||
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.service.SendReceiveService;
|
||||
@@ -17,7 +17,6 @@ import org.thoughtcrime.securesms.sms.MultipartSmsMessageHandler;
|
||||
import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
|
||||
import org.thoughtcrime.securesms.sms.SmsTransportDetails;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.textsecure.crypto.protocol.EncryptedMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -142,7 +141,7 @@ public class SmsTransport extends BaseTransport {
|
||||
|
||||
private String getAsymmetricEncrypt(MasterSecret masterSecret, String body, Recipient recipient) {
|
||||
IdentityKeyPair identityKey = IdentityKeyUtil.getIdentityKeyPair(context, masterSecret);
|
||||
EncryptedMessage message = new EncryptedMessage(context, masterSecret, identityKey, new SmsTransportDetails());
|
||||
MessageCipher message = new MessageCipher(context, masterSecret, identityKey, new SmsTransportDetails());
|
||||
return new String(message.encrypt(recipient, body.getBytes()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user