summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Janis Danisevskis <jdanis@google.com> 2021-01-25 12:59:39 -0800
committer Janis Danisevskis <jdanis@google.com> 2021-02-04 07:58:39 -0800
commit09fabf025dc99992c6411b6c93a20ee0e1603047 (patch)
treea0e483357daca72a536a8836bef4acb4ba1b3112
parent182e90d1ea5cda262500c73085c17544fb62755d (diff)
Keystore 2.0 SPI: Add NAMESPACE_WIFI.
Test: N/A Bug: 171305388 Change-Id: I9003bb2754c2a09cdac77d86786d2e7d3dc05651
-rw-r--r--core/api/system-current.txt5
-rw-r--r--keystore/java/android/security/keystore/KeyProperties.java15
2 files changed, 20 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index b6b5f35fc3da..d88e5ac7e15d 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -8415,6 +8415,11 @@ package android.security.keystore {
method @Deprecated @NonNull public android.security.keystore.KeyGenParameterSpec.Builder setUid(int);
}
+ public abstract class KeyProperties {
+ field public static final int NAMESPACE_APPLICATION = -1; // 0xffffffff
+ field public static final int NAMESPACE_WIFI = 102; // 0x66
+ }
+
}
package android.security.keystore.recovery {
diff --git a/keystore/java/android/security/keystore/KeyProperties.java b/keystore/java/android/security/keystore/KeyProperties.java
index 014d6882be8d..459c9af27ee8 100644
--- a/keystore/java/android/security/keystore/KeyProperties.java
+++ b/keystore/java/android/security/keystore/KeyProperties.java
@@ -20,6 +20,8 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringDef;
+import android.annotation.SystemApi;
+import android.os.Process;
import android.security.KeyStore;
import android.security.keymaster.KeymasterDefs;
@@ -874,9 +876,18 @@ public abstract class KeyProperties {
* which it must be configured in SEPolicy.
* @hide
*/
+ @SystemApi
public static final int NAMESPACE_APPLICATION = -1;
/**
+ * The namespace identifier for the WIFI Keystore namespace.
+ * This must be kept in sync with system/sepolicy/private/keystore2_key_contexts
+ * @hide
+ */
+ @SystemApi
+ public static final int NAMESPACE_WIFI = 102;
+
+ /**
* For legacy support, translate namespaces into known UIDs.
* @hide
*/
@@ -884,6 +895,8 @@ public abstract class KeyProperties {
switch (namespace) {
case NAMESPACE_APPLICATION:
return KeyStore.UID_SELF;
+ case NAMESPACE_WIFI:
+ return Process.WIFI_UID;
// TODO Translate WIFI and VPN UIDs once the namespaces are defined.
// b/171305388 and b/171305607
default:
@@ -900,6 +913,8 @@ public abstract class KeyProperties {
switch (uid) {
case KeyStore.UID_SELF:
return NAMESPACE_APPLICATION;
+ case Process.WIFI_UID:
+ return NAMESPACE_WIFI;
// TODO Translate WIFI and VPN UIDs once the namespaces are defined.
// b/171305388 and b/171305607
default: