File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,9 @@ idevid_cert = "default"
263
263
# Use this option to state the existing TPM ownerpassword.
264
264
# This option should be set only when a password is set for the Endorsement
265
265
# Hierarchy (e.g. via "tpm2_changeauth -c e").
266
+ # In order to use a hex value for the password, use the prefix "hex:"
267
+ # For example if tpm2_changeauth -c e "hex:00a1b2c3e4" has run, the config option
268
+ # would be 'tpm_ownerpassword = "hex:00a1b2c3e4"'
266
269
# If no password was set, keep the empty string "".
267
270
#
268
271
# To override tpm_ownerpassword, set KEYLIME_AGENT_TPM_OWNERPASSWORD environment
Original file line number Diff line number Diff line change @@ -295,7 +295,15 @@ async fn main() -> Result<()> {
295
295
// ownership of TPM access, which will not be implemented here.
296
296
let tpm_ownerpassword = & config. agent . tpm_ownerpassword ;
297
297
if !tpm_ownerpassword. is_empty ( ) {
298
- let auth = Auth :: try_from ( tpm_ownerpassword. as_bytes ( ) ) ?;
298
+ let auth = if let Some ( hex_ownerpassword) =
299
+ tpm_ownerpassword. strip_prefix ( "hex:" )
300
+ {
301
+ let decoded_ownerpassword =
302
+ hex:: decode ( hex_ownerpassword) . map_err ( Error :: from) ?;
303
+ Auth :: try_from ( decoded_ownerpassword) ?
304
+ } else {
305
+ Auth :: try_from ( tpm_ownerpassword. as_bytes ( ) ) ?
306
+ } ;
299
307
ctx. as_mut ( ) . tr_set_auth ( Hierarchy :: Endorsement . into ( ) , auth)
300
308
. map_err ( |e| {
301
309
Error :: Configuration ( format ! (
You can’t perform that action at this time.
0 commit comments