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

From: Benjamin Kaduk <[email-masked]>
Date: Mon, 4 Nov 2019 18:38:31 -0800

Hi all,

Thanks for this document -- it's pretty readable (once I did my background
reading on RFC 7296) and is an interim measure that we're seeing some
demand for already.  Sorry to have been sitting on this for so long; my
backlog is taking longer to clear than planned.

There are a few substantitve comments mixed in with the nits -- the IANA
Considerations in particular will probably need a bit more attention to get
fleshed out with what we need.

Anyway, here are the section-by-section notes.

Abstract

   The possibility of Quantum Computers pose a serious challenge to
   cryptography algorithms deployed widely today.  IKEv2 is one example

nit: singular/plural mismatch "possibility"/"pose".
maybe-nit: s/cryptography/cryptographic/?

Section 1

   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.

   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?

   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]

Section 1.2

Every directorate reviewer and IESG member is going to suggest that we
use the RFC 8174 version of the boilerplate, if we don't preemptively do
so :)

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?

   This PPK is independent of the preshared key (if any) that the IKEv2

I expect us to get a few questions about why we need a separate PPK in
cases when an authentication psk is also available; a short note here
might forestall such questions.  (It's needed because PSK for auth does
not feed into any of the other key derivations, right?)

   protocol uses to perform authentication.  The PPK specific
   configuration that is assumed on each peer consists of the following
   tuple:

   Peer, PPK, PPK_ID, mandatory_or_not

nit: we use "peer" twice here, and the context suggests that they refer
to different parties in the different places.

Section 3

   N(USE_PPK) is a status notification payload with the type 16435; it
   has a protocol ID of 0, no SPI and no notification data associated
   with it.

[check the IANA status of the value]

   If the responder does not support this specification or does not have
   any PPK configured, then she ignores the received notification and
   continues with the IKEv2 protocol as normal.  Otherwise the responder
   checks if she has a PPK configured, and if she does, then the

nit: we probably don't need to mention "if [...] PPK configured" twice.

   responder included the USE_PPK notification.  If the responder did
   not and the flag mandatory_or_not indicates that using PPKs is
   mandatory for communication with this responder, then the initiator
   MUST abort the exchange.  This situation may happen in case of

We might get some directorate questions about what it means to "abort
the exchange"; I note that RFC 7296 does not use that terminology,
though I'm perfectly happy to leave this as-is and see if we get any ADs
that are concerned about it.

   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?

   If the responder did include the USE_PPK notification, then the
   initiator selects a PPK, along with its identifier PPK_ID.  Then, she
   computes this modification of the standard IKEv2 key derivation:

Just to double-check: the responder's USE_PPK is just a boolean "I'm
willing to do PPK", right?  So we don't really hae a signal as to which
PPK_IDs the peer thinks are valid?

   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?

   If the PPK_IDENTITY notification contains PPK_ID that is not known to

nit: "a PPK_ID"

   the responder or is not configured for use for the identity from IDi
   payload, then the responder checks whether using PPKs for this
   initiator is mandatory and whether the initiator included NO_PPK_AUTH
   notification in the message.  If using PPKs is mandatory or no
   NO_PPK_AUTH notification found, then then the responder MUST send

nit: "is found"

   The responder then continues with the IKE_AUTH exchange (validating
   the AUTH payload that the initiator included) as usual and sends back
   a response, which includes the PPK_IDENTITY notification with no data
   to indicate that the PPK is used in the exchange:

Why does the responder not need to transmit an explicit PPK_ID?  (I see
that the following paragraph says that the initiatore MUST ignore any
content to that notification, but why?)

   not yet known to the responder.  Once the IKE_AUTH request message
   containing PPK_IDENTITY notification is received, the responder
   follows rules described above for non-EAP authentication case.

nits: (missing "the"s) "the PPK_IDENTITY notification", "the rules
described above", "the non-EAP authentication case"

      Initiator                         Responder
      ----------------------------------------------------------------
      HDR, SK {IDi, [CERTREQ,]
          [IDr,] SAi2,
          TSi, TSr}  -->
                                   <--  HDR, SK {IDr, [CERT,] AUTH,
                                            EAP}
      HDR, SK {EAP}  -->
                                   <--  HDR, SK {EAP (success)}
      HDR, SK {AUTH,
          N(PPK_IDENTITY, PPK_ID)
          [, N(NO_PPK_AUTH)]}  -->
                                   <--  HDR, SK {AUTH, SAr2, TSi, TSr
                                        [, N(PPK_IDENTITY)]}

