[Hipsec] Something wrong in -12 Re: Fwd: New Version Notification for draft-ietf-hip-dex-12.txt

Robert Moskowitz <rgm@htt-consult.com> Wed, 12 February 2020 19:11 UTC

Return-Path: <rgm@htt-consult.com>
X-Original-To: hipsec@ietfa.amsl.com
Delivered-To: hipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DAAD9120274 for <hipsec@ietfa.amsl.com>; Wed, 12 Feb 2020 11:11:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id liu0BaRNgm2T for <hipsec@ietfa.amsl.com>; Wed, 12 Feb 2020 11:11:30 -0800 (PST)
Received: from z9m9z.htt-consult.com (z9m9z.htt-consult.com [23.123.122.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3BD7C12013D for <hipsec@ietf.org>; Wed, 12 Feb 2020 11:11:30 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by z9m9z.htt-consult.com (Postfix) with ESMTP id 52C5962132; Wed, 12 Feb 2020 14:11:28 -0500 (EST)
X-Virus-Scanned: amavisd-new at htt-consult.com
Received: from z9m9z.htt-consult.com ([127.0.0.1]) by localhost (z9m9z.htt-consult.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UFDZ9DYzX4JK; Wed, 12 Feb 2020 14:11:20 -0500 (EST)
Received: from lx140e.htt-consult.com (unknown [192.168.160.12]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by z9m9z.htt-consult.com (Postfix) with ESMTPSA id 83E2660029; Wed, 12 Feb 2020 14:11:20 -0500 (EST)
To: Jeff Ahrenholz <j.ahrenholz@tempered.io>, HIP <hipsec@ietf.org>, Miika Komu <miika.komu@ericsson.com>
References: <158131871520.13534.9437394233256375155.idtracker@ietfa.amsl.com> <29372f3d-0a9e-949d-ce64-338be8561500@htt-consult.com> <66046762-C4F2-47AD-BE69-7CAA1AEB6F2A@tempered.io> <c3019aa3-128e-7d8a-34d0-f8c82a597135@htt-consult.com> <E43AD038-70F1-4FF0-B411-0E48E60B34C1@tempered.io>
From: Robert Moskowitz <rgm@htt-consult.com>
Message-ID: <b19c11c1-64f6-c5cd-419c-c13faa53b8fa@htt-consult.com>
Date: Wed, 12 Feb 2020 14:11:13 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
MIME-Version: 1.0
In-Reply-To: <E43AD038-70F1-4FF0-B411-0E48E60B34C1@tempered.io>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/hipsec/YTmT9noL54G_yCnxOzaxgx7r7oU>
Subject: [Hipsec] Something wrong in -12 Re: Fwd: New Version Notification for draft-ietf-hip-dex-12.txt
X-BeenThere: hipsec@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the official IETF Mailing List for the HIP Working Group." <hipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hipsec>, <mailto:hipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/hipsec/>
List-Post: <mailto:hipsec@ietf.org>
List-Help: <mailto:hipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hipsec>, <mailto:hipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Feb 2020 19:11:33 -0000


On 2/12/20 12:50 PM, Jeff Ahrenholz wrote:
>>> Looking at Section 6.3 HIP DEX KEYMAT Generation, it discusses
>>> using Diffie-Hellman derived key Kij, but I don't see anything
>>> about using I_NONCE. There is a random #I  provided by the
>>> Responder from the PUZZLE parameter, but nothing about a
>>> random I_NONCE supplied by the Initiator.
>>     
>>     In 6.3:
>>     
>>             IKM       Input keying material
>>                         the Diffie-Hellman derived key, concatenated with the
>>                           random I_NONCE value for the Master Key SA
>>                         the Diffie-Hellman derived key, concatenated with the
>>                           random values of the ENCRYPTED_KEY parameters in
>>                           the same order as the HITs with sort(HIT-I | HIT-R)
>>                           for the Pair-wise Key SA   The key derivation for the Master Key SA employs always both the
>>     Extract and Expand phases.  The Pair-wise Key SA needs only the
>>     Extract phase when key is smaller or equal to 128 bits, but otherwise
>>     requires also the Expand phase.
>>
>>     The CKDF-Extract function is the following operation:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Moskowitz, et al.        Expires August 15, 2020               [Page 32]
>> 
>> Internet-Draft           HIP Diet EXchange (DEX)           February 2020
>>
>>
>>       CKDF-Extract(I, IKM, info) -> PRK
>>
>>       Inputs:
>>         I         Random #I, provided by the Responder, from the PUZZLE
>>                   parameter
>>
>>         IKM       Input keying material
>>                     the Diffie-Hellman derived key, concatenated with the
>>                       random I_NONCE value for the Master Key SA
>>                     the Diffie-Hellman derived key, concatenated with the
>>                       random values of the ENCRYPTED_KEY parameters in
>>                       the same order as the HITs with sort(HIT-I | HIT-R)
>>                       for the Pair-wise Key SA
>>
>>         info      sort(HIT-I | HIT-R) | "CKDF-Extract"
>>                   where "CKDF-Extract" is an octet string
>>
>>       Output:
>>         PRK       a pseudorandom key (of RHASH_len/8 octets)
>>
>>
>>     The pseudorandom key PRK is calculated as follows:
>>
>>         PRK     = CMAC(I, IKM | info)
>>
>>     The CKDF-Expand function is the following operation:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Moskowitz, et al.        Expires August 15, 2020               [Page 33]
>> 
>> Internet-Draft           HIP Diet EXchange (DEX)           February 2020
>>
>>
>>       CKDF-Expand(PRK, info, L) -> OKM
>>
>>       Inputs:
>>         PRK       a pseudorandom key of at least RHASH_len/8 octets
>>                   (either the output from the extract step or the
>>                   concatenation of the random values of the
>>                   ENCRYPTED_KEY parameters in the same order as the
>>                   HITs with sort(HIT-I | HIT-R) in case of no extract)
>>         info      sort(HIT-I | HIT-R) | "CKDF-Expand"
>>                   where "CKDF-Expand" is an octet string
>>         L         length of output keying material in octets
>>                   (<= 255*RHASH_len/8)
>>
>>       Output:
>>         OKM        output keying material (of L octets)
>>
>>     The output keying material OKM is calculated as follows:
>>
>>         N       =  ceil(L/(RHASH_len/8))
>>         T       =  T(1) | T(2) | T(3) | ... | T(N)
>>         OKM     =  first L octets of T
>>
>>     where
>>
>>         T(0) = empty string (zero length)
>>         T(1) = CMAC(PRK, T(0) | info | 0x01)
>>         T(2) = CMAC(PRK, T(1) | info | 0x02)
>>         T(3) = CMAC(PRK, T(2) | info | 0x03)
>>         ...
>>
>      
> Is this a new table row, or maybe something happened to the output?

Look at it in the draft, it does not format so well in a message.


> It looks good.
>
> In the dex-12 html/text versions I'm seeing the following text, which does not list IKM or info inputs for CKDF-Extract:
>
>
>     The CKDF-Extract function is the following operation:
>
>       CKDF-Extract(I, IKM, info) -> PRK
>
>       Inputs:
>         I         Random #I, provided by the Responder, from the PUZZLE
>                   parameter
>
>     The CKDF-Expand function is the following operation:
>
>
>
>
> Moskowitz, et al.        Expires August 12, 2020               [Page 32]
>
>
> Internet-Draft           HIP Diet EXchange (DEX)           February 2020
>
>
>       CKDF-Expand(PRK, info, L) -> OKM
>
>       Inputs:
>         PRK       a pseudorandom key of at least RHASH_len/8 octets
>                   (either the output from the extract step or the
>                   concatenation of the random values of the
>                   ENCRYPTED_KEY parameters in the same order as the
>                   HITs with sort(HIT-I | HIT-R) in case of no extract)
>         info      sort(HIT-I | HIT-R) | "CKDF-Expand"
>                   where "CKDF-Expand" is an octet string
>         L         length of output keying material in octets
>                   (<= 255*RHASH_len/8)
>


Oh, oh.  I checked https://www.ietf.org/id/draft-ietf-hip-dex-12.txt and 
you are right and it is wrong.


Miika?  Something went wrong from what I sent and what got posted. Here 
is what I have from running xml2rfc locally on the xml:


=============================================

    The key derivation for the Master Key SA employs always both the
    Extract and Expand phases.  The Pair-wise Key SA needs only the
    Extract phase when key is smaller or equal to 128 bits, but otherwise
    requires also the Expand phase.

    The CKDF-Extract function is the following operation:












Moskowitz, et al.        Expires August 15, 2020               [Page 32]

Internet-Draft           HIP Diet EXchange (DEX)           February 2020


      CKDF-Extract(I, IKM, info) -> PRK

      Inputs:
        I         Random #I, provided by the Responder, from the PUZZLE
                  parameter

        IKM       Input keying material
                    the Diffie-Hellman derived key, concatenated with the
                      random I_NONCE value for the Master Key SA
                    the Diffie-Hellman derived key, concatenated with the
                      random values of the ENCRYPTED_KEY parameters in
                      the same order as the HITs with sort(HIT-I | HIT-R)
                      for the Pair-wise Key SA

        info      sort(HIT-I | HIT-R) | "CKDF-Extract"
                  where "CKDF-Extract" is an octet string

      Output:
        PRK       a pseudorandom key (of RHASH_len/8 octets)


    The pseudorandom key PRK is calculated as follows:

        PRK     = CMAC(I, IKM | info)

    The CKDF-Expand function is the following operation:

























Moskowitz, et al.        Expires August 15, 2020               [Page 33]

Internet-Draft           HIP Diet EXchange (DEX)           February 2020


      CKDF-Expand(PRK, info, L) -> OKM

      Inputs:
        PRK       a pseudorandom key of at least RHASH_len/8 octets
                  (either the output from the extract step or the
                  concatenation of the random values of the
                  ENCRYPTED_KEY parameters in the same order as the
                  HITs with sort(HIT-I | HIT-R) in case of no extract)
        info      sort(HIT-I | HIT-R) | "CKDF-Expand"
                  where "CKDF-Expand" is an octet string
        L         length of output keying material in octets
                  (<= 255*RHASH_len/8)

      Output:
        OKM        output keying material (of L octets)

    The output keying material OKM is calculated as follows:

        N       =  ceil(L/(RHASH_len/8))
        T       =  T(1) | T(2) | T(3) | ... | T(N)
        OKM     =  first L octets of T

    where

        T(0) = empty string (zero length)
        T(1) = CMAC(PRK, T(0) | info | 0x01)
        T(2) = CMAC(PRK, T(1) | info | 0x02)
        T(3) = CMAC(PRK, T(2) | info | 0x03)
        ...