1 Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
2 See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
6 Source Identity Token (SIT) is based in Donald Eastlake 3rd's DNS Cookies[1].
8 The main differences are that the error code has been dropped and
9 that the server cookie doesn't have a fixed length and may be
12 The error code has been dropped because it served no useful purpose
13 for us. If it was to be restored it should be the first element
16 We extended the server cookie to transmit server time and to include
17 a server generated nonce. The purpose of these is to provide a
18 short window of time (1 hour with a 5 minutes of clock skew for
19 cluster time) where a previous cookie can be used for and to not
20 require the server secret to be updated when it is shared by a
21 cluster of servers. In particular the time of generation needed
22 to be passed between servers via the client so that old cookie can
25 The option structure is:
27 client cookie (64 bits)
28 server cookie (128 bits) broken up into:
33 The initial requests just sends the client cookie. If the response
34 contains a matching client cookie the entire response is saved and
35 sent on the next transaction. A new server cookie is generated for
38 We are currently using EDNS Experimental code point 65001. This is
41 We have three supported hash method. AES, HMAC SHA 1 and HMAC SHA 256.
42 A cluster of servers needs to choose one of them.
45 memset(input, 0, sizeof(input));
46 cp = isc_buffer_used(buf);
47 isc_buffer_putmem(buf, client->cookie, 8);
48 isc_buffer_putuint32(buf, nonce);
49 isc_buffer_putuint32(buf, when);
50 memmove(input, cp, 16);
51 isc_aes128_crypt(ns_g_server->secret, input, digest);
52 for (i = 0; i < 8; i++)
53 input[i] = digest[i] ^ digest[i + 8];
54 isc_netaddr_fromsockaddr(&netaddr, &client->peeraddr);
55 switch (netaddr.family) {
57 memmove(input + 8, (unsigned char *)&netaddr.type.in, 4);
58 memset(input + 12, 0, 4);
59 isc_aes128_crypt(ns_g_server->secret, input, digest);
62 memmove(input + 8, (unsigned char *)&netaddr.type.in6, 16);
63 isc_aes128_crypt(ns_g_server->secret, input, digest);
64 for (i = 0; i < 8; i++)
65 input[i + 8] = digest[i] ^ digest[i + 8];
66 isc_aes128_crypt(ns_g_server->secret, input + 8, digest);
69 for (i = 0; i < 8; i++)
70 digest[i] ^= digest[i + 8];
71 isc_buffer_putmem(buf, digest, 8);
75 hash = trunc(hmacsha1(secret, client|nonce|when|address), 8);
79 hash = trunc(hmacsha256(secret, client|nonce|when|address), 8);
82 INTERNET-DRAFT Donald Eastlake
83 Intended Status: Proposed Standard Huawei
84 Expires: July 21, 2014 January 22, 2014
87 Domain Name System (DNS) Cookies
88 <draft-eastlake-dnsext-cookies-04.txt>