ホーム › System.Environment › ENCLAVE_IDENTITY
ENCLAVE_IDENTITY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OwnerId | BYTE | 32 | +0 | +0 | エンクレーブの所有者を識別する32バイトID。 |
| UniqueId | BYTE | 32 | +32 | +32 | エンクレーブイメージの一意な測定値(32バイト)。 |
| AuthorId | BYTE | 32 | +64 | +64 | エンクレーブの署名作成者を識別する32バイトID。 |
| FamilyId | BYTE | 16 | +96 | +96 | エンクレーブのファミリーを識別する16バイトID。 |
| ImageId | BYTE | 16 | +112 | +112 | エンクレーブイメージを識別する16バイトID。 |
| EnclaveSvn | DWORD | 4 | +128 | +128 | エンクレーブのセキュリティバージョン番号。 |
| SecureKernelSvn | DWORD | 4 | +132 | +132 | セキュアカーネルのセキュリティバージョン番号。 |
| PlatformSvn | DWORD | 4 | +136 | +136 | プラットフォームのセキュリティバージョン番号。 |
| Flags | DWORD | 4 | +140 | +140 | エンクレーブの属性フラグ(デバッグ可否等)。 |
| SigningLevel | DWORD | 4 | +144 | +144 | イメージの署名レベル。 |
| EnclaveType | DWORD | 4 | +148 | +148 | エンクレーブの種類(SGX/VBS等)。 |
各言語での定義
#include <windows.h>
// ENCLAVE_IDENTITY (x64 152 / x86 152 バイト)
#pragma pack(push, 1)
typedef struct ENCLAVE_IDENTITY {
BYTE OwnerId[32];
BYTE UniqueId[32];
BYTE AuthorId[32];
BYTE FamilyId[16];
BYTE ImageId[16];
DWORD EnclaveSvn;
DWORD SecureKernelSvn;
DWORD PlatformSvn;
DWORD Flags;
DWORD SigningLevel;
DWORD EnclaveType;
} ENCLAVE_IDENTITY;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct ENCLAVE_IDENTITY
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] OwnerId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] UniqueId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] AuthorId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] FamilyId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] ImageId;
public uint EnclaveSvn;
public uint SecureKernelSvn;
public uint PlatformSvn;
public uint Flags;
public uint SigningLevel;
public uint EnclaveType;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure ENCLAVE_IDENTITY
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public OwnerId() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public UniqueId() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public AuthorId() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public FamilyId() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public ImageId() As Byte
Public EnclaveSvn As UInteger
Public SecureKernelSvn As UInteger
Public PlatformSvn As UInteger
Public Flags As UInteger
Public SigningLevel As UInteger
Public EnclaveType As UInteger
End Structureimport ctypes
from ctypes import wintypes
class ENCLAVE_IDENTITY(ctypes.Structure):
_pack_ = 1
_fields_ = [
("OwnerId", ctypes.c_ubyte * 32),
("UniqueId", ctypes.c_ubyte * 32),
("AuthorId", ctypes.c_ubyte * 32),
("FamilyId", ctypes.c_ubyte * 16),
("ImageId", ctypes.c_ubyte * 16),
("EnclaveSvn", wintypes.DWORD),
("SecureKernelSvn", wintypes.DWORD),
("PlatformSvn", wintypes.DWORD),
("Flags", wintypes.DWORD),
("SigningLevel", wintypes.DWORD),
("EnclaveType", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct ENCLAVE_IDENTITY {
pub OwnerId: [u8; 32],
pub UniqueId: [u8; 32],
pub AuthorId: [u8; 32],
pub FamilyId: [u8; 16],
pub ImageId: [u8; 16],
pub EnclaveSvn: u32,
pub SecureKernelSvn: u32,
pub PlatformSvn: u32,
pub Flags: u32,
pub SigningLevel: u32,
pub EnclaveType: u32,
}import "golang.org/x/sys/windows"
type ENCLAVE_IDENTITY struct {
OwnerId [32]byte
UniqueId [32]byte
AuthorId [32]byte
FamilyId [16]byte
ImageId [16]byte
EnclaveSvn uint32
SecureKernelSvn uint32
PlatformSvn uint32
Flags uint32
SigningLevel uint32
EnclaveType uint32
}type
ENCLAVE_IDENTITY = packed record
OwnerId: array[0..31] of Byte;
UniqueId: array[0..31] of Byte;
AuthorId: array[0..31] of Byte;
FamilyId: array[0..15] of Byte;
ImageId: array[0..15] of Byte;
EnclaveSvn: DWORD;
SecureKernelSvn: DWORD;
PlatformSvn: DWORD;
Flags: DWORD;
SigningLevel: DWORD;
EnclaveType: DWORD;
end;const ENCLAVE_IDENTITY = extern struct {
OwnerId: [32]u8,
UniqueId: [32]u8,
AuthorId: [32]u8,
FamilyId: [16]u8,
ImageId: [16]u8,
EnclaveSvn: u32,
SecureKernelSvn: u32,
PlatformSvn: u32,
Flags: u32,
SigningLevel: u32,
EnclaveType: u32,
};type
ENCLAVE_IDENTITY {.packed.} = object
OwnerId: array[32, uint8]
UniqueId: array[32, uint8]
AuthorId: array[32, uint8]
FamilyId: array[16, uint8]
ImageId: array[16, uint8]
EnclaveSvn: uint32
SecureKernelSvn: uint32
PlatformSvn: uint32
Flags: uint32
SigningLevel: uint32
EnclaveType: uint32align(1)
struct ENCLAVE_IDENTITY
{
ubyte[32] OwnerId;
ubyte[32] UniqueId;
ubyte[32] AuthorId;
ubyte[16] FamilyId;
ubyte[16] ImageId;
uint EnclaveSvn;
uint SecureKernelSvn;
uint PlatformSvn;
uint Flags;
uint SigningLevel;
uint EnclaveType;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ENCLAVE_IDENTITY サイズ: 152 バイト(x64)
dim st, 38 ; 4byte整数×38(構造体サイズ 152 / 4 切り上げ)
; OwnerId : BYTE (+0, 32byte) varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; UniqueId : BYTE (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; AuthorId : BYTE (+64, 32byte) varptr(st)+64 を基点に操作(32byte:入れ子/配列)
; FamilyId : BYTE (+96, 16byte) varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; ImageId : BYTE (+112, 16byte) varptr(st)+112 を基点に操作(16byte:入れ子/配列)
; EnclaveSvn : DWORD (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; SecureKernelSvn : DWORD (+132, 4byte) st.33 = 値 / 値 = st.33 (lpoke/lpeek も可)
; PlatformSvn : DWORD (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; Flags : DWORD (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; SigningLevel : DWORD (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; EnclaveType : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ENCLAVE_IDENTITY, pack=1
#field byte OwnerId 32
#field byte UniqueId 32
#field byte AuthorId 32
#field byte FamilyId 16
#field byte ImageId 16
#field int EnclaveSvn
#field int SecureKernelSvn
#field int PlatformSvn
#field int Flags
#field int SigningLevel
#field int EnclaveType
#endstruct
stdim st, ENCLAVE_IDENTITY ; NSTRUCT 変数を確保
st->EnclaveSvn = 100
mes "EnclaveSvn=" + st->EnclaveSvn