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

Commit 39b8f135 authored by Hunter Knepshield's avatar Hunter Knepshield Committed by android-build-merger
Browse files

Merge "Fix EuiccCard#authenticateServer error checking." am: 9f9cdb3f am: 7c5f58a0

am: 9f013a71

Change-Id: I40c677649a9365b7174a0f310fb3cccecfc96df8
parents 7df42894 9f013a71
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -660,9 +660,15 @@ public class EuiccCard extends UiccCard {
                            .addChild(ctxParams1Builder)
                            .build().toHex());
                }),
                (byte[] response) ->
                        parseResponseAndCheckSimpleError(response,
                                EuiccCardErrorException.OPERATION_AUTHENTICATE_SERVER).toBytes(),
                (byte[] response) -> {
                    Asn1Node root = parseResponse(response);
                    if (root.hasChild(Tags.TAG_CTX_COMP_1, Tags.TAG_UNI_2)) {
                        throw new EuiccCardErrorException(
                                EuiccCardErrorException.OPERATION_AUTHENTICATE_SERVER,
                                root.getChild(Tags.TAG_CTX_COMP_1, Tags.TAG_UNI_2).asInteger());
                    }
                    return root.toBytes();
                },
                callback, handler);
    }

+1 −1
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ public class EuiccCardTest extends TelephonyTest {
                com.android.internal.R.array.config_telephonyEuiccDeviceCapabilities))
                .thenReturn(new String[] {});

        int channel = mockLogicalChannelResponses("BF38038101039000");
        int channel = mockLogicalChannelResponses("BF3805A1030201039000");

        ResultCaptor<byte[]> resultCaptor = new ResultCaptor<>();
        mEuiccCard.authenticateServer("A1B2C3-X4Y5Z6", // Matching id