summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuryaprakash.konduru <suryaprakash.konduru@nxp.com>2023-02-01 09:44:51 +0530
committersuryaprakash.konduru <suryaprakash.konduru@nxp.com>2023-02-01 09:44:51 +0530
commit87e5776a1ed3e3fdeb7ea94cf0ca2fcfccb4d1ff (patch)
tree7ecb9874e2fe8ae1c6c7ed1f798c466cf30a7c12
parentcfa266e1b3fa1b653dadf4bf2ae73ecca0a41992 (diff)
downloadSecureElement-87e5776a1ed3e3fdeb7ea94cf0ca2fcfccb4d1ff.tar.gz
Fix for null pointer exception when logical channel opened
with empty AID. Empty byte array is passing when the received aid is set to null. Bug: 266649129 Test: Manual openLogicalChannel with empty AID Change-Id: I335468b6be5aeb87f6fa84e33d036db1c37dfcc5
-rw-r--r--src/com/android/se/Terminal.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/com/android/se/Terminal.java b/src/com/android/se/Terminal.java
index 25bb896..5bb3e3b 100644
--- a/src/com/android/se/Terminal.java
+++ b/src/com/android/se/Terminal.java
@@ -670,7 +670,7 @@ public class Terminal {
try {
responseArray[0] = new LogicalChannelResponse();
android.hardware.secure_element.LogicalChannelResponse aidlRs =
- mAidlHal.openLogicalChannel(aid, p2);
+ mAidlHal.openLogicalChannel(aid == null ? new byte[0] : aid, p2);
responseArray[0].channelNumber = aidlRs.channelNumber;
responseArray[0].selectResponse = byteArrayToArrayList(aidlRs.selectResponse);
} catch (RemoteException e) {
@@ -712,7 +712,6 @@ public class Terminal {
Channel logicalChannel = new Channel(session, this, channelNumber,
selectResponse, aid, listener);
logicalChannel.setChannelAccess(channelAccess);
-
mChannels.put(channelNumber, logicalChannel);
return logicalChannel;
}