Merge "Validate AID format and length." into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
807fd04435
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user