Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f91cc45 authored by Raphael Kim's avatar Raphael Kim
Browse files

[CDM] Fixed an issue where SecureChannel would erroneously close upon...

[CDM] Fixed an issue where SecureChannel would erroneously close upon receiving a bad message rather than ignoring it. 

By design, the secure channel should not consider a badly formatted message _after_ a successful connection to be a fatal error. An unhandled exception type (CryptoException caused by an attempt to decrypt a rogue message) was causing the secure channel to behave otherwise.

Bug: 443136060
Test: m services.companion
Flag: EXEMPT bug fix
Change-Id: I11926f274dd36a54893e12a07777cde4d3e04452
parent 86b91736
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ public class SecureChannel {
        }
    }

    private void receiveSecureMessage() throws IOException, CryptoException {
    private void receiveSecureMessage() throws IOException {
        // Check if channel is secured. Trigger error callback. Let user handle it.
        if (!isSecured()) {
            Slog.d(TAG, "Received a message without a secure connection. "
@@ -263,7 +263,7 @@ public class SecureChannel {
        try {
            byte[] receivedMessage = readMessage(MessageType.SECURE_MESSAGE);
            mCallback.onSecureMessageReceived(receivedMessage);
        } catch (SecureChannelException e) {
        } catch (SecureChannelException | CryptoException e) {
            Slog.w(TAG, "Ignoring received message.", e);
        }
    }