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

Commit e829829d authored by Rajesh Nyamagoud's avatar Rajesh Nyamagoud
Browse files

Restructuring of AAID using aidl_interface build system.

Making changes to use aidl_interface build system in
KeyAttestationApplicationProvider to support Rust, CPP and Java
backends.
Defined AAID interface and its parcelables using AIDL types.
Removed custom parcelables defined for AAID.

Bug: 267452060
Test: atest android.keystore.cts.KeyAttestationTest
Change-Id: Iec558642867c13e2998d7f69f00b3f1adf4e2b62
parent 2bcc7900
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -6301,12 +6301,6 @@ android.security.Scrypt
android.security.attestationverification.AttestationVerificationManager
android.security.keymaster.ExportResult$1
android.security.keymaster.ExportResult
android.security.keymaster.IKeyAttestationApplicationIdProvider$Stub
android.security.keymaster.IKeyAttestationApplicationIdProvider
android.security.keymaster.KeyAttestationApplicationId$1
android.security.keymaster.KeyAttestationApplicationId
android.security.keymaster.KeyAttestationPackageInfo$1
android.security.keymaster.KeyAttestationPackageInfo
android.security.keymaster.KeyCharacteristics$1
android.security.keymaster.KeyCharacteristics
android.security.keymaster.KeymasterArgument$1
@@ -6331,7 +6325,13 @@ android.security.keystore.AttestationUtils
android.security.keystore.BackendBusyException
android.security.keystore.DelegatingX509Certificate
android.security.keystore.DeviceIdAttestationException
android.security.keystore.IKeyAttestationApplicationIdProvider$Stub
android.security.keystore.IKeyAttestationApplicationIdProvider
android.security.keystore.KeyAttestationApplicationId$Stub
android.security.keystore.KeyAttestationApplicationId
android.security.keystore.KeyAttestationException
android.security.keystore.KeyAttestationPackageInfo$Stub
android.security.keystore.KeyAttestationPackageInfo
android.security.keystore.KeyExpiredException
android.security.keystore.KeyGenParameterSpec$Builder
android.security.keystore.KeyGenParameterSpec
@@ -6354,6 +6354,8 @@ android.security.keystore.KeystoreResponse$1
android.security.keystore.KeystoreResponse
android.security.keystore.ParcelableKeyGenParameterSpec$1
android.security.keystore.ParcelableKeyGenParameterSpec
android.security.keystore.Signature$Stub
android.security.keystore.Signature
android.security.keystore.SecureKeyImportUnavailableException
android.security.keystore.StrongBoxUnavailableException
android.security.keystore.UserAuthArgs
+0 −5
Original line number Diff line number Diff line
@@ -31,11 +31,6 @@ filegroup {
    visibility: ["//frameworks/base"],
}

filegroup {
    name: "IKeyAttestationApplicationIdProvider.aidl",
    srcs: ["android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl"],
}

aidl_library {
    name: "IDropBoxManagerService_aidl",
    srcs: [
+0 −32
Original line number Diff line number Diff line
/* //device/java/android/android/view/WindowManager.aidl
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

package android.content.pm;

/* For the key attestation application id provider service we needed a native implementation
 * of the Signature parcelable because the service is used by the native keystore.
 * The native implementation is now located at
 * system/security/keystore/Signature.cpp
 * and
 * system/security/keystore/include/keystore/Signature.h.
 * and can be used by linking against libkeystore_binder.
 *
 * This is not the best arrangement. If you, dear reader, happen to implement native implementations
 * for the package manager's parcelables, consider moving Signature.cpp/.h to your library and
 * adjust keystore's dependencies accordingly. Thank you.
 */
parcelable Signature cpp_header "keystore/Signature.h";
+0 −95
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.security.keymaster;

import android.content.pm.Signature;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @hide
 * This class constitutes and excerpt from the PackageManager's PackageInfo for the purpose of
 * key attestation. It is part of the KeyAttestationApplicationId, which is used by
 * keystore to identify the caller of the keystore API towards a remote party.
 */
public class KeyAttestationPackageInfo implements Parcelable {
    private final String mPackageName;
    private final long mPackageVersionCode;
    private final Signature[] mPackageSignatures;

    /**
     * @param mPackageName
     * @param mPackageVersionCode
     * @param mPackageSignatures
     */
    public KeyAttestationPackageInfo(
            String mPackageName, long mPackageVersionCode, Signature[] mPackageSignatures) {
        super();
        this.mPackageName = mPackageName;
        this.mPackageVersionCode = mPackageVersionCode;
        this.mPackageSignatures = mPackageSignatures;
    }
    /**
     * @return the mPackageName
     */
    public String getPackageName() {
        return mPackageName;
    }
    /**
     * @return the mPackageVersionCode
     */
    public long getPackageVersionCode() {
        return mPackageVersionCode;
    }
    /**
     * @return the mPackageSignatures
     */
    public Signature[] getPackageSignatures() {
        return mPackageSignatures;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mPackageName);
        dest.writeLong(mPackageVersionCode);
        dest.writeTypedArray(mPackageSignatures, flags);
    }

    public static final @android.annotation.NonNull Parcelable.Creator<KeyAttestationPackageInfo> CREATOR
            = new Parcelable.Creator<KeyAttestationPackageInfo>() {
        @Override
        public KeyAttestationPackageInfo createFromParcel(Parcel source) {
            return new KeyAttestationPackageInfo(source);
        }

        @Override
        public KeyAttestationPackageInfo[] newArray(int size) {
            return new KeyAttestationPackageInfo[size];
        }
    };

    private KeyAttestationPackageInfo(Parcel source) {
        mPackageName = source.readString();
        mPackageVersionCode = source.readLong();
        mPackageSignatures = source.createTypedArray(Signature.CREATOR);
    }
}
+31 −0
Original line number Diff line number Diff line
// Copyright 2020, The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

aidl_interface {
    name: "android.security.aaid_aidl",
    srcs: ["android/security/keystore/*.aidl"],
    unstable: true,
    backend: {
        rust: {
            enabled: true,
        },
        cpp: {
            enabled: true,
        },
    },
}
Loading