Merge "Validate AID format and length." into klp-dev

This commit is contained in:
Martijn Coenen
2013-09-18 17:56:02 +00:00
committed by Android (Google) Code Review

View File

@@ -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;
}