<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc rfcedstyle="yes" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc strict="yes" ?>
<?rfc iprnotified="yes" ?>
<rfc category="info"
     ipr="full3978"
     docName="draft-ietf-behave-stun-test-vectors-00">

	<front>
		<title abbrev="STUN test vectors">Test vectors for STUN</title>
		<author initials="R." surname="Denis-Courmont"
		        fullname="R&eacute;mi Denis-Courmont">
			<organization abbrev="Nokia">Nokia Corporation</organization>
			<address>
				<postal>
					<street>P.O. Box 407</street>
					<city>NOKIA GROUP</city>
					<code>00045</code>
					<country>FI</country>
				</postal>
				<phone>+358 50 487 6315</phone>
				<email>remi.denis-courmont@nokia.com</email>
			</address>
		</author>
		<date year="2007" month="December" day="17"/>
		<area>Transport</area>
		<workgroup>Behavior Engineering for Hindrance Avoidance</workgroup>

		<keyword>STUN</keyword>
		<keyword>test</keyword>
		<keyword>vectors</keyword>
		<keyword>fingerprint</keyword>

		<abstract>
			<t> This document includes test vectors for the
				MESSAGE-INTEGRITY and FINGERPRINT attributes
				of the STUN protocol.
			</t>
		</abstract>
	</front>
	<middle>
		<section title="Introduction">
			<t> The Session Traversal Utilities for NAT (STUN)<xref target="I-D.ietf-behave-rfc3489bis"/>
				protocol defines two different hashes that may be included in
				messages exchanged by peers implementing that protocol:
			</t>
			<t>
				<list style="hanging">
					<t hangText="FINGERPRINT attribute:">
					  a 32-bits Circular Redundancy Check.
					</t>
					<t hangText="MESSAGE-INTEGRITY attribute:">
					  a HMAC-SHA1 authentication code.
					</t>
				</list>
			</t>
			<t> This document documents sample properly-formatted STUN
				messages including these hashes, for the sake of testing
				implementations of the STUN protocol.
			</t>
		</section>

		<section title="Test vectors">
			<t> All included vectors are represented as a series of
				hexadecimal values in network byte order.
				Each pair of hexadecimal digits represents one byte.
			</t>
			<t> Messages follow the ICE Connectivity Checks use case of STUN,
				(see <xref target="I-D.ietf-mmusic-ice"/>).
				They include both FINGERPRINT and MESSAGE-INTEGRITY
				attributes.
			</t>
			<section title="Sample request">
				<t>
					This request uses the following parameters:
					<list style="hanging">
					  <t hangText="Username:">
					    "evtj:h6vY" (without quotes)
					  </t>
					  <t hangText="Password:">
					    "VOkJxbRl1RmTxUk/WvJxBt" (without quotes)
					  </t>
					</list>
				</t>
				<figure align="center">
<artwork>

00 01 00 44     Request type and message length
21 12 a4 42     Message cookie
b7 e7 a7 01  }
bc 34 d6 86  }  Transaction ID
fa 87 df ae  }
00 24 00 04
6e 00 01 ff
80 29 00 08
93 2f f9 b1
51 26 3b 36
00 06 00 09     USERNAME attribute header
65 76 74 6a  }
3a 68 36 76  }  Username (9 bytes) and padding (3 bytes)
59 20 20 20  }
00 08 00 14     MESSAGE-INTEGRITY attribute header
62 4e eb dc  }
3c c9 2d d8  }
4b 74 bf 85  }  HMAC-SHA1 fingerprint
d1 c0 f5 de  }
36 87 bd 33  }
80 28 00 04     FINGERPRINT attribute header
ad 8a 85 ff     CRC32 fingerprint
</artwork>
				</figure>
			</section>
			<section title="Sample IPv4 response">
				<t>
					This response used the following parameter:
					<list style="hanging">
					  <t hangText="Password:">
					    "VOkJxbRl1RmTxUk/WvJxBt" (without quotes)
					  </t>
					  <t hangText="Mapped address:">
					    192.0.2.1 port 32853
					  </t>
					</list>
				</t>
				<figure align="center">
<artwork>
01 01 00 3c     Response type and message length
21 12 a4 42     Message cookie
b7 e7 a7 01  }
bc 34 d6 86  }  Transaction ID
fa 87 df ae  }
80 22 00 0b
74 65 73 74
20 76 65 63
74 6f 72 20
00 20 00 08
00 01 a1 47
e1 12 a6 43
00 08 00 14     MESSAGE-INTEGRITY attribute header
2b 91 f5 99  }
fd 9e 90 c3  }
8c 74 89 f9  }  HMAC-SHA1 fingerprint
2a f9 ba 53  }
f0 6b e7 d7  }
80 28 00 04     FINGERPRINT attribute header
c0 7d 4c 96     CRC32 fingerprint
</artwork>
				</figure>
			</section>
			<section title="Sample IPv6 response">
				<t>
					This response used the following parameter:
					<list style="hanging">
						<t hangText="Password:">
							"VOkJxbRl1RmTxUk/WvJxBt" (without quotes)
						</t>
						<t hangText="Mapped address:">
							2001:db8:1234:5678:11:2233:4455:6677 port 32853
						</t>
					</list>
				</t>
				<figure align="center">
