Re: [IPsec] draft-fluhrer-qr-ikev2 AUTH issue

"Valery Smyslov" <svanru@gmail.com> Mon, 21 August 2017 14:24 UTC

Return-Path: <svanru@gmail.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 09C9113217D for <ipsec@ietfa.amsl.com>; Mon, 21 Aug 2017 07:24:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.2
X-Spam-Level:
X-Spam-Status: No, score=-1.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 9VfAp3k_X_5x for <ipsec@ietfa.amsl.com>; Mon, 21 Aug 2017 07:24:52 -0700 (PDT)
Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C98C9132113 for <ipsec@ietf.org>; Mon, 21 Aug 2017 07:24:49 -0700 (PDT)
Received: by mail-lf0-x22e.google.com with SMTP id y15so67390155lfd.5 for <ipsec@ietf.org>; Mon, 21 Aug 2017 07:24:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=k8bs3yNIddlpeaXzeoDga4bvU6VdsjZiYdB4QD8wJE4=; b=iIjZh7EneTcu7q+DzfYuTqXDB92EGNP1/cRdj8xRJWaaPlUCVj7pcKqydDC/dSvJra ksukjsev4/m3KrZEuzjFXlFdIJY8h9d6ry/AgbQyz94EZOzA+Kg6IEn1ss75eEGQ1SDr kMv2Exybj3lfHrMID4M2gxZipFdLBkX2zNTKHzrm4nTroyn4yCif0PwCZx0S+iZwROv0 Cu9f9s77y/MDPtuGSp15LU7PctNL4qWkTmSU74UBd9OrPlN+q+8IPj7Hx6jnE9Irzcj1 b+nD4y8YvEDJ4FHkOFQ1kmRsgh54Q3GKFZo2GP1tGXcmKdx855nT1uSOYgp66VShrcOJ 9KsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=k8bs3yNIddlpeaXzeoDga4bvU6VdsjZiYdB4QD8wJE4=; b=V+gzWF/kx8aYZzUBvy2vP9ClXNUYSBmo/AaoqdqWT3occnlVJkGWIofNVnbnYF9R4r m0RpKsvYBE2HRS9y9lo1HLK4+MmZS+HT79PxOQdMGbx19KvX7qCf8HD2w9mMFS6hByjc NplArjnHbIfurlpvQzhfO/CPjsrrJwRGV+0xfobyHFd1BF9gSFAezdqWakmfz/CJ625U qYgd2pbb2c9bMSM8fIxQMohGys3+kaZJNUbRVBc6ZCf6EsGeSwBjXEp0V4N3IgBxxZL7 81SdQeylbDkQkm0ZBDo+gbQ5oMok6pz6bQtPQVvgs9RcMZ47/qe/Nc8R21OjtefHx0Si PJUw==
X-Gm-Message-State: AHYfb5ha979Kt4gRfeC8DVtYSXOkqyQHwEnItjQdA+0pJSWpEJ3SYZqy oLJojSI4q5Xq6Yfj
X-Received: by 10.25.79.80 with SMTP id a16mr383901lfk.122.1503325487703; Mon, 21 Aug 2017 07:24:47 -0700 (PDT)
Received: from buildpc ([82.138.51.4]) by smtp.gmail.com with ESMTPSA id o69sm2746955lfk.8.2017.08.21.07.24.46 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 07:24:46 -0700 (PDT)
From: Valery Smyslov <svanru@gmail.com>
To: "'Scott Fluhrer (sfluhrer)'" <sfluhrer@cisco.com>, 'Paul Wouters' <paul@nohats.ca>, ipsec@ietf.org
Cc: 'Vukasin Karadzic' <vukasin.karadzic@gmail.com>
References: <alpine.LRH.2.21.1708162147570.26093@bofh.nohats.ca> <38865aa6100d491fb1beb120f72d4bda@XCH-RTP-006.cisco.com>
In-Reply-To: <38865aa6100d491fb1beb120f72d4bda@XCH-RTP-006.cisco.com>
Date: Mon, 21 Aug 2017 17:24:45 +0300
Message-ID: <001701d31a89$3cf35ca0$b6da15e0$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQFrzo/mLNHQ912KAIRbgs5wCt+pzQFW4fuSo1KroxA=
Content-Language: ru
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/A8tyT6XR5EZTnO4WU4BK-VhQ3uk>
Subject: Re: [IPsec] draft-fluhrer-qr-ikev2 AUTH issue
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Aug 2017 14:24:54 -0000

