Skip to content

[Feature]: Set EFI_TIME in the DBX's EFI_VARIABLE_AUTHENTICATION_2 to the time when the DBX was updated #157

@pbatard

Description

@pbatard

Feature Overview

Per specs, the signed DBXs are of type EFI_VARIABLE_AUTHENTICATION_2 as defined in the EDK2.

This means that, like all EFI_VARIABLE_AUTHENTICATION_2 structures, the signed DBX files start with an EFI_TIME structure that can (should?) be set to the time at which the EFI_VARIABLE_AUTHENTICATION_2 is built.

Looking at the DBX files released in the past few years as well as the secure_boot_default_keys.py in this repository, we see however that the EFI_TIME used in DBXs is always fixed to 2010-03-06 19:17:21 (This is easy to validate by looking at very first bytes of any DBX).

We find this to be problematic because it prevents automated tools dealing with DBXs to validate whether a specific DBX is more recent than another one, or provide feedback to the user with regards to when the DBX was released by simply looking at the file itself. We don't see a valid reason to have the EFI_TIME construct not reflect the time of creation, especially when this seemed the intent of the UEFI specs (or else it wouldn't make sense to add an EFI_TIME struct to EFI_VARIABLE_AUTHENTICATION_2).

Solution Overview

We propose that the following section in scripts/secure_boot_default_keys.py (currently line 288):

    # Microsoft uses "2010-03-06T19:17:21Z" for all secure boot UEFI authenticated variables
    efi_time = EfiTime(time=datetime.datetime(2010, 3, 6, 19, 17, 21))

is changed to:

   efi_time = EfiTime(time=datetime.now())

This way, utilities and people looking at DBXs can immediately determine when exactly they were created, which might also avoid issues with old DBXs being inadvertently used in lieu of newer ones on account that it is not currently possible to validate if a DBX is more recent than another, or matches the release date, by simply looking at the file.

Alternatives Considered

Since we don't really see what prompts the need to use a fixed 15 years old static date, and the request seems easy to implement, we have not considered any alternatives.

Urgency

Low

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

I am willing to submit a PR for this feature, unless someone can justify the need to set the variable authentication of DBXs to the year 2010.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions