You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found some unexpected results when using the ToString method of Uuid, In both optee_utee and optee_teec:
1. the output formation is different with input
the parse_str method require formation of neither 32 bytes or 36 bytes (just what the uuid crate defined), however, the realization of Display trait of optee_teec::Uuid and optee_utee::Uuid will output a str with 35 bytes.
for example:
fntest(){let uuid_str = "6bfaa402-50ed-42f2-9bde-b2aecfa216c2";let uuid = optee_teec::Uuid::parse_str(uuid_str).unwrap();let uuid_str2 = uuid.to_string();// this is "6bfaa402-50ed-42f2-9bdeb2aecfa216c2", the last "-" is missing}
2. missing the prefix zeros:
the formation teaclave use is "{:x}-{:x}-{:x}-{}", which will get an unexpected result when format number has zeros at front, for example:
I wish we could just produce output string as same as the input string(the 36 bytes format with no missing prefix zeros, as this is how tee-supplicant finds the TA), in short, just change the realization of Display traits, from:
Problem
I found some unexpected results when using the ToString method of Uuid, In both optee_utee and optee_teec:
1. the output formation is different with input
the parse_str method require formation of neither 32 bytes or 36 bytes (just what the uuid crate defined), however, the realization of Display trait of optee_teec::Uuid and optee_utee::Uuid will output a str with 35 bytes.
for example:
2. missing the prefix zeros:
the formation teaclave use is
"{:x}-{:x}-{:x}-{}"
, which will get an unexpected result when format number has zeros at front, for example:the codes will produce:
Suggest Solution
I wish we could just produce output string as same as the input string(the 36 bytes format with no missing prefix zeros, as this is how tee-supplicant finds the TA), in short, just change the realization of Display traits, from:
to
The text was updated successfully, but these errors were encountered: