ホーム › Security.ExtensibleAuthenticationProtocol › EapCredentialTypeData
EapCredentialTypeData
共用体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| username_password | EapUsernamePasswordCredential | 16/8 | +0 | +0 | ユーザー名とパスワードによる資格情報。 |
| certificate | EapCertificateCredential | 32/24 | +0 | +0 | 証明書による資格情報。 |
| sim | EapSimCredential | 8/4 | +0 | +0 | SIMカードによる資格情報。 |
各言語での定義
#include <windows.h>
// EapUsernamePasswordCredential (x64 16 / x86 8 バイト)
typedef struct EapUsernamePasswordCredential {
LPWSTR username;
LPWSTR password;
} EapUsernamePasswordCredential;
// EapCertificateCredential (x64 32 / x86 24 バイト)
typedef struct EapCertificateCredential {
BYTE certHash[20];
LPWSTR password;
} EapCertificateCredential;
// EapSimCredential (x64 8 / x86 4 バイト)
typedef struct EapSimCredential {
LPWSTR iccID;
} EapSimCredential;
// EapCredentialTypeData (x64 32 / x86 24 バイト)
typedef struct EapCredentialTypeData {
EapUsernamePasswordCredential username_password;
EapCertificateCredential certificate;
EapSimCredential sim;
} EapCredentialTypeData;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EapUsernamePasswordCredential
{
public IntPtr username;
public IntPtr password;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EapCertificateCredential
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] public byte[] certHash;
public IntPtr password;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EapSimCredential
{
public IntPtr iccID;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EapCredentialTypeData
{
public EapUsernamePasswordCredential username_password;
public EapCertificateCredential certificate;
public EapSimCredential sim;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EapUsernamePasswordCredential
Public username As IntPtr
Public password As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EapCertificateCredential
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> Public certHash() As Byte
Public password As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EapSimCredential
Public iccID As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EapCredentialTypeData
Public username_password As EapUsernamePasswordCredential
Public certificate As EapCertificateCredential
Public sim As EapSimCredential
End Structureimport ctypes
from ctypes import wintypes
class EapUsernamePasswordCredential(ctypes.Structure):
_fields_ = [
("username", ctypes.c_void_p),
("password", ctypes.c_void_p),
]
class EapCertificateCredential(ctypes.Structure):
_fields_ = [
("certHash", ctypes.c_ubyte * 20),
("password", ctypes.c_void_p),
]
class EapSimCredential(ctypes.Structure):
_fields_ = [
("iccID", ctypes.c_void_p),
]
class EapCredentialTypeData(ctypes.Structure):
_fields_ = [
("username_password", EapUsernamePasswordCredential),
("certificate", EapCertificateCredential),
("sim", EapSimCredential),
]#[repr(C)]
pub struct EapUsernamePasswordCredential {
pub username: *mut core::ffi::c_void,
pub password: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct EapCertificateCredential {
pub certHash: [u8; 20],
pub password: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct EapSimCredential {
pub iccID: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct EapCredentialTypeData {
pub username_password: EapUsernamePasswordCredential,
pub certificate: EapCertificateCredential,
pub sim: EapSimCredential,
}import "golang.org/x/sys/windows"
type EapUsernamePasswordCredential struct {
username uintptr
password uintptr
}
type EapCertificateCredential struct {
certHash [20]byte
password uintptr
}
type EapSimCredential struct {
iccID uintptr
}
type EapCredentialTypeData struct {
username_password EapUsernamePasswordCredential
certificate EapCertificateCredential
sim EapSimCredential
}type
EapUsernamePasswordCredential = record
username: Pointer;
password: Pointer;
end;
EapCertificateCredential = record
certHash: array[0..19] of Byte;
password: Pointer;
end;
EapSimCredential = record
iccID: Pointer;
end;
EapCredentialTypeData = record
username_password: EapUsernamePasswordCredential;
certificate: EapCertificateCredential;
sim: EapSimCredential;
end;const EapUsernamePasswordCredential = extern struct {
username: ?*anyopaque,
password: ?*anyopaque,
};
const EapCertificateCredential = extern struct {
certHash: [20]u8,
password: ?*anyopaque,
};
const EapSimCredential = extern struct {
iccID: ?*anyopaque,
};
const EapCredentialTypeData = extern struct {
username_password: EapUsernamePasswordCredential,
certificate: EapCertificateCredential,
sim: EapSimCredential,
};type
EapUsernamePasswordCredential {.bycopy.} = object
username: pointer
password: pointer
EapCertificateCredential {.bycopy.} = object
certHash: array[20, uint8]
password: pointer
EapSimCredential {.bycopy.} = object
iccID: pointer
EapCredentialTypeData {.bycopy.} = object
username_password: EapUsernamePasswordCredential
certificate: EapCertificateCredential
sim: EapSimCredentialstruct EapUsernamePasswordCredential
{
void* username;
void* password;
}
struct EapCertificateCredential
{
ubyte[20] certHash;
void* password;
}
struct EapSimCredential
{
void* iccID;
}
struct EapCredentialTypeData
{
EapUsernamePasswordCredential username_password;
EapCertificateCredential certificate;
EapSimCredential sim;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; EapCredentialTypeData サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; username_password : EapUsernamePasswordCredential (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; certificate : EapCertificateCredential (+0, 24byte) varptr(st)+0 を基点に操作(24byte:入れ子/配列)
; sim : EapSimCredential (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EapCredentialTypeData サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; username_password : EapUsernamePasswordCredential (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; certificate : EapCertificateCredential (+0, 32byte) varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; sim : EapSimCredential (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global EapUsernamePasswordCredential
#field intptr username
#field intptr password
#endstruct
#defstruct global EapCertificateCredential
#field byte certHash 20
#field intptr password
#endstruct
#defstruct global EapSimCredential
#field intptr iccID
#endstruct
#defstruct global EapCredentialTypeData
#field EapUsernamePasswordCredential username_password
#field EapCertificateCredential certificate
#field EapSimCredential sim
#endstruct
stdim st, EapCredentialTypeData ; NSTRUCT 変数を確保