From 7e63bacd15656fb40258bfb5225437e8d164b1f3 Mon Sep 17 00:00:00 2001 From: Dario Gonzalez Date: Fri, 12 Jul 2019 11:54:48 -0700 Subject: [PATCH] fix for newest nightly --- enclave-runner/src/tcs.rs | 6 +++--- sgxs-tools/src/sgx_detect/tests/debug.rs | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/enclave-runner/src/tcs.rs b/enclave-runner/src/tcs.rs index 9c706368..3bd9e74b 100644 --- a/enclave-runner/src/tcs.rs +++ b/enclave-runner/src/tcs.rs @@ -84,13 +84,13 @@ pub(crate) fn coenter( let mut _tmp2: u64; unsafe { - let mut uninit_debug_buf: DebugBuffer; + let mut uninit_debug_buf: std::mem::MaybeUninit; let debug_buf = debug_buf.map(|r| r.borrow_mut()); let debug_buf = match debug_buf { Some(mut buf) => buf.as_mut_ptr(), None => { - uninit_debug_buf = std::mem::uninitialized(); - uninit_debug_buf.as_mut_ptr() + uninit_debug_buf = std::mem::MaybeUninit::uninit(); + uninit_debug_buf.as_mut_ptr() as *mut _ } }; asm!(" diff --git a/sgxs-tools/src/sgx_detect/tests/debug.rs b/sgxs-tools/src/sgx_detect/tests/debug.rs index 99b11832..7eb0fef3 100644 --- a/sgxs-tools/src/sgx_detect/tests/debug.rs +++ b/sgxs-tools/src/sgx_detect/tests/debug.rs @@ -49,26 +49,26 @@ impl DebugSupport for SgxCpuConfiguration { if !Paint::is_enabled() { swcontrol_msg = swcontrol_msg.replace('“', r#"""#).replace('”', r#"""#).into(); } - const SGX_DISABLED: Result> = Ok(EfiSoftwareguardstatus { status: SgxEnableStatus::Disabled }); - const SGX_ENABLED: Result> = Ok(EfiSoftwareguardstatus { status: SgxEnableStatus::Enabled }); - const SGX_SWCONTROL: Result> = Ok(EfiSoftwareguardstatus { status: SgxEnableStatus::SoftwareControlled }); - const SGX_UNKNOWN: Result> = Ok(EfiSoftwareguardstatus { status: SgxEnableStatus::Unknown }); + const SGX_DISABLED: EfiSoftwareguardstatus = EfiSoftwareguardstatus { status: SgxEnableStatus::Disabled }; + const SGX_ENABLED: EfiSoftwareguardstatus = EfiSoftwareguardstatus { status: SgxEnableStatus::Enabled }; + const SGX_SWCONTROL: EfiSoftwareguardstatus = EfiSoftwareguardstatus { status: SgxEnableStatus::SoftwareControlled }; + const SGX_UNKNOWN: EfiSoftwareguardstatus = EfiSoftwareguardstatus { status: SgxEnableStatus::Unknown }; writeln!(out, "Your hardware supports SGX, but it's not enabled.\n")?; match (&inner.efi_status, &inner.efi_epcbios) { - (&SGX_DISABLED, _) => { + (&Ok(SGX_DISABLED), _) => { writeln!(out, "Your BIOS supports SGX, but it's disabled. Reboot your machine and enable SGX in your BIOS.")?; debug_msr = false; }, - (&SGX_ENABLED, _) => { + (&Ok(SGX_ENABLED), _) => { writeln!(out, "Your BIOS says it supports SGX and SGX is enabled, but it's not. Try updating your BIOS to the latest version or contact your BIOS vendor.")?; }, - (&SGX_SWCONTROL, Err(e)) if is_efi_perm_error(&e) => { + (&Ok(SGX_SWCONTROL), Err(e)) if is_efi_perm_error(&e) => { writeln!(out, "Your BIOS says it supports SGX reconfiguration, but the control mechanism could not be accessed due to a permission issue.")?; writeln!(out, "\nWould you like to re-run this program with sudo to try again?\n{}", Paint::red("(not supported yet)"))?; //TODO } - (&SGX_SWCONTROL, Err(_)) => { + (&Ok(SGX_SWCONTROL), Err(_)) => { write!(out, "Your BIOS says it supports SGX reconfiguration, but there is a problem with the control mechanism.")?; writeln!(out, "{}", swcontrol_msg)?; }, @@ -95,7 +95,7 @@ impl DebugSupport for SgxCpuConfiguration { writeln!(out, "BIOS support for SGX could not be determined due to a permission issue.")?; writeln!(out, "\nWould you like to re-run this program with sudo to try again?\n{}", Paint::red("TODO"))?; } - (&SGX_UNKNOWN, Err(_)) | (Err(_), Err(_)) => { + (&Ok(SGX_UNKNOWN), Err(_)) | (Err(_), Err(_)) => { writeln!(out, "BIOS support for SGX could not be determined. Reboot your machine and try to enable SGX in your BIOS. Alternatively, try updating your BIOS to the latest version or contact your BIOS vendor.")?; } }