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

Commit 7c8b795e authored by Karuna Wadhera's avatar Karuna Wadhera Committed by Gerrit Code Review
Browse files

Merge changes from topic "get_attestation_input" into main

* changes:
  Add getSupplementaryAttestationInfo
  Bump KeyMint and Keystore version
parents bbbac2d1 c5fe9b63
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ aconfig_declarations_group {
        "framework-jobscheduler-job.flags-aconfig-java",
        "framework_graphics_flags_java_lib",
        "hwui_flags_java_lib",
        "keystore2_flags_java-framework",
        "power_flags_lib",
        "sdk_sandbox_flags_lib",
        "surfaceflinger_flags_java_lib",
+10 −3
Original line number Diff line number Diff line
@@ -105,7 +105,6 @@ filegroup {
        ":android.hardware.radio.data-V3-java-source",
        ":android.hardware.radio.network-V3-java-source",
        ":android.hardware.radio.voice-V3-java-source",
        ":android.hardware.security.keymint-V3-java-source",
        ":android.hardware.security.secureclock-V1-java-source",
        ":android.hardware.thermal-V2-java-source",
        ":android.hardware.tv.tuner-V2-java-source",
@@ -114,7 +113,6 @@ filegroup {
        ":android.security.legacykeystore-java-source",
        ":android.security.maintenance-java-source",
        ":android.security.metrics-java-source",
        ":android.system.keystore2-V4-java-source",
        ":android.hardware.cas-V1-java-source",
        ":credstore_aidl",
        ":dumpstate_aidl",
@@ -149,7 +147,16 @@ filegroup {
        ":framework-javastream-protos",
        ":statslog-framework-java-gen", // FrameworkStatsLog.java
        ":audio_policy_configuration_V7_0",
    ] + select(release_flag("RELEASE_ATTEST_MODULES"), {
        true: [
            ":android.hardware.security.keymint-V4-java-source",
            ":android.system.keystore2-V5-java-source",
        ],
        default: [
            ":android.hardware.security.keymint-V3-java-source",
            ":android.system.keystore2-V4-java-source",
        ],
    }),
}

java_library {
+2 −0
Original line number Diff line number Diff line
@@ -40035,8 +40035,10 @@ package android.security.keystore {
    method @NonNull public java.util.List<java.security.cert.X509Certificate> getGrantedCertificateChainFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
    method @NonNull public java.security.Key getGrantedKeyFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
    method @NonNull public java.security.KeyPair getGrantedKeyPairFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
    method @FlaggedApi("android.security.keystore2.attest_modules") @NonNull public byte[] getSupplementaryAttestationInfo(int) throws android.security.KeyStoreException;
    method public long grantKeyAccess(@NonNull String, int) throws android.security.KeyStoreException, java.security.UnrecoverableKeyException;
    method public void revokeKeyAccess(@NonNull String, int) throws android.security.KeyStoreException, java.security.UnrecoverableKeyException;
    field public static final int MODULE_HASH = -1879047468; // 0x900002d4
  }
  public class SecureKeyImportUnavailableException extends java.security.ProviderException {
+8 −0
Original line number Diff line number Diff line
@@ -13,5 +13,13 @@ filegroup {
        "**/*.java",
        "**/*.aidl",
    ],
    exclude_srcs: select(release_flag("RELEASE_ATTEST_MODULES"), {
        true: [
            "android/security/KeyStore2HalCurrent.java",
        ],
        default: [
            "android/security/KeyStore2HalLatest.java",
        ],
    }),
    visibility: ["//frameworks/base"],
}
+13 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class KeyStore2 {
        R execute(IKeystoreService service) throws RemoteException;
    }

    private <R> R handleRemoteExceptionWithRetry(@NonNull CheckedRemoteRequest<R> request)
    <R> R handleRemoteExceptionWithRetry(@NonNull CheckedRemoteRequest<R> request)
            throws KeyStoreException {
        IKeystoreService service = getService(false /* retryLookup */);
        boolean firstTry = true;
@@ -369,6 +369,18 @@ public class KeyStore2 {
        }
    }

    /**
     * Returns tag-specific info required to interpret a tag's attested value.
     * @see IKeystoreService#getSupplementaryAttestationInfo(Tag) for more details.
     * @param tag
     * @return
     * @throws KeyStoreException
     * @hide
     */
    public byte[] getSupplementaryAttestationInfo(int tag) throws KeyStoreException {
        return KeyStore2HalVersion.getSupplementaryAttestationInfoHelper(tag, this);
    }

    static KeyStoreException getKeyStoreException(int errorCode, String serviceErrorMessage) {
        if (errorCode > 0) {
            // KeyStore layer error
Loading