I'm implementing a TLS-like system, which uses ECDHE-RSA-AE-GCM-SHA
, and I've faced two interrogations.
At the end of the handshake ( and before the ChangeCipherSpec
message), both the client and the server have to build the same Pre-Master Secret
.
On what data is based this secret ? Since I haven't found the answer in the RFS's (4492 and 5246), I'd say this :
- the Server Public ECDHE Key (send within
ServerKeyExchange
message) - the Client Public ECDHE Key (sent, ciphered, with the
ClientKeyExchange
message)
It's, for me, the logical components, since Mallory couldn't retrieve the Client Public ECDHE Key, because encrypted with the server PublicKey. If yes, the signature of the ServerkeyExchange
message would be wrong, and the Client would know that attempt.
I'm aware that this isn't a proper justification at all, and, when speaking of cryptography, these kinds of reasoning are bad (when not wrong), but since I haven't found the answer in the RFC, all what's left is here...
And moreover, what algorithm do we use to actually build the Pre-Master secret ? Is it a classical hash function (SHA, ...) ?
I know that SHA
is used for expanding the MasterSecret
(from the random numbers and the Pre-Patser Secret
), but for its little brother I'm in the fog...