aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2023-02-13 23:53:39 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-02-13 23:53:39 +0000
commitc9ef60d0a9b85b55143a327bcf5a39dd86515b24 (patch)
treee312434e0adea6b7ed603673a173fed684c1f040
parentf1f097f924ac1497cec68b83abfe913f05473307 (diff)
parent47efe57b4e364919f3a664a9abbf099a23a98105 (diff)
downloadopen-dice-c9ef60d0a9b85b55143a327bcf5a39dd86515b24.tar.gz
ANDROID: Introduce libopen_dice_*_baremetal am: 2baf4441a2 am: 47efe57b4e
Original change: https://android-review.googlesource.com/c/platform/external/open-dice/+/2376033 Change-Id: I93439ba5f8ebeee609ef4cf865ad519d368779c0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp52
1 files changed, 43 insertions, 9 deletions
diff --git a/Android.bp b/Android.bp
index 1ec5bbe..984dc4a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -51,8 +51,8 @@ cc_library_headers {
export_include_dirs: ["include/dice/config/boringssl_ecdsa_p384"],
}
-cc_library_static {
- name: "libopen_dice_cbor",
+cc_defaults {
+ name: "libopen_dice_cbor.cc_defaults",
defaults: ["libopen_dice.cc_defaults"],
srcs: [
"src/boringssl_hash_kdf_ops.c",
@@ -60,7 +60,6 @@ cc_library_static {
"src/cbor_cert_op.c",
"src/cbor_ed25519_cert_op.c",
"src/cbor_writer.c",
- "src/clear_memory.c",
"src/dice.c",
"src/utils.c",
],
@@ -72,6 +71,14 @@ cc_library_static {
"libopen_dice_boringssl_ed25519_headers",
"libopen_dice_headers",
],
+}
+
+cc_library {
+ name: "libopen_dice_cbor",
+ defaults: ["libopen_dice_cbor.cc_defaults"],
+ srcs: [
+ "src/clear_memory.c",
+ ],
shared_libs: ["libcrypto"],
}
@@ -100,16 +107,41 @@ cc_library_static {
shared_libs: ["libcrypto"],
}
+// Version of the library missing DiceClearMemory, for baremetal client code.
cc_library_static {
- name: "libopen_dice_bcc",
+ name: "libopen_dice_cbor_baremetal",
+ defaults: ["libopen_dice_cbor.cc_defaults"],
+ allow_undefined_symbols: true,
+ static_libs: ["libcrypto_baremetal"],
+}
+
+cc_defaults {
+ name: "libopen_dice_bcc.cc_defaults",
defaults: ["libopen_dice.cc_defaults"],
srcs: [
"src/cbor_reader.c",
"src/android/bcc.c",
],
- static_libs: ["libopen_dice_cbor"],
- export_static_lib_headers: ["libopen_dice_cbor"],
- shared_libs: ["libcrypto"],
+}
+
+cc_library {
+ name: "libopen_dice_bcc",
+ defaults: ["libopen_dice_bcc.cc_defaults"],
+ export_shared_lib_headers: ["libopen_dice_cbor"],
+ shared_libs: [
+ "libcrypto",
+ "libopen_dice_cbor",
+ ],
+}
+
+cc_library_static {
+ name: "libopen_dice_bcc_baremetal",
+ defaults: ["libopen_dice_bcc.cc_defaults"],
+ export_static_lib_headers: ["libopen_dice_cbor_baremetal"],
+ static_libs: [
+ "libcrypto_baremetal",
+ "libopen_dice_cbor_baremetal",
+ ],
}
cc_library_static {
@@ -302,7 +334,6 @@ rust_defaults {
wrapper_src: "rust/dice.h",
crate_name: "open_dice_cbor_bindgen",
source_stem: "bindings",
- whole_static_libs: ["libopen_dice_cbor"],
// 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
@@ -339,6 +370,7 @@ rust_defaults {
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__"],
}
@@ -348,6 +380,7 @@ rust_bindgen {
"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__",
@@ -360,7 +393,6 @@ rust_defaults {
wrapper_src: "rust/android/bcc.h",
crate_name: "open_dice_bcc_bindgen",
source_stem: "bindings",
- whole_static_libs: ["libopen_dice_bcc"],
// 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
@@ -400,6 +432,7 @@ rust_bindgen {
rustlibs: [
"libopen_dice_cbor_bindgen",
],
+ whole_static_libs: ["libopen_dice_bcc"],
visibility: ["//system/security/diced:__subpackages__"],
}
@@ -412,6 +445,7 @@ rust_bindgen {
rustlibs: [
"libopen_dice_cbor_bindgen_nostd",
],
+ whole_static_libs: ["libopen_dice_bcc_baremetal"],
visibility: [
"//packages/modules/Virtualization:__subpackages__",
"//system/security/diced:__subpackages__",