Re: [IPsec] AD review of draft-ietf-ipsecme-qr-ikev2-08

Valery Smyslov <svan@elvis.ru> Wed, 06 November 2019 07:49 UTC

Return-Path: <svan@elvis.ru>
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 DFB15120C01; Tue, 5 Nov 2019 23:49:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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 3q4lDvhfsSGU; Tue, 5 Nov 2019 23:49:43 -0800 (PST)
Received: from akmail.elvis.ru (akmail.elvis.ru [82.138.51.97]) (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 79D43120BFF; Tue, 5 Nov 2019 23:49:43 -0800 (PST)
Received: from kmail2.elvis.ru ([93.188.44.210]) by akmail.elvis.ru with esmtp (Exim 4.89) (envelope-from <svan@elvis.ru>) id 1iSG4P-0005T5-Ue; Wed, 06 Nov 2019 10:49:38 +0300
Received: from mail16.office.elvis.ru ([10.111.1.29] helo=mail.office.elvis.ru) by kmail2.elvis.ru with esmtp (Exim 4.89) (envelope-from <svan@elvis.ru>) id 1iSG4P-0005m1-Ga; Wed, 06 Nov 2019 10:49:37 +0300
Received: from MAIL16.office.elvis.ru (10.111.1.29) by MAIL16.office.elvis.ru (10.111.1.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 6 Nov 2019 10:49:37 +0300
Received: from buildpc (10.111.10.33) by MAIL16.office.elvis.ru (10.111.1.29) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Wed, 6 Nov 2019 10:49:37 +0300
From: Valery Smyslov <svan@elvis.ru>
To: 'Benjamin Kaduk' <kaduk@mit.edu>
CC: draft-ietf-ipsecme-qr-ikev2.all@ietf.org, ipsec@ietf.org
References: <20191105023831.GH55993@kduck.mit.edu> <058d01d593e5$0be7eb80$23b7c280$@elvis.ru> <20191105195939.GH61969@kduck.mit.edu>
In-Reply-To: <20191105195939.GH61969@kduck.mit.edu>
Date: Wed, 06 Nov 2019 10:49:40 +0300
Message-ID: <06dd01d59476$befb9c30$3cf2d490$@elvis.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQL0a9Ttu9PudiK014soS4Z/m3iG4QIy6txqAr5BIRClGHn0MA==
Content-Language: ru
X-CrossPremisesHeadersFilteredBySendConnector: MAIL16.office.elvis.ru
X-OrganizationHeadersPreserved: MAIL16.office.elvis.ru
X-Spam-Scanner: Rspamd work in kmail2.elvis.ru, WHITELIST
X-KLMS-Rule-ID: 1
X-KLMS-Message-Action: clean
X-KLMS-AntiSpam-Status: not scanned, disabled by settings
X-KLMS-AntiPhishing: Clean, bases: 2019/11/06 06:20:00
X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2019/11/06 05:19:00 #14339377
X-KLMS-AntiVirus-Status: Clean, skipped
X-Spam-Scanner: Rspamd work in akmail.elvis.ru, WHITELIST
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipsec/zrYezk7Tms3XhYaFK8HCFy9PUwk>
Subject: Re: [IPsec] AD review of draft-ietf-ipsecme-qr-ikev2-08
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 06 Nov 2019 07:49:47 -0000

Hi Ben,

please see inline (I removed those parts of the message that seem to be resolved).

> > >    It is an open question whether or not it is feasible to build a
> > >    Quantum Computer (and if so, when one might be implemented), but if
> > >
> > > Feasibility of some quantum computer is becoming much less of an open
> > > question; perhaps we want some qualifiers about efficiency, scale,
> > > and/or general-purpose-nature.
> >
> > Do you have any data or pointers?
> 
> I'm mostly just thinking about press releases from D-WAVE and Google that
> get turned into articles in the technology press.  We see headlines about
> 60+ q-bit machines, that more likely than not are doing *something*.  So in
> my mind it becomes a question of whether what these machines (that exist and
> are being sold) are doing is useful for the problems relevant to a given
> technology, rather than whether a quantum computer exists.  (I'm not even
> sure that there's a generally accepted definition for what "quantum
> computer" means -- some people seem to use it for just annealing-based
> stuff.)

Probably, if we add a qualifier "full-scale Quantum Computer" then the text 
will become less questionable? Something like this:

     It is an open question whether or not it is feasible to build a large-scale Quantum Computer
      (and if so, when one might be implemented), but if it is, many of the cryptographic algorithms
      and protocols currently in use would be insecure.  

Or are you suggesting to rephrase the sentence completely? E.g.:

    Recent achievements in developing Quantum Computers (QC) demonstrate that 
    it is probably feasible to build a large scale QC. If such a QC is implemented,
    many of the cryptographic algorithms and protocols currently in use would be insecure.  

> > >    would be compromised.  IKEv1 [RFC2409], when used with strong
> > >    preshared keys, is not vulnerable to quantum attacks, because those
> > >    keys are one of the inputs to the key derivation function.  If the
> > >    preshared key has sufficient entropy and the PRF, encryption and
> > >    authentication transforms are postquantum secure, then the resulting
> > >    system is believed to be quantum resistant, that is, invulnerable to
> > >    an attacker with a Quantum Computer.
> > >
> > > Do we have a reference for this "it is believed", or is it just the
> > > outcome of the WG discussions?
> >
> > I'll let my co-authors comment on this, but I think it is meant
> > that according to our best current knowledge nothing
> > better than Grover's algorithm can be used to break symmetric
> > key cryptosystem with QC. And Grover's algorithm only
> > halves an effective key length, so if longer PSK is used, we're safe
> > (we believe we are).
> 
> To be clear: I share this belief! :)
> I am just asking if it is sufficiently well-known/widespread that no
> reference is needed; that may well be the case.

I believe it is, but I again prefer someone more knowledgeable in QC than myself to comment.

> > >    The general idea is that we add an additional secret that is shared
> > >    between the initiator and the responder; this secret is in addition
> > >    to the authentication method that is already provided within IKEv2.
> > >    We stir this secret into the SK_d value, which is used to generate
> > >    the key material (KEYMAT) and the SKEYSEED for the child SAs; this
> > >    secret provides quantum resistance to the IPsec SAs (and any child
> > >    IKE SAs).  We also stir the secret into the SK_pi, SK_pr values; this
> > >    allows both sides to detect a secret mismatch cleanly.
> > >
> > > With apologies for the pedanticism, let's be careful what wording we
> > > use, as just mixing into SK_d is not necessarily enough to get quantum
> > > resitsance for the parent IPsec SA.
> > > [need to check this some more]
> >
> > Well, there is no "parent IPsec SA" in IKEv2, all the IPsec SAs
> > are children of an IKE SA. They are created using SK_d as a key,
> > so if PPK is mixed into SK_d, then all Child IIPsec) SAs are protected.
> > Moreover, the SK_d is used when IKE SA is rekeyed as one of the inputs
> > for computation of new keys, so once IKE SA is rekeyed, the new
> > IKE SA will be QC-resistant too.
> 
> Oh, this is probably the key part of my confusion/misunderstanding with the
> terminology (which also shows up later on, IIRC).
> Namely, that the initial exchange generates an IKE SA, and the other SAs
> ("children" for ESP/AH usage) are called IPsec SAs (not IKE SAs).
> In that case this text is fine as-is and there's nothing to change, so
> sorry for the noise.

