pub struct Keystore {
    pub header: KeystoreHeader,
    pub puf_discharge_time_milliseconds: u32,
    pub activation_code: ActivationCode,
    pub secure_boot_kek: Keycode,
    pub user_key: Keycode,
    pub unique_device_secret: Keycode,
    pub prince_region_0: Keycode,
    pub prince_region_1: Keycode,
    pub prince_region_2: Keycode,
}
Expand description

All the keys :)

We “unroll” the prince_regions array to be able to serialize_with hex_serialize.

Fields

header: KeystoreHeader

The Excel spreadsheet says “Valid Key Sore Header : 0x95959595u”.

Empirically, this value 2509608341 appears as header in the PFR as soon as PUF is enrolled, regardless of number of key codes stored.

UM 11126 says: “Marker. A value of 0x95959595 means that Activation code is valid.”

puf_discharge_time_milliseconds: u32

Excel spreadsheet specifies this interpretation.

Seems this can’t be actually set anywhere.

activation_code: ActivationCode

1192 bytes of data, generated when PUF is enrolled.

secure_boot_kek: Keycode

KEK for secure boot, aka SBKEK.

This is an actual “key encryption key”. The SB2.1 container format uses two “random” firmware encryption and MAC keys, which are stored via AES keywrap with this SBKEK in the container.

user_key: Keycodeunique_device_secret: Keycode

Key intended for use with the “DICE” algorithm, which is a Microsoft standard to ensure devices and their firmware are authentic; based on symmetric cryptography.

prince_region_0: Keycode

Key used when PRINCE is activated for the first PRINCE region (first 256K flash)

prince_region_1: Keycode

Key used when PRINCE is activated for the first PRINCE region (second 256K flash)

prince_region_2: Keycode

Key used when PRINCE is activated for the first PRINCE region (last 128K flash, or more precisely, 119.5K – excluding PFR itself)

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.