跳到主要内容

7. Truncated HMAC (截断 HMAC)

TLS 中使用 HMAC 的 cipher suite 通常把 hash function 的完整输出作为 MAC tag. 在受限网络中, 为节省带宽, 双方可能希望把 HMAC 输出截断为 80 bit.

Client MAY 在 extended client hello 中包含 truncated_hmac extension, 且 extension_data MUST 为空. Server MAY 通过在 extended server hello 中返回空 truncated_hmac extension 接受该协商.

如果协商成功且所选 cipher suite 使用 HMAC, client 和 server MUST 在该 session 中使用 truncated HMAC. CipherSpec.hash_size 为 10 octet, 只传输和验证 HMAC 输出的前 10 octet. 该 extension 不影响 handshake PRF 或 key derivation.

协商出的 HMAC 截断大小适用于整个 session, 包括 session resumption.