Files
MicrOBU/obu-firmware/main/ble_security_policy.hpp
T

14 lines
515 B
C++
Raw Normal View History

#pragma once
#include <cstdint>
namespace microbu::ble {
// BLE needs a configured six-digit station passkey (0 disables BLE). It does not depend on
// secure boot, flash encryption or encrypted NVS: none of them may be enabled by this firmware.
constexpr bool pairing_allowed(std::uint32_t passkey) {
return passkey > 0 && passkey <= 999999;
}
constexpr bool station_link_security_ready(bool encrypted, bool authenticated, std::uint8_t key_size) {
return encrypted && authenticated && key_size == 16;
}
}