Merge "ID attestation: Pass second IMEIs to Keystore" am: bfbf069ee5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2277393 Change-Id: Ic507510d3e6ef3f1a1241d4d99fe0f877b6608b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -126,6 +126,8 @@ public final class KeymasterDefs {
|
|||||||
Tag.BOOT_PATCHLEVEL; // KM_UINT | 719;
|
Tag.BOOT_PATCHLEVEL; // KM_UINT | 719;
|
||||||
public static final int KM_TAG_DEVICE_UNIQUE_ATTESTATION =
|
public static final int KM_TAG_DEVICE_UNIQUE_ATTESTATION =
|
||||||
Tag.DEVICE_UNIQUE_ATTESTATION; // KM_BOOL | 720;
|
Tag.DEVICE_UNIQUE_ATTESTATION; // KM_BOOL | 720;
|
||||||
|
public static final int KM_TAG_ATTESTATION_ID_SECOND_IMEI =
|
||||||
|
Tag.ATTESTATION_ID_SECOND_IMEI; // KM_BYTES | 723;
|
||||||
|
|
||||||
public static final int KM_TAG_NONCE = Tag.NONCE; // KM_BYTES | 1001;
|
public static final int KM_TAG_NONCE = Tag.NONCE; // KM_BYTES | 1001;
|
||||||
public static final int KM_TAG_MAC_LENGTH = Tag.MAC_LENGTH; // KM_UINT | 1003;
|
public static final int KM_TAG_MAC_LENGTH = Tag.MAC_LENGTH; // KM_UINT | 1003;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import android.system.keystore2.KeyEntryResponse;
|
|||||||
import android.system.keystore2.KeyMetadata;
|
import android.system.keystore2.KeyMetadata;
|
||||||
import android.system.keystore2.ResponseCode;
|
import android.system.keystore2.ResponseCode;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -856,6 +857,13 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato
|
|||||||
KeymasterDefs.KM_TAG_ATTESTATION_ID_IMEI,
|
KeymasterDefs.KM_TAG_ATTESTATION_ID_IMEI,
|
||||||
imei.getBytes(StandardCharsets.UTF_8)
|
imei.getBytes(StandardCharsets.UTF_8)
|
||||||
));
|
));
|
||||||
|
final String secondImei = telephonyService.getImei(1);
|
||||||
|
if (!TextUtils.isEmpty(secondImei)) {
|
||||||
|
params.add(KeyStore2ParameterUtils.makeBytes(
|
||||||
|
KeymasterDefs.KM_TAG_ATTESTATION_ID_SECOND_IMEI,
|
||||||
|
secondImei.getBytes(StandardCharsets.UTF_8)
|
||||||
|
));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AttestationUtils.ID_TYPE_MEID: {
|
case AttestationUtils.ID_TYPE_MEID: {
|
||||||
|
|||||||
Reference in New Issue
Block a user