Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/src/tee/otp_stubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use super::utee_defines::HW_UNIQUE_KEY_LENGTH;
use crate::tee::TeeResult;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[cfg(all(target_arch = "x86_64", not(feature = "qemu")))]
是不是增加 qemu x86 判断?

#[cfg(target_arch = "x86_64")]
use super::tee_get_sealing_key::vmmcall_get_sealing_key;

#[repr(C)]
pub struct TeeHwUniqueKey {
Expand All @@ -15,5 +17,8 @@ pub struct TeeHwUniqueKey {
// TODO: need to be implement
pub fn tee_otp_get_hw_unique_key(hwkey: &mut TeeHwUniqueKey) -> TeeResult {
hwkey.data.fill(0xAA);
#[cfg(target_arch = "x86_64")]
let _ = unsafe { vmmcall_get_sealing_key(hwkey.data.as_mut_ptr(), HW_UNIQUE_KEY_LENGTH) };

Ok(())
}
Loading
Loading