Almost true. The initial pair of exchanges (IKE_SA_INIT & IKE_AUTH)
generate an IKE SA and a single (to be exact - a single pair of) IPsec SA,
which in RFC7296 is called Child SA. This initial IKE SA can be used 
later to create as many additional IPsec (Child) SAs, as peers want (with 
CREATE_CHILD_SA exchange). At some point of time the initial IKE SA can be 
rekeyed (again with CREATE_CHILD_SA) and after this point is deleted.
The newly created IKE SA replaces it and is used for creating additional
IPsec (Child) SAs.

With QR draft all these SAs (both IKE SAs and Child SAs) except for
the initial IKE SA are protected with PPK. The initial IKE SA (those
created with IKE_SA_INIT and IKE_AUTH) doesn't have this protection.

> > > Section 2
> > >
> > >    We assume that each IKE peer has a list of Postquantum Preshared Keys
> > >    (PPK) along with their identifiers (PPK_ID), and any potential IKE
> > >    initiator has a selection of which PPK to use with any specific
> > >    responder.  In addition, implementations have a configurable flag
> > >
> > > nit: I'm not sure what "has a selection of" is intended to mean.  Is it
> > > more about making a choice of which PPK to use or about having a list to
> > > choose from?
> >
> > The former - making a choice of which PPK to use with any
> > specific responder. Do you think it should be rephrased?
> 
> I'd suggest "any potential IKE initiator selects which PPK to use with any
> specific responder".  (The other case involves the word "selection" in the
> sense of "this restaurant has a large selection of wines", but we want the
> verb form of "selection".)