Am I missing something subtle as to why N(PPK_IDENTIFY) is listed as
optional here in the EAP case but not in the previous diagram for the
non-EAP case?

Section 4

   With this configuration, the node will continue to operate with nodes
   that have not yet been upgraded.  This is due to the USE_PPK notify
   and the NO_PPK_AUTH notify; if the initiator has not been upgraded,
   he will not send the USE_PPK notify (and so the responder will know

nit: I think we should be consistent about using either "notification"
or "Notify payload"/"Notify message", avoiding just the bare "notify".
(Also occurs in subsequent locations that I won't quote/mention
individually.)

   NO_PPK_AUTH notification.  If both the responder and initiator have
   been upgraded and properly configured, they will both realize it, and
   in that case, the link will be quantum secure.

I think that "the link will be quantum secure" is probably overselling
things a little bit; for one, the confidentiality protection we provide
is only for the child SAs, and the discussion earlier in the document is
about providing protection for current connections against future
development of a quantum computer, while most people probably think of
full "quantum secure" as being protection even against a current quantum
computer.

   As an optional second step, after all nodes have been upgraded, then
   the administrator should then go back through the nodes, and mark the
   use of PPK as mandatory.  This will not affect the strength against a
   passive attacker; it would mean that an attacker with a Quantum
   Computer (which is sufficiently fast to be able to break the (EC)DH
   in real time) would not be able to perform a downgrade attack.

It seems like (given the current lack of advice for logging/reporting,
as noted above) changing the use of PPK to mandatory also serves to
provide notification if any future misconfiguration changes regarding
the use of PPK, to give a more robust indication of when the desired
protection is not being applied.

Section 5.1

      initiator and the responder.  The responder can use to do a look
      up the passed PPK_ID value to determine the corresponding PPK
      value.  Not all implementations are able to configure arbitrary

nit: this sentence is hard to follow; I suggest

% The responder can use the PPK_ID to look up the corresponding PPK
% value.

      value.  Not all implementations are able to configure arbitrary
      octet strings; to improve the potential interoperability, it is
      recommended that, in the PPK_ID_FIXED case, both the PPK and the
      PPK_ID strings be limited to the base64 character set, namely the
      64 characters 0-9, A-Z, a-z, + and /.

I don't have much experience with the conventions in this space; does it
make sense to distinguish between the PPK representation as configured
(which would use the base64 alphabet) and the "actual PPK" that could be
binary after, e.g., a base64-decoding step?  I guess it could be
reasonable to rely on the ability of the PRF to take an arbitrary-length
input and just have sufficient entropy even while limiting the PPK value
to the base64 alphabet.

   The PPK_ID type value 0 is reserved; values 3-127 are reserved for
   IANA; values 128-255 are for private use among mutually consenting
   parties.

I guess that anything done in the 128-255 range could also be done under
the PPK_ID_OPAQUE space (at the cost of an extra octet), but I don't
object to this breakdown.

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.)

Section 5.2.2

   It is possible to use a single PPK for a group of users.  Since each
   peer uses classical public key cryptography in addition to PPK for
   key exchange and authentication, members of the group can neither
   impersonate each other nor read other's traffic, unless they use
   Quantum Computers to break public key operations.  However group
   members can record other members' traffic and decrypt it later, when
   they get access to a Quantum Computer.

nit: I suggest "can record any traffic they have access to that comes
from other group members and decrypt it later", since just being a group
member does not grant one a universal network tap.

   In addition, the fact that the PPK is known to a (potentially large)
   group of users makes it more susceptible to theft.  When an attacker
   equipped with a Quantum Computer got access to a group PPK, all
   communications inside the group are revealed.

nit: s/got/gets/

Section 5.2.3

   PPK-only authentication can be achieved in IKEv2 if NULL
   Authentication method [RFC7619] is employed.  Without PPK the NULL

nit: "the NULL Authentication method" (the next/trimmed sentence gets it
right already).

Section 6

We should document the privacy considerations of the PPK_ID both in the
face of an attacker with a quantum computer (now or in the future) and
in the face of a classical attacker.  The latter would, IIUC, need to be
an active MITM in order to see anything other than N(USE_PPK), and who
would also get IDi along with the PPK_ID value, so there's not much of a
change in the privacy stance.

   Quantum computers are able to perform Grover's algorithm; that
   effectively halves the size of a symmetric key.  Because of this, the
   user SHOULD ensure that the postquantum preshared key used has at
   least 256 bits of entropy, in order to provide 128-bit security
   level.

