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

Commit fca35787 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Validate AID format and length.

Bug: 10817001
Change-Id: I7cb0d4f718c467d2fccb30068f383f8e71a4a39b
parent ab62870c
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;
    }