Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd3946b3 authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "Remove pybind11 for security" into main

parents 2f9c2808 67acf283
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ LOCAL_host_executables := \
LOCAL_host_python_hci_packets_library := \
	$(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/gd/gd_hci_packets_python3_gen/gen/hci_packets.py

LOCAL_host_python_smp_packets_library := \
	$(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/gd/gd_smp_packets_python3_gen/gen/smp_packets.py

LOCAL_host_python_extension_libraries := \
	$(HOST_OUT_SHARED_LIBRARIES)/bluetooth_packets_python3.so

@@ -94,16 +97,19 @@ $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_executables := $(LOCAL_host_exec
$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_libraries := $(LOCAL_host_libraries)
$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_extension_libraries := $(LOCAL_host_python_extension_libraries)
$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_hci_packets_library := $(LOCAL_host_python_hci_packets_library)
$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_smp_packets_library := $(LOCAL_host_python_smp_packets_library)
$(bluetooth_cert_src_and_bin_zip): PRIVATE_target_executables := $(LOCAL_target_executables)
$(bluetooth_cert_src_and_bin_zip): PRIVATE_target_libraries := $(LOCAL_target_libraries)
$(bluetooth_cert_src_and_bin_zip): $(SOONG_ZIP) $(LOCAL_cert_test_sources) \
		$(LOCAL_host_executables) $(LOCAL_host_libraries) $(LOCAL_host_python_libraries) \
		$(LOCAL_host_python_extension_libraries) \
		$(LOCAL_host_python_hci_packets_library) \
		$(LOCAL_host_python_smp_packets_library) \
		$(LOCAL_target_executables) $(LOCAL_target_libraries)
	$(hide) $(SOONG_ZIP) -d -o $@ \
		-C $(PRIVATE_bluetooth_project_dir) $(addprefix -f ,$(PRIVATE_cert_test_sources)) \
		-C $(dir $(PRIVATE_host_python_hci_packets_library)) -f $(PRIVATE_host_python_hci_packets_library) \
		-C $(dir $(PRIVATE_host_python_smp_packets_library)) -f $(PRIVATE_host_python_smp_packets_library) \
		-C $(HOST_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_host_executables)) \
		-C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_python_extension_libraries)) \
		-P lib64 \
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#   limitations under the License.

import hci_packets as hci
from bluetooth_packets_python3.security_packets import PairingFailedReason
import smp_packets as smp
from blueberry.tests.gd.cert.matchers import SecurityMatchers
from blueberry.tests.gd.cert.metadata import metadata
from blueberry.tests.gd.cert.py_hci import PyHci
@@ -585,7 +585,7 @@ class LeSecurityTest(gd_base_test.GdBaseTestClass):
        # 3. IUT transmits the Pairing Failed command.
        assertThat(self.dut_security.get_bond_stream()).emits(
            SecurityMatchers.BondMsg(BondMsgType.DEVICE_BOND_FAILED, self.cert_address,
                                     int(PairingFailedReason.ENCRYPTION_KEY_SIZE)))
                                     int(smp.PairingFailedReason.ENCRYPTION_KEY_SIZE)))

    @metadata(pts_test_id="SM/SLA/EKS/BI-02-C",
              pts_test_name="IUT Responder, Lower Tester Maximum Encryption Key Size < Min_Encryption_Key_Length")
@@ -622,7 +622,7 @@ class LeSecurityTest(gd_base_test.GdBaseTestClass):
        #3. IUT transmits the Pairing Failed command.
        assertThat(self.cert_security.get_bond_stream()).emits(
            SecurityMatchers.BondMsg(BondMsgType.DEVICE_BOND_FAILED, self.dut_address,
                                     int(PairingFailedReason.ENCRYPTION_KEY_SIZE)))
                                     int(smp.PairingFailedReason.ENCRYPTION_KEY_SIZE)))

    @metadata(pts_test_id="SM/MAS/SCPK/BV-01-C",
              pts_test_name="Passkey Entry, IUT Initiator, Secure Connections – Success")
+16 −12
Original line number Diff line number Diff line
@@ -701,7 +701,6 @@ genrule {
    cmd: "$(location bluetooth_packetgen) --include=packages/modules/Bluetooth/system/gd --out=$(genDir) --num_shards=10 $(in)",
    srcs: [
        "l2cap/l2cap_packets.pdl",
        "security/smp_packets.pdl",
    ],
    out: [
        "l2cap/l2cap_packets_python3.cc",
@@ -715,17 +714,6 @@ genrule {
        "l2cap/l2cap_packets_python3_shard_7.cc",
        "l2cap/l2cap_packets_python3_shard_8.cc",
        "l2cap/l2cap_packets_python3_shard_9.cc",
        "security/smp_packets_python3.cc",
        "security/smp_packets_python3_shard_0.cc",
        "security/smp_packets_python3_shard_1.cc",
        "security/smp_packets_python3_shard_2.cc",
        "security/smp_packets_python3_shard_3.cc",
        "security/smp_packets_python3_shard_4.cc",
        "security/smp_packets_python3_shard_5.cc",
        "security/smp_packets_python3_shard_6.cc",
        "security/smp_packets_python3_shard_7.cc",
        "security/smp_packets_python3_shard_8.cc",
        "security/smp_packets_python3_shard_9.cc",
    ],
}

@@ -847,3 +835,19 @@ genrule {
        "hci_packets.py",
    ],
}

// Generate the python parser+serializer backend for
// smp_packets.pdl.
genrule {
    name: "gd_smp_packets_python3_gen",
    defaults: ["pdl_python_generator_defaults"],
    cmd: "$(location :pdlc) $(in) |" +
        " $(location :pdl_python_generator)" +
        " --output $(out) --custom-type-location blueberry.utils.bluetooth",
    srcs: [
        "security/smp_packets.pdl",
    ],
    out: [
        "smp_packets.py",
    ],
}
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ BT_PACKETS_BASE_SRCS = [
BT_PACKETS_PY3_SRCs = \
  [os.path.join(GD_DIR, "packet/python3_module.cc")] \
  + glob.glob(os.path.join(BT_PACKETS_PY3_GEN_DIR, "l2cap", "*.cc")) \
  + glob.glob(os.path.join(BT_PACKETS_PY3_GEN_DIR, "security", "*.cc"))

bluetooth_packets_python3_module = Extension(
    'bluetooth_packets_python3',
+2 −2
Original line number Diff line number Diff line
@@ -82,8 +82,8 @@ OUT_TARGET="${ANDROID_BUILD_TOP}/out/target"
TEST_CONFIG="${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/blueberry/tests/gd/host_config.yaml"
TEST_FILTER="--presubmit"
TEST_RUNNER="blueberry/tests/gd/gd_test_runner.py"
CPP_BUILD_TARGET="bluetooth_stack_with_facade root-canal bluetooth_packets_python3 gd_hci_packets_python3_gen"
RUST_BUILD_TARGET="bluetooth_with_facades root-canal bluetooth_packets_python3 bt_topshim_facade gd_hci_packets_python3_gen"
CPP_BUILD_TARGET="bluetooth_stack_with_facade root-canal bluetooth_packets_python3 gd_hci_packets_python3_gen gd_smp_packets_python3_gen"
RUST_BUILD_TARGET="bluetooth_with_facades root-canal bluetooth_packets_python3 bt_topshim_facade gd_hci_packets_python3_gen gd_smp_packets_python3_gen"
BUILD_TARGET=$CPP_BUILD_TARGET

CLEAN_VENV=false
Loading