|
◆ HITLS_TicketKeyCb
typedef int32_t(* HITLS_TicketKeyCb) (uint8_t *keyName, uint32_t keyNameSize, HITLS_CipherParameters *cipher, uint8_t isEncrypt) |
Obtain and verify ticket_key on the server.
- 注意
- keyName is fixed at 16 bytes, and iv is fixed at 16 bytes. During encryption, the keyName and cipher need to be returned. The encryption type, encryption algorithm, key, iv, and hmacKey need to be filled in. During decryption, the HiTLS transfers the keyName. The user needs to find the corresponding key based on the keyName and return the corresponding encryption type, encryption algorithm, and key. (HiTLS uses the iv value sent by the client, so the iv value does not need to be returned.)
- 参数
-
keyName | [IN/OUT] name values corresponding to aes_key and hmac_key |
keyNameSize | [IN] length of keyName |
cipher | [IN/OUT] Encryption information |
isEncrypt | [IN] Indicates whether to encrypt data. true: encrypt data. false: decrypt data. |
- 返回值
-
TICKET_KEY_RET_NEED_ALERT | : indicates that the function fails to be called. A fatal error occurs. An alert message needs to be sent. TICKET_KEY_RET_FAIL : During encryption, the failure to obtain the key_name is not a fatal error. In this case, the HiTLS sends an empty new session ticket message to the client.During decryption, the key_name matching fails, but it is not a fatal error. If the return value is the same, the HiTLS performs a complete handshake process or uses the session ID to restore the session. TICKET_KEY_RET_SUCCESS : indicates that the encryption is successful. Decryption succeeds. TICKET_KEY_RET_SUCCESS_RENEW : indicates that the encryption is successful. The value is the same as the returned value TICKET_KEY_RET_SUCCESS. If the decryption succeeds and the ticket needs to be renewed or changed, the HiTLS calls the callback again to encrypt the ticket when sending a new session ticket. |
|