nit: missing article (maybe "provide a 128-bit security level"?)

   Section 3 requires the initiator to abort the initial exchange if
   using PPKs is mandatory for it, but the responder might not include
   the USE_PPK notification in the response.  In this situation when the

nit: I suggest s/, but the responder might not include/but the responder
does not include/

   initiator aborts negotiation he leaves half-open IKE SA on the
   responder (because IKE_SA_INIT completes successfully from the
   responder's point of view).  This half-open SA will eventually expire

nits: comma after "In this situation", and s/half-open/a half-open/

   [RFC8019] for more detail).  It is RECOMMENDED that implementations
   in this situation cache the negative result of negotiation for some
   time and don't make attempts to create it again for some time,
   because this is a result of misconfiguration and probably some re-
   configuration of the peers is needed.

Is this "implementations" as initiators, responders, or both?

   removing USE_PPK notification from the IKE_SA_INIT and forging
   digital signatures in the subsequent exchange.  If using PPKs is
   mandatory for at least one of the peers or PSK is used for
   authentication, then the attack will be detected and the SA won't be
   created.

side note(?): Up in Section 5.2.3 we talk about PPK-only authentication,
but here we talk about PSK authentication.  I believe those are distinct
things (and thus that there's nothing to change in the text), but am
checking just to be sure.

   If using PPKs is mandatory for the initiator, then an attacker
   capable to eavesdrop and to inject packets into the network can
   prevent creating IKE SA by mounting the following attack.  The
   attacker intercepts the initial request containing the USE_PPK
   notification and injects the forget response containing no USE_PPK.

nits: s/capable to/able to/, s/creating IKE SA/creating an IKE SA/,
s/the forget response/a forged response/ (note both the->a and t->d in
the last one).

   If the attacker manages to inject this packet before the responder
   sends a genuine response, then the initiator would abort the
   exchange.  To thwart this kind of attack it is RECOMMENDED, that if
   using PPKs is mandatory for the initiator and the received response
   doesn't contain the USE_PPK notification, then the initiator doesn't
   abort the exchange immediately, but instead waits some time for more
   responses (possibly retransmitting the request).  If all the received

I expect that some reviewer is going to note that this recommendation
only occurs in the security considerations section and suggest moving it
to the body of the document, and also that we will be asked to give more
concrete guidance about "some time".  I don't think either change is
critical to make, but consider yourself forewarned...

Section 7

We should have a registration template for what information new
registration requests should include.  (In particular, since we allow
changing entries, a "change controller" and contact information will be
needed.)  I suggest including a column for "reference to specification
(if available)", even though the "Expert Review" policy does not
strictly require one.  We could also provide some guidance to the DEs as
to what criteria they may or may not want to apply in deciding whether
to approve or reject a registration request.

Appendix A

   The idea behind this document is that while a Quantum Computer can
   easily reconstruct the shared secret of an (EC)DH exchange, they
   cannot as easily recover a secret from a symmetric exchange.  This
   makes the SK_d, and hence the IPsec KEYMAT and any child SA's
   SKEYSEED, depend on both the symmetric PPK, and also the Diffie-
   Hellman exchange.  If we assume that the attacker knows everything

nit: I think we need to say "This document [makes the SK_D...]", since
otherwise the pronoun seems to refer back to the property of the QC.

   O(2^(n/2)) time to recover the PPK.  So, even if the (EC)DH can be
   trivially solved, the attacker still can't recover any key material
   (except for the SK_ei, SK_er, SK_ai, SK_ar values for the initial IKE
   exchange) unless they can find the PPK, which is too difficult if the
   PPK has enough entropy (for example, 256 bits).  Note that we do

nit: closing "and" for the list of SK_* values.

   Another goal of this protocol is to minimize the number of changes
   within the IKEv2 protocol, and in particular, within the cryptography
   of IKEv2.  By limiting our changes to notifications, and adjusting
   the SK_d, SK_pi, SK_pr, it is hoped that this would be implementable,
   even on systems that perform most of the IKEv2 processing in
   hardware.

nit: I suggest s/adjusting/only adjusting/

   A fourth goal was to avoid violating any of the security goals of
   IKEv2.

nit: It is sometimes considered good style to avoid using the same word
too much in close succession (here, "goal"); would it change the meaning
to say "the security properties provided by IKEv2"?

Thanks,

Ben

---

From: Paul Wouters <[email-masked]>
Date: Mon, 4 Nov 2019 22:39:46 -0500 (EST)

On Mon, 4 Nov 2019, Benjamin Kaduk wrote:

[ignoring the nits and leaving that to the authors, although reading it
again I would like to see "he" and "she" replaced by "it" everwhere]

> and/or general-purpose-nature.

It all depends on the algorithms these machines support as well as their
key size. It's hard to read the the quantum marketing to know what to
believe :)

