dmi_hardware_security

Synopsis

#include <opendmi/entity/hardware-security.h>

typedef struct dmi_hardware_security {
    dmi_hardware_security_status_t front_panel_reset;
    dmi_hardware_security_status_t admin_password;
    dmi_hardware_security_status_t keyboard_password;
    dmi_hardware_security_status_t poweron_password;
} dmi_hardware_security_t;

Description

The dmi_hardware_security_t structure holds the decoded hardware security structure (type 24) of SMBIOS: the state of the passwords and of the front panel reset, which the firmware sets for the whole system.

The structure is returned by dmi_entity_info for the structures of type DMI_TYPE(hardware_security) and lives as long as the context it has been decoded in.

Fields

front_panel_reset

State of the front panel reset.

admin_password

State of the administrator password.

keyboard_password

State of the keyboard password.

poweron_password

State of the power-on password.

Examples

dmi_registry_t          *registry = dmi_get_registry(context);
dmi_entity_t            *entity   = dmi_registry_lookup_first(registry,
                                        DMI_TYPE(hardware_security), true);
dmi_hardware_security_t *security = dmi_entity_info(entity,
                                        DMI_TYPE(hardware_security));

if (security != nullptr) {
    const char *state =
        dmi_hardware_security_status_name(security->poweron_password);

    printf("Power-on password: %s\n", state != nullptr ? state : "?");
}

Standards

DMTF SMBIOS Specification (DSP0134), version 2.2 or newer.