Hi Scott, 

> > then it has to flip a coin on whether or not to send the PPK_SUPPORT
> > notify and if it guessed wrong, the AUTH payload on the initiator will be
> > wrong. Sending the notify commits to using a PPK because the initiator uses
> > it as input to the AUTH payload.

[...]

> > One way of solving this could be to allow PPK_SUPPORT to have some notify
> > data, which could for instance be a hash of the connection/group name used
> > by the responder.
> > Another option is to use the PPK as one of the inputs to
> > some hash algorithm as PPK_SUPPORT data, so the responder can go
> > through its list of PPKs to match it back to a connection/group. But we would
> > need to be sure that this does not open up the PPK to attacks (classic and
> > quantum)
> 
> That's what we did in our original proposal (actually, it was a function of the PPK itself).  The problems with
> that were:
> 
> - If we made it a nondeterministic function (that is, include a randomizer), then the server had to do a linear
> scan over all their known PPKs to find the matching one.
> 
> - If we made it a deterministic function, then someone listening in can trivially determine when we're reusing
> the same PPK
> 
> (There's also a minor issue of "which hash function to use"; we haven't negotiated any at this time).
> 
> A linear scan over possibly 10,000 PPKs was considered unacceptable.  One of our proposals even allowed the
> server to specify the trade-off between the above two; that was considered too complex.
> 
> I'm not thrilled with Tero's answer of "lets be careful about the order we upgrade things in complex
> networks", but I don't know how to better solve it without adding lots of complexity to the protocol, potential
> anonymity leaks or requiring significant computation on the server side.

One (relatively) simple solution would be the following.

If initiator is configured with PPK, but at the same time its policy marks using PPK as optional,
then the initiator can send two authenticators - one using SK_pi' and the other using SK_pi
(where SK_pi = prf(PPK, SK_pi')). The one, computed using SK_pi (where PPK is involved) is placed in
AUTH payload, and the other, computed using SK_pi' (without PPK) is placed in 
a new optional status notification NO_PPK_AUTH.

   Initiator                       Responder
   ------------------------------------------------------------------
   HDR, SK {IDi, [CERT,] [CERTREQ,]
       [IDr,] AUTH, SAi2, TSi, TSr, 
       N(PPK_IDENTITY)(PPK_id), 
      [N(NO_PPK_AUTH)(auth_data)] }  --->

When responder receives this message and cannot find the corresponding PPK based on PPK_id and is configured
to allow PPK-less SA, it can still authenticate initiator by using the content of NO_PPK_AUTH. 
In this case the Responder replies with the IKE_AUTH response lacking PPK_IDENTITY to let the initiator
know that AUTH payload is computed as per RFC7296 (using SK_pr', i.e. without using PPK).

<---   HDR, SK {IDr, [CERT,]
       AUTH, SAr2, TSi, TSr} 

If the responder has the corresponding PPK, then it computes its AUTH payload using 
SK_pr and includes PPK_IDENTITY notification:

<---   HDR, SK {IDr, [CERT,] 
       AUTH, SAr2, TSi, TSr, 
       N(PPK_IDENTITY)(PPK_id)} 

This solution allows peers to communicate in different settings and to enforce their own policy.
For instance, if the initiator is configured to always use PPK, it won't include 
NO_PPK_AUTH at all. If responder is configured to always use PPK, it will just ignore
NO_PPK_AUTH and return AUTHENTICATION_FAILED in case the proper PPK is not found.

Regards,
Valery.