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

Commit 9f9cdb3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix EuiccCard#authenticateServer error checking."

parents ea2bba4e b28af91f
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