Get-TlsCipherSuite 输出中的协议字段的值含义是什么?

Get-TlsCipherSuite 输出中的协议字段的值含义是什么?

Powershell 有一个Get-TlsCipherSute返回有关 TLS 可以使用哪些密码的信息的 cmdlet。

输出包括一个Protocols似乎设置为数字数组的字段,例如:

PS C:\>Get-TlsCipherSuite -Name "AES"
KeyType               : 0
Certificate           : ECDSA
MaximumExchangeLength : 65536
MinimumExchangeLength : 0
Exchange              : ECDH
HashLength            : 0
Hash                  :
CipherBlockLength     : 16
CipherLength          : 256
BaseCipherSuite       : 49196
CipherSuite           : 49196
Cipher                : AES
Name                  : TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
Protocols             : {771, 65277}

每个密码套件的字段值的数字含义是什么Protocols(例如771652677)?

笔记:如果你去探索,请注意此命令的输出似乎与 不兼容select,请参阅https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/16511008-get-tlsciphersuite-does-not-output-well-behaved-ob

答案1

它们似乎是TLS 版本字段771 = 0x0303 = TLS_1_2, 和65277 = 0xFEFD = DTLS_1_1。你可以看到类似的常量定义在各种 TLS 库

TLS_VERSIONS = {
    # SSL
    0x0002: "SSL_2_0", # 2
    0x0300: "SSL_3_0", # 768
    # TLS:
    0x0301: "TLS_1_0", # 769
    0x0302: "TLS_1_1", # 770
    0x0303: "TLS_1_2", # 771
    0x0304: "TLS_1_3", # 772
    # DTLS
    0x0100: "PROTOCOL_DTLS_1_0_OPENSSL_PRE_0_9_8f", # 256
    0x7f10: "TLS_1_3_DRAFT_16", # 32528
    0x7f12: "TLS_1_3_DRAFT_18", # 32530
    0xfeff: "DTLS_1_0", # 65279
    0xfefd: "DTLS_1_1", # 65277
}

因此它们很可能代表该密码可用的 TLS/SSL 协议版本。

答案2

TLS_VERSIONS = {
    # SSL
    2       0x0002: "SSL_2_0",
    768     0x0300: "SSL_3_0",
    # TLS:
    769     0x0301: "TLS_1_0",
    770     0x0302: "TLS_1_1",
    771     0x0303: "TLS_1_2",
    772     0x0304: "TLS_1_3",
    # DTLS
    256     0x0100: "PROTOCOL_DTLS_1_0_OPENSSL_PRE_0_9_8f",
    32528   0x7f10: "TLS_1_3_DRAFT_16",
    32530   0x7f12: "TLS_1_3_DRAFT_18",
    65279   0xfeff: "DTLS_1_0",
    65277   0xfefd: "DTLS_1_1",
}

相关内容