diff options
author | Martijn Coenen <maco@google.com> | 2013-09-18 17:26:18 +0200 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2013-09-18 17:26:18 +0200 |
commit | fca357877307f307934457165a91a1b11e0b6853 (patch) | |
tree | 51d253f32fa0080dce1d365b5fdb7b070107dd27 /core | |
parent | ab62870c7e787323057d3b16a3ff1fd118fb5925 (diff) | |
download | frameworks_base-fca357877307f307934457165a91a1b11e0b6853.zip frameworks_base-fca357877307f307934457165a91a1b11e0b6853.tar.gz frameworks_base-fca357877307f307934457165a91a1b11e0b6853.tar.bz2 |
Validate AID format and length.
Bug: 10817001
Change-Id: I7cb0d4f718c467d2fccb30068f383f8e71a4a39b
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/nfc/cardemulation/ApduServiceInfo.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/nfc/cardemulation/ApduServiceInfo.java b/core/java/android/nfc/cardemulation/ApduServiceInfo.java index 40a3612..d0feaa3 100644 --- a/core/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/core/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -255,6 +255,10 @@ public final class ApduServiceInfo implements Parcelable { return mRequiresDeviceUnlock; } + public String getDescription() { + return mDescription; + } + public CharSequence loadLabel(PackageManager pm) { return mService.loadLabel(pm); } @@ -287,6 +291,11 @@ public final class ApduServiceInfo implements Parcelable { Log.e(TAG, "AID " + aid + " is not correctly formatted."); return false; } + // Minimum AID length is 5 bytes, 10 hex chars + if (aidLength < 10) { + Log.e(TAG, "AID " + aid + " is shorter than 5 bytes."); + return false; + } return true; } |