> outcome of the WG discussions?

These are one-way functions with unknown input. There is no way to
reverse that using any known quantum algorithm.

> [need to check this some more]

It is not, but none of the above thanks about the Parent SA. It only
talks about the Child SA (AKA IPsec SA)

> use the RFC 8174 version of the boilerplate, if we don't preemptively do

To be fair, I had to check the publication date of 8174 to see which was
older - the RFC of the latest version of this draft waiting for the AD :)

> not feed into any of the other key derivations, right?)

Correct, the PSK is only used in the AUTH payload calculation. In IKEv1, it
was also mixed into the SKEYSEED, and so a mismatched PSK lead to a
garbled unreadable IKE packet which was not nice for administrators to
debug. In IKEv2 this was changed so we can provide proper error messages
on a wrong PSK. But we did lose the post-quantum protection.

> [check the IANA status of the value]

Those values have been used already for interoperability tests between
libreswan, strongswan, elvis+, cisco and apple :)

> that are concerned about it.

It could be rephased as "abort the exchange by sending an AUTHENTICATION_FAILED
error notify message back to the initiator".

> in case someone is concerned about the level of quantum-resistance in

That could be done. I just checked our implementation, and we seem to
not be tracking informational notifies, only error notifies (as can be
seen here: https://vpn.nohats.ca/munin/vpn-month.html on a test server)
and indeed we should add it to our implementation. And having a line of
text here would have cause implementors to do so :)

> PPK_IDs the peer thinks are valid?

Right. You would not want to tell an unauthenticated peer which IDs are
valid. In the case of a remote access VPN, you would have too many valid
IDs to share. Also in case of using ephemeral or pseudo-random IDs, you
couldn't have a complete list of these.

> when a quantum computer is available at the time of the exchange,

Practically all information that is in the parent can be learned by an
active attacker that has no valid credentials, that MITMs a connection.
The exception to this are the traffic selectors of the IPsec SA.

Additionally, if you care about this, you can first establish a
childless Parent SA, then do a Parent SA rekey that uses the PPK, and
only when you are quantum-safe, do a create_child_sa for the IPsec SA.
That way, no traffic selectors are available even if the initial Parent
SA is compromised by a quantum computer. Similarly, if you believe a
quantum computer would be fast enough to do real time attacks on the
Parent SA, this trick prevents someone with such a quantum computer from
sending valid IKE packets. Although even there, the damage that can be
done is very limited - send a keepalive probe, a delete request, or a
rekey or create request. Note that a compromised Parent SA does _not_
lead to compromised Child SA (IPsec SA) because the PPK is not known
to the attacker even after cracking the Parent SA encryption.

> content to that notification, but why?)

The identity of the responder is always known to the initiator. It is
the responder they set out to reach. They already know which PPK to
use with that. The responder however, might not know which of the many
valid initiators out there is trying to reach them, so they need to be
told.

>      Initiator                         Responder

You found a real bug :)

> full "quantum secure" as being protection even against a current quantum

Instead of the "link", it should probably talk about the IPsec SA being
quantum secure. A disclaimer like "based on current academic knowledge"
could be added :P

> input and just have sufficient entropy even while limiting the PPK value

Based on operational experience, anything not following the above will
run into interoperability problems. Often people cannot even input a hex
PSK, so we felt it better to just avoid the PSK issues we know about
with the new PPK. Similarly, ID_KEY_ID is an ID type that is mostly
useless in IKE because it is configured differently on each
implementation.

> object to this breakdown.

Yes. It was mostly done because implementers like something easy to
compare, and do not like "sub-typing" :)

> noting that the latter string does not appear in RFC 6030.)

I'm pretty confused about that too actually.

> change in the privacy stance.

I don't think the attack differs whether you have a quantum computer or
not. Just by relaying as MITM, you can learn IDs. It is inevitable.

> Is this "implementations" as initiators, responders, or both?

Initiators. In IKEv2, responders always only respond once per
received initiator packet.

> checking just to be sure.

Yes there are distinct things.

> critical to make, but consider yourself forewarned...

Sounds fair. Timing advise would be similar to how long the implemention
keeps half-open SA's around in general.

