Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ jobs:

- name: test SDK
working-directory: ./rust/sdk
run: cargo test --workspace
run: cargo test
--workspace
--exclude vbsenclave-sdk-enclave
--exclude windows-enclave
--exclude sdk_enclave_gen
10 changes: 7 additions & 3 deletions rust/scripts/generate_codegen_crates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ param(
[Parameter(Mandatory = $true)]
[string]$Namespace = "",

[string]$Vtl0ClassName = ""
[string]$Vtl0ClassName = "",

[string]$ImportDirectories = ""
)

$ErrorActionPreference = "Stop"
Expand All @@ -27,7 +29,8 @@ $ErrorActionPreference = "Stop"
--language rust `
--EdlPath $EdlPath `
--VirtualTrustLayer enclave `
--OutputDirectory $EnclaveOutDir
--OutputDirectory $EnclaveOutDir `
--ImportDirectories $ImportDirectories

# Run codegen for the host crate
& $edlCodeGenToolsPath `
Expand All @@ -36,4 +39,5 @@ $ErrorActionPreference = "Stop"
--EdlPath $EdlPath `
--VirtualTrustLayer hostapp `
--Vtl0ClassName $Vtl0ClassName `
--OutputDirectory $HostAppOutDir
--OutputDirectory $HostAppOutDir `
--ImportDirectories $ImportDirectories
33 changes: 25 additions & 8 deletions rust/scripts/sign-enclave.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,37 @@ if (-not (Test-Path $sdkRegPath)) {
throw "Windows SDK not found. Please install the latest Windows 11 SDK."
}

# Read the two important values
# Read the installation folder
$sdk = Get-ItemProperty -Path $sdkRegPath

$installationFolder = $sdk.InstallationFolder
$productVersion = $sdk.ProductVersion

Write-Host "`nAttempting to run veiid.exe and sign enclave DLL using certificate '$CertName'..."

if (-not $installationFolder -or -not $productVersion) {
if (-not $installationFolder) {
throw "Incomplete Windows SDK installation. Please reinstall the latest Windows SDK."
}

# Build full SDK bin path
$sdkBin = Join-Path $installationFolder "bin\$productVersion.0\x64"
# Find an SDK version that has veiid.exe in its bin folder
# List all version folders under bin and find one with veiid.exe
$binRoot = Join-Path $installationFolder "bin"
if (-not (Test-Path $binRoot)) {
throw "Windows SDK bin folder not found at: $binRoot. Please install the latest Windows SDK."
}

if (-not (Test-Path $sdkBin)) {
throw "Windows SDK bin folder not found at: $sdkBin. Please install (or repair) the latest Windows SDK."
$sdkBin = $null
$versionFolders = Get-ChildItem -Path $binRoot -Directory | Sort-Object Name -Descending
foreach ($versionFolder in $versionFolders) {
$candidateBin = Join-Path $versionFolder.FullName "x64"
$candidateVeiid = Join-Path $candidateBin "veiid.exe"
if (Test-Path $candidateVeiid) {
$sdkBin = $candidateBin
Write-Host "Found SDK tools in: $sdkBin"
break
}
}

if (-not $sdkBin) {
throw "Could not find veiid.exe in any SDK version under $binRoot. Please install Windows SDK 10.0.26100.0 or higher."
Comment thread
SohamDas2021 marked this conversation as resolved.
}

# Compute tool paths
Expand Down Expand Up @@ -84,3 +98,6 @@ if ($LASTEXITCODE -ne 0) {
} else {
Write-Host "Enclave DLL signing completed with no warnings."
}

# Exit with success since signing completed (even with warnings)
exit 0
6 changes: 4 additions & 2 deletions rust/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ resolver = "3"
members = [
"crates/libs/sdk-enclave",
Comment thread
SohamDas2021 marked this conversation as resolved.
"crates/libs/sdk-host",
"crates/libs/sdk-enclave/generated/veil_abi_gen",
"crates/libs/sdk-host/generated/veil_abi_gen",
"crates/libs/sdk-enclave/generated/sdk_gen",
"crates/libs/sdk-host/generated/sdk_gen",
"crates/libs/userboundkey-kcm",
"crates/tests/sdk",
"crates/libs/windows-enclave",
Expand All @@ -14,11 +14,13 @@ members = [
edition = "2024"

[workspace.dependencies]
edlcodegen-tools = { git = "https://github.com/microsoft/VbsEnclaveTooling" }
regex = "1.11"
spin = "0.10.0"
userboundkey-kcm = { version = "0.1.0", path = "crates/libs/userboundkey-kcm" }
vbsenclave-sdk-enclave = { version = "0.1.0", path = "crates/libs/sdk-enclave" }
vbsenclave-sdk-host = { version = "0.1.0", path = "crates/libs/sdk-host" }
widestring = { version = "1.1", default-features = false, features = ["alloc"] }
windows = "0.62.2"
windows-bindgen = "0.66.0"
windows-enclave = { version = "0.1.0", path = "crates/libs/windows-enclave" }
Expand Down
6 changes: 3 additions & 3 deletions rust/sdk/crates/libs/sdk-enclave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = { workspace = true }

[dependencies]
sdk_enclave_gen = { path = "./generated/sdk_gen" }
spin = { workspace = true }
veil_abi_enclave_gen = { path = "./generated/veil_abi_gen" }
windows-enclave = {workspace = true }

widestring = { workspace = true }
windows-enclave = { workspace = true }
Loading