Search in sources :

Example 96 with SignalServiceAddress

use of org.whispersystems.signalservice.api.push.SignalServiceAddress in project Signal-Android by signalapp.

the class MessageDecryptionUtil method decrypt.

/**
 * Takes a {@link SignalServiceEnvelope} and returns a {@link DecryptionResult}, which has either
 * a plaintext {@link SignalServiceContent} or information about an error that happened.
 *
 * Excluding the data updated in our protocol stores that results from decrypting a message, this
 * method is side-effect free, preferring to return the decryption results to be handled by the
 * caller.
 */
@NonNull
public static DecryptionResult decrypt(@NonNull Context context, @NonNull SignalServiceEnvelope envelope) {
    SignalServiceAccountDataStore protocolStore = ApplicationDependencies.getProtocolStore().aci();
    SignalServiceAddress localAddress = new SignalServiceAddress(Recipient.self().requireServiceId(), Recipient.self().requireE164());
    SignalServiceCipher cipher = new SignalServiceCipher(localAddress, SignalStore.account().getDeviceId(), protocolStore, ReentrantSessionLock.INSTANCE, UnidentifiedAccessUtil.getCertificateValidator());
    List<Job> jobs = new LinkedList<>();
    if (envelope.isPreKeySignalMessage()) {
        jobs.add(new RefreshPreKeysJob());
    }
    try {
        try {
            return DecryptionResult.forSuccess(cipher.decrypt(envelope), jobs);
        } catch (ProtocolInvalidVersionException e) {
            Log.w(TAG, String.valueOf(envelope.getTimestamp()), e);
            return DecryptionResult.forError(MessageState.INVALID_VERSION, toExceptionMetadata(e), jobs);
        } catch (ProtocolInvalidKeyIdException | ProtocolInvalidKeyException | ProtocolUntrustedIdentityException | ProtocolNoSessionException | ProtocolInvalidMessageException e) {
            Log.w(TAG, String.valueOf(envelope.getTimestamp()), e);
            Recipient sender = Recipient.external(context, e.getSender());
            if (sender.supportsMessageRetries() && Recipient.self().supportsMessageRetries() && FeatureFlags.retryReceipts()) {
                jobs.add(handleRetry(context, sender, envelope, e));
                postInternalErrorNotification(context);
            } else {
                jobs.add(new AutomaticSessionResetJob(sender.getId(), e.getSenderDevice(), envelope.getTimestamp()));
            }
            return DecryptionResult.forNoop(jobs);
        } catch (ProtocolLegacyMessageException e) {
            Log.w(TAG, "[" + envelope.getTimestamp() + "] " + envelope.getSourceIdentifier() + ":" + envelope.getSourceDevice(), e);
            return DecryptionResult.forError(MessageState.LEGACY_MESSAGE, toExceptionMetadata(e), jobs);
        } catch (ProtocolDuplicateMessageException e) {
            Log.w(TAG, "[" + envelope.getTimestamp() + "] " + envelope.getSourceIdentifier() + ":" + envelope.getSourceDevice(), e);
            return DecryptionResult.forError(MessageState.DUPLICATE_MESSAGE, toExceptionMetadata(e), jobs);
        } catch (InvalidMetadataVersionException | InvalidMetadataMessageException | InvalidMessageStructureException e) {
            Log.w(TAG, "[" + envelope.getTimestamp() + "] " + envelope.getSourceIdentifier() + ":" + envelope.getSourceDevice(), e);
            return DecryptionResult.forNoop(jobs);
        } catch (SelfSendException e) {
            Log.i(TAG, "Dropping UD message from self.");
            return DecryptionResult.forNoop(jobs);
        } catch (UnsupportedDataMessageException e) {
            Log.w(TAG, "[" + envelope.getTimestamp() + "] " + envelope.getSourceIdentifier() + ":" + envelope.getSourceDevice(), e);
            return DecryptionResult.forError(MessageState.UNSUPPORTED_DATA_MESSAGE, toExceptionMetadata(e), jobs);
        }
    } catch (NoSenderException e) {
        Log.w(TAG, "Invalid message, but no sender info!");
        return DecryptionResult.forNoop(jobs);
    }
}
Also used : ProtocolInvalidMessageException(org.signal.libsignal.metadata.ProtocolInvalidMessageException) ProtocolUntrustedIdentityException(org.signal.libsignal.metadata.ProtocolUntrustedIdentityException) ProtocolInvalidVersionException(org.signal.libsignal.metadata.ProtocolInvalidVersionException) InvalidMessageStructureException(org.whispersystems.signalservice.api.InvalidMessageStructureException) SelfSendException(org.signal.libsignal.metadata.SelfSendException) ProtocolInvalidKeyIdException(org.signal.libsignal.metadata.ProtocolInvalidKeyIdException) ProtocolDuplicateMessageException(org.signal.libsignal.metadata.ProtocolDuplicateMessageException) UnsupportedDataMessageException(org.whispersystems.signalservice.internal.push.UnsupportedDataMessageException) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) ProtocolLegacyMessageException(org.signal.libsignal.metadata.ProtocolLegacyMessageException) SignalServiceAccountDataStore(org.whispersystems.signalservice.api.SignalServiceAccountDataStore) AutomaticSessionResetJob(org.thoughtcrime.securesms.jobs.AutomaticSessionResetJob) RefreshPreKeysJob(org.thoughtcrime.securesms.jobs.RefreshPreKeysJob) SendRetryReceiptJob(org.thoughtcrime.securesms.jobs.SendRetryReceiptJob) Job(org.thoughtcrime.securesms.jobmanager.Job) RefreshPreKeysJob(org.thoughtcrime.securesms.jobs.RefreshPreKeysJob) ProtocolNoSessionException(org.signal.libsignal.metadata.ProtocolNoSessionException) SignalServiceCipher(org.whispersystems.signalservice.api.crypto.SignalServiceCipher) Recipient(org.thoughtcrime.securesms.recipients.Recipient) AutomaticSessionResetJob(org.thoughtcrime.securesms.jobs.AutomaticSessionResetJob) LinkedList(java.util.LinkedList) InvalidMetadataMessageException(org.signal.libsignal.metadata.InvalidMetadataMessageException) ProtocolInvalidKeyException(org.signal.libsignal.metadata.ProtocolInvalidKeyException) InvalidMetadataVersionException(org.signal.libsignal.metadata.InvalidMetadataVersionException) NonNull(androidx.annotation.NonNull)

