summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-06-10 16:02:10 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-10 16:02:10 +0000
commit8408f4984d22f96eea7e4c38b371a62963f92c2d (patch)
tree28e6403c0f813d72307dd23d45976438a1a81089
parentab8c47531fd35c5af3851373b3b1f150426aaa60 (diff)
parentda6daab1ebf75fef31bf78d01f1f1f76903a3f73 (diff)
downloadSecureElement-8408f4984d22f96eea7e4c38b371a62963f92c2d.tar.gz
Merge "Allow OpenLogicalChannel with null aid for privilege apps" into rvc-dev am: da6daab1eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/SecureElement/+/11628925 Change-Id: Ib1920e2f35ad96f34c6105a07067d25e0a92c025
-rw-r--r--src/com/android/se/SecureElementService.java3
-rw-r--r--src/com/android/se/Terminal.java6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/se/SecureElementService.java b/src/com/android/se/SecureElementService.java
index 5ca4646..e979fd9 100644
--- a/src/com/android/se/SecureElementService.java
+++ b/src/com/android/se/SecureElementService.java
@@ -303,9 +303,6 @@ public final class SecureElementService extends Service {
throw new IllegalStateException("Session is closed");
} else if (listener == null) {
throw new NullPointerException("listener must not be null");
- } else if (((aid == null) || (aid.length == 0)) && mReader.getTerminal().getName()
- .startsWith(SecureElementService.UICC_TERMINAL)) {
- return null;
} else if ((p2 != 0x00) && (p2 != 0x04) && (p2 != 0x08)
&& (p2 != (byte) 0x0C)) {
throw new UnsupportedOperationException("p2 not supported: "
diff --git a/src/com/android/se/Terminal.java b/src/com/android/se/Terminal.java
index 080f337..4638926 100644
--- a/src/com/android/se/Terminal.java
+++ b/src/com/android/se/Terminal.java
@@ -517,7 +517,7 @@ public class Terminal {
packageName);
try {
channelAccess = setUpChannelAccess(aid, packageName, pid, false);
- } catch (MissingResourceException e) {
+ } catch (MissingResourceException | UnsupportedOperationException e) {
return null;
}
}
@@ -761,6 +761,10 @@ public class Terminal {
}
if (isBasicChannel) {
throw new MissingResourceException("openBasicChannel is not allowed.", "", "");
+ } else if (aid == null) {
+ // openLogicalChannel with null aid is only allowed for privilege applications
+ throw new UnsupportedOperationException(
+ "null aid is not accepted in UICC terminal.");
}
}