On Mon, 2003-12-29 at 18:43, Jostein Tveit wrote: > Ole Hansen <[EMAIL PROTECTED]> writes: > > > I would like to decrypt the Finished message from the client. What > > functions will do here? I have tried with EVP_Decrypt*() but output does > > not make sense. Which key should I pass to EVP_Decrypt*-functions if > > these are to be used? Those from the key block or..? > > You should pass the client or server write key, depending on the > finished message came from the client or server. And if you use > TLS_RSA_WITH_RC4_128_MD5, you have to use the RC4 algorithm. > > When the finished message are decrypted the result will either be > a SSLv3 or TLS hash. Details on the differences can be found in > the standards or in the excellent book SSL and TLS by Eric > Rescorla. > > I don't know what you mean by make sense, but the finished > message is just a hash and will not make sense unless you use the > same algorithm and compute the same hash over the same messages > and compare the results. > > And if you are fiddling with low level SSL, I strongly advice you > to buy Rescorla's book.
Thank you for your reply. I already have the SSL book from Eric Rescorla and it has been a great help. I have tried to decrypt the Finished message and I cannot make it right. >From my network monitor (ethereal) the last packet from the server has 'Change Cipher Spec' and an encrypted handshake message in it. Just as expected. The last message I expect to be the 'Finished' message. It has its own TLS Record Layer indicating that the message is of type 'Handshake (22)', Version TLS 1.0 and a length of 32 bytes. I now pass the 32 bytes (after the 5 bytes Record Layer Header) to my decrypt function and I expected a result that at least had the handshake protocol header as the first 4 bytes indicating the handshake type (20) and length but it is not. Thats what I meant with things not making sense. The result seems to be just as random as the input. I know a hashvalue is part of the Finished message but does it not have a four byte header as well? Maby thats the problem. I have used EVP_Decrypt*-functions to decrypt the Finished message. They are part of openssl-0.9.7c. I think this should be ok but I'm not quite sure how to use them. Not many examples from the openssl documentation. Thanks, and a happy new year. Ole ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]