> to approve or reject a registration request.

Sounds fair.

Paul

---

From: Benjamin Kaduk <[email-masked]>
Date: Tue, 5 Nov 2019 01:47:34 -0800

> again I would like to see "he" and "she" replaced by "it" everwhere]

Thanks for chiming in (and quickly)!  I think the "he"/"she" thing has come
up recently in another context, and was left to author discretion, but
perhaps there is a broader conversation to have.

> key size. It's hard to read the the quantum marketing to know what to

Indeed :)

> talks about the Child SA (AKA IPsec SA)

Whoops, the square brackets were notes to myself that escaped prematurely
(I had a long interruption mid-review of this one, which presumably made me
forget they were there.)

I think I'm just complaining about "this secret provides quantum resistance
to the IPsec SAs".  Perhaps I'm not parting the terminology properly, but I
thought that meant (or included?) the parent SA.

> older - the RFC of the latest version of this draft waiting for the AD :)

I think the line "it's funny because it's true" comes to mind.  I am trying
to do better.

> libreswan, strongswan, elvis+, cisco and apple :)

Cool!  I had just left a note to myself to check that the specific value is
in fact allocated, so we don't write a document that "squats" on a
codepoint.  I even did the check before I sent the review; I just failed to
remove this note to myself!

> to the attacker even after cracking the Parent SA encryption.

Thanks for the extra discussion (which confirms my understanding of
things).  It is sounding like more text is not really going to be needed
here, then.

> valid initiators out there is trying to reach them, so they need to be

Sure ... I'm mostly coming at this from the perspective of the generic
class of (identity) misbinding, that leads us to have each party sign the
other's nonce, etc..  I don't have a concrete attack in this case (and one
seems like it would probably require a misbehaving peer?), so it was just a
question on general principles.

> > optional here in the EAP case but not in the previous diagram for the

(Which version is correct?)

> quantum secure. A disclaimer like "based on current academic knowledge"

I won't insist on the extra disclaimer :)

> > to approve or reject a registration request.

Thanks again,

Ben

---

From: Valery Smyslov <[email-masked]>
Date: Tue, 5 Nov 2019 17:26:43 +0300

Hi Ben,

many thanks for the very thorough review. Please, see inline.

> Anyway, here are the section-by-section notes.

In an attempt to make the message more readable I removed all the nits
that are silently accepted (thanks for catching them).

> and/or general-purpose-nature.

Do you have any data or pointers?

> 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).

> [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.

> use the RFC 8174 version of the boilerplate, if we don't preemptively do

Haven't we added it yet? Oh, my bad, the draft is so old, that
it doesn't even reference 8174 :-) Fixed.

> more about making a choice of which PPK to use or about having a list to

The former - making a choice of which PPK to use with any
specific responder. Do you think it should be rephrased?

> not feed into any of the other key derivations, right?)

Exactly. I've added short explanation:

      This PPK is independent of the preshared key (if any) that the IKEv2 protocol uses to perform authentication
      (because preshared key in IKEv2 is not used for any key derivation, and thus doesn't protect against Quantum Computers).

Is it OK?

> to different parties in the different places.

If we change it to:

"The PPK specific configuration that is assumed on each node consists of the following tuple:"

does it eliminate the possible confusion?

> [check the IANA status of the value]

These values have been allocated by IANA as a result of early allocation request.

> nit: we probably don't need to mention "if [...] PPK configured" twice.

Removed second instance of the phrase.

> that are concerned about it.

In this context "abort the exchange" means that the initiator
just stops any activity related to this exchange (but 
see Security Considerations for some hints).

> in case someone is concerned about the level of quantum-resistance in

Hmmm. I think that we follow RFC 7296 tradition that leaves
all logging (and the like) up to implementations...

> PPK_IDs the peer thinks are valid?

Yes. The PPK_ID is sent by the initiator in the IKE_AUTH request,
the IKE_SA_INIT only negotiate using PPK without specifying 
which PPK to use.

> when a quantum computer is available at the time of the exchange,

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.

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.

> content to that notification, but why?)

Because we use a single PPK for both (unlike PSKs, which can be different
for initiator and responder). So, the purpose of the PPK_IDENTITY
in this case is just to confirm that the responder agrees to use the PPK,
which the initiator selected. There is no need to return it back - 
the responder cannot change it, so an empty notification
does the job and saves some space. 

> described above", "the non-EAP authentication case"

Oh, it's my text, I've been always having problems with articles :-)

>       Initiator                         Responder

