diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-06-10 15:53:06 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-10 15:53:06 +0000 |
commit | da6daab1ebf75fef31bf78d01f1f1f76903a3f73 (patch) | |
tree | 28e6403c0f813d72307dd23d45976438a1a81089 | |
parent | 69dbe6f5de0429289fce35841c2b394ea25a26bb (diff) | |
parent | 79a2fb585586e203d6dc76cb38ec3c2d4a27a84a (diff) | |
download | SecureElement-da6daab1ebf75fef31bf78d01f1f1f76903a3f73.tar.gz |
Merge "Allow OpenLogicalChannel with null aid for privilege apps" into rvc-dev
-rw-r--r-- | src/com/android/se/SecureElementService.java | 3 | ||||
-rw-r--r-- | src/com/android/se/Terminal.java | 6 |
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."); } } |