Commit graph

11 commits

Author SHA1 Message Date
Luca Stefani
481b5d663b Format Android.bp files with bpfmt
Change-Id: I083e96e3dd94a48ebad473bcfbbb7fcbb89ce466
2024-01-18 08:34:35 +01:00
Shaquille Johnson
718036a8ad [Keystore]Fix abort unsafe check in keystore fuzz
Fuzzer finds issue when checking return message after response code
fails.

```
m -j$(nproc) keystore2_unsafe_fuzzer
adb sync data
adb shell /data/fuzz/${TARGET_ARCH}/keystore2_unsafe_fuzzer/keystore2_unsafe_fuzzer
```

Test: description
Bug: 292231203
Change-Id: I27bdcb91fa05a75239aeeb34d817e4f04387b41f
2023-08-10 15:16:43 +01:00
Andrew Walbran
094a9c4e17 Add safety comments.
These will soon be required by a lint.

Bug: 290018030
Test: m libkeystore2_apc_compat-rust
Change-Id: Ic7e4e62e52d3361af9a275443bf097282a84f034
2023-07-18 15:31:38 +01:00
Charisee
03e0084a39 Change requests for Rust update v1.66.0
error: casting to the same type is unnecessary

Test: ./build.py --lto=thin
Bug: 263153841
Change-Id: Ibf820a90c36c46155d07176b3194b460904140c9
2023-01-25 01:49:59 +00:00
Jeff Vander Stoep
76c0f2874b Remove use of size_t in Rust code
Needed to upgrade bindgen from 0.59.0 to 0.63.0. Resolves the
following errors:

//#[path = "../../../src/options.rs"]
//mod options;

error[E0432]: unresolved import `keystore2_apc_compat_bindgen::size_t`
  --> system/security/keystore2/apc_compat/apc_compat.rs:22:82
   |
22 |     abortUserConfirmation, closeUserConfirmationService, promptUserConfirmation, size_t,
   |
      ^^^^^^ no `size_t` in the root

error[E0412]: cannot find type `size_t` in this scope
  --> system/security/keystore2/apc_compat/apc_compat.rs:79:23
   |
79 |     tbs_message_size: size_t,
   |                       ^^^^^^ not found in this scope

error[E0412]: cannot find type `size_t` in this scope
  --> system/security/keystore2/apc_compat/apc_compat.rs:81:30
   |
81 |     confirmation_token_size: size_t,
   |                              ^^^^^^ not found in this scope

error[E0412]: cannot find type `size_t` in this scope
   --> system/security/keystore2/apc_compat/apc_compat.rs:181:37
    |
181 |                 extra_data.len() as size_t,
    |                                     ^^^^^^ not found in this scope

Test: Treehugger
Change-Id: I848f481627f3c14caa6252eee6b5dd40d2f58eed
2022-12-07 11:57:25 +01:00
Rajesh Nyamagoud
dc4b612793 Changes to adapt ConfirmationUi AIDL interface.
apc_compat module updated to support confirmationui AIDL service without
altering the existing behavior with HIDL service. Higher precedence is
given to AIDL service.

Bug: b/205760172
Test: Run confirmation UI test using CTS Verifier
Change-Id: I0fac9b3a7ea0d4d63cb76111ccd95d52b10a047e
2022-09-29 18:02:05 +00:00
Joel Galenson
733d1d0a8b Add bindgen bindings test
Note that some of these are currently no-op tests that do nothing.
But this makes them future proof in case we add more later.

Test: atest
Change-Id: I22914e36568d5808ab60541354e5585a1aeebd44
2021-08-23 13:47:37 -07:00
Joel Galenson
915d3eae87 Use the new more inclusive command-line options.
Test: Compile
Change-Id: I9443541a912a0e9e718650a2349ba540f3f04958
2021-04-19 09:02:41 -07:00
Bob Badour
4c7858c848 [LSC] Add LOCAL_LICENSE_KINDS to system/security
Added SPDX-license-identifier-Apache-2.0 to:
  fsverity_init/Android.bp
  identity/Android.bp
  keystore/tests/Android.bp
  keystore2/Android.bp
  keystore2/aaid/Android.bp
  keystore2/aidl/Android.bp
  keystore2/apc_compat/Android.bp
  keystore2/selinux/Android.bp
  keystore2/src/crypto/Android.bp
  keystore2/src/km_compat/Android.bp
  ondevice-signing/Android.bp
  provisioner/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  Android.bp
  keystore/Android.bp

Added SPDX-license-identifier-BSD to:
  keystore-engine/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Ic9e19695bd19c3f127dfd545df60e4c9df89af77
2021-02-14 10:37:25 -08:00
Janis Danisevskis
b1673db3e5 Keystore 2.0: Provide confirmation token to operation.
This patch connects the APC manager to the enforment module and
ultimately to the operation, so that the confirmation token can be
delivered to operations that require it.

Also fix a bug in apc_compat.rs.

Test: CtsVerifier
Change-Id: I69b6b08b10f51d255c2d70da3a6354b04f0ce801
2021-02-09 12:10:08 -08:00
Janis Danisevskis
7a1cf38f94 Keystore 2.0: Implement APC service.
This patch implements the Android Protected Confirmation service in
Keystore 2.0. This includes a C++ wrapper around the HIDL confirmationui
interface which will stay a HIDL interface for now.
This patch also includes the new AIDL specification.

This patch lacks death listener registration b/176491050.

Bug: 159341464
Bug: 173546269
Test: None
Change-Id: Ida4af108e86b538ab64d1dea4809cfa3b36f74cd
2020-12-29 11:42:07 -08:00