In the previous diagram we consider only the case when using
PPK is agreed upon, so N(PPK_IDENTITY) is not optional.
We leave out the case when using PPK is optional
for both and the responder doesn't have the PPK the initiator
has selected, in which case the normal IKE_AUTH takes place
(which is not depicted and is only spelled out).

With EAP a single diagram shows all possible scenarios,
thus  N(PPK_IDENTITY) becomes optional here.

> (Also occurs in subsequent locations that I won't quote/mention

Changed to "notification" in all places.

> full "quantum secure" as being protection even against a current quantum

Changed to "Child SAs".

> protection is not being applied.

Implicitly. However, even if we don't mandate any logging,
wise implementations would log all the important information
anyway.

> % The responder can use the PPK_ID to look up the corresponding PPK

OK.

> input and just have sufficient entropy even while limiting the PPK value

I recall it was requested by somebody during discussion in the WG.
I tend to agree with you, but I'd rather to wait for some input
from others.

> object to this breakdown.

We think that for some use cases new PPK_ID types may be needed.

> noting that the latter string does not appear in RFC 6030.)

I recall it was requested by somebody during discussion in the WG...

> member does not grant one a universal network tap.

OK.

> change in the privacy stance.

OK, we'll think how to do it right.

> Is this "implementations" as initiators, responders, or both?

Initiator. Changed to "the initiator".

> checking just to be sure.

Those are distinct things.

PPK-only authentication is in fact the NULL authentication
method used with PPK, so if using PPK is optional for both peers, 
then the described attack works even without QC, the attacker
just removes all PPK related stuff from the messages.

Note, that 5.2.3 requires that PPK is mandatory for both peers
for PPK-only authentication to work.

> critical to make, but consider yourself forewarned...

OK, we'll consider :-)

> to approve or reject a registration request.

Adding a reference column makes a lot of sense, thanks.

> to say "the security properties provided by IKEv2"?

OK, thanks.

Thank you,
Valery.

---

From: Benjamin Kaduk <[email-masked]>
Date: Tue, 5 Nov 2019 11:59:39 -0800

> that are silently accepted (thanks for catching them).

Thanks for that; I don't have a great workflow to split them out into a
separate section/document yet.

> 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.)

> halves an effective key length, so if longer PSK is used, we're safe

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.

> 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.

> 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".)

>       (because preshared key in IKEv2 is not used for any key derivation, and thus doesn't protect against Quantum Computers).

That's the right level of detail/length, thanks.
(nit: "the preshared key")

> does it eliminate the possible confusion?

Yes!

> 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.

> 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.)

> Oh, it's my text, I've been always having problems with articles :-)

English is a pretty silly language in this way (and many others) :)

> thus  N(PPK_IDENTITY) becomes optional here.

Ah, I see, since in the other case we split up each step of the exchange
into a separate diagram, so they had narrower focus.

> 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.)

> Initiator. Changed to "the initiator".

Thanks!

> for PPK-only authentication to work.

Yes, I do remember that, and am happy to see that requirement.

Thanks,

Ben

---

From: Paul Wouters <[email-masked]>
Date: Tue, 5 Nov 2019 17:44:41 -0500 (EST)

> In that case this text is fine as-is and there's nothing to change, so

Sorry, I do want to clarify this to be sure you got it completely right:

In IKEv1, you first setup an IKE SA (then called ISAKMP SA) using eiher
the Main or Aggress Mode Exchange, and then you do one or more Quick Mode
Exchanges to setup the first and subsequent IPsec SA's.

In IKEv2, the Initial Exchanges (1 IKE_SA_INIT plus 1 IKE_AUTH exchange)
create one IKE SA (now called Parent SA) nd one IPsec SA (now also called
Child SA) at the same time. Additional IPsec SA's can be created using
the CREATE_CHILD_SA exchange.

In IKEv2, we don't talk about ISAKMP SA anymore. I think people hoped
that in IKEv2 we would not talk about IKE SA and IPsec SA anymore (but
only talk about Parent SA and Child SA) but I don't think in reality
that is happening. I know our developers continue to disagree about what
to call certain things in code and documentation :)

This all does make it a little confusing. I can recommend the new NIST
Guide to IPsec VPNs SP800-77r1 document where I explain all these terms
as well :)

>> PPK is agreed upon, so N(PPK_IDENTITY) is not optional.

This btw, is a little weird. I think it is better to have the "generic"
exchange documented, and in the text write specific examples of when
payloads are or aren't t there. I think the figures/diagrams should be
drawn to represent the generic case, where it should be optional because
if it does not know the right PPK_ID, it will not send the notify.

