Commit Graph

85 Commits

Author SHA1 Message Date
Steven Moreland
3556da3b4a Add include/hardware/*.h symlinks.
These are required to build. Separate CL to preserve blame history.

From running 'update-includes.sh' script here.

Bug: 37280010
Test: boot/build (sanity)
Change-Id: Id9c2dc37f674b27b947a9f823bd38a550d64d31b
2023-06-02 23:01:56 +00:00
Steven Moreland
d783cabd4d Split up headers.
This splits headers into three locations:
include - for backwards compatibility, the global include
include_all - for things system/vendor both use
include_vendor - for things that only vendors use

The goal is to gradually have system things stop referencing
(at least most) of these headers.

Bug: 37280010
Test: build (CL on top adds back in symlinks)

Change-Id: Ibf194276b7faa857e1e7605d7719f4e7d873ecba
2023-06-02 23:01:54 +00:00
Eran Messeri
bd9dcfcf4f Add the second IMEI tag
This CL keeps keymaster_defs.h in sync with the changes to
KeymasterDefs.java.

Bug: 244732345
Test: n/a
Change-Id: I3dbed2c077d74ffd276ea007c165309a61f90992
2022-11-28 12:07:41 +00:00
David Drysdale
635b706889 Add new KeyMint curve enum
Bug: 194358913
Test: VtsAidlKeyMintTargetTest
Change-Id: I6fb21c0662f2c810a086c5146fa3caa51be9464e
2021-12-15 14:56:19 +00:00
Paul Crowley
1f4800f20a Add MAX_BOOT_LEVEL tag, BOOT_LEVEL_EXCEEDED error
Test: Treehugger
Bug: 176450483
Change-Id: Ibfc838496fec507dbe4831e86b933666296a4b35
2021-02-18 09:50:56 -08:00
Shawn Willden
46c5244839 Add ATTEST_KEY
Bug: 171845787
Test: Build
Change-Id: I41451eb35dd0992c049525782e7afb5228ed6b3f
2021-02-11 07:50:39 -07:00
Janis Danisevskis
06cd71d88a Keymint: Add CERTIFICATE_* tags
Add CERTIFICATE_NOT_BEFORE/AFTER and change CERTIFICATE_SERIAL to bignum
type.

Test: N/A
Change-Id: I5b1ed20a9babe8425e98a03637cdc14be842872c
2021-01-31 22:08:17 -08:00
Treehugger Robot
3cd53f9f9d Merge "Add limited use key tag defination." 2021-01-26 23:05:51 +00:00
David Zeuthen
3107e47dfc Add KM_PURPOSE_AGREE_KEY constant.
Test: VtsAidlKeyMintTargetTest
Bug: 171847641
Change-Id: I9e3128652767509911445491248c01953359cb67
2021-01-25 13:23:51 -05:00
Qi Wu
ba765a66c1 Add limited use key tag defination.
Test: none
Change-Id: I5464f6411b8bce94a3736cd033d064e75d313fe1
2021-01-13 22:37:19 +08:00
Chirag Pathak
39fd306e43 Add libhardware support for RSA OAEP MGF1.
Test: atest VtsAidlKeyMintV1_0TargetTest
Bug: 160968519
Change-Id: I2c534d2a9ad401a48451ca392ebf6e0039345de4
2020-12-21 18:45:35 -05:00
Selene Huang
d7dcd78f01 Add new certificate tags defination for KeyMint V1.
Test: n/a
Change-Id: I05f629feec5cd2bd01f03b88cd5d830bb1f22623
2020-11-18 18:14:50 -08:00
Selene Huang
5d3c1ec971 keymaster_defs: Add missing tags added in KM 4.1 and earlier.
Test: N/A
Change-Id: Ie01cbc50d9bc77150adc46962d06cda2a7c1544a
Merged-In: Ie01cbc50d9bc77150adc46962d06cda2a7c1544a
2020-11-03 03:23:13 +00:00
Selene Huang
79a5bd607d Added identity credential key to keymaster tag set.
Bug: 149908474

Test: atest android.security.identity.cts.AttestationTest
Test: atest VtsHalIdentityCredentialTarge
Change-Id: I5a0336692f894580a46d6e70a5b2e2b6d54508e5
2020-02-21 15:58:10 -08:00
Shawn Willden
e59d5b1e2e Add Keymaster4.1 definitions.
Test: VtsHalKeymasterV4_1TargetTest
Change-Id: I501e63a577368d78c609f868e452603b4110a970
2020-02-11 15:51:03 -07:00
Matthew Maurer
581f6f774e Add ROLLBACK_RESISTANCE definition to for KM4
* Add ROLLBACK_RESISTANCE tag
* Add ROLLBACK_RESISTANCE_UNAVAILABLE error code

Test: m libkeymaster_messages
Change-Id: I355ca86741337f86ae3954bed60b7fc061cae9ce
Merged-In: I355ca86741337f86ae3954bed60b7fc061cae9ce
2019-12-11 07:02:18 +00:00
Matthew Maurer
0b9dc0d026 Add KM_TRUSTED_CONFIRMATION_REQUIRED
This was added in KM4, but didn't make it into this header.

Additionally, KM_TAG_UNLOCKED_DEVICE_REQUIRED was squatting on
KM_TRUSTED_CONFIRMATION_REQUIRED's number.

See hardware/interfaces/keymaster/4.0/types.hal for correct numbering.

Bug: 128851722
Test: Keymaster VTS 4.0 + Trusty
Change-Id: I89117ffe91602884edb8dd19ffd22e659f40fb1c
2019-03-26 00:18:24 +00:00
Pirama Arumuga Nainar
e0dc13833f Remove extraneous semicolon
Bug: http://b/122481018

Upcoming clang update has a warning, -Wextra-semi-stmt, that warns about
extra semicolons.  Remove extra semi-colon after an 'if' statement.

Test: Build with new Clang.
Change-Id: I05e7c027126b2ed6e61da8e749bbb813b7afd0e3
2019-01-15 10:31:39 -08:00
Brian Young
8cf2862f94 Add "Unlocked device required" key API
Add a keymaster parameter for keys that should be inaccessible when
the device screen is locked. "Locked" here is a state where the device
can be used or accessed without any further trust factor such as a
PIN, password, fingerprint, or trusted face or voice.

This parameter is added to the Java keystore interface for key
creation and import, as well as enums specified by and for the native
keystore process.

Test: CTS tests in I8a5affd1eaed176756175158e3057e44934fffed

Bug: 67752510

Merged-In: I94d8bc5543d00d28064c6e555b38823b70dbfbe6
Change-Id: I94d8bc5543d00d28064c6e555b38823b70dbfbe6
(cherry picked from commit a47bb10496)
2018-03-28 08:38:57 -07:00
Brian Young
968f997468 Revert "Restore "Add "Unlocked device required" parameter to keys""
This reverts commit a684cb6c2c.

Reason for revert: Regression in creating auth-bound keys

Bug: 73773914

Bug: 67752510

Change-Id: Ib215d63efe442916f90065015a57614b097cd74d
2018-02-23 01:31:34 +00:00
Brian C. Young
a684cb6c2c Restore "Add "Unlocked device required" parameter to keys"
Add a keymaster parameter for keys that should be inaccessible when
the device screen is locked. "Locked" here is a state where the device
can be used or accessed without any further trust factor such as a
PIN, password, fingerprint, or trusted face or voice.

This parameter is added to the Java keystore interface for key
creation and import, as well as enums specified by and for the native
keystore process.

This reverts commit 680068e9f2.

Test: CTS tests in I8a5affd1eaed176756175158e3057e44934fffed

Bug: 67752510

Change-Id: I9f3ea694f676801dc3dd348301544a603574edc7
2018-02-15 11:22:40 -08:00
Brian Young
680068e9f2 Revert "Add "Unlocked device required" parameter to keys"
This reverts commit dc9505de44.

Reason for revert: Build breakages on elfin, gce_x86_phone.

Bug: 72679761
Bug: 67752510
Change-Id: I53d396632b7a23141b755e028342accf6625ca0b
2018-01-30 15:31:29 +00:00
Brian C. Young
dc9505de44 Add "Unlocked device required" parameter to keys
Add a keymaster parameter for keys that should be inaccessible when
the device screen is locked. "Locked" here is a state where the device
can be used or accessed without any further trust factor such as a
PIN, password, fingerprint, or trusted face or voice.

This parameter is added to the Java keystore interface for key
creation and import, as well as enums specified by and for the native
keystore process.

Test: go/asym-write-test-plan

Bug: 67752510

Change-Id: Ic1ec3bde05f8a28e20b9443b7f0078749921f297
2018-01-25 08:43:13 -08:00
TreeHugger Robot
b11abc155b Merge "Add KM_ALGORITHM_TRIPLE_DES to keymaster_defs.h" 2018-01-17 23:14:11 +00:00
Frank Salim
343f309e0a Add KM_PURPOSE_WRAP to keymaster_defs for wrapped key import
AndroidKeymaster depends on keymaster_defs and needs the new
purpose for secure key import.

Test: system/keymaster/tests/android_keymaster_tests

Change-Id: I8ab6d9756689342bc5865861c89c5ccc87179454
2018-01-16 13:43:29 -07:00
Shawn Willden
2b55708fbb Add KM_ALGORITHM_TRIPLE_DES to keymaster_defs.h
Test: system/keymaster unit tests
Change-Id: I1ed56e543b657155c9194bc30616747d51aef7df
2018-01-16 09:08:51 -07:00
Bartosz Fabianowski
81b7b5f68c Add manufacturer and model to device ID attestation
Discussions have shown that in addition to brand, device and product,
we should also allow devices to attest their manufacturer and model.

Bug: 36433192
Test: GTS com.google.android.gts.security.DeviceIdAttestationHostTest

Change-Id: I126003420a93241e04bf18ee7ff8e6aefa5599a8
2017-03-20 14:01:40 +01:00
Frank Salim
38925770ef Revert "Add new purpose to the HAL layer."
This reverts commit ee2f29de40.

Reason for revert: Remove partial support for wrapped key import

Change-Id: Iefb57c910a3d05fa9e2c9660c2ac236c2ecc9cc0
2017-02-16 19:18:19 +00:00
Bartosz Fabianowski
9d2f5b911e Add device id attestation tags
This syncs the keymaster defs with the Keymaster 3.0 HAL definition
after the addition of device id attestation.

Bug: 34597337
Test: CTS CtsKeystoreTestCases and GTS DeviceIdAttestationHostTest

Change-Id: I75a4b7cca6da83b239fba97964415788dbcd8862
2017-01-24 23:07:23 +01:00
Crystal Qin
ee2f29de40 Add new purpose to the HAL layer.
Test: There will be a CTS test CL.
Change-Id: Ic623b7be8949fe0adb3706958a9be59f267057c4
2017-01-03 16:57:21 -08:00
Tucker Sylvestro
0b885c1032 Treat all tags as unsigned when comparing them am: 28a872eb79
am: 8f1436275a

Change-Id: I2b3f571ed02470ab6b1e46f7d239fbd767c68225
2016-10-06 14:40:53 +00:00
Tucker Sylvestro
28a872eb79 Treat all tags as unsigned when comparing them
All tags are presumed to be unsigned, but some of them have signed
representations that are negative.  This caused problems in
AuthorizationSet.Deduplicate, where TAG_APPLICATION_DATA (signed rep
of -1879047492) was being sorted before TAG_INVALID (0), which was
presumed to always be first in the list.

BUG: 30701680
Change-Id: I67047cee21fd7617248022a4674779fe80d5ddfd
2016-10-05 14:39:39 -04:00
Janis Danisevskis
3696685df4 add error code KM_ERROR_ATTESTATION_APPLICATION_ID_MISSING
This error code is required by keystore.

Bug: 22914603
Change-Id: Icda276cb6b6faf2c0bb0c98a3c5700612a92e51b
2016-08-10 09:48:27 +01:00
Janis Danisevskis
b62995e42e add tag KM_TAG_ATTESTATION_APPLICATION_ID
This tag is used by keystore for denoting key attestation
applications IDs

Bug: 22914603
Change-Id: Ie92352686123e0172ca0df20f54059a4c92c319c
2016-08-10 09:48:27 +01:00
Shawn Willden
e366efd5bb Zero length in keymaster_free_param_set.
Change-Id: I0b9999e4c148d70369549cbd2fcdbbff7321a587
2016-03-25 11:39:35 -06:00
Shawn Willden
aeb15d64fc Add keymaster_security_level_t for attestation.
Change-Id: Iffa71e3c285d35c2feafd04e8153306f086a3118
2016-03-25 11:39:35 -06:00
Shawn Willden
3080276974 Remove agree_key and add configure to keymaster2.
Key agreement (ECDH) has been punted from the N release, and a
configuration method has been added to support version binding.

Change-Id: Ia4aeee1bd7ab88cda3b9faa653470e608aa55942
2016-03-25 11:39:29 -06:00
Shawn Willden
7fd11186a6 Add KM_TAG_ATTESTATION_CHALLENGE.
Bug: 22914603
Change-Id: Ibf1341f47ab3cecd4a8e3099b819c5cac0d81b17
2016-02-08 20:07:04 +00:00
Shawn Willden
ef01d97967 Merge "Add KM_TAG_ALLOW_WHILE_ON_BODY." am: f704e8a939
am: b9733d9bff

* commit 'b9733d9bff225ae0b16feeb64283b123225af465':
  Add KM_TAG_ALLOW_WHILE_ON_BODY.
2016-01-28 23:28:10 +00:00
Shawn Willden
71ca0109be Add KM_TAG_ALLOW_WHILE_ON_BODY.
Change-Id: I39ca0eee8be46a6acc65e975aad81d2f2c2aa5b8
2016-01-26 07:34:48 -07:00
Shawn Willden
1227f460ce Merge "Add keymaster2 HAL." am: 0c5612db38
am: 7b4766882d

* commit '7b4766882d1a11a4b87570e7f0b83c5116a64f07':
  Add keymaster2 HAL.
2016-01-25 17:40:10 +00:00
Shawn Willden
cf30fe17fd Add keymaster2 HAL.
Change-Id: Ibfcda30f33077f61e74701fa026983f9e72e140e
2016-01-21 12:19:31 -07:00
Shawn Willden
20e4f8ea3b Merge "ECIES: adding ECIES-KEM" am: 3aa7935ef2 am: 7adb2d457c
am: 2eef78d355

* commit '2eef78d355c62f3e1b5ec626a080a7e3f91257c9':
  ECIES: adding ECIES-KEM
2015-11-23 16:36:47 +00:00
Thai Duong
40d59c8155 ECIES: adding ECIES-KEM
Change-Id: Iea5877eba0a9b13610d3d1b33d04b5657edc3550
2015-11-23 06:41:33 -07:00
Chad Brubaker
a3c0ae16ac Fix benign unsigned overflow
On the last check of the conditional param_count-- causes an unsigned
wrap around. This isn't incorrect but does lead to a false positive with
fsanitize unsigned-integer-overflow

Change-Id: If3eb7a9e248d0404a434de2ead70e8c099e84ddf
2015-08-12 12:46:44 -07:00
Shawn Willden
70335f3d30 Correct keymaster1 documentation.
Bug: 22291207
Change-Id: I130d2ab2110321dc2228d41a154750da3a3f0b75
2015-07-23 12:54:15 -06:00
Shawn Willden
a3f0ab55a7 Add KM_TAG_MIN_MAC_LENGTH.
This allows the binding of minimum length for MACs or tags to HMAC keys
and AEAD symmetric keys.  Later attempts to use these keys with a
shorter MAC or tag specification (provided to begin() with
KM_TAG_MAC_LENGTH) will fail with KM_ERROR_INVALID_MAC_LENGTH.

Bug: 22337277
Change-Id: Ic5292ce01bdd6ecde25aad115e4b407aadc85f23
2015-07-15 10:07:59 -06:00
Shawn Willden
fe6bcfa71d Revert "Revert "Rename keymaster tag types to clarify that integers are unsigned.""
This reverts commit 1fb6c227de.

Change-Id: Iccc8a7ff40a694b1e4420a5de4b847e62289ff42
2015-06-24 20:59:14 +00:00
Shawn Willden
1fb6c227de Revert "Rename keymaster tag types to clarify that integers are unsigned."
This reverts commit 335920edae.

Change-Id: Ib65f744b93ad2b62d5848dcf743397124a08911b
2015-06-24 20:52:32 +00:00
Shawn Willden
335920edae Rename keymaster tag types to clarify that integers are unsigned.
Bug: 22008538
Change-Id: I699a0f03aaf0f9f49a78b310763364fc2fb34c90
2015-06-24 13:26:52 -07:00