Draft: draft-ietf-perc-double

Commentary: few nits to the commit 
 Oh , one things I think we should add ref to ABNF
Paragraph (version A):
This specification defines an SRTP transform that uses the AES-GCM
algorithm RFC7714 to provide encryption and integrity for an RTP
packet for the end-to-end cryptographic key as well as a hop-by-hop
cryptographic encryption and integrity between the endpoint and the
Media Distributor.  The Media Distributor decrypts and checks
integrity of the hop-by-hop security.  The Media Distributor MAY
change some of the RTP header information that would impact the end-
to-end integrity.  The original value of any RTP header field that is
changed is included in a new RTP header extension called the Original
Header Block.  The new RTP packet is encrypted with the hop-by-hop
cryptographic algorithm before it is sent.  The receiving endpoint
decrypts and checks integrity using the hop-by-hop cryptographic
algorithm and then replaces any parameters the Media Distributor
changed using the information in the Original Header Block before
decrypting and checking the end-to-end integrity.
Paragraph (version A):
One can think of the double as a normal SRTP transform for encrypting
the RTP in a way where things that only know half of the key, can
decrypt and modify part of the RTP packet but not other parts of if
including the media payload.
Paragraph (version B):
This specification defines an SRTP transform that uses the AES-GCM
algorithm RFC7714 to provide encryption and integrity for an RTP
packet for the end-to-end cryptographic key as well as a hop-by-hop
cryptographic encryption and integrity between the endpoint and the
Media Distributor.  The Media Distributor decrypts and checks
integrity of the hop-by-hop security.  The Media Distributor MAY
change some of the RTP header information that would impact the end-
to-end integrity.  In that case, the original value of any RTP header
field that is changed is included in a new RTP header extension
called the Original Header Block.  The new RTP packet is encrypted
with the hop-by-hop cryptographic algorithm before it is sent.  The
receiving endpoint decrypts and checks integrity using the hop-by-hop
cryptographic algorithm and then replaces any parameters the Media
Distributor changed using the information in the Original Header
Block before decrypting and checking the end-to-end integrity.
Paragraph (version B):
One can think of the double as a normal SRTP transform for encrypting
the RTP in a way where things that only know half of the key, can
decrypt and modify part of the RTP packet but not other parts,
including the media payload.
Paragraph (version A):
This specification uses a cryptographic context with two parts: an
inner (end-to-end) part that is used by endpoints that originate and
consume media to ensure the integrity of media end-to-end, and an
outer (hop-by-hop) part that is used between endpoints and Media
Distributors to ensure the integrity of media over a single hop and
to enable a Media Distributor to modify certain RTP header fields.
RTCP is also handled using the hop-by-hop cryptographic part.  The
RECOMMENDED cipher for the hop-by-hop and end-to-end algorithm is
AES-GCM.  Other combinations of SRTP ciphers that support the
procedures in this document can be added to the IANA registry.
Paragraph (version B):
The RECOMMENDED cipher for the hop-by-hop and end-to-end algorithm is
AES-GCM.  Other combinations of SRTP ciphers that support the
procedures in this document can be added to the IANA registry.
Paragraph (version A):
The Original Header Block (OHB) contains the original values of any
modified header fields.  In the encryption process, the OHB is
appended to the RTP payload.  In the decryption process, the
receiving endpoint uses it to reconstruct the original RTP header, so
that it can pass the proper AAD value to the inner transform.
Paragraph (version B):
The Original Header Block (OHB) contains the original values of any
modified RTP header fields.  In the encryption process, the OHB is
appended to the RTP payload.  In the decryption process, the
receiving endpoint uses it to reconstruct the original RTP header, so
that it can pass the proper AAD value to the inner transform.
Paragraph (version A):
The Media Distributor has the part of the key for the outer (hop-by-
hop), but it does not have the part of the key for the (end-to-end)
cryptographic algorithm.  The cryptographic algorithm and key used to
decrypt a packet and any encrypted RTP header extensions would be the
same as those used in the endpoint's outer algorithm and key.
Paragraph (version A):
In order to modify a packet, the Media Distributor decrypts the
packet, modifies the packet, updates the OHB with any modifications
not already present in the OHB, and re-encrypts the packet using the
cryptographic using the outer (hop-by-hop) key.
Paragraph (version B):
The Media Distributor has the part of the key for the outer (hop-by-
hop) cryptographic algorithm, but it does not have the part of the
key for the (end-to-end) cryptographic algorithm.  The cryptographic
algorithm and key used to decrypt a packet and any encrypted RTP
header extensions would be the same as those used in the endpoint's
outer algorithm and key.
Paragraph (version B):
In order to modify a packet, the Media Distributor decrypts the
received packet, modifies the packet, updates the OHB with any
modifications not already present in the OHB, and re-encrypts the
packet using the the outer (hop-by-hop) cryptographic key before
transmitting.
Paragraph (version A):
Unlike RTP, which is encrypted both hop-by-hop and end-to-end using
two separate cryptographic key, RTCP is encrypted using only the
outer (hop-by-hop) cryptographic key.  The procedures for RTCP
encryption are specified in RFC3711 and this document introduces no
additional steps.
Paragraph (version B):
Unlike RTP, which is encrypted both hop-by-hop and end-to-end using
two separate cryptographic keys, RTCP is encrypted using only the
outer (hop-by-hop) cryptographic key.  The procedures for RTCP
encryption are specified in RFC3711 and this document introduces no
additional steps.
Paragraph (version A):
There are some RTP related extensions that need special consideration
to be used by a relay when using the double transform due to the end-
to-end protection of the RTP.  The repair mechanism, when used with
double, typically operate on the double encrypted data then take the
results of theses operations and encrypted them using only the HBH
key.  This results in three cryptography operation happening to the
repair data sent over the wire.
Paragraph (version A):
When using RTX RFC4588 with double, the cached payloads MUST be the
encrypted packets with the bits that are sent over the wire to the
other side.  When encrypting a retransmission packet, it MUST be
encrypted in packet repair mode.
Paragraph (version A):
A typical RTX receiver would decrypt the packet, undo the RTX
transformation, then process the resulting packet using the normally
by using the steps in decrypt.
Paragraph (version A):
When using RED RFC2198 with double, the primary encoding MAY contain
RTP header extensions and CSRC identifiers but non primary encodings
can not.
Paragraph (version A):
The sender takes encrypted payloads from the cached packets to form
the RED payload.  Any header extensions from the primary encoding are
copied to the RTP packet that will cary the RED payload and the other
RTP header information such as SSRC, SEQ, CSRC, etc are set to the
same as the primary payload.  The RED RTP packet is then encrypted in
repair mode and sent.
Paragraph (version A):
The receiver decrypts the payload to find the RED payload.  Note a
media relay can do this decryption as the packet was sent in repair
mode that only needs the hop-by-hop key.  The RTP headers and header
extensions along with the primary payload and PT from inside the RED
payload are used to form the encrypted primary RTP packet which can
then be decrypted with double.  The RTP headers (but not header
extensions or CSRC) along with PT from inside the RED payload are
used for from the non primary payloads.  The time offset information
in the RED data MUST be used to adjust the sequence number in the RTP
header by using the timestamp offset and packet rate to find a
sequence number offset to adjust by.  At this point the non primary
packets can be decrypted with double.
Paragraph (version B):
There are some RTP related extensions that need special consideration
to be used by a relay when using the double transform due to the end-
to-end protection of the RTP.  The repair mechanism, when used with
double, typically operates on the double encrypted data and encrypts
them using only the HBH key.  This results in three cryptography
operation happening to the repair data sent over the wire.
Paragraph (version B):
When using RTX RFC4588 with double, the cached payloads MUST be the
encrypted packets with the bits that are sent over the wire to the
other side.  When encrypting a retransmission packet, it MUST be
encrypted the packet in repair mode.
Paragraph (version B):
A typical RTX receiver would decrypt the packet, undo the RTX
transformation, then process the resulting packet normally by using
the steps in decrypt.
Paragraph (version B):
When using RED RFC2198 with double, the primary encoding MAY contain
RTP header extensions and CSRC identifiers but non primary encodings
cannot.
Paragraph (version B):
The sender takes encrypted payload from the cached packets to form
the RED payload.  Any header extensions from the primary encoding are
copied to the RTP packet that will carry the RED payload and the
other RTP header information such as SSRC, SEQ, CSRC, etc are set to
the same as the primary payload.  The RED RTP packet is then
encrypted in repair mode and sent.
Paragraph (version B):
The receiver decrypts the payload to find the encrypted RED payload.
Note a media relay can do this decryption as the packet was sent in
repair mode that only needs the hop-by-hop key.  The RTP headers and
header extensions along with the primary payload and PT from inside
the RED payload (for the primary encoding) are used to form the
encrypted primary RTP packet which can then be decrypted with double.
Paragraph (version B):
The RTP headers (but not header extensions or CSRC) along with PT
from inside the RED payload corresponding to the redundant encoding
are used to from the non primary payloads.  The time offset and
packet rate information in the RED data MUST be used to adjust the
sequence number in the RTP header.  At this point the non primary
packets can be decrypted with double.
Paragraph (version A):
When DTMF is sent with RFC4733, it is end-to-end encrypted and the
relay can not read it so it can not be used to control the relay.
Other out of band methods to control the relay need to be used
instead.
Paragraph (version B):
When DTMF is sent with RFC4733, it is end-to-end encrypted and the
relay can not read it so it cannot be used to control the relay.
Other out of band methods to control the relay need to be used
instead.
Paragraph (version A):
While this document only defines a profile based on AES-GCM, it is
possible for future documents to define further profiles with
different inner and outer crypto in this same framework.  For
example, if a new SRTP transform was defined that encrypts some or
all of the RTP header, it would be reasonable for systems to have the
option of using that for the outer algorithm.  Similarly, if a new
transform was defined that provided only integrity, that would also
be reasonable to use for the hop-by-hop as the payload data is
already encrypted by the end-to-end.
Paragraph (version B):
While this document only defines a profile based on AES-GCM, it is
possible for future documents to define further profiles with
different inner and outer algorithms in this same framework.  For
example, if a new SRTP transform was defined that encrypts some or
all of the RTP header, it would be reasonable for systems to have the
option of using that for the outer algorithm.  Similarly, if a new
transform was defined that provided only integrity, that would also
be reasonable to use for the hop-by-hop as the payload data is
already encrypted by the end-to-end.
Paragraph (version A):
To summarize what is encrypted and authenticated, we will refer to
all the RTP fields except headers created by the sender and before
the pay load as the initial envelope and the RTP payload information
with the media as the payload.  Any additional headers added by the
sender or Media Distributor are referred to as the extra envelope.
The sender uses the end-to-end key to encrypts the payload and
authenticate the payload + initial envelope which using an AEAD
cipher results in a slight longer new payload.  Then the sender uses
the hop-by-hop key to encrypt the new payload and authenticate the
initial envelope extra envelope and the new payload.
Paragraph (version A):
The Media Distributor has the hop-by-hop key so it can check the
authentication of the received packet across the initial envelope,
extra envelope and payload data but it can't decrypt the payload as
it does not have the end-to-end key.  It can add or change extra
envelope information.  It then authenticates the initial plus extra
envelope information plus payload with a hop-by-hop key.  This hop-
by-hop for the outgoing packet is typically different than the hop-
by-hop key for the incoming packet.
Paragraph (version A):
The receiver can check the authentication of the initial and extra
envelope information from the Media Distributor.  This, along with
the OHB, is used to construct a synthetic packet that is should be
identical initial envelope plus payload to one the sender created and
the receiver can check that it is identical and then decrypt the
original payload.
Paragraph (version A):
The end result is that if the authentications succeed, the receiver
knows exactly what the payload and initial envelope the sender sent,
as well as exactly which modifications were made by the Media
Distributor and what extra envelope the Media Distributor send.  The
receive does not know exactly what extra envelope the sender sent.
Paragraph (version A):
It is obviously critical that the intermediary has only the outer
(hop-by-hop) algorithm key and not the half of the key for the the
inner (end-to-end) algorithm.  We rely on an external key management
protocol to assure this property.
Paragraph (version B):
To summarize what is encrypted and authenticated, we will refer to
all the RTP fields except headers created by the sender and before
the payload as the initial envelope and the RTP payload information
with the media as the payload.  Any additional headers added by the
sender or Media Distributor are referred to as the extra envelope.
The sender uses the end-to-end key to encrypt the payload and
authenticate the payload + initial envelope, which using an AEAD
cipher results in a slight longer new payload.  Then the sender uses
the hop-by-hop key to encrypt the new payload and authenticate the
initial envelope, extra envelope and the new payload.
Paragraph (version B):
The Media Distributor has the hop-by-hop key so it can check the
authentication of the received packet across the initial envelope,
extra envelope and payload data but it can't decrypt the payload as
it does not have the end-to-end key.  It can add or change extra
envelope information.  It then authenticates the initial plus extra
envelope information plus payload with a hop-by-hop key.  The hop-by-
hop key for the outgoing packet is typically different than the hop-
by-hop key for the incoming packet.
Paragraph (version B):
The receiver can check the authentication of the initial and extra
envelope information from the Media Distributor.  This, along with
the OHB, is used to construct a synthetic packet which should be
identical to the initial envelope plus payload to one the sender
created and the receiver can check that it is identical and then
decrypt the original payload.
Paragraph (version B):
The end result is that if the authentications succeed, the receiver
knows exactly the payload and initial envelope the sender sent, as
well as exactly which modifications were made by the Media
Distributor and what extra envelope the Media Distributor sent.  The
receive does not know exactly what extra envelope the sender sent.
Paragraph (version B):
It is obviously critical that the intermediary has access to just the
outer (hop-by-hop) algorithm key and not the half of the key for the
the inner (end-to-end) algorithm.  We rely on an external key
management protocol to ensure this property.