Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 807fd044 authored by Martijn Coenen's avatar Martijn Coenen Committed by Android (Google) Code Review
Browse files

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

parents d73d34c8 fca35787
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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;
    }