I Have a confusion here. From what I know, in TLS1.2, the Client sends Client Hello and then the Server Sends a Server Hello, Certificate(with its public key) and Certificate chain, and then a Server Hello Done.
Then, the Client sends a Client Key exchange with a Pre-Master Secret encrypted with the public key of the server. Both, Client and Server have the Pre-Master Secret, they then generate the Master-Secret through PRF and then the Session keys(Client and Server write HMAC keys, Client and Server Write Encryption keys) again through PRF.
Then Client sends a Change Cipher Spec and then Client Finished message which contains the hash of all the previous handshake messages which is then fed into a PRF with the Master Key and "Client Finished" string literal to generate a Verification Data.
For example, lets say the Cipher Suite used is TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256.
Questions:
Is SHA256 here used to generate the handshake hash from the previous handshake messages messages?
I know that the Verification data is encrypted with the CLient Write Encryption key, but what about the Client Write HMAC key? Isnt that used to generate MAC of the verification data and that is what is encrypted to form Encryption data which is sent to the other side?
Basically, I want to know if CLient Write HMAC key or Server write HMAC key is involved with any of the handshake messages or Finished messages or it is just to generate MAC for the traffic data because I know that the Encryption key is used for the traffic as well as in the Finished message.