In newer versions of libc++, std::char_traits<T> is no longer defined
for non-character types, and a result, std::basic_string<uint8_t> is
also no longer defined. See
https://discourse.llvm.org/t/deprecating-std-string-t-for-non-character-t/66779.
Bug: 175635923
Test: make checkbuild
Change-Id: Icb3937d8b1ff6dbe7e35e62f2e6cc1e2eb789121
The following are the updates to the fuzzer:
1. Randomized order of apis.
Test: ./keymaster4_utils_fuzzer
exec/s: 4950
Bug: 302149569
Change-Id: Ie5d80a4e1d28ddd76a9c16609d20995d93710965
std::unique consolidates the unique nonces at the start of the `nonces`
vector, but it doesn't modify nonces.size(), so these tests weren't
actually verifying that the nonces were unique. Add a vector::erase
call to shrink the vector.
After upgrading libc++, std::unique is [[nodiscard]] and this bug is
a compiler error.
Bug: 175635923
Test: treehugger
Test: m VtsAidlSharedSecretTargetTest VtsHalKeymasterV4_0TargetTest
Change-Id: I7fd8c40a3920bf3a8988c8065503c78ba36dc742
ROT was previously parsed into local variable, then discarded.
Fix it so that we are actually using parsed values.
Bug: 283892150
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I8af439d6262141648b01f1accaa9eb739fea85f8
Reaching into the struct will fail to build in the future when we make
the struct opaque. Use the public APIs instead.
Test: mm, treehugger
Change-Id: I78cbf5e66f0c4a891049edd187c8705ad163f658
Add tests for device locked state, verfied boot state and VBMeta digest.
Bug: 255344624
Test: VtsHalKeymasterV4_0TargetTest against default impl of KM 4
Change-Id: I46e62ab9031d3745f99bd214f9e579e80edc9128
Apply the same fix as https://r.android.com/2462896 to
keymaster/4.0/vts/performance/Benchmark.cpp
Test: presubmit
Bug: 271241374
Change-Id: Ib0d2a3a523491d0522f5b3dd031cdde46f88a165
SM8550 doesn't support Keymint2.0, per the discussion in b/
add an exception in the test case when SM8550 is detected.
Bug: b/245649355
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I788a80c0f9b011f73aac9a8c4774e70e203ac3d6
Check if the zero input data with AES-CBC-[NONE|PKCS7] padding mode
generates correct output data and length.
Bug: 200553873
Test: VtsHalKeymasterV4_0TargetTest, VtsAidlKeyMintTargetTest
Merged-In: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
Change-Id: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
The AesEcbPkcs7PaddingCorrupted test has been incorrect since it was
originally introduced -- it was feeding the original message as input to
the decryption operation, rather than the corrupted ciphertext. As a
result, the expected error code was also wrong -- INVALID_INPUT_LENGTH
is appropriate for a too-short cipher text (length 1 in this case),
whereas a corrupt-but-correct-length cipher text should give
INVALID_ARGUMENT.
Fix the test, and add a separate test to cover what was inadvertently
being tested before. Add a sentence to the HAL spec to describe what
expected and tested by CTS/VTS.
Bug: 194126736
Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Change-Id: Iaa5e42768814197f373797831093cf344d342b77
Bug: http://b/197965342
Remove unnecessary `static_libs` dependencies or move them to
`shared_libs` to build with upstream LLD. See b/197965342#comment1
(internal) for rationale. Some info is available externally at
https://github.com/llvm/llvm-project/issues/42899.
Per go/android-lld-static-lib-fix, OWNERS are added for visibility. No
action is needed if the change looks good. This change will be merged
after two business days with Global Approvers.
Test: Build modules with aosp/2036867 in addition to presubmit
Change-Id: I6b607969ab89605d392344d307f5deeb883d4191
Change Id62fdce65131ee00c88e5849955a937f1c171748 split up the AES
incremental encryption tests into individual tests for each encryption
mode. This meant that each generated key is only valid for a single
mode, which in turn means that for non-GCM mode keys it is not valid
to specify MIN_MAC_LENGTH.
Bug: 223934835
Test: VtsAidlKeyMintTargetTest
Change-Id: I38f34f60116bde3d23f203365d62e5b25d7b254b
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
the following settings:
TIDY_TIMEOUT=90
WITH_TIDY=1
CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
tidy_timeout_srcs files will not be compiled by clang-tidy.
When developers build locally without TIDY_TIMEOUT,
tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
or disable some time consuming checks, and then
enable clang-tidy to run within limited time.
Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
The Key{Mint,Master} spec previously said that RSA-PSS mode should use
SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets
specified as the main digest.
However, both the reference implementation and the VTS/CTS tests
use BoringSSL's defaults, which is to re-use the main digest as the MGF1
digest if none is separately specified.
Given that this behaviour is embedded in many implementations over
several years (and given that there isn't a security implication),
change the spec to match this behaviour. Also update the VTS test
code to make this clear/obvious.
Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Bug: 210424594
Merged-In: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
On a bramble device, observed a crash in the VTS binary itself when
executing BoringSSL signature verification code locally (i.e. with no
KeyMaster interaction involved).
The crash call stack involves CFI checks, and seems to occur at the
point when some BoringSSL digest calculation code invokes a function
pointer.
- SHA1_Update passes &sha1_block_data_order to (inlined)...
- crypto_md32_update() which invokes the function pointer
via its block_func parameter.
Moving the BoringSSL dependency from static_libs: libcrypto_static to
shared_libs: libcrypto makes the crash go away, but a smaller change
that also fixes the problem is to disable CFI checks for the test
binary.
This approach was inspired by:
ab65cd0e89%5E%21/#F0
The same problem looks to be relevant for the bugs listed below.
Bug: 206496340
Bug: 206498742
Test: VtsHalKeymasterV4_0TargetTest --gtest_filter="*VerificationOperationsTest.RsaAllPaddingsAndDigests*"
Change-Id: I12b145dad5535846d68c97954d31a93123bb95e7
Transfer the fix in http://aosp/1745035 from the KeyMint VTS test back
into the keymaster VTS test.
Bug: 189261752
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I5f0a69255cfe980dd6e71fa29ff06a84cb668f6d
Each VTS module is required to have OWNERS file. The ownership is based on
go/vts-owners. For more information about ownership policy, please visit
go/xts-owners-policy.
Test: Tree Hugger
Bug: 143903671
Change-Id: I4328efc697dafa313fd685f12d867006b8b332ee
This reverts commit eb8b0577e8.
Reason for revert: Broke a different TEE implementation
Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
Merged-In: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.
Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: Ic0ff19d2d19d6e18dfbc0fad4b8182264f36b2f6
This reverts commit eb8b0577e8.
Reason for revert: Broke a different TEE implementation
Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.
Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: I1a27a0d61e5247ad90c8f5b1423f2a1567016bac
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.
Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: I1a27a0d61e5247ad90c8f5b1423f2a1567016bac
Commit f18a8328a1 ("keymaster: Relax testing under GSI") disabled
some tag checks for devices running with GSI, but detected GSI by
looking for an absence of the ro.boot.vbmeta.device_state property.
This property is currently present on GSI, so instead detect GSI using
the existing is_gsi() helper, which checks ro.product.system.name
against "mainline".
Bug: 192513934
Test: atest VtsHalKeymasterV4_0TargetTest:PerInstance/AttestationTest
Merged-In: If3c7d84a9e091b9b0842e4d8919453600bc239ea
Change-Id: If3c7d84a9e091b9b0842e4d8919453600bc239ea
Commit f18a8328a1 ("keymaster: Relax testing under GSI") disabled
some tag checks for devices running with GSI, but detected GSI by
looking for an absence of the ro.boot.vbmeta.device_state property.
This property is currently present on GSI, so instead detect GSI using
the existing is_gsi() helper, which checks ro.product.system.name
against "mainline".
Bug: 192513934
Test: atest VtsHalKeymasterV4_0TargetTest:PerInstance/AttestationTest
Change-Id: If3c7d84a9e091b9b0842e4d8919453600bc239ea
Ignore-AOSP-First: manual merge to aosp/master to follow
Check that the various ATTESTATION_ID_* tags are included if they
have the correct value, and that keygen fails if they have an invalid
value.
Also fix the support libraries to add the missing fields to the ASN.1
schema and fix the existing ordering.
Bug: 190757200
Test: VtsHalKeymasterV4_1TargetTest, VtsHalKeymasterV4_0TargetTest
Merged-In: I11d28d71676d44ebdc79b25b2eb70947022bb1cf
Ignore-AOSP-First: to be cross-merged manually
Change-Id: I5e19880bbc9e2e667f1204bdc2247ae53a3dada7