Topic: Where and when does the wc_AesGcmEncrypt_ex key gets initialized ?
I am working in the client/server example using TLS 1.3
I want to change the encryption key of the early_data that are sent during the resumption session.
I am running my examples with:
./client -v 4 -r -s -t -0
both client and server.
Therefore, as the documentation says, https://tools.ietf.org/html/rfc8446#section-2.3, "The client uses the PSK to authenticate the server and to encrypt the early data".
I would like to find the exact point where the client uses the PSK to encrypt the early data. I observed that this is done in the function EncryptTLS13 in the tls.c file using the function wc_AesGcmEncrypt_ex, but going there I could observe that the aes->key was already initialized.
So where does the PSK encrypt the early data or how is it used in the aes function?
Additionally, what is the relation of the aadwith the PSK ?