<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>.:SSLFail:. &#187; SSL Facts</title>
	<atom:link href="http://www.sslfail.com/category/ssl-facts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sslfail.com</link>
	<description>1.2.840.113549.1.1</description>
	<lastBuildDate>Sat, 24 Jul 2010 14:50:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSLv3 Traces [Part 2]</title>
		<link>http://www.sslfail.com/2009/02/sslv3-traces-part-2/</link>
		<comments>http://www.sslfail.com/2009/02/sslv3-traces-part-2/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 05:03:15 +0000</pubDate>
		<dc:creator>jgraver</dc:creator>
				<category><![CDATA[SSL Facts]]></category>
		<category><![CDATA[0x00]]></category>

		<guid isPermaLink="false">http://www.sslfail.com/?p=250</guid>
		<description><![CDATA[This SSL Packet Trace is based on the Server View found here. My goal is to add useful hash information to the packet dump which in its original form only contained the state register values.
These are the starting values for your MD5 and SHA-1 Hash Objects.
State = useless
Hash = digest() of all handshake data seen [...]]]></description>
			<content:encoded><![CDATA[<p>This SSL Packet Trace is based on the Server View found <a href="http://www.mozilla.org/projects/security/pki/nss/ssl/traces/trc-srv-us.html">here</a>. My goal is to add useful hash information to the packet dump which in its original form only contained the state register values.</p>
<p>These are the starting values for your MD5 and SHA-1 Hash Objects.<br />
State = useless<br />
Hash = digest() of all handshake data seen so far<br />
Buf Hash = digest() of all 64 byte blocked handshake data<br />
Buffered Data = 63 or less bytes of data waiting to be added to the hashes</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Starting Values [0]<br />
MD5 State:      67452301efcdab8998badcfe10325476<br />
SHA State:      67452301efcdab8998badcfe10325476c3d2e1f0<br />
MD5 Hash:       d41d8cd98f00b204e9800998ecf8427e<br />
SHA Hash:       da39a3ee5e6b4b0d3255bfef95601890afd80709<br />
Buf MD5 Hash:   d41d8cd98f00b204e9800998ecf8427e<br />
Buf SHA Hash:   da39a3ee5e6b4b0d3255bfef95601890afd80709<br />
Buffered Data [0]</div></div>
<p>Now each handshake section of the packet is added to the hash objects in 64 byte blocks. If you do not yet have 64 bytes to add you simply hold onto them in a buffer.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Client Hello [52]<br />
MD5 State:      67452301efcdab8998badcfe10325476<br />
SHA State:      67452301efcdab8998badcfe10325476c3d2e1f0<br />
MD5 Hash:       56d14200dd0dc905d876474c98ac2e0e<br />
SHA Hash:       677664bb8d411d0f757f593dfb2509194274177b<br />
Buf MD5 Hash:   d41d8cd98f00b204e9800998ecf8427e<br />
Buf SHA Hash:   da39a3ee5e6b4b0d3255bfef95601890afd80709<br />
Buffered Data [52]<br />
01 03 00 00 1b 00 00 00  10 01 00 80 03 00 80 06  ................<br />
00 40 07 00 c0 00 00 04  00 00 0a 00 00 09 00 00  .@..............<br />
03 00 00 06 d8 90 d7 86  4e 5c 92 9f 90 07 da 83  ........N\......<br />
1c 25 89 01                                       .%..</div></div>
<p>While the hash states listed in the original packet traces were useless the buffered data was pretty handy, it was a clear indication of what pieces to add to the hash objects. In this packet we add 74 more bytes to the 52 we had saved up from before. After using up the first 64 bytes we are left with 62 left over.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Server Hello [74]<br />
MD5 state:      88c9b8dfc144c3163d5f0a6f5c8050c2<br />
SHA state:      626c5d48a75e632814b572a7a634256195d4b038<br />
MD5 Hash:       613d367016bd9df00fa25e8761c0af57<br />
SHA Hash:       bbf09b7676a261bb679cd618919450e14a62aec7<br />
Buf MD5 Hash:   5e612aa87f6994fb836aba168af7eb10<br />
Buf SHA Hash:   34d1303dde2ff4f0bfede8a22e8307fcb7a297bf<br />
Buffered Data [62]<br />
ce e0 92 9c ff 03 be d3  c5 25 a2 ec 61 85 b1 ea  .........%..a...<br />
93 bf a0 5e a9 79 1c 8a  ed 16 20 00 00 4f 47 95  ...^.y.... ..OG.<br />
8f 49 f8 7b d8 41 71 5f  36 f9 6f 7d a2 31 fa 25  .I.{.Aq_6.o}.1.%<br />
07 8e 45 3c 0e d9 e7 d4  d2 86 5c 00 04 00        ..E&amp;lt;......\...</div></div>
<p>This is where the packets start getting really long. Although the certificates are long (and very complicated) they are one of the very few SSL packets with ASCII printable text. When looking at a packet dump these are the most recognizable packets of an SSL transaction.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Server Certificate [1331]<br />
MD5 state:      9cbff56d42b7e94ef4ff1acf323703fa<br />
SHA state:      bb19323f4e8e5ab8b1cbe0a2687c706bd8f29c00<br />
MD5 Hash:       1c0168d2bf58b931d3900e043b3d0811<br />
SHA Hash:       192cd1976ae06f563062c05744ab632aebd54226<br />
Buf MD5 Hash:   658a2e15ea5d2bd02b3b8c19b91bb8ff<br />
Buf SHA Hash:   ee8d3d2e7c232414b45c2d94045abfbe4d78f2f9<br />
Buffered Data [49]<br />
a7 62 b3 5b 8e 4d 82 bd  4d 85 eb 0d 5a 87 c0 41  .b.[.M..M...Z..A<br />
c9 a6 c2 69 9c ee 81 49  2a fb 01 55 6f b1 df 21  ...i...I*..Uo..!<br />
a7 b0 70 e4 5d 34 3b 90  29 f9 14 c3 2e 07 79 13  ..p.]4;.).....y.<br />
c7                                                .</div></div>
<p>The following packet is where this demo trace really goes off the rails. Netscape chose to illustrate one of the more complicated capabilities of SSL. Although client side certificates are essential to SSL VPN connections, they are very seldom seen in standard HTTPS sessions.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Server Certificate Request [4846]<br />
MD5 state: &nbsp; &nbsp; &nbsp;8e428cd82e39d5b55907f503aba04860<br />
SHA1 state: &nbsp; &nbsp; c6a44cb5395684f2bd4f6340a9e71646f27f44a1<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; 944f3c49e385599172d9c418a93c4bf0<br />
SHA Hash: &nbsp; &nbsp; &nbsp; 274b63fb35c478f7358e9f2b5334cb17c96728c5<br />
Buf MD5 Hash: &nbsp; 54c0082e941319cb5aea8683d83f745a<br />
Buf SHA Hash: &nbsp; 54b3a5bd49a6d2b8c2265d4166bf5feb2b17a1f4<br />
Buffered Data [31]<br />
&nbsp;1e 30 1c 06 03 55 04 03 &nbsp;14 15 47 65 74 20 53 6d &nbsp;.0...U....Get Sm<br />
&nbsp;61 72 74 63 61 72 64 20 &nbsp;44 65 6d 6f 20 43 41 &nbsp; &nbsp; artcard Demo CA</div></div>
<p>Finally we get to the Server Hello Done message.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Server Hello Done [4]<br />
MD5 state: &nbsp; &nbsp; &nbsp;8e428cd82e39d5b55907f503aba04860<br />
SHA state: &nbsp; &nbsp; &nbsp;c6a44cb5395684f2bd4f6340a9e71646f27f44a1<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; d100fddd68dc017674a40f3cc28921d4<br />
SHA Hash: &nbsp; &nbsp; &nbsp; 4bd7ccd3e58633b629e2bb2f51cc90aa0973d9b4<br />
Buf MD5 Hash: &nbsp; 54c0082e941319cb5aea8683d83f745a<br />
Buf SHA Hash: &nbsp; 54b3a5bd49a6d2b8c2265d4166bf5feb2b17a1f4<br />
Buffered Data [35]<br />
&nbsp;1e 30 1c 06 03 55 04 03 &nbsp;14 15 47 65 74 20 53 6d &nbsp;.0...U....Get Sm<br />
&nbsp;61 72 74 63 61 72 64 20 &nbsp;44 65 6d 6f 20 43 41 0e &nbsp;artcard Demo CA.<br />
&nbsp;00 00 00 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...</div></div>
<p>Client sends its identity to the Server. This step is not commonly seen.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Client Certificate [1330]<br />
MD5 state: &nbsp; &nbsp; &nbsp;87508b0c13815c09c8c3d6e1c21acdea<br />
SHA state: &nbsp; &nbsp; &nbsp;5cfaa109407fc96ac3ca17120fdb98899772153a<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; b508728fb32560bcd8d4dce42cea601e<br />
SHA Hash: &nbsp; &nbsp; &nbsp; b6dbc745718ed93d8ad2237b2e2aea8d73cfd3a5<br />
Buf MD5 Hash: &nbsp; b7bb5762de2898dd0b995e91f9c30e85<br />
Buf SHA Hash: &nbsp; eba03e1be44f281b97b0b709316a916353be3da8<br />
Buffered Data [21]<br />
&nbsp;6f b1 df 21 a7 b0 70 e4 &nbsp;5d 34 3b 90 29 f9 14 c3 &nbsp;o..!..p.]4;.)...<br />
&nbsp;2e 07 79 13 c7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;..y..</div></div>
<p>Now here is the first packet with actual encryption. This packet contains the pre-master secret that has been asymmetrically encrypted with the server&#8217;s public key. This pre-master secret will be used to calculate the symmetric key. I will focus on this packet in a future post as it is very interesting.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Client Key Exchange [68]<br />
MD5 state: &nbsp; &nbsp; &nbsp;250fb55d512afd7f4854468080c702a9<br />
SHA state: &nbsp; &nbsp; &nbsp;cf323bf6a3ca8feb6b10e4f5101104276472968d<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; 54eb606b1f4352c10c52d240091602b7<br />
SHA Hash: &nbsp; &nbsp; &nbsp; 65141df5f72d09f62828f95ed8de803e0a009716<br />
Buf MD5 Hash: &nbsp; b699de2ef33abd107ede96e69faf64a7<br />
Buf SHA Hash: &nbsp; b91d39ce7f125cf8f7b1996607478c4f618a6616<br />
Buffered Data [25]<br />
&nbsp;88 a4 60 56 61 57 c9 4f &nbsp;5e 3a 1f f2 86 12 16 38 &nbsp;..`VaW.O^:.....8<br />
&nbsp;36 1c 3d c6 b8 0a 3f bd &nbsp;88 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6.=...?..</div></div>
<p>Certificate Verify message &#8211; not commonly seen as client authentication is rare.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Certificate Verify [70]<br />
MD5 state: &nbsp; &nbsp; &nbsp;0cde7c7c27e9771142037f53633d4736<br />
SHA state: &nbsp; &nbsp; &nbsp;f6b217ec76f0d9ddda324813462ca026fe925ba3<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; f92d49e65ac3d9a74de397f064db1adf<br />
SHA Hash: &nbsp; &nbsp; &nbsp; 69c1b5559a70c2c489b57b4b9ba0e4c93c7b667c<br />
Buf MD5 Hash: &nbsp; b6ec7929879ba9b378fe4081442940d9<br />
Buf SHA Hash: &nbsp; 45848df7885b538bd7c0df282a8701fb1ccfaf6f<br />
Buffered Data [31]<br />
&nbsp;77 28 96 8e b5 61 74 f2 &nbsp;84 1c 31 a2 3f 4f 58 78 &nbsp;w(...at...1.?OXx<br />
&nbsp;11 88 72 4e ed 70 e8 ac &nbsp;e9 82 37 ec 8d 32 7b &nbsp; &nbsp; ..rN.p....7..2{</div></div>
<p>The Client Change Cipher Spec message is not included in the hashes. The Client Finished message however is. This packet (or portion of a packet) is the first symmetrically encrypted data we have seen so far. At this point in the handshake both the server and client posses a shared key.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Client Finished [40]<br />
MD5 state: &nbsp; &nbsp; &nbsp;f6b0a72e2150598caa3fb2fe89f69207<br />
SHA state: &nbsp; &nbsp; &nbsp;56341040456e541453cd46246e6ddff8789c7ee0<br />
MD5 Hash: &nbsp; &nbsp; &nbsp; cb815a237cf657b82b5bdb8e686d8a7b<br />
SHA Hash: &nbsp; &nbsp; &nbsp; 732a54c36c4346d076727a8ff7856361adfaeec7<br />
Buf MD5 Hash: &nbsp; 33329f6bde606b5ffd7516031f3ff610<br />
Buf SHA Hash: &nbsp; 3e9fe0f55988bdb950d710e74d3279866b77713a<br />
Buffered Data [7]<br />
&nbsp;ba c1 0f d4 a3 0f 67 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;......g</div></div>
<p>When this packet is unencrypted you will find a message that can only be verified if you have all the handshake data seen thus far. This is a little harder than just adding a couple of captured packets, as several portions of the message need to be excluded (all record data and change cipher spec messages). The server then does the same thing with this newly included data and completes the handshake by constructing the server finished message. I will look at this final step in my next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sslfail.com/2009/02/sslv3-traces-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSLv3 Traces [Part 1]</title>
		<link>http://www.sslfail.com/2009/01/sslv3-traces-part-1/</link>
		<comments>http://www.sslfail.com/2009/01/sslv3-traces-part-1/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 20:43:46 +0000</pubDate>
		<dc:creator>jgraver</dc:creator>
				<category><![CDATA[SSL Facts]]></category>
		<category><![CDATA[0x00]]></category>

		<guid isPermaLink="false">http://www.sslfail.com/?p=139</guid>
		<description><![CDATA[This is Part 1 of a series of posts about Netscape&#8217;s SSLv3 spec.
When working on my first SSL Client I went looking for the official RFC to correctly implement the SSLv3 protocol. Near total FAIL.
The SSLv3 protocol was created by Netscape back in 1995. The file that most people (continue to) reference is:
http://www.netscape.com/eng/ssl3/draft302.txt
Which is tragically [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This is Part 1 of a series of posts about Netscape&#8217;s SSLv3 spec.</strong></p>
<p>When working on my first SSL Client I went looking for the official RFC to correctly implement the SSLv3 protocol. Near total FAIL.</p>
<p>The SSLv3 protocol was created by Netscape back in 1995. The file that most people (continue to) reference is:</p>
<p><a href="http://www.netscape.com/eng/ssl3/draft302.txt">http://www.netscape.com/eng/ssl3/draft302.txt</a></p>
<p>Which is tragically some horrible 404 page now. Even <a href="http://openssl.org/">Openssl.org</a> continues to cite this as the official spec for SSLv3.</p>
<p>The file has been moved into the care of the The Mozilla Foundation and can now be found here:</p>
<p><a href="http://www-archive.mozilla.org/projects/security/pki/nss/ssl/draft302.txt">http://www-archive.mozilla.org/projects/security/pki/nss/ssl/draft302.txt</a></p>
<p>Once you have found the SSLv3 spec you get to read one of the most ambitious and sadly disappointing specs ever written. SSLv3 got so many ideas right and fell just short of explaining them in enough detail that developers could easily build their own clients. What saved SSLv3 was the set of packet traces of live connections that Netscape put together.</p>
<p><a href="http://www.mozilla.org/projects/security/pki/nss/ssl/traces/index.html">http://www.mozilla.org/projects/security/pki/nss/ssl/traces/index.html</a></p>
<p>They spoke the universal language of hex and came close to being the best illustration of this protocol in action. Unfortunately they too fell short of properly explaining what was going on. The non-client auth trace used export keys and the 128 bit RC4 trace used client-auth. This left out perhaps the most common scenario seen on the Internet &#8211; the high encryption (&gt;=128 bit) non-client auth session.</p>
<p>What makes these connection traces difficult to construct (and annotate) is that by design SSL is difficult to sniff and recreate. Looking directly at encrypted traffic will do you little good in understanding the algorithms that encrypted it.</p>
<p>I am going to do my best to recreate the original Netscape traces as well as add some more modern traces of traffic typically seen today.</p>
<p>On with the show &#8230;<br />
<a href="http://www.mozilla.org/projects/security/pki/nss/ssl/traces/trc-clnt-ex.html">SSL_RSA_EXPORT_WITH_RC4_40_MD5 no client-auth.</a></p>
<p><strong>PACKET 1 :: CLIENT &gt;&gt; SERVER </strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ClientHello [54]<br />
80 34 01 03 00 00 1b 00  00 00 10 01 00 80 03 00  .4..............<br />
80 06 00 40 07 00 c0 00  00 04 00 00 0a 00 00 09  ...@............<br />
00 00 03 00 00 06 d8 90  d7 86 4e 5c 92 9f 90 07  ..........N\....<br />
da 83 1c 25 89 01                                 ...%..</div></div>
<p>Although it is listed as an SSLv2 Client Hello it carries SSLv3 information. There was a time when there were HTTP servers on the Internet which only spoke SSLv2. By sending the SSLv3 information in an SSLv2 Client Hello users were able to safely contact tcp(443) without crashing servers. These days nearly all clients will default to TLSv1/SSLv3 so there is little reason to actually use this old format anymore.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SSL2 record [2]<br />
80 34 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .4</div></div>
<p>The record layer is not considered part of the SSL Handshake and is usually listed separately &#8211; you will see why shortly.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SSL2 ClientHello [52]<br />
01 03 00 00 1b 00 00 00 &nbsp;10 01 00 80 03 00 80 06 &nbsp;................<br />
00 40 07 00 c0 00 00 04 &nbsp;00 00 0a 00 00 09 00 00 &nbsp;.@..............<br />
03 00 00 06 d8 90 d7 86 &nbsp;4e 5c 92 9f 90 07 da 83 &nbsp;........N\......<br />
1c 25 89 01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .%..</div></div>
<p>The SSLv2 Client Hello (minus the record layer) is added to the handshake data. Why is this important? To complete the SSL Handshake (SSL Finished Message) all Handshake Data sent from both the Client and Server is required. When coding this you just keep concatenating these byte strings together.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Handshake Data [52]<br />
01 03 00 00 1b 00 00 00 &nbsp;10 01 00 80 03 00 80 06 &nbsp;................<br />
00 40 07 00 c0 00 00 04 &nbsp;00 00 0a 00 00 09 00 00 &nbsp;.@..............<br />
03 00 00 06 d8 90 d7 86 &nbsp;4e 5c 92 9f 90 07 da 83 &nbsp;........N\......<br />
1c 25 89 01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .%..</div></div>
<p>Now as we trace through the SSL Connection this handshake data is going to get fairly large. The Netscape traces use an MD5 and SHA1 hash to track the progress. However they use the values of the internal hash registers, which for practical coding purposes is near useless. Listing the hash digest as you add data to it allows you follow along and ensure you have added the correct data.</p>
<p>Netscape lists the starting values of MD5 and SHA1 hashes as:</p>
<pre>MD5 state: 67452301 efcdab89 98badcfe 10325476
SHA1 state: 67452301 efcdab89 98badcfe 10325476 c3d2e1f0</pre>
<p>However if you were to create a brand new md5 or sha object (in Python) and call digest() you get:</p>
<p>MD5 Digest d41d8cd98f00b204e9800998ecf8427e<br />
SHA Digest da39a3ee5e6b4b0d3255bfef95601890afd80709</p>
<p>I have not seen an easy way to view the internal state registers of these hash objects &#8211; and really why bother? Just list the digest instead &#8230;</p>
<p>If you search for the obscure hex strings above you will eventually find out they are the default starting values of MD5 and SHA1 state registers.</p>
<p><a href="http://www.faqs.org/rfcs/rfc1321.html">RFC 1321 Section 3.3</a></p>
<p>word A: 01 23 45 67<br />
word B: 89 ab cd ef<br />
word C: fe dc ba 98<br />
word D: 76 54 32 10</p>
<p><a href="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf">FIPS 180 Section 5.3.1</a></p>
<p>0 H = 67452301<br />
1 H = efcdab89<br />
2 H = 98badcfe<br />
3 H = 10325476<br />
4 H = c3d2e1f0</p>
<p>I have no idea why Netscape chose this akward method of hash usage.</p>
<p>If you add the handshake data to your MD5 and SHA1 objects and check the digest you will see the following values for the first packet.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;Handshake Data [52]<br />
MD5: 56d14200dd0dc905d876474c98ac2e0e<br />
SHA: 677664bb8d411d0f757f593dfb2509194274177b</div></div>
<p>As is usually the case when studying the SSL Protocol, the most confusing parts are often the secondary protocols involved (of which there are a TON).</p>
<p>In Part 2 of this series I will explain the First Server Packet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sslfail.com/2009/01/sslv3-traces-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
