I've been working through how TLS1.0 works, and think I've basically understood most of it. One thing I can't seem to find a explanation of though is the order in which MACing and encrypting should happen. Let's say we've got the client finished message. You generate the 12 bytes of verify_data from the master secret, the finished label, and the md5/sha1 hashes of the handshake messages. At that point, do you:
a-> use your MAC key to create a hash of the 12 bytes, tag it onto the end and then encrypt the whole thing with your Write Key, or
b-> use your MAC key to create a hash of the 12 bytes, then use your Write Key to encrypt the 12 bytes, and tag the hash onto the end of the encrypted bytes?