ホーム › Security.Cryptography › NCRYPT_SSL_CIPHER_LENGTHS
NCRYPT_SSL_CIPHER_LENGTHS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbLength | DWORD | 4 | +0 | +0 | この構造体のバイト単位サイズ。 |
| dwHeaderLen | DWORD | 4 | +4 | +4 | 暗号化レコードヘッダーのバイト長。 |
| dwFixedTrailerLen | DWORD | 4 | +8 | +8 | 固定長トレーラ(MAC等)のバイト長。 |
| dwMaxVariableTrailerLen | DWORD | 4 | +12 | +12 | 可変長トレーラ(パディング等)の最大バイト長。 |
| dwFlags | DWORD | 4 | +16 | +16 | 暗号長に関する動作フラグ。 |
各言語での定義
#include <windows.h>
// NCRYPT_SSL_CIPHER_LENGTHS (x64 20 / x86 20 バイト)
typedef struct NCRYPT_SSL_CIPHER_LENGTHS {
DWORD cbLength;
DWORD dwHeaderLen;
DWORD dwFixedTrailerLen;
DWORD dwMaxVariableTrailerLen;
DWORD dwFlags;
} NCRYPT_SSL_CIPHER_LENGTHS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NCRYPT_SSL_CIPHER_LENGTHS
{
public uint cbLength;
public uint dwHeaderLen;
public uint dwFixedTrailerLen;
public uint dwMaxVariableTrailerLen;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NCRYPT_SSL_CIPHER_LENGTHS
Public cbLength As UInteger
Public dwHeaderLen As UInteger
Public dwFixedTrailerLen As UInteger
Public dwMaxVariableTrailerLen As UInteger
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class NCRYPT_SSL_CIPHER_LENGTHS(ctypes.Structure):
_fields_ = [
("cbLength", wintypes.DWORD),
("dwHeaderLen", wintypes.DWORD),
("dwFixedTrailerLen", wintypes.DWORD),
("dwMaxVariableTrailerLen", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
]#[repr(C)]
pub struct NCRYPT_SSL_CIPHER_LENGTHS {
pub cbLength: u32,
pub dwHeaderLen: u32,
pub dwFixedTrailerLen: u32,
pub dwMaxVariableTrailerLen: u32,
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type NCRYPT_SSL_CIPHER_LENGTHS struct {
cbLength uint32
dwHeaderLen uint32
dwFixedTrailerLen uint32
dwMaxVariableTrailerLen uint32
dwFlags uint32
}type
NCRYPT_SSL_CIPHER_LENGTHS = record
cbLength: DWORD;
dwHeaderLen: DWORD;
dwFixedTrailerLen: DWORD;
dwMaxVariableTrailerLen: DWORD;
dwFlags: DWORD;
end;const NCRYPT_SSL_CIPHER_LENGTHS = extern struct {
cbLength: u32,
dwHeaderLen: u32,
dwFixedTrailerLen: u32,
dwMaxVariableTrailerLen: u32,
dwFlags: u32,
};type
NCRYPT_SSL_CIPHER_LENGTHS {.bycopy.} = object
cbLength: uint32
dwHeaderLen: uint32
dwFixedTrailerLen: uint32
dwMaxVariableTrailerLen: uint32
dwFlags: uint32struct NCRYPT_SSL_CIPHER_LENGTHS
{
uint cbLength;
uint dwHeaderLen;
uint dwFixedTrailerLen;
uint dwMaxVariableTrailerLen;
uint dwFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NCRYPT_SSL_CIPHER_LENGTHS サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbLength : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwHeaderLen : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwFixedTrailerLen : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwMaxVariableTrailerLen : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NCRYPT_SSL_CIPHER_LENGTHS
#field int cbLength
#field int dwHeaderLen
#field int dwFixedTrailerLen
#field int dwMaxVariableTrailerLen
#field int dwFlags
#endstruct
stdim st, NCRYPT_SSL_CIPHER_LENGTHS ; NSTRUCT 変数を確保
st->cbLength = 100
mes "cbLength=" + st->cbLength