Example 97 with SignalServiceAddress

use of org.whispersystems.signalservice.api.push.SignalServiceAddress in project libsignal-service-java by signalapp.

the class SignalServiceCipher method decrypt.

private Plaintext decrypt(SignalServiceEnvelope envelope, byte[] ciphertext) throws InvalidMetadataMessageException, InvalidMetadataVersionException, ProtocolDuplicateMessageException, ProtocolUntrustedIdentityException, ProtocolLegacyMessageException, ProtocolInvalidKeyException, ProtocolInvalidVersionException, ProtocolInvalidMessageException, ProtocolInvalidKeyIdException, ProtocolNoSessionException, SelfSendException {
    try {
        byte[] paddedMessage;
        Metadata metadata;
        int sessionVersion;
        if (!envelope.hasSource() && !envelope.isUnidentifiedSender()) {
            throw new ProtocolInvalidMessageException(new InvalidMessageException("Non-UD envelope is missing a source!"), null, 0);
        }
        if (envelope.isPreKeySignalMessage()) {
            SignalProtocolAddress sourceAddress = getPreferredProtocolAddress(signalProtocolStore, envelope.getSourceAddress(), envelope.getSourceDevice());
            SessionCipher sessionCipher = new SessionCipher(signalProtocolStore, sourceAddress);
            paddedMessage = sessionCipher.decrypt(new PreKeySignalMessage(ciphertext));
            metadata = new Metadata(envelope.getSourceAddress(), envelope.getSourceDevice(), envelope.getTimestamp(), false);
            sessionVersion = sessionCipher.getSessionVersion();
        } else if (envelope.isSignalMessage()) {
            SignalProtocolAddress sourceAddress = getPreferredProtocolAddress(signalProtocolStore, envelope.getSourceAddress(), envelope.getSourceDevice());
            SessionCipher sessionCipher = new SessionCipher(signalProtocolStore, sourceAddress);
            paddedMessage = sessionCipher.decrypt(new SignalMessage(ciphertext));
            metadata = new Metadata(envelope.getSourceAddress(), envelope.getSourceDevice(), envelope.getTimestamp(), false);
            sessionVersion = sessionCipher.getSessionVersion();
        } else if (envelope.isUnidentifiedSender()) {
            SealedSessionCipher sealedSessionCipher = new SealedSessionCipher(signalProtocolStore, localAddress.getUuid().orNull(), localAddress.getNumber().orNull(), 1);
            DecryptionResult result = sealedSessionCipher.decrypt(certificateValidator, ciphertext, envelope.getServerTimestamp());
            SignalServiceAddress resultAddress = new SignalServiceAddress(UuidUtil.parse(result.getSenderUuid().orNull()), result.getSenderE164());
            SignalProtocolAddress protocolAddress = getPreferredProtocolAddress(signalProtocolStore, resultAddress, result.getDeviceId());
            paddedMessage = result.getPaddedMessage();
            metadata = new Metadata(resultAddress, result.getDeviceId(), envelope.getTimestamp(), true);
            sessionVersion = sealedSessionCipher.getSessionVersion(protocolAddress);
        } else {
            throw new InvalidMetadataMessageException("Unknown type: " + envelope.getType());
        }
        PushTransportDetails transportDetails = new PushTransportDetails(sessionVersion);
        byte[] data = transportDetails.getStrippedPaddingMessageBody(paddedMessage);
        return new Plaintext(metadata, data);
    } catch (DuplicateMessageException e) {
        throw new ProtocolDuplicateMessageException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (LegacyMessageException e) {
        throw new ProtocolLegacyMessageException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (InvalidMessageException e) {
        throw new ProtocolInvalidMessageException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (InvalidKeyIdException e) {
        throw new ProtocolInvalidKeyIdException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (InvalidKeyException e) {
        throw new ProtocolInvalidKeyException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (UntrustedIdentityException e) {
        throw new ProtocolUntrustedIdentityException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (InvalidVersionException e) {
        throw new ProtocolInvalidVersionException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    } catch (NoSessionException e) {
        throw new ProtocolNoSessionException(e, envelope.getSourceIdentifier(), envelope.getSourceDevice());
    }
}
Also used : ProtocolInvalidMessageException(org.signal.libsignal.metadata.ProtocolInvalidMessageException) SealedSessionCipher(org.signal.libsignal.metadata.SealedSessionCipher) InvalidMessageException(org.whispersystems.libsignal.InvalidMessageException) ProtocolInvalidMessageException(org.signal.libsignal.metadata.ProtocolInvalidMessageException) UntrustedIdentityException(org.whispersystems.libsignal.UntrustedIdentityException) ProtocolUntrustedIdentityException(org.signal.libsignal.metadata.ProtocolUntrustedIdentityException) ProtocolUntrustedIdentityException(org.signal.libsignal.metadata.ProtocolUntrustedIdentityException) ProtocolInvalidVersionException(org.signal.libsignal.metadata.ProtocolInvalidVersionException) InvalidVersionException(org.whispersystems.libsignal.InvalidVersionException) ProtocolInvalidVersionException(org.signal.libsignal.metadata.ProtocolInvalidVersionException) ProtocolInvalidKeyIdException(org.signal.libsignal.metadata.ProtocolInvalidKeyIdException) NoSessionException(org.whispersystems.libsignal.NoSessionException) ProtocolNoSessionException(org.signal.libsignal.metadata.ProtocolNoSessionException) ProtocolDuplicateMessageException(org.signal.libsignal.metadata.ProtocolDuplicateMessageException) PreKeySignalMessage(org.whispersystems.libsignal.protocol.PreKeySignalMessage) PushTransportDetails(org.whispersystems.signalservice.internal.push.PushTransportDetails) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) ProtocolLegacyMessageException(org.signal.libsignal.metadata.ProtocolLegacyMessageException) SessionCipher(org.whispersystems.libsignal.SessionCipher) SealedSessionCipher(org.signal.libsignal.metadata.SealedSessionCipher) SignalProtocolAddress(org.whispersystems.libsignal.SignalProtocolAddress) ProtocolNoSessionException(org.signal.libsignal.metadata.ProtocolNoSessionException) PreKeySignalMessage(org.whispersystems.libsignal.protocol.PreKeySignalMessage) SignalMessage(org.whispersystems.libsignal.protocol.SignalMessage) InvalidKeyException(org.whispersystems.libsignal.InvalidKeyException) ProtocolInvalidKeyException(org.signal.libsignal.metadata.ProtocolInvalidKeyException) InvalidMetadataMessageException(org.signal.libsignal.metadata.InvalidMetadataMessageException) ProtocolInvalidKeyException(org.signal.libsignal.metadata.ProtocolInvalidKeyException) DuplicateMessageException(org.whispersystems.libsignal.DuplicateMessageException) ProtocolDuplicateMessageException(org.signal.libsignal.metadata.ProtocolDuplicateMessageException) DecryptionResult(org.signal.libsignal.metadata.SealedSessionCipher.DecryptionResult) InvalidKeyIdException(org.whispersystems.libsignal.InvalidKeyIdException) ProtocolInvalidKeyIdException(org.signal.libsignal.metadata.ProtocolInvalidKeyIdException) LegacyMessageException(org.whispersystems.libsignal.LegacyMessageException) ProtocolLegacyMessageException(org.signal.libsignal.metadata.ProtocolLegacyMessageException)

Example 98 with SignalServiceAddress

use of org.whispersystems.signalservice.api.push.SignalServiceAddress in project libsignal-service-java by signalapp.

the class SignalServiceCipher method createGroupInfo.

private SignalServiceGroup createGroupInfo(DataMessage content) throws ProtocolInvalidMessageException {
    if (!content.hasGroup())
        return null;
    SignalServiceGroup.Type type;
    switch(content.getGroup().getType()) {
        case DELIVER:
            type = SignalServiceGroup.Type.DELIVER;
            break;
        case UPDATE:
            type = SignalServiceGroup.Type.UPDATE;
            break;
        case QUIT:
            type = SignalServiceGroup.Type.QUIT;
            break;
        case REQUEST_INFO:
            type = SignalServiceGroup.Type.REQUEST_INFO;
            break;
        default:
            type = SignalServiceGroup.Type.UNKNOWN;
            break;
    }
    if (content.getGroup().getType() != DELIVER) {
        String name = null;
        List<SignalServiceAddress> members = null;
        SignalServiceAttachmentPointer avatar = null;
        if (content.getGroup().hasName()) {
            name = content.getGroup().getName();
        }
        if (content.getGroup().getMembersCount() > 0) {
            members = new ArrayList<>(content.getGroup().getMembersCount());
            for (SignalServiceProtos.GroupContext.Member member : content.getGroup().getMembersList()) {
                if (SignalServiceAddress.isValidAddress(member.getUuid(), member.getE164())) {
                    members.add(new SignalServiceAddress(UuidUtil.parseOrNull(member.getUuid()), member.getE164()));
                } else {
                    throw new ProtocolInvalidMessageException(new InvalidMessageException("GroupContext.Member had no address!"), null, 0);
                }
            }
        } else if (content.getGroup().getMembersE164Count() > 0) {
            members = new ArrayList<>(content.getGroup().getMembersE164Count());
            for (String member : content.getGroup().getMembersE164List()) {
                members.add(new SignalServiceAddress(null, member));
            }
        }
        if (content.getGroup().hasAvatar()) {
            AttachmentPointer pointer = content.getGroup().getAvatar();
            avatar = new SignalServiceAttachmentPointer(pointer.getId(), pointer.getContentType(), pointer.getKey().toByteArray(), Optional.of(pointer.getSize()), Optional.<byte[]>absent(), 0, 0, Optional.fromNullable(pointer.hasDigest() ? pointer.getDigest().toByteArray() : null), Optional.<String>absent(), false, Optional.<String>absent(), Optional.<String>absent());
        }
        return new SignalServiceGroup(type, content.getGroup().getId().toByteArray(), name, members, avatar);
    }
    return new SignalServiceGroup(content.getGroup().getId().toByteArray());
}
Also used : ProtocolInvalidMessageException(org.signal.libsignal.metadata.ProtocolInvalidMessageException) InvalidMessageException(org.whispersystems.libsignal.InvalidMessageException) ProtocolInvalidMessageException(org.signal.libsignal.metadata.ProtocolInvalidMessageException) ArrayList(java.util.ArrayList) SignalServiceAttachmentPointer(org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer) ByteString(com.google.protobuf.ByteString) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) SignalServiceGroup(org.whispersystems.signalservice.api.messages.SignalServiceGroup) SignalServiceAttachmentPointer(org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer) AttachmentPointer(org.whispersystems.signalservice.internal.push.SignalServiceProtos.AttachmentPointer)

Example 99 with SignalServiceAddress

use of org.whispersystems.signalservice.api.push.SignalServiceAddress in project libsignal-service-java by signalapp.

the class SignalServiceMessageSender method sendMessage.

private List<SendMessageResult> sendMessage(List<SignalServiceAddress> recipients, List<Optional<UnidentifiedAccess>> unidentifiedAccess, long timestamp, byte[] content, boolean online) throws IOException {
    List<SendMessageResult> results = new LinkedList<>();
    Iterator<SignalServiceAddress> recipientIterator = recipients.iterator();
    Iterator<Optional<UnidentifiedAccess>> unidentifiedAccessIterator = unidentifiedAccess.iterator();
    while (recipientIterator.hasNext()) {
        SignalServiceAddress recipient = recipientIterator.next();
        try {
            SendMessageResult result = sendMessage(recipient, unidentifiedAccessIterator.next(), timestamp, content, online);
            results.add(result);
        } catch (UntrustedIdentityException e) {
            Log.w(TAG, e);
            results.add(SendMessageResult.identityFailure(recipient, e.getIdentityKey()));
        } catch (UnregisteredUserException e) {
            Log.w(TAG, e);
            results.add(SendMessageResult.unregisteredFailure(recipient));
        } catch (PushNetworkException e) {
            Log.w(TAG, e);
            results.add(SendMessageResult.networkFailure(recipient));
        }
    }
    return results;
}
Also used : UntrustedIdentityException(org.whispersystems.signalservice.api.crypto.UntrustedIdentityException) UnregisteredUserException(org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException) PushNetworkException(org.whispersystems.signalservice.api.push.exceptions.PushNetworkException) Optional(org.whispersystems.libsignal.util.guava.Optional) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) SendMessageResult(org.whispersystems.signalservice.api.messages.SendMessageResult) LinkedList(java.util.LinkedList)

Example 100 with SignalServiceAddress

use of org.whispersystems.signalservice.api.push.SignalServiceAddress in project libsignal-service-java by signalapp.

the class DeviceContactsInputStream method read.

public DeviceContact read() throws IOException {
    long detailsLength = readRawVarint32();
    byte[] detailsSerialized = new byte[(int) detailsLength];
    Util.readFully(in, detailsSerialized);
    SignalServiceProtos.ContactDetails details = SignalServiceProtos.ContactDetails.parseFrom(detailsSerialized);
    if (!SignalServiceAddress.isValidAddress(details.getUuid(), details.getNumber())) {
        throw new IOException("Missing contact address!");
    }
    SignalServiceAddress address = new SignalServiceAddress(UuidUtil.parseOrNull(details.getUuid()), details.getNumber());
    Optional<String> name = Optional.fromNullable(details.getName());
    Optional<SignalServiceAttachmentStream> avatar = Optional.absent();
    Optional<String> color = details.hasColor() ? Optional.of(details.getColor()) : Optional.<String>absent();
    Optional<VerifiedMessage> verified = Optional.absent();
    Optional<byte[]> profileKey = Optional.absent();
    boolean blocked = false;
    Optional<Integer> expireTimer = Optional.absent();
    if (details.hasAvatar()) {
        long avatarLength = details.getAvatar().getLength();
        InputStream avatarStream = new LimitedInputStream(in, avatarLength);
        String avatarContentType = details.getAvatar().getContentType();
        avatar = Optional.of(new SignalServiceAttachmentStream(avatarStream, avatarContentType, avatarLength, Optional.<String>absent(), false, null));
    }
    if (details.hasVerified()) {
        try {
            if (!SignalServiceAddress.isValidAddress(details.getVerified().getDestinationUuid(), details.getVerified().getDestinationE164())) {
                throw new InvalidMessageException("Missing Verified address!");
            }
            IdentityKey identityKey = new IdentityKey(details.getVerified().getIdentityKey().toByteArray(), 0);
            SignalServiceAddress destination = new SignalServiceAddress(UuidUtil.parseOrNull(details.getVerified().getDestinationUuid()), details.getVerified().getDestinationE164());
            VerifiedMessage.VerifiedState state;
            switch(details.getVerified().getState()) {
                case VERIFIED:
                    state = VerifiedMessage.VerifiedState.VERIFIED;
                    break;
                case UNVERIFIED:
                    state = VerifiedMessage.VerifiedState.UNVERIFIED;
                    break;
                case DEFAULT:
                    state = VerifiedMessage.VerifiedState.DEFAULT;
                    break;
                default:
                    throw new InvalidMessageException("Unknown state: " + details.getVerified().getState());
            }
            verified = Optional.of(new VerifiedMessage(destination, identityKey, state, System.currentTimeMillis()));
        } catch (InvalidKeyException | InvalidMessageException e) {
            Log.w(TAG, e);
            verified = Optional.absent();
        }
    }
    if (details.hasProfileKey()) {
        profileKey = Optional.fromNullable(details.getProfileKey().toByteArray());
    }
    if (details.hasExpireTimer() && details.getExpireTimer() > 0) {
        expireTimer = Optional.of(details.getExpireTimer());
    }
    blocked = details.getBlocked();
    return new DeviceContact(address, name, avatar, color, verified, profileKey, blocked, expireTimer);
}
Also used : InvalidMessageException(org.whispersystems.libsignal.InvalidMessageException) IdentityKey(org.whispersystems.libsignal.IdentityKey) InputStream(java.io.InputStream) IOException(java.io.IOException) InvalidKeyException(org.whispersystems.libsignal.InvalidKeyException) SignalServiceAttachmentStream(org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream) SignalServiceProtos(org.whispersystems.signalservice.internal.push.SignalServiceProtos) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress)

Aggregations

SignalServiceAddress (org.whispersystems.signalservice.api.push.SignalServiceAddress)113 Recipient (org.thoughtcrime.securesms.recipients.Recipient)44 SignalServiceMessageSender (org.whispersystems.signalservice.api.SignalServiceMessageSender)32 SendMessageResult (org.whispersystems.signalservice.api.messages.SendMessageResult)28 LinkedList (java.util.LinkedList)27 Optional (org.whispersystems.libsignal.util.guava.Optional)23 SignalServiceDataMessage (org.whispersystems.signalservice.api.messages.SignalServiceDataMessage)21 NotPushRegisteredException (org.thoughtcrime.securesms.net.NotPushRegisteredException)20 UnidentifiedAccessPair (org.whispersystems.signalservice.api.crypto.UnidentifiedAccessPair)20 NonNull (androidx.annotation.NonNull)18 RecipientId (org.thoughtcrime.securesms.recipients.RecipientId)18 InvalidKeyException (org.whispersystems.libsignal.InvalidKeyException)17 IOException (java.io.IOException)16 ArrayList (java.util.ArrayList)16 SignalServiceAttachment (org.whispersystems.signalservice.api.messages.SignalServiceAttachment)15 List (java.util.List)14 ByteString (com.google.protobuf.ByteString)13 Nullable (androidx.annotation.Nullable)12 UntrustedIdentityException (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException)12 InvalidMessageException (org.whispersystems.libsignal.InvalidMessageException)10