That is, the diagrams should represent the state machine, not an
example of the state machine.

Paul

---

From: Valery Smyslov <[email-masked]>
Date: Wed, 6 Nov 2019 10:49:40 +0300

Hi Ben,

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

> computer" means -- some people seem to use it for just annealing-based

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.  

> 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.

> In that case this text is fine as-is and there's nothing to change, so

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.

OK, thanks.

OK.

> > 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.

OK.

> preconceptions of the terminology used.  (I have no prior experience with

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.

---

From: Valery Smyslov <[email-masked]>
Date: Wed, 6 Nov 2019 10:55:44 +0300

Hi Paul,

> if it does not know the right PPK_ID, it will not send the notify.

Do you think the current diagrams are confusing?

> example of the state machine.

Hmmmm... It's an open question :-) Aa a counter-example,
the EAP and non-EAP case of IKEv2 are not shown
on the same diagrams - these are different diagrams,
however the state machine for IKE_AUTH is the same.

I think diagrams (at least in IKE) don't replace state machine
description and are mostly used for clarity.

Regards,
Valery.

---

From: Valery Smyslov <[email-masked]>
Date: Wed, 6 Nov 2019 11:05:44 +0300

Hi Paul,

> again I would like to see "he" and "she" replaced by "it" everwhere]

Is it your strong preference? For me it's easier to use "it" everywhere,
but I'd like to see some advice from native speakers...

Regards,
Valery.

---

From: Paul Wouters <[email-masked]>
Date: Wed, 6 Nov 2019 09:42:51 -0500 (EST)

> Do you think the current diagrams are confusing?

Yes. Because often I go back to RFCs and only look at the diagrams
expecting it to be what I need to implement. So for optional/required
payloads, I would mostly look at the diagram, and perhaps read a bit
of text.

> however the state machine for IKE_AUTH is the same.

Sure.

> description and are mostly used for clarity.

We even put the diagrams in some of our code comments. It's used
for more than just clarity by us :)

Paul

---

From: "Scott Fluhrer (sfluhrer)" <[email-masked]>
Date: Wed, 6 Nov 2019 16:42:27 +0000

> -----Original Message-----
> From: Valery Smyslov <[email-masked]>
> Sent: Wednesday, November 06, 2019 2:50 AM
> To: 'Benjamin Kaduk' <[email-masked]>
> Cc: [email-masked]; [email-masked]
> Subject: RE: AD review of draft-ietf-ipsecme-qr-ikev2-08
> 
> Hi Ben,
> 
> > > > 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.
> > >
> > 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*.
> > 60+ 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.)
> 

I'd suggest using the phrase "cryptographically significant Quantum Computer".  The problems that you find in cryptography do need more qubits than current Quantum Computers possess; however they also need to perform millions of operations without significant error, and that would appear to be a more serious hurdle.

> > > > 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).
> >

Breaking it down, we come up with four propositions:
- Grover's attack would require a huge number of operations against a sufficiently long secret.
- This huge number of operations is infeasible against any plausible operation.
- Any attack better than Grovers would require attacking the function at a lower level than a black box
- No such insight is known.

The first can easily be cited (e.g. the original Grover paper).  The second one is generally believed, but the exact length of the secret would depend on the eventual speed/scale of a quantum computer, which is somewhat unknown.
The third is also citable (again, the original Grover paper).  The fourth is problematic, because it is essentially an argument from a lack of knowledge.

Personally, I believe that this sort of argument is well known enough (at least, to the people who know postquantum cryptography) that it would not be required.

---

From: Tero Kivinen <[email-masked]>
Date: Fri, 8 Nov 2019 02:36:32 +0200

> payloads, I would mostly look at the diagram, and perhaps read a bit

That is the reason we added Appendix C in the IKEv2.

So my proposal is to leave the exchanges inside the text as they are,
but add new Appendix that has the different exchanges including the
optional payloads.

> > however the state machine for IKE_AUTH is the same.

In RFC7296 Appendix C we do have C.2 IKE_AUTH Exchange without EAP,
and C.3 IKE_AUTH Exchange with EAP. And I would say that the state
machine for IKE_AUTH for them are different, the state machine for
IKE_SA_INIT is same for both and is not included in C.2, or C.3, both
of them use the IKE_SA_INIT from C.1
-- 
[email-masked]

---

From: Tero Kivinen <[email-masked]>
Date: Fri, 8 Nov 2019 03:00:37 +0200