<artwork>
01 01 00 48     Response type and message length
21 12 a4 42     Message cookie
b7 e7 a7 01  }
bc 34 d6 86  }  Transaction ID
fa 87 df ae  }
80 22 00 0b
74 65 73 74
20 76 65 63
74 6f 72 20
00 20 00 14
00 02 a1 47
01 13 a9 fa
a5 d3 f1 79
bc 25 f4 b5
be d2 b9 d9
00 08 00 14     MESSAGE-INTEGRITY attribute header
a3 82 95 4e  }
4b e6 7b f1  }
17 84 c9 7c  }  HMAC-SHA1 fingerprint
82 92 c2 75  }
bf e3 ed 41  }
80 28 00 04     FINGERPRINT attribute header
c8 fb 0b 4c     CRC32 fingerprint
</artwork>
				</figure>
			</section>
		</section>


		<section anchor="security" title="Security Considerations">
			<t> There are no security considerations.
			</t>
		</section>

		<section anchor="iana" title="IANA Considerations">
			<t> This document raises no IANA considerations.
			</t>
		</section>

		<section title="Acknowledgements">
			<t> The author would like to thank
				Marc Petit-Huguenin for his comments, and
				Brian Korver, Alfred E. Heggestad
				and Gustavo Garc&iacute;a for their review.
			</t>
		</section>
		
	</middle>
	<back>
		<references title="Normative References">
			<?rfc include="reference.I-D.ietf-behave-rfc3489bis" ?>
			<?rfc include="reference.I-D.ietf-mmusic-ice" ?>
		</references>
		<!--references title="Informative Referencs">
			<?rfc include="reference.I-D.ietf-behave-turn" ?>
		</references-->

		<section anchor="source" title="Source code for test vectors">
			<t>
				<figure title="Request message">
<artwork>
const unsigned char req[] =
  "\x00\x01\x00\x44"
  "\x21\x12\xa4\x42"
  "\xb7\xe7\xa7\x01\xbc\x34\xd6\x86\xfa\x87\xdf\xae"
  "\x00\x24\x00\x04"
    "\x6e\x00\x01\xff"
  "\x80\x29\x00\x08"
    "\x93\x2f\xf9\xb1\x51\x26\x3b\x36"
  "\x00\x06\x00\x09"
    "\x65\x76\x74\x6a\x3a\x68\x36\x76\x59\x20\x20\x20"
  "\x00\x08\x00\x14"
    "\x62\x4e\xeb\xdc\x3c\xc9\x2d\xd8\x4b\x74\xbf\x85"
    "\xd1\xc0\xf5\xde\x36\x87\xbd\x33"
  "\x80\x28\x00\x04"
    "\xad\x8a\x85\xff";
</artwork>
				</figure>
				<figure title="IPv4 response message">
<artwork>
const unsigned char respv4[] =
  "\x01\x01\x00\x3c"
  "\x21\x12\xa4\x42"
  "\xb7\xe7\xa7\x01\xbc\x34\xd6\x86\xfa\x87\xdf\xae"
  "\x80\x22\x00\x0b"
    "\x74\x65\x73\x74\x20\x76\x65\x63\x74\x6f\x72\x20"
  "\x00\x20\x00\x08"
    "\x00\x01\xa1\x47\xe1\x12\xa6\x43"
  "\x00\x08\x00\x14"
    "\x2b\x91\xf5\x99\xfd\x9e\x90\xc3\x8c\x74\x89\xf9"
    "\x2a\xf9\xba\x53\xf0\x6b\xe7\xd7"
  "\x80\x28\x00\x04"
    "\xc0\x7d\x4c\x96";
</artwork>
				</figure>
				<figure title="IPv6 response message">
<artwork>
const unsigned char respv6[] =
  "\x01\x01\x00\x48"
  "\x21\x12\xa4\x42"
  "\xb7\xe7\xa7\x01\xbc\x34\xd6\x86\xfa\x87\xdf\xae"
  "\x80\x22\x00\x0b"
    "\x74\x65\x73\x74\x20\x76\x65\x63\x74\x6f\x72\x20"
  "\x00\x20\x00\x14"
    "\x00\x02\xa1\x47"
    "\x01\x13\xa9\xfa\xa5\xd3\xf1\x79"
    "\xbc\x25\xf4\xb5\xbe\xd2\xb9\xd9"
  "\x00\x08\x00\x14"
    "\xa3\x82\x95\x4e\x4b\xe6\x7b\xf1\x17\x84\xc9\x7c"
    "\x82\x92\xc2\x75\xbf\xe3\xed\x41"
  "\x80\x28\x00\x04"
    "\xc8\xfb\x0b\x4c";
</artwork>
				</figure>
			</t>
		</section>
	</back>
</rfc>
