[IPsec] Re: test vectors for IKEv2 SKEYSEED derivation
Tero Kivinen <kivinen@iki.fi> Mon, 26 November 2007 15:26 UTC
Return-path: <ipsec-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1Iwfqb-0005cg-2e; Mon, 26 Nov 2007 10:26:09 -0500
Received: from ipsec by megatron.ietf.org with local (Exim 4.43) id 1Iwfqa-0005cM-7x for ipsec-confirm+ok@megatron.ietf.org; Mon, 26 Nov 2007 10:26:08 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1IwfqY-0005b2-NO for ipsec@lists.ietf.org; Mon, 26 Nov 2007 10:26:07 -0500
Received: from [2001:1bc8:100d::2] (helo=mail.kivinen.iki.fi) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1IwfqX-0000LN-FI for ipsec@lists.ietf.org; Mon, 26 Nov 2007 10:26:06 -0500
Received: from fireball.kivinen.iki.fi (localhost [127.0.0.1]) by mail.kivinen.iki.fi (8.13.8/8.12.10) with ESMTP id lAQFQ472008107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Nov 2007 17:26:04 +0200 (EET)
Received: (from kivinen@localhost) by fireball.kivinen.iki.fi (8.13.8/8.12.11) id lAQFQ45w022154; Mon, 26 Nov 2007 17:26:04 +0200 (EET)
X-Authentication-Warning: fireball.kivinen.iki.fi: kivinen set sender to kivinen@iki.fi using -f
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <18250.58764.542898.587852@fireball.kivinen.iki.fi>
Date: Mon, 26 Nov 2007 17:26:04 +0200
From: Tero Kivinen <kivinen@iki.fi>
To: Michael Richardson <mcr@sandelman.ca>
Subject: [IPsec] Re: test vectors for IKEv2 SKEYSEED derivation
In-Reply-To: <fia7cq$t93$1@ger.gmane.org>
References: <fhe1bp$7h0$1@ger.gmane.org> <fia7cq$t93$1@ger.gmane.org>
X-Mailer: VM 7.19 under Emacs 21.4.1
X-Edit-Time: 10 min
X-Total-Time: 14 min
X-Spam-Score: -1.4 (-)
X-Scan-Signature: a2c12dacc0736f14d6b540e805505a86
Cc: ipsec@lists.ietf.org
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
Errors-To: ipsec-bounces@ietf.org
Michael Richardson writes:
> Part A
> The problem is that I didn't know what the key size for MD5 and SHA1 is.
> As far as I knew, it was open --- I can use any key size, since
> HMAC just prepends the key to the data. This for me meant that I should
> have no problems concatenating Ni|Nr
Depends what HMAC-MD5 / HMAC-SHA1 you talk about. For the
AUTH_HMAC_MD5_96, and AUTH_MHAC_SHA1_96 the RFCs 2403 and 2404 clearly
specify that the input key size is 128 bits and 160 bits, and no other
key lengths are supported. For the PRF_HMAC_MD5 and PRF_HMAC_SHA1 the
RFC2104 does NOT specify the key lenght, but says any key lenght is
acceptable.
> Part B
> However, in order to know how much keying material to generate, and how much
> is going to be SK_d, SK_ai, SK_ar, I need to know how big each one is going
> to be. For *ESP* the key size of integrity algorithms is MD5,SHA1 = (16
> bytes, 20 bytes).
That same applies to the SK_ai, and SK_ar, as they use
AUTH_HMAC_MD5_96 / AUTH_HMAC_SHA1_96.
The only problem is the SK_d, i.e. how many bytes of keying material
needs to be generated for the SK_d.
> SK_d is used in prf+ as specified in 2.17. As that is based upon
> prf, I might assume that the "keysize" for prf is like for ESP, i.e.
> 16 and 20 bytes.
That is what implementations do now, and I think that should be
specified in the future documents.
> Go back to Part A. If md5 has a 16-byte keysize, then if I provide two
> 16-byte nonces (the smallest allowable), then I should take 8 bytes from Ni,
> and 8 bytes from Nr. Tero's vector clearly didn't do that --- it had 32
> bytes of input, 16 from each nonce.
No.
Even when we have some key size associated with the PRF to specify how
many bytes we need to generate when generating key to be used for the
PRF, that does not make the PRF to require fixed size key. It can
still take variable size of key, thus no truncation is done, and full
Ni and Nr are used.
> As I am writing this, I am inserting text from RFC4306, such as below:
>
> This concerns RFC4306 sections 2.13/2.14.
>
> 2.13: says:
>
> We assume that each encryption algorithm and integrity protection
> algorithm uses a fixed-size key and that any randomly chosen value of
> that fixed size can serve as an appropriate key. For algorithms that
> accept a variable length key, a fixed key size MUST be specified as
> part of the cryptographic transform negotiated.
>
> I understood this to apply to things like AES.
It does not apply to AES, which is encryption algorithm. It applies to
the RPF_AES128_XCBC which is PRF function. And note there is some
problems with that already (RFC4434 vs RFC 3664).
> Does this *ALSO* apply to MD5 and SHA1?
No.
> Are these considered to be variable length, and we need to include a keysize
> attribute for the *PRF* and *INTEGRITY* options for the PARENT SA?
No. For integrity the key size is fixed by the RFC2403 and RFC2404.
For the PRF the key size is whatever is given to the PRF. The only
thing we should define is the length of the SK_d.
> Section 3.3.5 "Key Length" says that it applies to Encryption
> Algorithms only.
Yes.
> (Also is it just me, or has the table in 3.3.5, Attribute Type/Value/Format
> been word wrapped on us?)
Yes seems to be, should be:
Attribute Type Value Attribute Format
--------------------------------------------------------------
RESERVED 0-13
Key Length (in bits) 14 TV
RESERVED 15-17
RESERVED TO IANA 18-16383
PRIVATE USE 16384-32767
--
kivinen@safenet-inc.com
_______________________________________________
IPsec mailing list
IPsec@ietf.org
https://www1.ietf.org/mailman/listinfo/ipsec
- [IPsec] test vectors for IKEv2 SKEYSEED derivation Michael Richardson
- Re: [IPsec] test vectors for IKEv2 SKEYSEED deriv… Scott G. Kelly
- [IPsec] Re: test vectors for IKEv2 SKEYSEED deriv… Michael Richardson
- [IPsec] Re: test vectors for IKEv2 SKEYSEED deriv… Tero Kivinen
- [IPsec] Re: test vectors for IKEv2 SKEYSEED deriv… Michael Richardson
- [IPsec] Re: test vectors for IKEv2 SKEYSEED deriv… Tero Kivinen