mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
net: tls: Add tls 1.3 support
TLS 1.3 has minor changes from TLS 1.2 at the record layer. * Header now hardcodes the same version and application content type in the header. * The real content type is appended after the data, before encryption (or after decryption). * The IV is xored with the sequence number, instead of concatinating four bytes of IV with the explicit IV. * Zero-padding: No exlicit length is given, we search backwards from the end of the decrypted data for the first non-zero byte, which is the content type. Currently recv supports reading zero-padding, but there is no way for send to add zero padding. Signed-off-by: Dave Watson <davejwatson@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fedf201e12
commit
130b392c6c
6 changed files with 154 additions and 43 deletions
|
@ -73,7 +73,8 @@ static int tls_enc_record(struct aead_request *aead_req,
|
|||
len -= TLS_CIPHER_AES_GCM_128_IV_SIZE;
|
||||
|
||||
tls_make_aad(aad, len - TLS_CIPHER_AES_GCM_128_TAG_SIZE,
|
||||
(char *)&rcd_sn, sizeof(rcd_sn), buf[0]);
|
||||
(char *)&rcd_sn, sizeof(rcd_sn), buf[0],
|
||||
TLS_1_2_VERSION);
|
||||
|
||||
memcpy(iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE, buf + TLS_HEADER_SIZE,
|
||||
TLS_CIPHER_AES_GCM_128_IV_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue