In TLS 1.2 the GCM
and SHA-256
in GCM_SHA256
should be seen separately.
GCM is the authenticated mode of operation used for confidentiality and integrity/authenticity of the messages (including the messages containing the data that TLS has been designed to protect).
SHA-256 is a parameter for the HMAC function which is used as PRF (pseudo random function) throughout the protocol.
5. HMAC and the Pseudorandom Function
The TLS record layer uses a keyed Message Authentication Code (MAC)
to protect message integrity. The cipher suites defined in this
document use a construction known as HMAC, described in [HMAC], which
is based on a hash function. Other cipher suites MAY define their
own MAC constructions, if needed.
In addition, a construction is required to do expansion of secrets
into blocks of data for the purposes of key generation or validation.
This pseudorandom function (PRF) takes as input a secret, a seed, and
an identifying label and produces an output of arbitrary length.
In this section, we define one PRF, based on HMAC. This PRF with the
SHA-256 hash function is used for all cipher suites defined in this
document and in TLS documents published prior to this document when
TLS 1.2 is negotiated. New cipher suites MUST explicitly specify a
PRF and, in general, SHOULD use the TLS PRF with SHA-256 or a
stronger standard hash function.
Now because GCM already provides message integrity the HMAC / PRF construction is not needed for that purpose in the ciphersuite.
The HMAC based PRF is however used at other locations:
7.4.9 Finished
...
The Finished message is the first one protected with the just
negotiated algorithms, keys, and secrets. Recipients of Finished
messages MUST verify that the contents are correct. Once a side
has sent its Finished message and received and validated the
Finished message from its peer, it may begin to send and receive
application data over the connection.
...
verify_data
PRF(master_secret, finished_label, Hash(handshake_messages))
[0..verify_data_length-1];
... and ...
8.1. Computing the Master Secret
For all key exchange methods, the same algorithm is used to convert
the pre_master_secret into the master_secret. The pre_master_secret
should be deleted from memory once the master_secret has been
computed.
master_secret = PRF(pre_master_secret, "master secret",
ClientHello.random + ServerHello.random)
[0..47];
Note that TLS 1.2 deviates from the previous versions with regards to this:
1.2. Major Differences from TLS 1.1
- The MD5/SHA-1 combination in the pseudorandom function (PRF) has
been replaced with cipher-suite-specified PRFs. All cipher suites
in this document use P_SHA256.
- The MD5/SHA-1 combination in the digitally-signed element has been
replaced with a single hash. Signed elements now include a field
that explicitly specifies the hash algorithm used.
I've slanted the last sentence because it shows that the hash algorithm used for digital signatures used for authentication may very well differ from the once specified for the PRF in the ciphersuite.