> [check the IANA status of the value]

As others already commented I as an IANA Expert for those registries
did do an assignment for those notification values, as they were
stable enough already in 2018 February...

Creating new registry could not be done as expert review, so that
creation PPK_ID type registry was left to this document. Of course
there was no problem with using the numbers, as there is nobody else
who can allocate things from that registry as that registry does not
yet exists. 

> input and just have sufficient entropy even while limiting the PPK value

We had long discussion this in one of the meetings some time ago, and
I think the problem is that some implementations use configuration
files where they write the keys directly, some use config files
pointing to the file on the disk, and some use some database backend,
and then there are the ones that use GUI to enter the key.

When you have key "makemetastygoat" that is easy. When you have key
which contains NULs, newlines, 8-bit characters etc., there are
several cases where you cannot enter such key to configuration of
implementation.

We decided that base64 is good enough, i.e., the keys do not get too
much longer, but every single system should be able to configure key
using that charset.

As the keys are feed in to the PRF anyways there is no need to require
them to be binary, only thing that should matter is how much entropy
there is in the key, and with base64 it is easy to calculate. 

> change in the privacy stance.

We did discuss this and decided that it would be possible to protect
the identity (IDi, and IDr) using pseudonyms if such thing is needed.
I.e., instead of using real IDi and IDr, we use some random identity
string. After the IKE SA creation we can do IKE SA rekey to gain QR
protection for the IKE SA traffic too, and after that we can agree on
the next ID to be used for next connection. This way the identities
will be always different and completely random.

The PPK_ID does not need to have meaning outside the fact that it
identifies the PPK we are going to be using. So it can be random from
the beginning, and you can either use similar agreeing on next PPK_IDs
after rekey than for IDi/IDr, or you can simply use each PPK only once
and generate lots of them before you even start.

None of this is written in the draft, as we kept the focus on making
IKEv2 quantum resistant and keeping the original properties of the
IKEv2 intact otherwise. Adding better identity protection is something
that can be done separately and can also be used with or without QR.

> to approve or reject a registration request.

As an IANA expert and most likely a candidate for expert for this
registry too, I do not think such templates or rules for expert are
needed. I hope people will trust experts enough to make smart
decisions.

In this case I do not think there will be too many new registrations
to this registry and in many cases vendors might be using just private
use numbers for their internal cases. Some vendor might defined
something like PPK_ID_FILE_AND_INDEX where there is first 32-bit index
and then filename indicating which one time pad file is used and the
index tells you which key inside the file is used. To be able to
transmit that file from one device to another both ends needs to
understand the file format etc, and if that file format is proprietary
then there is no point of using standard PPK_ID type either. 
-- 
[email-masked]

---

From: Benjamin Kaduk <[email-masked]>
Date: Fri, 8 Nov 2019 12:51:10 -0800

Hi Tero,

> there is in the key, and with base64 it is easy to calculate. 

That's roughly where I ended up after thinking about it, so I'm glad we're
all on the same page.  (And my apologies for having everyone spend more
words on it.)

> that can be done separately and can also be used with or without QR.

Okay.

> needed. I hope people will trust experts enough to make smart

Okay, I'll put that down as "we considered providing guidance but decided
not to", which is fine.

> In this case I do not think there will be too many new registrations

Indeed, I cannot think of many possibilities there.

Thanks,

Ben

---

From: Benjamin Kaduk <[email-masked]>
Date: Fri, 8 Nov 2019 12:52:49 -0800

> I'd suggest using the phrase "cryptographically significant Quantum Computer".  The problems that you find in cryptography do need more qubits than current Quantum Computers possess; however they a…

This is the best suggestion I've heard so far, thanks.

> Personally, I believe that this sort of argument is well known enough (at least, to the people who know postquantum cryptography) that it would not be required.

I've heard enough people say this that I'm convinced.

Thanks for having the discussion!

-Ben

---

From: Valery Smyslov <[email-masked]>
Date: Wed, 13 Nov 2019 11:36:27 +0300

Hi Tero,

> but add new Appendix that has the different exchanges including the

I don't think it's justified for such small changes in IKE exchanges
(a couple new notifications). Instead, I suggest to add the following
short clarification after the picture:

      Initiator                         Responder

   Note, that the diagram above shows both the cases when the responder
   uses PPK and when it chooses not to do it (provided the initiator has
   included NO_PPK_AUTH notification), so the responder's PPK_IDENTITY
   notification is marked as optional.  

Is it OK? Paul?

Regards,
Valery.