OK, thanks.

> > >    If the responder did not include the USE_PPK notification and using a
> > >    PPK for this particular responder is optional, then the initiator
> > >    continues with the IKEv2 protocol as normal, without using PPKs.
> > >
> > > Do we want to say anything about logging or notifications for this case,
> > > in case someone is concerned about the level of quantum-resistance in
> > > use?
> >
> > Hmmm. I think that we follow RFC 7296 tradition that leaves
> > all logging (and the like) up to implementations...
> 
> If we do that, I'd suggest a little more exposition in the security
> considerations about how operational misconfiguration or similar could
> result in PPKs not being used, unless the "PPK is mandatory" knob is
> switched on.

OK.

> > >    That is, we use the standard IKEv2 key derivation process except that
> > >    the three subkeys SK_d, SK_pi, SK_pr are run through the prf+ again,
> > >    this time using the PPK as the key.  Using prf+ construction ensures
> > >
> > > Do we want to say anything about why only these three values need the
> > > PPK mixed in to them?  (I guess the idea is that the parent SA is
> > > "short-lived" on the timescale of a quantum computer and the messages
> > > protected directly by it are not of interest to an attacker years in the
> > > future.  This does mean that this scheme does not provide much value
> > > when a quantum computer is available at the time of the exchange,
> > > though, right?
> >
> > No, the reason is different. The PPK_ID is sent in the IKE_AUTH,
> > that is protected by the SK_ei/er/ai/ar keys. If these keys were
> > dependent on PPK, then in case of PPK mismatch the responder
> > would not be able to decrypt the message and thus cannot handle
> > this situation properly. We ran into this problem with IKEv1,
> > when PSK was stirred into key computation and in case of PSK mismatch
> > the responder received garbage, and wasn't able to recover gracefully.

I must correct myself here - one more (and even more important) reason
not to stir PPK into SK_ei/er keys is that the PPK identity is sent
in IKE_AUTH request that is encrypted using SK_ei. If we mix PPK
into it, then the responder must select the right PPK to decrypt the message
without knowing its ID, that it gets only after decryption. Chicken and eggs problem.

> > For this reason it was decided by the WG to only mix PPK into SK_d
> > and SK_pi/pr, leaving it out from SK_ei/er/ai/ar. This leaves
> > initial IKE SA not protected against QC, but allows the protocol to
> > handle PPK mismatch gracefully.
> 
> Ah, okay.  (I think this is discussed adequately later on in the document,
> so don't feel obligated to add any new text here if you don't want to.)

OK.

> > > Section 5.2.1
> > >
> > > I'm kind of confused by the PSKC reference, especially the implication
> > > ("algorithm ("Algorithm=urn:ietf:params:xml:ns:keyprov:pskc:pin") as the
> > > PIN") that a fixed string is to be used as a PIN.  (I also think it's
> > > better to discuss what it does as "key transport" than "key exchange",
> > > noting that the latter string does not appear in RFC 6030.)
> >
> > I recall it was requested by somebody during discussion in the WG...
> 
> To be clear, unless someone can explain to me how I'm misunderstanding the
> current text (and thus that the current text makes sense), I object to the
> current description.  It doesn't give me a clear picture of what I'd need
> to do to use it, and what it seems to describe sounds insecure based on my
> preconceptions of the terminology used.  (I have no prior experience with
> PSKC, to be clear.)

I tend to agree with you here, but I hope someone in the WG who asked
for this text will chime in :-)

Thank you,
Valery.

> Thanks,
> 
> Ben