aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Wang <aliceywang@google.com>2023-02-17 20:14:27 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-02-17 20:14:27 +0000
commit9c513b301c0cc94c5a29375fccbe0b727c088e0b (patch)
treeb7f1525834e7a57d28512fba598b4a0f9d413918
parent9172e8e69cc0f36a276b6dffc209310e509ec8a8 (diff)
parentd8deba8bc7e588f785533e169b55852fb971343f (diff)
downloadopen-dice-9c513b301c0cc94c5a29375fccbe0b727c088e0b.tar.gz
[ANDROID] Move open-dice bindgens and bindgen tests next to wrappers am: a873dcf070 am: 1a9fcc06ea am: 0f007f4f3a am: d8deba8bc7aml_hef_341717050aml_hef_341613000aml_hef_341512030aml_hef_341415040aml_hef_341311010aml_hef_341114030android14-mainline-healthfitness-release
Original change: https://android-review.googlesource.com/c/platform/external/open-dice/+/2439496 Change-Id: I92170c343245a9697bc46654df7aec076620f4a4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp191
-rw-r--r--TEST_MAPPING10
-rw-r--r--rust/android/bcc.h17
-rw-r--r--rust/dice.h18
4 files changed, 0 insertions, 236 deletions
diff --git a/Android.bp b/Android.bp
index 984dc4a..a0043a0 100644
--- a/Android.bp
+++ b/Android.bp
@@ -21,18 +21,6 @@ cc_defaults {
],
}
-rust_defaults {
- name: "libopen_dice.rust_defaults",
- defaults_visibility: ["//visibility:private"],
- host_supported: true,
- vendor_available: true,
- apex_available: [
- "//apex_available:platform",
- "com.android.compos",
- "com.android.virt",
- ],
-}
-
cc_library_headers {
name: "libopen_dice_headers",
defaults: ["libopen_dice.cc_defaults"],
@@ -301,182 +289,3 @@ cc_fuzz {
],
shared_libs: ["libcrypto"],
}
-
-rust_defaults {
- name: "libopen_dice_bindgen_nostd.rust_defaults",
- bindgen_flags: [
- "--use-core",
- "--ctypes-prefix=core::ffi",
- "--raw-line=#![no_std]",
- ],
- no_stdlibs: true,
- prefer_rlib: true,
- stdlibs: [
- "libcore.rust_sysroot",
- "libcompiler_builtins.rust_sysroot",
- ],
- target: {
- musl: {
- enabled: false,
- },
- glibc: {
- enabled: false,
- },
- darwin: {
- enabled: false,
- },
- },
-}
-
-rust_defaults {
- name: "libopen_dice_cbor_bindgen.rust_defaults",
- defaults: ["libopen_dice.rust_defaults"],
- wrapper_src: "rust/dice.h",
- crate_name: "open_dice_cbor_bindgen",
- source_stem: "bindings",
-
- // Generate bindings only for the symbols that are actually exported (see exported.map.txt).
- // This makes the generated bindings much more concise and improves compilation
- // time.
- bindgen_flags: [
- "--size_t-is-usize",
- "--rustified-enum DiceConfigType",
- "--rustified-enum DiceMode",
- "--rustified-enum DiceResult",
-
- "--allowlist-function=DiceDeriveCdiPrivateKeySeed",
- "--allowlist-function=DiceDeriveCdiCertificateId",
- "--allowlist-function=DiceMainFlow",
- "--allowlist-function=DiceHash",
- "--allowlist-function=DiceKdf",
- "--allowlist-function=DiceKeypairFromSeed",
- "--allowlist-function=DiceSign",
- "--allowlist-function=DiceVerify",
- "--allowlist-function=DiceGenerateCertificate",
-
- // We also need some constants in addition to the functions.
- "--allowlist-var=DICE_CDI_SIZE",
- "--allowlist-var=DICE_HASH_SIZE",
- "--allowlist-var=DICE_HIDDEN_SIZE",
- "--allowlist-var=DICE_INLINE_CONFIG_SIZE",
- "--allowlist-var=DICE_PRIVATE_KEY_SEED_SIZE",
- "--allowlist-var=DICE_ID_SIZE",
- "--allowlist-var=DICE_PUBLIC_KEY_SIZE",
- "--allowlist-var=DICE_PRIVATE_KEY_SIZE",
- "--allowlist-var=DICE_SIGNATURE_SIZE",
- ],
-}
-
-rust_bindgen {
- name: "libopen_dice_cbor_bindgen",
- defaults: ["libopen_dice_cbor_bindgen.rust_defaults"],
- whole_static_libs: ["libopen_dice_cbor"],
- visibility: ["//system/security/diced:__subpackages__"],
-}
-
-rust_bindgen {
- name: "libopen_dice_cbor_bindgen_nostd",
- defaults: [
- "libopen_dice_cbor_bindgen.rust_defaults",
- "libopen_dice_bindgen_nostd.rust_defaults",
- ],
- whole_static_libs: ["libopen_dice_cbor_baremetal"],
- visibility: [
- "//system/security/diced:__subpackages__",
- "//packages/modules/Virtualization:__subpackages__",
- ],
-}
-
-rust_defaults {
- name: "libopen_dice_bcc_bindgen.rust_defaults",
- defaults: ["libopen_dice.rust_defaults"],
- wrapper_src: "rust/android/bcc.h",
- crate_name: "open_dice_bcc_bindgen",
- source_stem: "bindings",
-
- // Generate bindings only for the symbols that are actually exported (see exported.map.txt).
- // This makes the generated bindings much more concise and improves compilation
- // time.
- bindgen_flags: [
- "--size_t-is-usize",
-
- "--allowlist-function=BccFormatConfigDescriptor",
- "--allowlist-function=BccMainFlow",
- "--allowlist-function=BccHandoverMainFlow",
- "--allowlist-function=BccHandoverParse",
-
- // We also need some constants in addition to the functions.
- "--allowlist-var=BCC_INPUT_COMPONENT_NAME",
- "--allowlist-var=BCC_INPUT_COMPONENT_VERSION",
- "--allowlist-var=BCC_INPUT_RESETTABLE",
-
- // Prevent DiceInputValues from being generated a second time and
- // import it instead from open_dice_cbor_bindgen.
- "--blocklist-type=DiceInputValues_",
- "--blocklist-type=DiceInputValues",
- "--raw-line",
- "pub use open_dice_cbor_bindgen::DiceInputValues;",
-
- // Prevent DiceResult from being generated a second time and
- // import it instead from open_dice_cbor_bindgen.
- "--blocklist-type=DiceResult",
- "--raw-line",
- "pub use open_dice_cbor_bindgen::DiceResult;",
- ],
-
-}
-
-rust_bindgen {
- name: "libopen_dice_bcc_bindgen",
- defaults: ["libopen_dice_bcc_bindgen.rust_defaults"],
- rustlibs: [
- "libopen_dice_cbor_bindgen",
- ],
- whole_static_libs: ["libopen_dice_bcc"],
- visibility: ["//system/security/diced:__subpackages__"],
-}
-
-rust_bindgen {
- name: "libopen_dice_bcc_bindgen_nostd",
- defaults: [
- "libopen_dice_bcc_bindgen.rust_defaults",
- "libopen_dice_bindgen_nostd.rust_defaults",
- ],
- rustlibs: [
- "libopen_dice_cbor_bindgen_nostd",
- ],
- whole_static_libs: ["libopen_dice_bcc_baremetal"],
- visibility: [
- "//packages/modules/Virtualization:__subpackages__",
- "//system/security/diced:__subpackages__",
- ],
-}
-
-rust_test {
- name: "libopen_dice_cbor_bindgen_test",
- srcs: [
- ":libopen_dice_cbor_bindgen",
- ],
- crate_name: "open_dice_cbor_bindgen_test",
- test_suites: ["general-tests"],
- auto_gen_config: true,
- clippy_lints: "none",
- lints: "none",
-}
-
-rust_test {
- name: "libopen_dice_bcc_bindgen_test",
- srcs: [
- ":libopen_dice_bcc_bindgen",
- ],
- crate_name: "open_dice_bcc_bindgen_test",
-
- rustlibs: [
- "libopen_dice_cbor_bindgen",
- ],
-
- test_suites: ["general-tests"],
- auto_gen_config: true,
- clippy_lints: "none",
- lints: "none",
-}
diff --git a/TEST_MAPPING b/TEST_MAPPING
deleted file mode 100644
index 507c7f5..0000000
--- a/TEST_MAPPING
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "presubmit": [
- {
- "name": "libopen_dice_cbor_bindgen_test"
- },
- {
- "name": "libopen_dice_bcc_bindgen_test"
- }
- ]
-}
diff --git a/rust/android/bcc.h b/rust/android/bcc.h
deleted file mode 100644
index 4dfc862..0000000
--- a/rust/android/bcc.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-#pragma once
-
-#include <dice/android/bcc.h>
diff --git a/rust/dice.h b/rust/dice.h
deleted file mode 100644
index 47fe911..0000000
--- a/rust/dice.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-#pragma once
-
-#include <dice/dice.h>
-#include <dice/ops.h>