idnits 2.17.1 draft-mcgrew-srtp-ekt-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.ii or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The Initial Sequence Number field is set to zero, if the initial RTP packet protected using the current SRTP master key for this source preceded, or was concurrent with, the last roll-over of the RTP sequence number. Otherwise, that field is set to the value of the RTP sequence number of the initial RTP packet that was or will be protected by that key. When the SRTP master key corresponding to a source is changed, the new key SHOULD be communicated in advance via EKT. (Note that the ISN field allows the receiver to know when it should start using the new key to process SRTP packets.) This enables the rekeying event to be communicated before any RTP packets are protected with the new key. The rekeying event MUST not change the value of ROC (otherwise, the current value of the ROC would not be known to late joiners of existing sessions). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 9, 2009) is 5525 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'SRTP' is mentioned on line 608, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS197' ** Downref: Normative reference to an Informational RFC: RFC 3394 ** Obsolete normative reference: RFC 3548 (Obsoleted by RFC 4648) ** Obsolete normative reference: RFC 4234 (Obsoleted by RFC 5234) Summary: 4 errors (**), 0 flaws (~~), 3 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group D. McGrew 3 Internet-Draft F. Andreasen 4 Intended status: Standards Track Cisco Systems, Inc. 5 Expires: September 10, 2009 L. Dondeti 6 QUALCOMM 7 March 9, 2009 9 Encrypted Key Transport for Secure RTP 10 draft-mcgrew-srtp-ekt-04.txt 12 Status of this Memo 14 This Internet-Draft is submitted to IETF in full conformance with the 15 provisions of BCP 78 and BCP 79. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that 19 other groups may also distribute working documents as Internet- 20 Drafts. 22 Internet-Drafts are draft documents valid for a maximum of six months 23 and may be updated, replaced, or obsoleted by other documents at any 24 time. It is inappropriate to use Internet-Drafts as reference 25 material or to cite them other than as "work in progress." 27 The list of current Internet-Drafts can be accessed at 28 http://www.ietf.org/ietf/1id-abstracts.txt. 30 The list of Internet-Draft Shadow Directories can be accessed at 31 http://www.ietf.org/shadow.html. 33 This Internet-Draft will expire on September 10, 2009. 35 Copyright Notice 37 Copyright (c) 2009 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents in effect on the date of 42 publication of this document (http://trustee.ietf.org/license-info). 43 Please review these documents carefully, as they describe your rights 44 and restrictions with respect to this document. 46 Abstract 48 SRTP Encrypted Key Transport (EKT) is an extension to SRTP that 49 provides for the secure transport of SRTP master keys, Rollover 50 Counters, and other information, within SRTCP. This facility enables 51 SRTP to work for decentralized conferences with minimal control, and 52 to handle situations caused by SIP forking and early media. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 57 1.1. Conventions Used In This Document . . . . . . . . . . . . 5 58 2. Encrypted Key Transport . . . . . . . . . . . . . . . . . . . 6 59 2.1. Authentication Tag Format . . . . . . . . . . . . . . . . 6 60 2.2. Packet Processing and State Machine . . . . . . . . . . . 8 61 2.2.1. Outbound (Tag Generation) . . . . . . . . . . . . . . 8 62 2.2.2. Inbound (Tag Verification) . . . . . . . . . . . . . . 10 63 2.3. Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . 12 64 2.3.1. The Default Cipher . . . . . . . . . . . . . . . . . . 13 65 2.3.2. The AES Key Wrap Cipher . . . . . . . . . . . . . . . 13 66 2.3.3. Other EKT Ciphers . . . . . . . . . . . . . . . . . . 14 67 2.4. Synchronizing Operation . . . . . . . . . . . . . . . . . 14 68 2.5. Timing and Reliability Consideration . . . . . . . . . . . 15 69 3. EKT and SDP Security Descriptions . . . . . . . . . . . . . . 16 70 3.1. SDP Security Descriptions Recap . . . . . . . . . . . . . 16 71 3.2. Relationship between EKT and SDP Security Descriptions . . 17 72 3.3. Overview of Combined EKT and SDP Security Description 73 Operation . . . . . . . . . . . . . . . . . . . . . . . . 19 74 3.4. EKT Extensions to SDP Security Descriptions . . . . . . . 19 75 3.4.1. EKT_Cipher . . . . . . . . . . . . . . . . . . . . . . 19 76 3.4.2. EKT_Key . . . . . . . . . . . . . . . . . . . . . . . 20 77 3.4.3. EKT_SPI . . . . . . . . . . . . . . . . . . . . . . . 20 78 3.5. Offer/Answer Procedures . . . . . . . . . . . . . . . . . 20 79 3.5.1. Generating the Initial Offer - Unicast Streams . . . . 20 80 3.5.2. Generating the Initial Answer - Unicast Streams . . . 22 81 3.5.3. Processing of the Initial Answer - Unicast Streams . . 23 82 3.6. SRTP-Specific Use Outside Offer/Answer . . . . . . . . . . 24 83 3.7. Modifying the Session . . . . . . . . . . . . . . . . . . 24 84 3.8. Backwards Compatibility Considerations . . . . . . . . . . 24 85 3.9. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . 25 86 4. Use of EKT with DTLS-SRTP Key Transport . . . . . . . . . . . 26 87 5. Use of EKT with MIKEY . . . . . . . . . . . . . . . . . . . . 27 88 5.1. EKT transform attribute mapping in MIKEY . . . . . . . . . 27 89 6. Design Rationale . . . . . . . . . . . . . . . . . . . . . . . 30 90 7. RTP Transport . . . . . . . . . . . . . . . . . . . . . . . . 32 91 8. Security Considerations . . . . . . . . . . . . . . . . . . . 33 92 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 93 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35 94 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 36 95 11.1. Normative References . . . . . . . . . . . . . . . . . . . 36 96 11.2. Informative References . . . . . . . . . . . . . . . . . . 37 97 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 38 99 1. Introduction 101 RTP is designed to allow decentralized groups with minimal control to 102 establish sessions, e.g. for multimedia conferences. Unfortunately, 103 Secure RTP (SRTP, [RFC3711]) cannot be used in many minimal-control 104 scenarios, because it requires that SSRC values and other data be 105 coordinated among all of the participants in a session. For example, 106 if a participant joins a session that is already in progress, the 107 SRTP rollover counter (ROC) of each SRTP source in the session needs 108 to be provided to that participant. 110 The inability of SRTP to work in the absence of central control was 111 well understood during the design of that protocol; that omission was 112 considered less important than optimizations such as bandwidth 113 conservation. Additionally, in many situations SRTP is used in 114 conjunction with a signaling system that can provide most of the 115 central control needed by SRTP. However, there are several cases in 116 which conventional signaling systems cannot easily provide all of the 117 coordination required. It is also desirable to eliminate the layer 118 violations that occur when signaling systems coordinate certain SRTP 119 parameters, such as SSRC values and ROCs. 121 This document defines Encrypted Key Transport (EKT) for SRTP, an 122 extension to SRTP that fits within the SRTP framework and reduces the 123 amount of signaling control that is needed in an SRTP session. EKT 124 securely distributes the SRTP master key and other information for 125 each SRTP source, using SRTCP to transport that information. With 126 this method, SRTP entities are free to choose SSRC values as they see 127 fit, and to start up new SRTP sources with new SRTP master keys (see 128 Section 2.2) within a session without coordinating with other 129 entities via signaling or other external means. This fact allows to 130 reinstate the RTP collision detection and repair mechanism, which is 131 nullified by the current SRTP specification because of the need to 132 control SSRC values closely. An SRTP endpoint using EKT can generate 133 new keys whenever an existing SRTP master key has been overused, or 134 start up a new SRTP source to replace an old SRTP source that has 135 reached the packet-count limit. EKT also solves the problem in which 136 the burst loss of the N initial SRTP packets can confuse an SRTP 137 receiver, when the initial RTP sequence number is greater than or 138 equal to 2^16 - N. These features simplify many architectures that 139 implement SRTP. 141 EKT provides a way for an SRTP session participant, either sender or 142 receiver, to securely transport its SRTP master key and current SRTP 143 rollover counter to the other participants in the session. This 144 data, possibly in conjunction with additional data provided by an 145 external signaling protocol, furnishes the information needed by the 146 receiver to instantiate an SRTP/SRTCP receiver context. 148 EKT does not control the manner in which the SSRC and master key are 149 generated; it is concerned only with their secure transport. Those 150 values may be generated on demand by the SRTP endpoint, or may be 151 dictated by an external mechanism such as a signaling agent or a 152 secure group controller. 154 EKT is not intended to replace external key establishment mechanisms 155 such as DTLS-SRTP Key Transport 156 [I-D.wing-avt-dtls-srtp-key-transport], SDP Security Descriptions 157 [RFC4568], or MIKEY [RFC3830]. Instead, it is used in conjunction 158 with those methods, and it relieves them of the burden of tightly 159 coordinating every SRTP source among every SRTP participant. 161 This document is organized as follows. A complete normative 162 definition of EKT is provided in Section 2. It consists of packet 163 processing algorithms (Section 2.2) and cryptographic definitions 164 (Section 2.3) . In Section 3, the use of EKT with SDP Security 165 Descriptions is defined. In Section 5 we outline the use of EKT with 166 MIKEY. Section 6 provides a design rationale. Security 167 Considerations are provided in Section 8, and IANA considerations are 168 provided in Section 9. 170 1.1. Conventions Used In This Document 172 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 173 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 174 document are to be interpreted as described in [RFC2119]. 176 2. Encrypted Key Transport 178 In EKT, an SRTP master key is encrypted with a Key Encrypting Key 179 (KEK), and the resulting ciphertext is transported in every SRTCP 180 packet. A single KEK suffices for a single SRTP session, regardless 181 of the number of participants in the session. However, there can be 182 multiple KEKs used within a particular session. 184 In order to convey the ciphertext of the SRTP master key, and other 185 additional information, the SRTCP Authentication Tag field is 186 subdivided as defined in Section 2.1. EKT defines a new SRTCP 187 authentication function, which uses this format. It incorporates a 188 conventional SRTCP authentication function, which is called the base 189 authentication function in this specification. Any SRTCP 190 authentication function, such as the default one of HMAC-SHA1 with a 191 160-bit key and an 80-bit authentication tag, can be used as a base 192 authentication function. EKT also defines a new method of providing 193 SRTP master keys to an endpoint. 195 0 1 2 3 196 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 197 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 198 : Base Authentication Tag : 199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 200 : Encrypted Master Key : 201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 202 | Rollover Counter | 203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 204 | Initial Sequence Number | Security Parameter Index |1| 205 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 207 0 1 2 3 208 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 209 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 210 : Base Authentication Tag : 211 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 212 | Reserved |0| 213 +-+-+-+-+-+-+-+-+ 215 Figure 1: The EKT Authentication Tag format. 217 2.1. Authentication Tag Format 219 EKT uses the Authentication Tag format shown in Figure 1. The top 220 diagram shows the format in the case that the final bit is set to 221 one, in which case all of the EKT fields are present. The bottom 222 diagram shows the format in the case that the final bit is set to 223 zero, in which case the Encrypted Master Key, Rollover Counter, 224 Initial Sequence Number, and Security Parameter Index fields are 225 absent, and the Reserved field is present; the latter field MUST be 226 set to the all-zero value. These two cases can always be 227 unambiguously distinguished by the final bit, or by checking to see 228 if the final byte in the packet has the all-zero value. 230 The Authentication Tag field contains the following sub-fields: 232 Base Authentication Tag This field contains the authentication tag 233 computed by the base authentication function. The value of this 234 field is used to check the authenticity of the packet. 236 Encrypted Master Key The length of this field is variable, and is 237 equal to the ciphertext size N defined in Section 2.3. Note that 238 the length of the field is inferable from the SPI field, since the 239 particular EKT cipher used by the sender of a packet is inferable 240 from that field. The Encrypted Master Key field is included 241 outside of the authenticated portion of the SRTCP packet, 242 immediately following the Authentication Tag. It contains the 243 ciphertext value resulting from the encryption of the SRTP master 244 key corresponding to the SSRC contained in the packet. The 245 encryption and decryption of this value is done using a cipher as 246 defined in Section 2.3. 248 Rollover Counter The length of this field is fixed at 32 bits. This 249 field is set to the current value of the SRTP rollover counter in 250 the SRTP context associated with the SSRC in the SRTCP packet. 251 This field immediately follows the Encrypted Master Key field. 253 Initial Sequence Number (ISN) The length of this field is fixed at 254 16 bits. If this field is nonzero, then it indicates the RTP 255 sequence number of the initial RTP packet that is protected using 256 the SRTP master key conveyed (in encrypted form) by the Encrypted 257 Master Key field of this packet. If this field is zero, it 258 indicates that the initial RTP packet protected using the SRTP 259 master key conveyed in this packet preceded, or was concurrent 260 with, the last roll-over of the RTP sequence number. The ISN 261 field follows the Rollover Counter field. 263 Security Parameter Index (SPI) The length of this field is fixed at 264 16 bits. This field indicates the appropriate Key Encrypting Key 265 and other parameters for the receiver to use when processing the 266 packet. It is an "index" into a table of possibilities (which are 267 established via signaling or some other out-of-band means), much 268 like the IPsec Security Parameter Index [RFC4301]. The parameters 269 that are identified by this field are: 271 The Key Encrypting Key used to process the packet. 273 The EKT cipher used to process the packet. 275 The Secure RTP parameters associated with the SRTP Master Key 276 carried by the packet and the SSRC value in the packet. 277 Section 8.2. of [RFC3711] summarizes the parameters defined by 278 that specification. 280 Together, these elements are called an EKT parameter set. Within 281 each SRTP session, each distinct EKT parameter set that may be 282 used MUST be associated with a distinct SPI value, to avoid 283 ambiguity. The SPI field follows the Initial Sequence Number. 284 Since it is the last field in the packet, and has a fixed length, 285 it is always possible to unambiguously parse this field. 287 2.2. Packet Processing and State Machine 289 At any given time, each SRTP/SRTCP source has associated with it a 290 single EKT parameter set. This parameter set is used to process all 291 outbound packets, and is called the outbound parameter set. There 292 may be other EKT parameter sets that are used by other SRTP/SRTCP 293 sources in the same session. All of these EKT parameter sets SHOULD 294 be stored by all of the participants in an SRTP session, for use in 295 processing inbound SRTCP traffic. 297 We next review the SRTCP authentication method and show how the EKT 298 authentication method is built on top of the base method. An SRTCP 299 authentication method consists of a tag-generation function and a 300 verification function. The tag-generation function takes as input a 301 secret key, the data to be authenticated, and the SRTCP packet index. 302 It provides an authentication tag as its sole output, and is used in 303 the processing of outbound packets. The verification function takes 304 as input a secret key, the data to be authenticated, the SRTCP packet 305 index, and the authentication tag. It returns an indication of 306 whether or not the data, index, and tag are valid or not. It is used 307 in the processing of inbound packets. EKT defines a tag-generation 308 function in terms of the base tag-generation function, and defines a 309 verification function in terms of the base verification function. 310 The tag-generation function is used to process outbound packets, and 311 the verification function is used to process inbound packets. 313 2.2.1. Outbound (Tag Generation) 315 When an SRTCP packet needs to be sent, the EKT tag generation 316 function works as follows. Given an RTCP packet, the Rollover 317 Counter field in the SRTCP packet is set to the current value of the 318 SRTP rollover counter (represented as an unsigned integer in network 319 byte order). 321 The Initial Sequence Number field is set to zero, if the initial RTP 322 packet protected using the current SRTP master key for this source 323 preceded, or was concurrent with, the last roll-over of the RTP 324 sequence number. Otherwise, that field is set to the value of the 325 RTP sequence number of the initial RTP packet that was or will be 326 protected by that key. When the SRTP master key corresponding to a 327 source is changed, the new key SHOULD be communicated in advance via 328 EKT. (Note that the ISN field allows the receiver to know when it 329 should start using the new key to process SRTP packets.) This 330 enables the rekeying event to be communicated before any RTP packets 331 are protected with the new key. The rekeying event MUST not change 332 the value of ROC (otherwise, the current value of the ROC would not 333 be known to late joiners of existing sessions). 335 The Security Parameter Index field is set to the value of the 336 Security Parameter Index that is associated with the outbound 337 parameter set. 339 The Encrypted Master Key field is set to the ciphertext created by 340 encrypting the SRTP master key with the EKT cipher, using the KEK as 341 the encryption key. The encryption process is detailed in 342 Section 2.3. Implementations MAY cache the value of this field to 343 avoid recomputing it for each packet that is sent. 345 2.2.1.1. Base Authentication Tag 347 The Base Authentication Tag field is computed using the base tag- 348 generation function as follows. It can only be computed after all of 349 the other fields have been set. The authenticated input consists of 350 the following elements, in order: 352 the SRTCP authenticated portion, 354 a string of zero bits whose length exactly matches that of the 355 Base Authentication Tag field, 357 the Encrypted Master Key field, 359 the Rollover Counter field, 361 the Initial Sequence Number field, and 363 the Security Parameter Index field. 365 Implementation note: the string of zero bits is included in the 366 authenticated input in order to allow implementations to compute 367 the base authentication tag using a single pass of the base 368 authentication function. Implementations MAY write zeros into the 369 Base Authentication Tag field prior to computing that function, on 370 the sending side. 372 2.2.2. Inbound (Tag Verification) 374 The EKT verification function proceeds as follows (see Figure 2), or 375 uses an equivalent set of steps. Recall that the verification 376 function is a component of SRTCP processing. When a packet does not 377 pass the verification step, the function indicates this fact to the 378 SRTCP packet processing function when it returns control to that 379 function. 381 1. The Security Parameter Index field is checked to determine which 382 EKT parameter set should be used when processing the packet. If 383 multiple parameter sets been defined for the SRTP session, then 384 the one that is associated with the Security Parameter Index 385 value that matches the Security Parameter Index field in the 386 packet is used. This parameter set is called the matching 387 parameter set below. If there is no matching SPI, then the 388 verification function MUST return an indication of authentication 389 failure, and the steps described below are not performed. 391 2. The Encrypted Master Key field is decrypted using the EKT 392 cipher's decryption function. That field is used as the 393 ciphertext input, and the Key Encrypting Key in the matching 394 parameter set is used as the decryption key. The decryption 395 process is detailed in Section 2.3. The plaintext resulting from 396 this decryption is provisionally accepted as the SRTP master key 397 corresponding to the SSRC in the packet. If an MKI is present in 398 the packet, then the provisional key corresponds to the 399 particular SSRC and MKI combination. A provisional key MUST be 400 used only to process one single packet. A provisional SRTCP 401 authentication key is generated from the provisional master key, 402 and the SRTP master salt from the matching parameter set, using 403 the SRTP key derivation algorithm (see Section 4.3 of [RFC3711]). 405 3. An authentication check is performed on the packet, using the 406 provisional SRTCP authentication key. This key is provided to 407 the base SRTCP authentication function (see Figure 2), which is 408 evaluated as described in Section 2.2.1.1. If the Base 409 Authentication Tag field matches the tag computed by the base 410 authentication function, then the packet passes the check. 412 Implementation note: an SRTP receiver MAY copy the Base 413 Authentication Tag field into temporary storage, then write 414 zeros into that field, prior to computing the base 415 authentication tag value. This step allows the base 416 authentication function to be computed in a single pass. 418 4. If the base authentication check using the provisional key fails, 419 then the provisional key MUST be discarded and it MUST NOT affect 420 any subsequent processing. The verification function MUST return 421 an indication of authentication failure, and the steps described 422 below are not performed. 424 5. Otherwise, if the base authentication check is passed, the 425 provisional key is also accepted as the SRTP master key 426 corresponding to the SRTP source that sent the packet. If an MKI 427 is present in the packet, then the master key corresponds to the 428 particular SSRC and MKI combination. If there is no SRTP crypto 429 context corresponding to the SSRC in the packet, then a new 430 crypto context is created. The rollover counter in the context 431 is set to the value of the Rollover Counter field. 433 6. If the Initial Sequence Number field is nonzero, then the initial 434 sequence number for the SRTP master key is set to the packet 435 index created by appending that field to the current rollover 436 counter and treating the result as a 48-bit unsigned integer. 437 The initial sequence number for the master key is equivalent to 438 the "From" value of the < From, To > pair of indices (Section 439 8.1.1 of [RFC3711]) that can be associated with a master key. 441 7. The newly accepted SRTP master key, the SRTP parameters from the 442 matching parameter set, the SSRC from the packet, and the MKI 443 from the packet, if one is present, are stored in the crypto 444 context associated with the SRTP source. The SRTP Key Derivation 445 algorithm is run in order to compute the SRTP encryption and 446 authentication keys, and those keys are stored for use in SRTP 447 processing of inbound packets. 449 8. The verification function then returns an indication that the 450 packet passed the verification. 452 Implementation note: the value of the Encrypted Master Key 453 field is identical in successive packets protected by the same 454 KEK and SRTP master key. This value MAY be cached by an SRTP 455 receiver to minimize computational effort, by allowing it to 456 recognize when the SRTP master key is unchanged, and thus 457 avoid repeating Steps 2, 6, and 7. 459 +------- Encrypted Master Key 460 | 461 v 462 +------------+ 463 | Decryption | 464 | Function |<-------------------------- Key Encrypting Key 465 +------------+ 466 | +----------------+ EKT 467 +--------+-- provisional ---->| SRTCP |<-- master 468 | master key | Key Derivation | salt 469 | +----------------+ 470 | | 471 | provisional SRTCP authentication key 472 | | 473 | v 474 | +----------------+ 475 | authenticated portion --> | Base SRTCP | 476 | authentication tag -----> | Verification | 477 | +----------------+ 478 | | 479 | +----------------+ +---+ 480 | | return FAIL |<- FAIL -| ? | 481 | +----------------+ +---+ 482 | | 483 | +----------------+ | 484 +------->| set master key,|<- PASS ---+ 485 | ROC, and MKI | 486 +----------------+ 487 | 488 v 489 +----------------+ 490 | return PASS | 491 +----------------+ 493 Figure 2: EKT inbound processing. 495 2.3. Ciphers 497 EKT uses a cipher to encrypt the SRTP master keys. We first specify 498 the interface to the cipher, in order to abstract the interface away 499 from the details of that function. We then define the cipher that is 500 used in EKT by default. This cipher MUST be implemented, but another 501 cipher that conforms to this interface MAY be used, in which case its 502 use MUST be coordinated by external means (e.g. call signaling). 504 An EKT cipher consists of an encryption function and a decryption 505 function. The encryption function E(K, P) takes the following 506 inputs: 508 a secret key K with a length of L bytes, and 510 a plaintext value P with a length of M bytes. 512 The encryption function returns a ciphertext value C whose length is 513 N bytes, where N is at least M. The decryption function D(K, C) takes 514 the following inputs: 516 a secret key K with a length of L bytes, and 518 a ciphertext value C with a length of N bytes. 520 The decryption function returns a plaintext value P that is M bytes 521 long. These functions have the property that D(K, E(K, P)) = P for 522 all values of K and P. Each cipher also has a limit T on the number 523 of times that it can be used with any fixed key value. For each key, 524 the encryption function MUST NOT be invoked on more than T distinct 525 values of P, and the decryption function MUST NOT be invoked on more 526 than T distinct values of C. 528 An EKT cipher MUST resist attacks in which both ciphertexts and 529 plaintexts can be adaptively chosen. For each randomly chosen key, 530 the encryption and decryption functions cannot be distinguished from 531 a random permutation and its inverse with non-negligible advantage. 532 This must be true even for adversaries that can query both the 533 encryption and decryption functions adaptively. The advantage is 534 defined as the difference between the probability that the adversary 535 will identify the cipher as such and the probability that the 536 adversary will identify the random permutation as the cipher, when 537 each case is equally likely. 539 2.3.1. The Default Cipher 541 The default cipher is the Advanced Encryption Standard (AES) 542 [FIPS197] with 128-bit keys, in Electronic Codebook (ECB) Mode. Its 543 parameters are fixed at L=16, M=16, and T=2^48. Note that M matches 544 the size of the SRTP master keys used by the default SRTP key 545 derivation function; if an SRTP cipher with a different SRTP master 546 key length is to be used with EKT, then another EKT cipher must be 547 used. ECB is the simplest mode of operation of a block cipher, in 548 which the block cipher is used in its raw form. 550 2.3.2. The AES Key Wrap Cipher 552 The AES Key Wrap [RFC3394] defines a cipher that can be used with 553 plaintexts larger than 16 bytes in length. It requires a plaintext 554 length M that is a multiple of eight bytes, and it returns a 555 ciphertext with a length of N = M + 8 bytes. It can be used with key 556 sizes of L = 16, 24, and 32. The key size determines the length of 557 the AES key used by the Key Wrap algorithm. With this cipher, 558 T=2^48. 560 2.3.3. Other EKT Ciphers 562 Other specification MAY extend this one by defining other EKT 563 ciphers. This section defines how those ciphers interact with this 564 specification. 566 An EKT cipher determines how the Encrypted Master Key field is 567 written, and how it is processed when it is read. This field is 568 opaque to the other aspects of EKT processing. EKT ciphers are free 569 to use this field in any way, but they SHOULD NOT use other EKT or 570 SRTP fields as an input. The values of the parameters L, M, N, and T 571 MUST be defined by each EKT cipher, and those values MUST be 572 inferable from the EKT parameter set. 574 2.4. Synchronizing Operation 576 EKT is transported over SRTCP, but some of the information that it 577 conveys is used for SRTP processing; some elements of the EKT 578 parameter set apply to both SRTP and SRTCP. Furthermore, SRTCP 579 packets can be lost and both SRTP and SRTCP packets may be delivered 580 out-of-order. This can lead to various race conditions, which we 581 review below. 583 When joining an SRTP session, SRTP packets may be received before any 584 SRTCP (EKT) packets, which implies the crypto context has not been 585 established, unless other external signaling mechanism has done so. 586 Rather than automatically discarding such SRTP packets, the receiver 587 MAY want to provisionally place them in a jitter buffer and delay 588 discarding them until playout time. 590 When an SRTP source using EKT performs a rekeying operation, there is 591 a race between the actual rekeying signaled via SRTCP and the SRTP 592 packets secured by the new keying material. If the SRTP packets are 593 received first, they will fail authentication; alternatively, if 594 authentication is not being used, they will decrypt to unintelligible 595 random-looking plaintext. (Note, however, that [RFC3711] says that 596 SRTP "SHOULD NOT be used without message authentication".) In order 597 to address this problem, the rekeying event can be sent before 598 packets using the new SRTP master key are sent (by use of the ISN 599 field). Another solution involves using an MKI at the expense of 600 added overhead in each SRTP packet. Alternatively, receivers MAY 601 want to delay discarding packets from known SSRCs that fail 602 authentication in anticipation of receiving a rekeying event via EKT 603 (SRTCP) shortly. 605 The ROC signaled via EKT over SRTCP may be off by one when it is 606 received by the other party(ies) in the session. In order to deal 607 with this, receivers should simply follow the SRTP packet index 608 estimation procedures defined in [SRTP] Section 3.3.1. 610 2.5. Timing and Reliability Consideration 612 SRTCP communicates the master key and ROC for the SRTP session. 613 Thus, as explained above, if SRTP packets are received prior to the 614 corresponding SRTCP (EKT) packet, a race condition occurs. From an 615 EKT point of view, it is therefore desirable for an SRTP sender to 616 send an SRTCP packet as soon as possible, and in no case any later 617 than when the initial SRTP packet is sent. SRTCP however MUST obey 618 the timing rules associated with the profile under which it runs 619 (e.g. RTP/SAVP or RTP/SAVPF). Subject to that constraint, SRTP 620 senders SHOULD send an SRTCP packet as soon as possible after joining 621 a session. Note that there is no need for SRTP receivers to do so. 622 Also note, that per RFC 3550, Section 6.2, it is permissible to send 623 a compound RTCP packet immediately after joining a unicast session 624 (but not a multicast session). 626 SRTCP is not reliable and hence SRTCP packets may be lost. This is 627 obviously a problem for endpoints joining an SRTP session and 628 receiving SRTP traffic (as opposed to SRTCP), or for endpoints 629 receiving SRTP traffic following a rekeying event. To reduce the 630 impact of lost packets, SRTP senders SHOULD send SRTCP packets as 631 often as allowed by the profile under which they operate. 633 3. EKT and SDP Security Descriptions 635 The SDP Security Descriptions (SDES) [RFC4568] specification defines 636 a generic framework for negotiating security parameters for media 637 streams negotiated via the Session Description Protocol by use of a 638 new SDP "crypto" attribute and the Offer/Answer procedures defined in 639 [RFC3264]. In addition to the general framework, SDES also defines 640 how to use that framework specifically to negotiate security 641 parameters for Secure RTP. Below, we first provide a brief recap of 642 the crypto attribute when used for SRTP and we then explain how it is 643 complementary to EKT. In the rest of this Section, we provide 644 extensions to the crypto attribute and associated offer/answer 645 procedures to define its use with EKT. 647 3.1. SDP Security Descriptions Recap 649 The SRTP crypto attribute defined for SDP Security Descriptions 650 contains a tag followed by three types of parameters (refer to 651 [RFC4568] for details): 653 Crypto-suite. Identifies the encryption and authentication 654 transform 656 Key parameters. SRTP keying material and parameters. 658 Session parameters. Additional (optional) SRTP parameters such as 659 Key Derivation Rate, Forward Error Correction Order, use of 660 unencrypted SRTP, etc. 662 The crypto attributes in the example SDP in Figure 3 illustrate these 663 parameters. 665 v=0 666 o=sam 2890844526 2890842807 IN IP4 192.0.2.5 667 s=SRTP Discussion 668 i=A discussion of Secure RTP 669 u=http://www.example.com/seminars/srtp.pdf 670 e=marge@example.com (Marge Simpson) 671 c=IN IP4 192.0.2.12 672 t=2873397496 2873404696 673 m=audio 49170 RTP/SAVP 0 674 a=crypto:1 AES_CM_128_HMAC_SHA1_80 675 inline:WVNfX19zZW1jdGwgKCkgewkyMjA7fQp9CnVubGVz|2^20|1:4 676 FEC_ORDER=FEC_SRTP 677 a=crypto:2 F8_128_HMAC_SHA1_80 678 inline:MTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5QUJjZGVm|2^20|1:4; 679 inline:QUJjZGVmMTIzNDU2Nzg5QUJDREUwMTIzNDU2Nzg5|2^20|2:4 680 FEC_ORDER=FEC_SRTP 682 Figure 3: SDP Security Descriptions example. Line breaks are 683 included for formatting purposes only. 685 The first crypto attribute has the tag "1" and uses the crypto-suite 686 "AES_CM_128_HMAC_SHA1_80". The "inline" parameter provides the SRTP 687 master key and salt, the master key lifetime (number of packets), and 688 the (optional) Master Key Identifier (MKI) whose value is "1" and has 689 a byte length of "4" in the SRTP packets. Finally, the FEC_ORDER 690 session parameter indicates the order of Forward Error Correction 691 used (FEC is applied before SRTP processing by the sender of the SRTP 692 media). 694 The second crypto attribute has the tag "2" and uses the crypto-suite 695 "F8_128_HMAC_SHA1_80". It includes two SRTP master keys and 696 associated salts. The first one is used with the MKI value 1, 697 whereas the second one is used with the MKI value 2. Finally, the 698 FEC_ORDER session parameter indicates the order of Forward Error 699 Correction used. 701 3.2. Relationship between EKT and SDP Security Descriptions 703 SDP Security Descriptions [RFC4568] define a generic framework for 704 negotiating security parameters for media streams negotiated via the 705 Session Description Protocol by use of the Offer/Answer procedures 706 defined in [RFC3264]. In addition to the general framework, SDP 707 Security Descriptions (SDES) also defines how to use it specifically 708 to negotiate security parameters for Secure RTP. 710 EKT and SDES are complementary. SDP Security Descriptions can 711 negotiate several of the SRTP security parameters (e.g. cipher and 712 use of Master Key Identifier/MKI) as well as SRTP master keys. SDP 713 Security Descriptions however does not negotiate SSRCs and their 714 associated Rollover Counter (ROC). Instead, SDES relies on a so- 715 called "late binding", where a newly observed SSRC will have its 716 crypto context initialized to a ROC value of zero. Clearly, this 717 does not work for participants joining an SRTP session that has been 718 established for a while and hence has a non-zero ROC. The use of EKT 719 solves this problem by communicating the ROC associated with the SSRC 720 in the media plane. 722 SDP Security Descriptions negotiates different SRTP master keys in 723 the send and receive direction. The offer contains the master key 724 used by the offerer to send media, and the answer contains the master 725 key used by the answerer to send media. Consequently, if media is 726 received by the offerer prior to the answer being received, the 727 offerer does not know the master key being used. Use of SDP security 728 preconditions can solve this problem, however it requires an 729 additional round-trip as well as a more complicated state machine. 730 EKT solves this problem by simply sending the master key used in the 731 media plane thereby avoiding the need for security preconditions. 733 If multiple crypto-suites were offered, the offerer also will not 734 know which of the crypto-suites offered was selected until the answer 735 is received. EKT solves this problem by using a correlator, the 736 Security Parameter Index (SPI), which uniquely identifies each crypto 737 attribute in the offer. 739 One of the primary call signaling protocols using offer/answer is the 740 Session Initiation Protocol (SIP) [RFC3261]. SIP uses the INVITE 741 message to initiate a media session and typically includes an offer 742 SDP in the INVITE. An INVITE may be "forked" to multiple recipients 743 which potentially can lead to multiple answers being received. SDP 744 Security Descriptions however does not properly support this 745 scenario, mainly because SDP and RTP/RTCP does not contain sufficient 746 information to allow for correlation of an incoming RTP/RTCP packet 747 with a particular answer SDP. Note that extensions providing this 748 correlation do exist, e.g. Interactive Connectivity Establishment 749 (ICE). SDP Security Descriptions addresses this point-to-multipoint 750 problem by moving each answer to a separate RTP transport address 751 thereby turning a point-to-multipoint scenario into multiple point- 752 to-point scenarios. There are however significant disadvantages to 753 doing so. As long as the crypto attribute in the answer does not 754 contain any declarative parameters that differ from those in the 755 offer, EKT solves this problem by use of the SPI correlator and 756 communication of the answerer's SRTP master key in EKT. 758 As can be seen from the above, the combination of EKT and SDES 759 provides a better solution to SRTP negotiation for offer/answer than 760 either of them alone. SDES negotiates the various SRTP crypto 761 parameters (which EKT does not), whereas EKT addresses the 762 shortcomings of SDES. 764 3.3. Overview of Combined EKT and SDP Security Description Operation 766 We define three session extension parameters to SDES to communicate 767 the EKT cipher, EKT key, and Security Parameter Index to the peer. 768 The original SDES parameters are used as defined in [RFC4568], 769 however the procedures associated with the SRTP master key differ 770 slightly, since both SDES and EKT communicate an SRTP master key. In 771 particular, the SRTP master key communicated via SDES is used only if 772 there is currently no crypto context established for the SSRC in 773 question. This will be the case when an entity has received only the 774 offer or answer, but has yet to receive a valid EKT message from the 775 peer. Once a valid EKT message is received for the SSRC, the crypto 776 context is initialized accordingly, and the SRTP master key will then 777 be derived from the EKT message. Subsequent offer/answer exchanges 778 do not change this: The most recent SRTP master key negotiated via 779 EKT will be used, or, if none is available for the SSRC in question, 780 the most recent SRTP master key negotiated via offer/answer will be 781 used. Note that with these rules, once a valid EKT message has been 782 received for a given SSRC, rekeying for that SSRC can only be done 783 via EKT. The associated SRTP crypto parameters however can be 784 changed via SDES. 786 3.4. EKT Extensions to SDP Security Descriptions 788 In order to use EKT and SDES in conjunction, we now define the 789 following new SDES session parameters, each of which MUST NOT appear 790 more than once in a given crypto attribute: 792 EKT_Cipher The EKT cipher used to encrypt the SRTP Master Key 794 EKT_Key The EKT key used to encrypt the SRTP Master Key 796 EKT_SPI The EKT Security Parameter Index 798 Below, we provide additional detail on each of these attributes. 800 3.4.1. EKT_Cipher 802 The (optional) EKT_Cipher parameter parameter defines the EKT cipher 803 used to encrypt the EKT key with in SRTCP packets. The default value 804 is "AES_128" in accordance with Section 2.3.1. For the AES Key Wrap 805 cipher (see Section 2.3.2, the values "AESKW_128", "AESKW_192", and 806 "AESKW_256" are defined for values of L=16, 24, and 32 respectively. 807 In the Offer/Answer model, the EKT_Cipher parameter is a negotiated 808 parameter. 810 3.4.2. EKT_Key 812 The (mandatory) EKT_Key parameter is the key K used to encrypt the 813 SRTP Master Key in SRTCP packets. The value is base64 encoded (see 814 [RFC3548], Section 3). When base64 decoding the key, padding 815 characters (i.e., one or two "=" at the end of the base64 encoded 816 data) are discarded (see [RFC3548] for details). Base64 encoding 817 assumes that the base64 encoding input is an integral number of 818 octets. If a given EKT cipher requires the use of a key with a 819 length that is not an integral number of octets, said cipher MUST 820 define a padding scheme that results in the base64 input being an 821 integral number of octets. For example, if the length defined was 822 250 bits, then 6 padding bits would be needed, which could be defined 823 to be the last 6 bits in a 256 bit input. In the Offer/Answer model, 824 the EKT_Key parameter is a negotiated parameter. 826 3.4.3. EKT_SPI 828 The (mandatory) EKT_SPI parameter is the Security Parameter Index. 829 It is encoded as an ASCII string representing the hexadecimal value 830 of the Security Parameter Index. The SPI identifies the *offer* 831 crypto attribute (including the EKT Key and Cipher) being used for 832 the associated SRTP session. A crypto attribute corresponds to an 833 EKT Parameter Set and hence the SPI effectively identifies a 834 particular EKT parameter set. Note that the scope of the SPI is the 835 SRTP session, which may or may not be limited to the scope of the 836 associated SIP dialog. In particular, if one of the participants in 837 an SRTP session is an SRTP translator, the scope of the SRTP session 838 is not limited to the scope of a single SIP dialog. However, if all 839 of the participants in the session are endpoints or mixers, the scope 840 of the SRTP session will correspond to a single SIP dialog. In the 841 Offer/Answer model, the EKT_SPI parameter is a negotiated parameter. 843 3.5. Offer/Answer Procedures 845 In this section, we provide the offer/answer procedures associated 846 with use of the three new SDES parameters defined in Section 847 Section 3.4. Since SDES is defined only for unicast streams, we 848 provide only offer/answer procedures for unicast streams here as 849 well. 851 3.5.1. Generating the Initial Offer - Unicast Streams 853 When the initial offer is generated, the offerer MUST follow the 854 steps defined in [RFC4568] Section 7.1.1 as well as the following 855 steps. 857 For each unicast media line using SDES and where use of EKT is 858 desired, the offerer MUST include one EKT_Key parameter and one 859 EKT_SPI parameter in at least one "crypto" attribute (see [RFC4568]). 860 The EKT_SPI parameter serves to identify the EKT parameter set used 861 for a particular SRTCP packet. Consequently, within a single media 862 line, a given EKT_SPI value MUST NOT be used with multiple crypto 863 attributes. Note that the EKT parameter set to use for the session 864 is not yet established at this point; each offered crypto attribute 865 contains a candidate EKT parameter set. Furthermore, if the media 866 line refers to an existing SRTP session, then any SPI values used for 867 EKT parameter sets in that session MUST NOT be remapped to any 868 different EKT parameter sets. When an offer describes an SRTP 869 session that is already in progress, the offer SHOULD use an EKT 870 parameter set (incl. EKT_SPI and EKT_KEY) that is already in use. 872 If an EKT_Cipher other than the default cipher is to be used, then 873 the EKT_Cipher parameter MUST be included as well. 875 If a given crypto attribute includes more than one set of SRTP key 876 parameters (SRTP master key, salt, lifetime, MKI), they MUST all use 877 the same salt. (EKT requires a single shared salt between all the 878 participants in the direct SRTP session). 880 Important Note: The scope of the offer/answer exchange is the SIP 881 dialog(s) established as a result of the INVITE, however the scope of 882 EKT is the direct SRTP session, i.e. all the participants that are 883 able to receive SRTP and SRTCP packets directly. If an SRTP session 884 spans multiple SIP dialogs, the EKT parameter sets MUST be 885 synchronized between all the SIP dialogs where SRTP and SRTCP packets 886 can be exchanged. In the case where the SIP entity operates as an 887 RTP mixer (and hence re-originates SRTP and SRTCP packets with its 888 own SSRC), this is not an issue, unless the mixer receives traffic 889 from the various participants on the same destination IP address and 890 port, in which case further coordination of SPI values and crypto 891 parameters may be needed between the SIP dialogs (note that SIP 892 forking with multiple early media senders is an example of this). 893 However if it operates as an RTP translator, synchronized negotiation 894 of the EKT parameter sets on *all* the involved SIP dialogs will be 895 needed. This is non-trivial in a variety of use cases, and hence use 896 of the combined SDES/EKT mechanism with RTP translators should be 897 considered very carefully. It should be noted, that use of SRTP with 898 RTP translators in general should be considered very carefully as 899 well. 901 The EKT session parameters can either be included as optional or 902 mandatory parameters, however within a given crypto attribute, they 903 MUST all be either optional or mandatory. 905 3.5.2. Generating the Initial Answer - Unicast Streams 907 When the initial answer is generated, the answerer MUST follow the 908 steps defined in [RFC4568] Section 7.1.2 as well as the following 909 steps. 911 For each unicast media line using SDES, the answerer examines the 912 associated crypto attribute(s) for the presence of EKT parameters. 913 If mandatory EKT parameters are included with a "crypto" attribute, 914 the answerer MUST support those parameters in order to accept that 915 offered crypto attribute. If optional EKT parameters are included 916 instead, the answerer MAY accept the offered crypto attribute without 917 using EKT. However, doing so will prevent the offerer from 918 processing any packets received before the answer. If neither 919 optional nor mandatory EKT parameters are included with a crypto 920 attribute, and that crypto attribute is accepted in the answer, EKT 921 MUST NOT be used. If a given a crypto attribute includes a mixture 922 of optional and mandatory EKT parameters, or an incomplete set of 923 mandatory EKT parameters, that crypto attribute MUST be considered 924 invalid. 926 When EKT is used with SDES, the offerer and answerer MUST use the 927 same SRTP salt. Thus, the SRTP key parameter(s) in the answer crypto 928 attribute MUST use the same salt as the one accepted from the offer. 930 When the answerer accepts the offered media line and EKT is being 931 used, the crypto attribute included in the answer MUST include the 932 same EKT parameter values as found in the accepted crypto attribute 933 from the offer (however, if the default EKT cipher is being used, it 934 may be omitted). Furthermore, the EKT parameters included MUST be 935 mandatory (i.e. no "-" prefix). 937 Acceptance of a crypto attribute with EKT parameters leads to 938 establishment of the EKT parameter set for the corresponding SRTP 939 session. Consequently, the answerer MUST send packets in accordance 940 with that particular EKT parameter set only. If the answerer wants 941 to enable the offerer to process SRTP packets received by the offerer 942 before it receives the answer, the answerer MUST NOT include any 943 declarative session parameters that either were not present in the 944 offered crypto attribute, or were present but with a different value. 945 Otherwise, the offerer's view of the EKT parameter set would differ 946 from the answerer's until the answer is received. Similarly, unless 947 the offerer and answerer has other means for correlating an answer 948 with a particular SRTP session, the answer SHOULD NOT include any 949 declarative session parameters that either were not present in the 950 offered crypto attribute, or were present but with a different value. 951 If this recommendation is not followed and the offerer receives 952 multiple answers (e.g. due to SIP forking), the offerer may not be 953 able to process incoming media stream packets correctly. 955 3.5.3. Processing of the Initial Answer - Unicast Streams 957 When the offerer receives the answer, it MUST perform the steps in 958 [RFC4568] Section 7.1.3 as well as the following steps for each SRTP 959 media stream it offered with one or more crypto lines containing EKT 960 parameters in it. 962 If the answer crypto line contains EKT parameters, and the 963 corresponding crypto line from the offer contained the same EKT 964 values, use of EKT has been negotiated successfully and MUST be used 965 for the media stream. When determining whether the values match, 966 optional and mandatory parameters MUST be considered equal. 967 Furthermore, if the default EKT cipher is being used, it MAY be 968 either present or absent in the offer and/or answer. 970 If the answer crypto line does not contain EKT parameters, then EKT 971 MUST NOT be used for the corresponding SRTP session. Note that per 972 [RFC4568] Section 5.1.3, if the accepted crypto attribute contained 973 mandatory EKT parameters in the offer, and the crypto attribute in 974 the answer does not contain EKT parameters, then negotiation has 975 failed. 977 If the answer crypto line contains EKT parameters but the 978 corresponding offered crypto line did not, or if the parameters don't 979 match or are invalid, then the offerer MUST consider the crypto line 980 invalid (see [RFC4568] Section 7.1.3 for further operation). 982 The EKT parameter set is established when the answer is received, 983 however there are a couple of special cases to consider here. First 984 of all, if an SRTCP packet is received prior to the answer, then the 985 EKT parameter set is established provisionally based on the SPI 986 included. Once the answer (which may include declarative session 987 parameters) is received, the EKT parameter set is fully established. 988 The second case involves receipt of multiple answers due to SIP 989 forking. In this case, there will be multiple EKT parameter sets; 990 one for each SRTP session. As mentioned earlier, reliable 991 correlation of SIP dialogs to SRTP sessions requires extensions, and 992 hence if one or more of the answers include declarative session 993 parameters, it may be difficult to fully establish the EKT parameter 994 set for each SRTP session. In the absence of a specific correlation 995 mechanism, it is RECOMMENDED, that such correlation be done based on 996 the signaled receive IP-address in the SDP and the observed source 997 IP-address in incoming SRTP/SRTCP packets, and, if necessary, the 998 signaled receive UDP port and the observed source UDP port. 1000 3.6. SRTP-Specific Use Outside Offer/Answer 1002 SDES use for SRTP is not defined outside offer/answer and hence 1003 neither is SDES with EKT. 1005 3.7. Modifying the Session 1007 When a media stream using the SRTP security descriptions has been 1008 established, and a new offer/answer exchange is performed, the 1009 offerer and answerer MUST follow the steps in [RFC4568] Section 7.1.4 1010 as well as the following steps. SDES allows for all parameters of 1011 the session to be modified, and the EKT session parameters are no 1012 exception to that, however, there are a few additional rules to be 1013 adhered to when using EKT. 1015 It is permissible to start a session without the use of EKT, and then 1016 subsequently start using EKT, however the converse is not. Thus, 1017 once use of EKT has been negotiated on a particular media stream, EKT 1018 MUST continue to be used on that media stream in all subsequent 1019 offer/answer exchanges. 1021 The reason for this is that both SDES and EKT communicate the SRTP 1022 Master Key with EKT Master Keys taking precedence. Reverting back to 1023 an SDES controlled master key in a synchronized manner is difficult. 1025 Once EKT is being used, the salt for the direct SRTP session MUST NOT 1026 be changed. Thus, a new offer/answer which does not create a new 1027 SRTP session (e.g. because it reuses the same IP address and port) 1028 MUST use the same salt for all crypto attributes as is currently used 1029 for the direct SRTP session. 1031 Finally, subsequent offer/answer exchanges MUST NOT remap a given SPI 1032 value to a different EKT parameter set until 2^32 other mappings have 1033 been used within the SRTP session. In practice, this requirements is 1034 most easily met by using a monotonically increasing SPI value (modulo 1035 2^32 and starting with zero) per direct SRTP session. Note that a 1036 direct SRTP session may span multiple SIP dialogs, and in such cases 1037 coordination of SPI values across those SIP dialogs will be required. 1038 In the simple point-to-point unicast case without translators, the 1039 requirement simply applies within each media line in the SDP. In the 1040 point-to-multipoint case, the requirement applies across all the 1041 associated SIP dialogs. 1043 3.8. Backwards Compatibility Considerations 1045 Backwards compatibility can be achieved in a couple of ways. First 1046 of all, SDES allows for session parameters to be prefixed with "-" to 1047 indicate that they are optional. If the answerer does not support 1048 the EKT session parameters, such optional parameters will simply be 1049 ignored. When the answer is received, absence of the parameters will 1050 indicate that EKT is not being used. Receipt of SRTCP packets prior 1051 to receipt of such an answer will obviously be problematic (as is 1052 normally the case for SDES without EKT). 1054 Alternatively, SDES allows for multiple crypto lines to be included 1055 for a particular media stream. Thus, two crypto lines that differ in 1056 their use of EKT parameters (presence in one, absence in the other) 1057 can be used as a way to negotiate use of EKT. When the answer is 1058 received, the accepted crypto attribute will indicate whether EKT is 1059 being used or not. 1061 3.9. Grammar 1063 The Augmented Backus-Naur Form (ABNF) syntax [RFC4234] for the three 1064 new SDES session parameters is as in Figure 4. 1066 EKT_Cipher = "EKT_Cipher=" EKT_Cipher_Name 1067 EKT_Cipher_Name = 1*(ALPHA / DIGIT / "_") ; "AES_128", "AESKW_128" 1068 ; "AESKW_192" and "AESKW_256" 1069 ; defined in this document. 1070 EKT_Key = 1*(base64) ; See Section 3 in RFC3548 1071 base64 = ALPHA / DIGIT / "+" / "/" / "=" 1072 EKT_SPI = 4HEXDIG ; See RFC4234 1074 Figure 4: ABNF for the EKT session parameters. 1076 4. Use of EKT with DTLS-SRTP Key Transport 1078 DTLS-SRTP Key Transport (KTR) [I-D.wing-avt-dtls-srtp-key-transport] 1079 uses DTLS to securely transport SRTP keying material from one DTLS- 1080 SRTP peer to another, so the same SRTP keying material can be used by 1081 multiple DTLS-SRTP peers. This extension can be used to establish 1082 EKT keys. This combination of protocols is valuable because it 1083 combines the advantages of DTLS (strong authentication of the 1084 endpoint, flexibility) with the advantages of EKT (allowing secure 1085 multiparty RTP with loose coordination and efficient communication of 1086 per-source keys). 1088 5. Use of EKT with MIKEY 1090 The advantages outlined in Section 1 are useful in some scenarios in 1091 which MIKEY is used to establish SRTP sessions. In this section, we 1092 briefly review MIKEY and related work, and discuss these scenarios. 1093 A n SRTP sender or a group controller can use MIKEY to establish a 1094 SRTP cryptographic context. This capability includes the 1095 distribution of the TEK or a TEK generation key (TGK) , security 1096 policy payload, crypto session bundle ID (CSB_ID), and a crypto 1097 session ID (CS_ID). The TEK directly maps to an SRTP master key, 1098 whereas the TGK is used along with the CSB_ID and a CS_ID to generate 1099 a TEK. The CS_ID can be used to generate multiple TEKs from a single 1100 TGK. For group communication, the sender or group controller sends 1101 the same TGK, CSB_ID, and CS_ID to all the members. For interactive 1102 conferencing, each sender distributes the same SRTP crypto context to 1103 the rest of the members. 1105 The MIKEY specification [RFC3830] suggests the use of unicast for 1106 rekeying. This method does not scale well to large groups or 1107 interactive groups. MIKEY also provides a way to provide ROC values 1108 to members when they join the group. It is desirable to not require 1109 the group controller to track the ROC values of each member. For 1110 example, in mobile and wireless environments, members may go in and 1111 out of coverage, and in those cases, key management based ROC 1112 synchronization is not reliable or sufficient. A better alternative 1113 to support ROC synchronization is to send ROC values via SRTP, as EKT 1114 does. A separate SRTP extension is being proposed [RFC4771] to 1115 include the ROC as part of a modified authentication tag. Unlike 1116 EKT, this extension uses SRTP and not SRTCP as its transport. A new 1117 MIKEY extension [RFC4563] specifies the use of MIKEY to update group 1118 keys via multicast or broadcast for 3GPP MBMS networks. 1120 The EKT extension of SRTP/SRTCP provides a combined solution for 1121 rekeying and ROC synchronization. It also offers several advantages. 1122 With EKT, an SRTP session participant can start a new SRTP source 1123 without coordinating with a group controller about the selection of 1124 keys or SSRC values. With EKT, SRTP can handle early media, since 1125 its SPI allows the receiver to identify the cryptographic keys and 1126 parameters used by the source. EKT also allows SRTP to work with SIP 1127 forking. 1129 MIKEY can readily be extended so that it can establish the EKT key, 1130 cipher and SPI values. 1132 5.1. EKT transform attribute mapping in MIKEY 1134 Interactive group communication using MIKEY currently requires each 1135 member to send its own TGK and SSRC information to the other members, 1136 resulting in O(n^2) MIKEY sessions. That is not desirable. With 1137 EKT, the conference organizer or only one of the members needs to 1138 distribute the EKT parameters to all the members. After that, each 1139 member can distribute its SRTP master key and ROC values using EKT. 1140 Cryptographic policy initially distributed via MIKEY will apply to 1141 all sessions. MIKEY specifies a security policy (SP) payload to 1142 negotiate or distribute SRTP security policy. Policy payload 1143 attributes include Session Encryption key length, Authentication 1144 algorithm, Session Authentication key length, Session Salt key 1145 length, SRTP PRF, Authentication tag length and other fields (see 1146 Section 6.10.1 of RFC 3830). 1148 For the EKT_Cipher parameter, we propose to specify a new SRTP Policy 1149 Type in the Security Policy (SP) payload of MIKEY (see Section 6.10 1150 of RFC 3830). The SP payload contains a number of Policy Param TLVs. 1151 We define Type = TBD: (will be requested from IANA) for EKT_Cipher. 1152 As with other payloads specifying cryptographic algorithms, we only 1153 specify Type and Values only. 1155 EKT_Cipher | Value 1156 ------------------- 1157 AES_128 | 0 1158 AESKW_128 | 1 1159 AESKW_192 | 2 1160 AESKW_256 | 3 1162 Figure 5: EKT_Cipher Table 1164 We propose to use the KEMAC payload to transport the two mandatory 1165 EKT parameters: EKT_Key and EKT_SPI MIKEY KEMAC payload, as specified 1166 in RFC 3830 carries the Traffic Encryption Key (TEK) or the TEK 1167 Generation Key (TGK). One or more TEKs or TGKs are carried in 1168 individual Key Data sub-payloads within the KEMAC payload. The KEMAC 1169 payload is encrypted as part of MIKEY. The Key Data sub- payload, 1170 specified in Section 6.13 of RFC 3830, has the following format: 1172 1 2 3 1173 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1175 ! Next Payload ! Type ! KV ! Key data len ! 1176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1177 ! Key data ~ 1178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1179 ! Salt len (optional) ! Salt data (optional) ~ 1180 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1181 ! KV data (optional) ~ 1182 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1184 Figure 6: Key Data Sub-Payload of MIKEY 1186 The Type field, 4 bits in length, indicates the type of key included 1187 in the payload. We define Type = TBD (will be requested from IANA) 1188 to indicate transport of EKT_Key. 1190 KV (4 bits): indicates the type of key validity period specified. 1191 KV=1 is currently specified as an SPI. We propose to use that value 1192 to indicate the KV_data contains the ETK_SPI. KV_data would be 16 1193 octets in length, but it is also possible to interpret the length 1194 from the 'Key data len' field. 1196 KV data MUST NOT be optional when KV = 1. 1198 6. Design Rationale 1200 From [RFC3550], a primary function of RTCP is to carry the CNAME, a 1201 "persistent transport-level identifier for an RTP source" since 1202 "receivers require the CNAME to keep track of each participant." EKT 1203 works in much the same way, using SRTCP to carry information needed 1204 for the proper processing of the SRTP traffic. 1206 With EKT, SRTP gains the ability to synchronize the creation of 1207 cryptographic contexts across all of the participants in a single 1208 session. This feature provides some, but not all, of the 1209 functionality that is present in IKE phase two (but not phase one). 1210 Importantly, EKT does not provide a way to indicate SRTP options. 1212 With EKT, external signaling mechanisms provide the SRTP options and 1213 the EKT Key, but need not provide the key(s) for each individual SRTP 1214 source. EKT provides a separation between the signaling mechanisms 1215 and the details of SRTP. The signaling system need not coordinate 1216 all SRTP streams, nor predict in advance how many streams will be 1217 present, nor communicate SRTP-level information (e.g. rollover 1218 counters) of current sessions. 1220 EKT is especially useful for multi-party sessions, and for the case 1221 where multiple RTP sessions are sent to the same destination 1222 transport address (see the example in the definition of "RTP session" 1223 in [RFC3550]). A SIP offer that is forked in parallel (sent to 1224 multiple endpoints at the same time) can cause multiple RTP sessions 1225 to be sent to the same transport address, making EKT useful for use 1226 with SIP. 1228 EKT can also be used in conjunction with a scalable group-key 1229 management system like GDOI. Such a system provides a secure entity 1230 authentication method and a way to revoke group membership, both of 1231 which are out of scope of EKT. 1233 It is natural to use SRTCP to transport encrypted keying material for 1234 SRTP, as it provides a secure control channel for (S)RTP. However, 1235 there are several different places in SRTCP in which the encrypted 1236 SRTP master key and ROC could be conveyed. We briefly review some of 1237 the alternatives in order to motivate the particular choice used in 1238 this specification. One alternative is to have those values carried 1239 as a new SDES item or RTCP packet. This would require that the 1240 normal SRTCP encryption be turned off for the packets containing that 1241 SDES item, since on the receiver's side, SRTCP processing completes 1242 before the RTCP processing starts. This tension between encryption 1243 and the desire for RTCP privacy is highly undesirable. Additionally, 1244 this alternative makes SRTCP dependent upon the parsing of the RTCP 1245 compound packet, which adds complexity. It is simpler to carry the 1246 encrypted key in a new SRTCP field. One way to do this and to be 1247 backwards compatible with the existing specification is to define a 1248 new crypto function that incorporates the encrypted key. We define a 1249 new authentication transform because EKT relies on the normal SRTCP 1250 authentication to provide implicit authentication of the encrypted 1251 key. 1253 An SRTP packet containing an SSRC that has not been seen will be 1254 discarded. This practice may induce a burst of packet loss at the 1255 outset of an SRTP stream, due to the loss or reorder of the first 1256 SRTCP packet with the EKT containing the key and rollover counter for 1257 that stream. However, this practice matches the conservative RTP 1258 memory-allocation strategy; many existing applications accept this 1259 risk of initial packet loss. Alternatively, implementations may wish 1260 to delay discarding such packets for a short period of time as 1261 described in Section 2.4. 1263 When EKT is carried in SRTCP, it adds eight additional bytes to each 1264 SRTCP packet, plus the length of the Encrypted Master Key field. 1265 Using the SRTP and EKT defaults, the total overhead is 24 bytes. 1266 This overhead does not detract from the total bandwidth used by SRTP, 1267 since it is included in the RTCP bandwidth computation. However, it 1268 will cause the control protocol to issue packets less frequently. 1270 The main motivation for the use of the variable-length format is 1271 bandwidth conservation. If EKT is used of SRTP, there will be a loss 1272 of bandwidth due to the additional 24 bytes in each RTP packet. For 1273 some applications, this bandwidth loss is significant. 1275 7. RTP Transport 1277 EKT MAY be used over SRTP instead of SRTCP if the latter protocol is 1278 not available, though implementations SHOULD otherwise use SRTCP. If 1279 EKT over SRTP is used in an SRTP session in which SRTCP is available, 1280 then EKT MUST be used for both SRTP and SRTCP. 1282 The packet processing, state machine, and Authentication Tag format 1283 for EKT over SRTP is identical to that for EKT over SRTCP. 1285 EKT SHOULD be carried over RTCP. However, if it is carried over SRTP 1286 within a session, then it SHOULD NOT be carried over SRTCP in that 1287 session. 1289 8. Security Considerations 1291 With EKT, each SRTP sender and receiver can generate distinct SRTP 1292 master keys. This property avoids any security concern over the re- 1293 use of keys, by empowering the SRTP layer to create keys on demand. 1294 Note that the inputs of EKT are the same as for SRTP with key- 1295 sharing: a single key is provided to protect an entire SRTP session. 1296 However, EKT provides complete security, even in the absence of 1297 further out-of-band coordination of SSRCs, and even when SSRC values 1298 collide. 1300 EKT uses encrypted key transport with implicit authentication. A 1301 strong cipher is used to ensure the confidentiality of the master 1302 keys as they are transported. The authenticity of the master keys is 1303 ensured by the base authentication check, which uses the plaintext 1304 form of that key. If the base authentication function and the cipher 1305 cannot be defeated by a particular attacker, then that attacker will 1306 be unable to defeat the implicit authentication. 1308 In order to avoid potential security issues, the SRTP authentication 1309 tag length used by the base authentication method MUST be at least 1310 ten octets. 1312 9. IANA Considerations 1314 This section registers with IANA the following SRTP session 1315 parameters for SDP Security Descriptions [RFC4568]: 1317 EKT_KEY 1319 EKT_CIPHER 1321 EKT_SPI 1323 The definition of these parameters is provided in Section 3.4. 1325 We request the following IANA assignments from existing MIKEY IANA 1326 tables: 1328 From the "Key Data payload name spaces:" a value to indicate the 1329 type as the "EKT_Key." 1331 From the "SRTP" policy table name space, a new value to be 1332 assigned for "EKT_Cipher." 1334 Furthermore, we need a new table to be defined: 1336 EKT_Cipher | Value 1337 ------------------- 1338 AES_128 | 0 1339 AESKW_128 | 1 1340 AESKW_192 | 2 1341 AESKW_256 | 3 1343 Figure 7: EKT_Cipher Table 1345 10. Acknowledgements 1347 Thanks to Dan Wing, Rob Raymond, and Nermeen Ismail for fruitful 1348 discussions. 1350 11. References 1352 11.1. Normative References 1354 [FIPS197] "The Advanced Encryption Standard (AES)", FIPS-197 Federal 1355 Information Processing Standard. 1357 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1358 Requirement Levels", BCP 14, RFC 2119, March 1997. 1360 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1361 A., Peterson, J., Sparks, R., Handley, M., and E. 1362 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1363 June 2002. 1365 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1366 with Session Description Protocol (SDP)", RFC 3264, 1367 June 2002. 1369 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 1370 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 1372 [RFC3548] Josefsson, S., "The Base16, Base32, and Base64 Data 1373 Encodings", RFC 3548, July 2003. 1375 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1376 Jacobson, "RTP: A Transport Protocol for Real-Time 1377 Applications", STD 64, RFC 3550, July 2003. 1379 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1380 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1381 RFC 3711, March 2004. 1383 [RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1384 Specifications: ABNF", RFC 4234, October 2005. 1386 [RFC4563] Carrara, E., Lehtovirta, V., and K. Norrman, "The Key ID 1387 Information Type for the General Extension Payload in 1388 Multimedia Internet KEYing (MIKEY)", RFC 4563, June 2006. 1390 [RFC4568] Andreasen, F., Baugher, M., and D. Wing, "Session 1391 Description Protocol (SDP) Security Descriptions for Media 1392 Streams", RFC 4568, July 2006. 1394 [RFC4771] Lehtovirta, V., Naslund, M., and K. Norrman, "Integrity 1395 Transform Carrying Roll-Over Counter for the Secure Real- 1396 time Transport Protocol (SRTP)", RFC 4771, January 2007. 1398 11.2. Informative References 1400 [I-D.wing-avt-dtls-srtp-key-transport] 1401 Wing, D., "DTLS-SRTP Key Transport (KTR)", 1402 draft-wing-avt-dtls-srtp-key-transport-03 (work in 1403 progress), March 2009. 1405 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 1406 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 1407 August 2004. 1409 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1410 Internet Protocol", RFC 4301, December 2005. 1412 Authors' Addresses 1414 David A. McGrew 1415 Cisco Systems, Inc. 1416 510 McCarthy Blvd. 1417 Milpitas, CA 95035 1418 US 1420 Phone: (408) 525 8651 1421 Email: mcgrew@cisco.com 1422 URI: http://www.mindspring.com/~dmcgrew/dam.htm 1424 Flemming Andreason 1425 Cisco Systems, Inc. 1426 499 Thornall Street 1427 Edison, NJ 08837 1428 US 1430 Email: fandreas@cisco.com 1432 Lakshminath Dondeti 1433 QUALCOMM 1434 5775 Morehouse Drive 1435 San Diego, CA 92121 1436 US 1438 Email: ldondeti@qualcomm.com