Add comment on MD5 update that is allowed in FIPS mode
Add a comment detailing why the MD5 connection handshake hash state
is updated even when in FIPS mode, ignoring the s2n_hash_is_available()
check.
@@ -306,6 +306,12 @@ int s2n_conn_set_handshake_type(struct s2n_connection *conn)
static int s2n_conn_update_handshake_hashes(struct s2n_connection *conn, struct s2n_blob *data)
{
+ /* The handshake MD5 hash state will fail the s2n_hash_is_available() check
+ * since MD5 is not permitted in FIPS mode. This check will not be used as
+ * the handshake MD5 hash state is specifically used by the TLS 1.0 and TLS 1.1
+ * PRF, which is required to comply with the TLS 1.0 and 1.1 RFCs and is approved
+ * as per NIST Special Publication 800-52 Revision 1.
+ */
GUARD(s2n_hash_update(&conn->handshake.md5, data->data, data->size));
if (s2n_hash_is_available(S2N_HASH_MD5_SHA1)) {
