idnits 2.17.1 draft-irtf-dtnrg-bundle-security-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 19. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 2165. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 2176. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 2183. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 2189. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 2059 has weird spacing: '...uential encry...' -- 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 (February 24, 2008) is 5905 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) == Unused Reference: '8' is defined on line 2019, but no explicit reference was found in the text ** Downref: Normative reference to an Experimental RFC: RFC 5050 (ref. '2') ** Obsolete normative reference: RFC 3369 (ref. '3') (Obsoleted by RFC 3852) ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. '4') ** Obsolete normative reference: RFC 3280 (ref. '7') (Obsoleted by RFC 5280) == Outdated reference: A later version (-06) exists of draft-irtf-dtnrg-sec-overview-04 -- No information found for draft-irtf-dtnrg-bundle-retrans - is the name correct? Summary: 5 errors (**), 0 flaws (~~), 5 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DTN Research Group S. Symington 3 Internet-Draft The MITRE Corporation 4 Expires: August 27, 2008 S. Farrell 5 Trinity College Dublin 6 H. Weiss 7 P. Lovell 8 SPARTA, Inc. 9 February 24, 2008 11 Bundle Security Protocol Specification 12 draft-irtf-dtnrg-bundle-security-05 14 Status of this Memo 16 By submitting this Internet-Draft, each author represents that any 17 applicable patent or other IPR claims of which he or she is aware 18 have been or will be disclosed, and any of which he or she becomes 19 aware will be disclosed, in accordance with Section 6 of BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF), its areas, and its working groups. Note that 23 other groups may also distribute working documents as Internet- 24 Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 The list of current Internet-Drafts can be accessed at 32 http://www.ietf.org/ietf/1id-abstracts.txt. 34 The list of Internet-Draft Shadow Directories can be accessed at 35 http://www.ietf.org/shadow.html. 37 This Internet-Draft will expire on August 27, 2008. 39 Copyright Notice 41 Copyright (C) The IETF Trust (2008). 43 Abstract 45 This document defines the bundle security protocol, which provides 46 data integrity and confidentiality services. We also describe 47 various bundle security considerations including policy options. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 52 1.1. Related Documents . . . . . . . . . . . . . . . . . . . . 3 53 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 54 2. Security Blocks . . . . . . . . . . . . . . . . . . . . . . . 7 55 2.1. Abstract Security Block . . . . . . . . . . . . . . . . . 8 56 2.2. Bundle Authentication Block . . . . . . . . . . . . . . . 11 57 2.3. Payload Integrity Block . . . . . . . . . . . . . . . . . 13 58 2.4. Payload Confidentiality Block . . . . . . . . . . . . . . 14 59 2.5. Parameters and Result Fields . . . . . . . . . . . . . . . 17 60 2.6. Key Transport . . . . . . . . . . . . . . . . . . . . . . 18 61 2.7. PIB and PCB combinations . . . . . . . . . . . . . . . . . 19 62 3. Security Processing . . . . . . . . . . . . . . . . . . . . . 21 63 3.1. Nodes as policy enforcement points . . . . . . . . . . . . 21 64 3.2. Processing order of security blocks . . . . . . . . . . . 21 65 3.3. Security Zones . . . . . . . . . . . . . . . . . . . . . . 24 66 3.4. Canonicalisation of bundles . . . . . . . . . . . . . . . 25 67 3.5. Endpoint ID confidentiality . . . . . . . . . . . . . . . 31 68 3.6. Bundles received from other nodes . . . . . . . . . . . . 31 69 3.7. The At-Most-Once-Delivery Option . . . . . . . . . . . . . 33 70 3.8. Bundle Fragmentation and Reassembly . . . . . . . . . . . 33 71 3.9. Reactive fragmentation . . . . . . . . . . . . . . . . . . 34 72 4. Mandatory Ciphersuites . . . . . . . . . . . . . . . . . . . . 36 73 4.1. BAB-HMAC . . . . . . . . . . . . . . . . . . . . . . . . . 36 74 4.2. PIB-RSA-SHA256 . . . . . . . . . . . . . . . . . . . . . . 37 75 4.3. PCB-RSA-AES128-PAYLOAD-PIB-PCB . . . . . . . . . . . . . . 38 76 5. Key Management . . . . . . . . . . . . . . . . . . . . . . . . 43 77 6. Default Security Policy . . . . . . . . . . . . . . . . . . . 44 78 7. Security Considerations . . . . . . . . . . . . . . . . . . . 46 79 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 80 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48 81 9.1. Normative References . . . . . . . . . . . . . . . . . . . 48 82 9.2. Informative References . . . . . . . . . . . . . . . . . . 48 83 Editorial Comments . . . . . . . . . . . . . . . . . . . . . . . . 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 52 85 Intellectual Property and Copyright Statements . . . . . . . . . . 53 87 1. Introduction 89 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 90 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 91 document are to be interpreted as described in [1]. 93 This document defines security features for the bundle protocol [2] 94 intended for use in delay tolerant networks, in order to provide the 95 DTN security services as described in the DTN Security Overview and 96 Motivations document [9]. 98 The bundle protocol is used in DTNs which overlay multiple networks, 99 some of which may be challenged by limitations such as intermittent 100 and possibly unpredictable loss of connectivity, long or variable 101 delay, asymmetric data rates, and high error rates. The purpose of 102 the bundle protocol is to support interoperability across such 103 stressed networks. The bundle protocol is layered on top of 104 underlay-network-specific convergence layers, on top of network- 105 specific lower layers, to enable an application in one network to 106 communicate with an application in another network, both of which are 107 spanned by the DTN. 109 Security will be important for the bundle protocol. The stressed 110 environment of the underlying networks over which the bundle protocol 111 will operate makes it important that the DTN be protected from 112 unauthorized use, and this stressed environment poses unique 113 challenges on the mechanisms needed to secure the bundle protocol. 114 Furthermore, DTNs may very likely be deployed in environments where a 115 portion of the network might become compromised, posing the usual 116 security challenges related to confidentiality, integrity and 117 availability. 119 1.1. Related Documents 121 This document is best read and understood within the context of the 122 following other DTN documents: 124 The Delay-Tolerant Network Architecture [10] defines the 125 architecture for delay-tolerant networks, but does not discuss 126 security at any length. 128 The DTN Bundle Protocol [2] defines the format and processing of 129 the blocks used to implement the bundle protocol, excluding the 130 security-specific blocks defined here. 132 The Delay-Tolerant Networking Security Overview [9] provides an 133 informative overview and high-level description of DTN security. 135 1.2. Terminology 137 We introduce the following terminology for purposes of clarity: 139 source - the bundle node from which a bundle originates 141 destination - the bundle node to which a bundle is ultimately 142 destined 144 forwarder - the bundle node that forwarded the bundle on its most 145 recent hop 147 intermediate receiver or "next hop" - the neighboring bundle node 148 to which a forwarder forwards a bundle. 150 In the figure below, which is adapted from figure 1 in the Bundle 151 Protocol Specification, four bundle nodes (denoted BN1, BN2, BN3, and 152 BN4) reside above some transport layer(s). Three distinct transport 153 and network protocols (denoted T1/N1, T2/N2, and T3/N3) are also 154 shown. 156 +---------v-| +->>>>>>>>>>v-+ +->>>>>>>>>>v-+ +-^---------+ 157 | BN1 v | | ^ BN2 v | | ^ BN3 v | | ^ BN4 | 158 +---------v-+ +-^---------v-+ +-^---------v-+ +-^---------+ 159 | T1 v | + ^ T1/T2 v | + ^ T2/T3 v | | ^ T3 | 160 +---------v-+ +-^---------v-+ +-^---------v + +-^---------+ 161 | N1 v | | ^ N1/N2 v | | ^ N2/N3 v | | ^ N3 | 162 +---------v-+ +-^---------v + +-^---------v-+ +-^---------+ 163 | >>>>>>>>^ >>>>>>>>>>^ >>>>>>>>^ | 164 +-----------+ +------------+ +-------------+ +-----------+ 165 | | | | 166 |<-- An Internet --->| |<--- An Internet --->| 167 | | | | 169 BN = "Bundle Node" (as defined in the Bundle Protocol Specification 171 Bundle Nodes Sit at the Application layer of the Internet Model. 173 Figure 1 175 Bundle node BN1 originates a bundle that it forwards to BN2. BN2 176 forwards the bundle to BN3, and BN3 forwards the bundle to BN4. BN1 177 is the source of the bundle and BN4 is the destination of the bundle. 178 BN1 is the first forwarder, and BN2 is the first intermediate 179 receiver; BN2 then becomes the forwarder, and BN3 the intermediate 180 receiver; BN3 then becomes the last forwarder, and BN4 the last 181 intermediate receiver, as well as the destination. 183 If node BN2 originates a bundle (for example, a bundle status report 184 or a custodial signal), which is then forwarded on to BN3, and then 185 to BN4, then BN2 is the source of the bundle (as well as being the 186 first forwarder of the bundle) and BN4 is the destination of the 187 bundle (as well as being the final intermediate receiver). 189 We introduce the following security-specific DTN terminology: 191 security-source - a bundle node that adds a security block to a 192 bundle 194 security-destination - a bundle node that processes a security 195 block of a bundle 197 security zone - that part of the network path from the security- 198 source to the security-destination 200 Referring to Figure 1 again: 202 If the bundle that originates at BN1 as source is given a security 203 block by BN1, then BN1 is the security-source of this bundle with 204 respect to that security block, as well as being the source of the 205 bundle. 207 If the bundle that originates at BN1 as source is given a security 208 block by BN2, then BN2 is the security-source of this bundle with 209 respect to that security block, even though BN1 is the source. 211 If the bundle that originates at BN1 as source is given a security 212 block by BN1 that is intended to be processed by BN3, then BN1 is the 213 security-source and BN3 is the security destination with respect to 214 this security block. The security zone for this block is BN1 to BN3. 216 A bundle may have multiple security blocks. The security-source of a 217 bundle with respect to a given security block in the bundle may be 218 the same as or different from the security-source of the bundle with 219 respect to a different security block in the bundle. Similarly, the 220 security-destination of a bundle with respect to each of that 221 bundle's security blocks may be the same or different. Therefore the 222 security zones for various blocks may be and often will be different. 224 If the bundle that originates at BN1 as source is given a security 225 block by BN1 that is intended to be processed by BN3, and BN2 adds a 226 security block with security-destination BN4, the security zones for 227 the two blocks overlap but not completely. This problem is discussed 228 further in Section 3.3. 230 Forwarding nodes MUST transmit blocks in the same order as they were 231 received. This requirement applies to all dtn nodes, not just ones 232 which implement security processing. Blocks in a bundle may be added 233 or deleted according to the applicable specification, but those 234 blocks which are both received and transmitted MUST be transmitted in 235 the same order that they were received. 237 The block sequence also indicates the order in which certain 238 significant actions have affected the bundle, and therefore the 239 sequence in which actions must occur in order to produce the bundle 240 at its destination. 242 2. Security Blocks 244 There are three types of security block that MAY be included in a 245 bundle. These are the Bundle Authentication Block (BAB), the Payload 246 Integrity Block (PIB), and the Payload Confidentiality Block (PCB). 248 The BAB is used to assure the authenticity and integrity of the 249 bundle along a single hop from forwarder to intermediate receiver. 251 The PIB is used to assure the authenticity and integrity of the 252 bundle from the PIB security-source, which creates the PIB, to the 253 PIB security-destination, which verifies the PIB authenticator. 254 The authentication information in the PIB may (if the ciphersuite 255 allows) be verified by any node inbetween the PIB security-source 256 and the PIB security-destination that has access to the 257 cryptographic keys and revocation status information required to 258 do so. 260 Since a BAB protects a bundle on a "hop-by-hop" basis and a PIB 261 protects on a (sort of) "end-to-end" basis, whenever both are 262 present the BAB MUST form the "outer" layer of protection - that 263 is, the BAB MUST always be calculated and added to the bundle 264 after the PIB has been calculated and added to the bundle. 266 The PCB indicates that some parts of the bundle have been 267 encrypted at the PCB security-source in order to protect the 268 bundle content while in transit to the PCB security-destination. 270 Each of the security blocks uses the Canonical Bundle Block Format as 271 defined in the Bundle Protocol Specification. That is, each security 272 block is comprised of the following elements: 274 - Block type code 276 - Block processing control flags 278 - Block EID reference list (optional) 280 - Block data length 282 - Block-type-specific data fields 284 Since the three security blocks have most fields in common, we can 285 shorten the description of the Block-type-specific data fields of 286 each security block if we first define an abstract security block 287 (ASB) and then specify each of the real blocks in terms of the fields 288 which are present/absent in an ASB. Note that no bundle ever 289 contains an ASB, which is simply a specification artifact. 291 2.1. Abstract Security Block 293 An ASB consists of the following mandatory and optional fields: 295 - Block-type code (one byte) - as in all bundle protocol blocks 296 except the primary bundle block. The block types codes for the 297 security blocks are: 299 BundleAuthentication Block - BAB: 0x02 301 PayloadIntegrity Block - PIB: 0x03 303 PayloadConfidentiality Block - PCB: 0x04 305 - Block processing control flags (SDNV) - defined as in all bundle 306 protocol blocks except the primary bundle block (as described in 307 the Bundle Protocol [2]). SDNV encoding is described in the 308 bundle protocol. There are no general constraints on the use of 309 the block processing flags, and some specific requirements are 310 discussed later.[Comment.1][Comment.2] 312 - EID references - composite field defined in [2] containing 313 references to one or two EIDs. Presence of the EID-reference 314 field is indicated by the setting of the "block contains an EID- 315 reference field" (EID_REF) bit of the block processing control 316 flags. If one or more references is present, flags in the 317 ciphersuite ID field, described below, specify which. 319 If no EID fields are present then the composite field itself is 320 omitted entirely, rather than containing a count field of zero, 321 since such a representation is not permitted. The EID_REF bit is 322 not set. 324 The possible EIDs are:- 326 - (optional) Security-source - specifies the security source 327 for the service. If this is omitted, then the source of the 328 bundle is assumed to be the security-source. 330 - (optional) Security-destination - specifies the security 331 destination for the service. If this is omitted, then the 332 destination of the bundle is assumed to be the security- 333 destination. 335 If two EIDs are present, security-source is first and security- 336 destination comes second. 338 - Block data length (SDNV) - as in all bundle protocol blocks 339 except the primary bundle block. SDNV encoding is described in 340 the bundle protocol. 342 - Block-type-specific data fields as follows: 344 - Ciphersuite ID (SDNV) 346 - Ciphersuite flags (SDNV) 348 - (optional) Correlator - when more than one related block is 349 inserted then this field MUST have the same value in each 350 related block instance. This is encoded as an SDNV. See note 351 in Section 3.8 with regard to correlator values in bundle 352 fragments. 354 - (optional) Ciphersuite parameters - compound field of next 355 two items 357 - Ciphersuite parameters length - specifies the length of 358 the following Ciphersuite parameters data field and is 359 encoded as an SDNV. 361 - Ciphersuite parameters data - parameters to be used with 362 the ciphersuite in use, e.g. a key identifier or 363 initialization vector (IV). See Section 2.5 for a list of 364 potential parameters and their encoding rules. The 365 particular set of parameters that are included in this field 366 are defined as part of the ciphersuite specification. 368 - (optional) Security result - compound field of next two items 370 - Security result length - contains the length of the next 371 field and is encoded as an SDNV. 373 - Security result data - contains the results of the 374 appropriate ciphersuite-specific calculation (e.g. a 375 signature, MAC or ciphertext block key). 377 +----------------+----------------+----------------+----------------+ 378 | type | flags (SDNV) | EID ref list(comp) | 379 +----------------+----------------+----------------+----------------+ 380 | length (SDNV) | ciphersuite (SDNV) | 381 +----------------+----------------+----------------+----------------+ 382 | ciphersuite flags (SDNV) | correlator (SDNV) | 383 +----------------+----------------+----------------+----------------+ 384 |params len(SDNV)| ciphersuite params data | 385 +----------------+----------------+----------------+----------------+ 386 |res-len (SDNV) | security result data | 387 +----------------+----------------+----------------+----------------+ 389 The structure of an abstract security block 391 Figure 2 393 Some ciphersuites are specified in Section 4, which also specifies 394 the rules which MUST be satisfied by ciphersuite specifications. 395 Additional ciphersuites MAY be defined in separate specifications. 396 Ciphersuite IDs not specified are reserved. Implementations of the 397 bundle security protocol decide which ciphersuites to support, 398 subject to the requirements of section Section 4. It is RECOMMENDED 399 that implementations that allow additional ciphersuites permit 400 ciphersuite ID values at least up to and including 127, and they MAY 401 decline to allow larger ID values. 403 The structure of the ciphersuite flags field is shown in Figure 3. 404 In each case the presence of an optional field is indicated by 405 setting the value of the corresponding flag to one. A value of zero 406 indicates the corresponding optional field is missing. Presently 407 there are five flags defined for the field and for convenience these 408 are shown as they would be extracted from a single-byte SDNV. Future 409 additions may cause the field to grow to the left so, as with the 410 flags fields defined in [2], the description below numbers the bit 411 positions from the right rather than the standard RFC definition 412 which numbers bits from the left. 414 src - bit 4 indicates whether the EID-reference field of the ASB 415 contains the optional reference to the security-source. 417 dest - bit 3 indicates whether the EID-reference field of the ASB 418 contains the optional reference to the security-destination. 420 parm - bit 2 indicates whether the ciphersuite-parameters-length 421 and ciphersuite parameters data fields are present or not. 423 corr - bit 1 indicates whether or not the ASB contains an optional 424 correlator. 426 res - bit 0 indicates whether or not the ASB contains the security 427 result length and security result data fields. 429 bits 5-6 are reserved for future use. 431 Ciphersuite flags 432 Bit Bit Bit Bit Bit Bit Bit 433 6 5 4 3 2 1 0 434 +-----+-----+-----+-----+-----+-----+-----+ 435 | reserved |src |dest |parm |corr |res | 436 +-----+-----+-----+-----+-----+-----+-----+ 438 Figure 3 440 A little bit more terminology: if the block is a PIB then when we 441 refer to the "PIB-source", we mean the security source for the PIB as 442 represented by the EID reference in the EID-references field. 443 Similarly we may refer to the PCB-dest, meaning the security- 444 destination of the PCB, again as represented by an EID reference. 445 For example, referring to Figure 1 again, if the bundle that 446 originates at BN1 as source is given a Confidentiality Block (PCB) by 447 BN1 that is protected using a key held by BN3 and it is given a 448 Payload Integrity Block (PIB) by BN1, then BN1 is both the PCB-source 449 and the PIB-source of the bundle, and BN3 is the PCB-dest of the 450 bundle. 452 The correlator field is used to associate several related instances 453 of a security block. This can be used to place a BAB that contains 454 the ciphersuite information at the "front" of a (probably large) 455 bundle, and another correlated BAB that contains the security result 456 at the "end" of the bundle. This allows even very memory-constrained 457 nodes to be able to process the bundle and verify the BAB. There are 458 similar use cases for multiple related instances of PIB and PCB as 459 will be seen below. 461 The ciphersuite specification MUST make it clear whether or not 462 multiple block instances are allowed, and if so, under what 463 conditions. Some ciphersuites can of course leave flexibility to the 464 implementation, whereas others might mandate a fixed number of 465 instances. 467 2.2. Bundle Authentication Block 469 In this section we describe typical BAB field values for two 470 scenarios - where a single instance of the BAB contains all the 471 information and where two related instances are used, one "up front" 472 which contains the ciphersuite and another following the payload 473 which contains the security result (e.g. a MAC). 475 For the case where a single BAB is used: 477 The block-type code field value MUST be 0x02. 479 The block processing control flags value can be set to whatever 480 values are required by local policy. 482 The ciphersuite ID MUST be documented as a hop-by-hop 483 authentication-ciphersuite which requires one instance of the BAB. 485 The correlator field MUST NOT be present. 487 The ciphersuite parameters field MAY be present, if so specified 488 in the ciphersuite specification. 490 An EID reference to the security-source SHOULD be present and, if 491 so, it MUST identify the forwarder of the bundle. (If the 492 forwarding node is identified in another block of the bundle that 493 the next hop supports, e.g., the Previous Hop Insertion Block, the 494 forwarding node need not be identified in the BAB. Similarly, if 495 the forwarding node is known through other implementation-specific 496 means, such as from the convergence layer, an EID reference need 497 not be included.) 499 An EID reference to the security-destination SHOULD NOT be present 500 unless the ciphersuite requires this information (since the first 501 node receiving the bundle ought be the one to validate the BAB). 503 The security result MUST be present as it is effectively the 504 "output" from the ciphersuite calculation (e.g. the MAC or 505 signature) applied to the (relevant parts of) the bundle (as 506 specified in the ciphersuite definition). 508 For the case using two related BAB instances, the first instance is 509 as defined above, except the ciphersuite ID MUST be documented as a 510 hop-by-hop authentication ciphersuite that requires two instances of 511 the BAB. In addition, the correlator MUST be present and the 512 security result length and security result fields MUST be absent. 513 The second instance of the BAB MUST have the same correlator value 514 present and MUST contain security result length and security result 515 data fields. The other optional fields MUST NOT be present. 516 Typically, this second instance of a BAB will be the last block of 517 the bundle. 519 2.3. Payload Integrity Block 521 A PIB is an ASB with the following additional restrictions: 523 The block type code value MUST be 0x03. 525 The block processing control flags value can be set to whatever 526 values are required by local policy. 528 The ciphersuite ID MUST be documented as an end-to-end 529 authentication-ciphersuite or as an end-to-end error-detection- 530 ciphersuite. 532 The correlator MUST be present if the ciphersuite requires more 533 than one related instance of a PIB be present in the bundle. The 534 correlator MUST NOT be present if the ciphersuite only requires 535 one instance of the PIB in the bundle. 537 The ciphersuite parameters field MAY be present. 539 An EID reference to the security-source MAY be present. 541 An EID reference to the security-destination MAY be present. 543 The security result is effectively the "output" from the 544 ciphersuite calculation (e.g. the MAC or signature) applied to the 545 (relevant parts of) the bundle. As in the case of the BAB, this 546 field MUST be present if the correlator is absent. If more than 547 one related instance of the PIB is required then this is handled 548 in the same way as described for the BAB above. 550 The ciphersuite may process less than the entire original bundle 551 payload, either because the current payload is a fragment of the 552 original bundle or just becuase it is defined to process some 553 subset. For whatever reason, if the ciphersuite processes less 554 than the complete, original bundle payload MUST specify, as part 555 of the ciphersuite parameters, which bytes of the bundle payload 556 are protected. 558 For some ciphersuites, (e.g. those using asymmetric keying to produce 559 signatures or those using symmetric keying with a group key), the 560 security information can be checked at any hop on the way to the 561 destination that has access to the required keying information. This 562 possibility is further discussed in Section 3.6 below. 564 Most asymmetric PIB-ciphersuites will use the PIB-source to indicate 565 the signer and will not require the PIB-dest field because the key 566 needed to verify the PIB authenticator will be a public key 567 associated with the PIB-source. 569 2.4. Payload Confidentiality Block 571 A typical confidentiality ciphersuite will encrypt the payload using 572 a randomly generated bundle encrypting key (BEK) and will use a PCB 573 security result to carry the BEK encrypted with some long term key 574 encryption key (KEK) or well-known public key. If neither the 575 destination nor security-destination resolves the key to use for 576 decryption, the ciphersuite parameters field can be used to indicate 577 the decryption key with which the BEK can be recovered. Subsequent 578 PCB security results will contain blocks encrypted using the BEK if 579 non-payload blocks are to be encrypted. 581 It is STRONGLY RECOMMENDED that a data integrity mechanism be used in 582 conjunction with confidentiality, and that encryption-only 583 ciphersuites NOT be used. The "authentication tag" or "integrity 584 check value" is stored into security-result rather than being 585 appended to the payload as is common in some protocols since, as 586 described below, it is important that there be no change in the size 587 of the payload. 589 The payload is encrypted "in-place", that is, following encryption, 590 the payload block payload field contains ciphertext, not plaintext. 591 The payload block processing flags are unmodified.[Comment.3] 593 The "in-place" encryption of payload bytes is to allow bundle payload 594 fragmentation and re-assembly, and custody transfer, to operate 595 without knowledge of whether or not encryption has occurred and, if 596 so, how many times. 598 Fragmentation and reassembly and custody transfer are adversely 599 affected by a change in size of the payload due to ambiguity about 600 what byte range of the original payload is actually in any particular 601 fragment. Ciphersuites SHOULD place any payload expansion, such as 602 authentication tags (integrity check values) and any padding 603 generated by a block-mode cipher, into an "integrity check value" 604 item in the security-result field (see Section 2.5) of the 605 confidentiality block. 607 Payload super-encryption is allowed. The second application of 608 confidentiality does not generally protect the parameters of the 609 first which represent a vulnerability in some circumstances. 610 Ciphersuites SHOULD define super-encryption such that it protects the 611 parameters of earlier encryption. 613 Confidentiality can be applied to blocks other than the payload and 614 in some cases this is recommended. The ciphersuite may apply 615 different rules to confidentiality for non-payload blocks. 617 For example, multiple related PCB instances are required if both the 618 payload and the PS blocks in the bundle are to be encrypted. These 619 multiple PCB instances require correlators to associate them with 620 each other. 622 Confidentiality is normally applied to the payload, and possibly to 623 additional blocks. It is RECOMMENDED to apply a Payload 624 Confidentiality ciphersuite to non-payload blocks only if these 625 should be super-encrypted with the payload. If super-encryption if 626 the block is not desired then protection of the block should be done 627 by means other than a Payload Confidentiality ciphersuite. 629 There are situations where more than one PCB instance is required but 630 the instances are not "related" in the sense which requires 631 correlators. One example is where a payload is encrypted for more 632 than one security-destination so as to be robust in the face of 633 routing uncertainties. These multiple PCB instances, are not 634 "related" and should not contain correlators. [Comment.4] 636 A PCB is an ASB with the following additional restrictions: 638 The block type code value MUST be 0x04. 640 The block processing control flags value can be set to whatever 641 values are required by local policy, except that a PCB containing 642 an encrypted key or a key reference MUST have the "replicate in 643 every fragment" flag set. This flag SHOULD NOT be set otherwise. 645 The ciphersuite ID MUST be documented as a confidentiality- 646 ciphersuite. 648 The correlator MUST be present if there is more than one related 649 PCB instance. The correlator MUST NOT be present if there are no 650 related PCB instances. 652 If a correlator is present, the encrypted key or key identifier 653 MUST be placed in the first PCB of the correlated set. 655 Any additional bytes generated as a result of encryption and/or 656 authentication processing of the payload SHOULD be placed in an 657 "integrity check value" field (see Section 2.5) in the security- 658 result of the first PCB. 660 The ciphersuite parameters field MAY be present. 662 An EID reference to the security-source MAY be present. 664 An EID reference to the security-destination MAY be present. 666 The security result MAY be present and normally contains fields 667 such as an encrypted bundle encryption key, authentication tag or 668 the encrypted versions of bundle blocks other than the payload 669 block. 671 As was the case for the BAB and PIB, if the ciphersuite requires more 672 than one instance of the PCB, then the first occurrence MUST contain 673 any optional fields (e.g. security destination etc.) that apply to 674 all instances with this correlator. These MUST be contained in the 675 first instance and MUST NOT be repeated in other correlated blocks. 676 Fields that are specific to a particular instance of the PCB MAY 677 appear in that PCB. For example, security result fields MAY (and 678 probably will) be included in multiple related PCB instances, with 679 each result being specific to that particular block. Similarly, 680 several PCBs might each contain a ciphersuite parameters field with 681 an IV specific to that PCB instance. 683 Put another way: when confidentiality will generate multiple blocks, 684 it MUST first create a PCB with the required ciphersuite ID, 685 parameters etc. as specified above. Typically, this PCB will appear 686 "early" in the bundle. If this "first" PCB doesn't contain all of 687 the ciphertext, then it may be followed by other, correlated PCBs 688 which MUST NOT repeat the ciphersuite parameters, security-source, or 689 security-destination fields from the first PCB. 691 A PCB ciphersuite may, or may not, specify which blocks are to be 692 encrypted. If the ciphersuite doesn't specify this, then the node is 693 free to encrypt whichever blocks it wishes. If a PCB ciphersuite 694 does specify which blocks are to be encrypted, then doing otherwise 695 is an error. 697 The ciphersuite may process less than the entire original bundle 698 payload, either because the current payload is a fragment of the 699 original bundle or just becuase it is defined to process some subset. 700 For whatever reason, if the ciphersuite processes less than the 701 complete, original bundle payload MUST specify, as part of the 702 ciphersuite parameters, which bytes of the bundle payload are 703 protected. 705 After decryption the recovered plaintext should then replace the PCB 706 in the bundle for further processing (e.g. PIB verification). This 707 recovered plaintext MUST contain all the appropriate block type, 708 processing flags and length information. In other words delete the 709 PCB in question and place the recovered plaintext, which consists of 710 some complete non-payload block, in the bundle at the location from 711 which the PCB was deleted. 713 A ciphersuite MUST NOT mix payload data and a non-payload block in a 714 single PCB. 716 Even if a to-be-encrypted block has the "discard" flag set, whether 717 or not the PCB's "discard" flag is set is an implementation/policy 718 decision for the encrypting node. (The "discard" flag is more 719 properly called the "discard if block cannot be processed" flag.) 721 2.5. Parameters and Result Fields 723 Various ciphersuites include several items in the security-parameters 724 and/or security-result fields. Which fields may appear is defined by 725 the particular ciphersuite description. 727 Each field is represented as type-length-value. Type is a single 728 byte indicating which item this is. Length is the count of data 729 bytes to follow, and is an SDNV-encoded integer. Value is the data 730 content of the item. 732 Item types are 734 0: reserved 736 1: initialization vector (IV) 738 2: reserved 740 3: key information 742 4: fragment range (offset and length as a pair of SDNVs) 744 5: integrity signature 746 6: reserved 748 7: C block salt 750 8: C block integrity check value (ICV) 752 9: reserved 754 10: encapsulated block 756 11: reserved 757 12 - 191: reserved 759 192 - 250: private use 761 251 - 255: reserved 763 The folowing descriptions apply to usage of these items for all 764 ciphersuites. Additional characteristics are noted in the discussion 765 for specific suites. 767 - initialization vector(IV): random value, typically eight to 768 sixteen bytes 770 - key information: key material encoded or protected by the key 771 management system. This item is discussed further below 772 Section 2.6 774 - fragment range: pair of SDNV values (offset then length) 775 specifying the range of payload bytes to which a particular 776 operation applies. This is termed "fragment range" since that is 777 its typical use, even though sometimes it may describe a subset 778 range that is not a fragment 780 - integrity signature: result of BA or PS digest or signing 781 operation. This item is discussed further below Section 2.6 783 - C block salt: an IV-like value used by certain confidentiality 784 suites 786 - C block integrity check value(ICV): output from certain 787 confidentiality ciphersuite operations to be used at the 788 destination to verify that the protected data has not been 789 modified 791 - encapsulated block: result of confidentiality operation on 792 certain blocks, contains the ciphertext of the block and may also 793 contain an integrity check value appended to the ciphertext; may 794 also contain padding if required by the encryption mode; used for 795 non-payload blocks only 797 2.6. Key Transport 799 This specification endeavours to maintain separation between the 800 security protocol and key management. However these two interact in 801 the transfer of key information etc from security-source to security- 802 destination. In this discussion, "key information" includes keys, 803 key identifiers, integrity signatures and other similar information 804 protected by a key. It excludes payload, metadata and similar blocks 805 even though these may be protected by a key. 807 The exact representation of "key information" and "integrity 808 signature" in their respective item types is currently a topic of 809 discussion. The general intent is that they should be ASN.1-encoded 810 as described in RFC 3369 [3] and related RFCs. 812 2.7. PIB and PCB combinations 814 Given the above definitions, nodes are free to combine applications 815 of PIB and PCB in any way they wish - the correlator value allows for 816 multiple applications of security services to be handled separately. 818 However, there are some clear security problems that could arise when 819 applying multiple services. For example, if we encrypted a payload 820 but left a PIB security result containing a signature in the clear, 821 payload guesses could be confirmed. 823 We cannot, in general, prevent all such problems since we cannot 824 assume that every ciphersuite definition takes account of every other 825 ciphersuite definition. However, we can limit the potential for such 826 problems by requiring that any ciphersuite which applies to one 827 instance of a PIB or PCB, must be applied to all instances with the 828 same correlator. 830 We now list the PIB and PCB combinations which we envisage as being 831 useful to support: 833 Encrypted tunnels - a single bundle may be encrypted many times 834 en-route to its destination. Clearly it must be decrypted an 835 equal number of times, but we can imagine each encryption as 836 representing the entry into yet another layer of tunnel. This is 837 supported by using multiple instances of PCB, but with the payload 838 encrypted multiple times, "in-place". Depending upon the 839 ciphersuite defintion, other blocks can and should be encrypted, 840 as discussed above and in Section 2.4 to ensure that parameters 841 are protected in the case of super-encryption. 843 Multiple parallel authenticators - a single security source might 844 wish to protect the integrity of a bundle in multiple ways. This 845 could be required if the bundle's path is unpredictable, and if 846 various nodes might be involved as security destinations. 847 Similarly, if the security source cannot determine in advance 848 which algorithms to use, then using all might be reasonable. This 849 would result in uses of PIB which presumably all protect the 850 payload, and which cannot in general protect one another. Note 851 that this logic can also apply to a BAB, if the unpredictable 852 routing happens in the convergence layer, so we also envisage 853 support for multiple parallel uses of BAB. 855 Multiple sequential authenticators - if some security destination 856 requires assurance about the route that bundles have taken, then 857 it might insist that each forwarding node add its own PIB. More 858 likely, however would be that outbound "bastion" nodes would be 859 configured to sign bundles as a way of allowing the sending 860 "domain" to take accountability for the bundle. In this case, the 861 various PIBs will likely be layered, so that each protects the 862 earlier applications of PIB. 864 Authenticated and encrypted bundles - a single bundle may require 865 both authentication and confidentiality. Some specifications 866 first apply the authenticator and follow this by encrypting the 867 payload and authenticator. As noted previously in the case where 868 the authenticator is a signature, there are security reasons for 869 this ordering. (See the PCB-RSA-AES128-PAYLOAD-PIB-PCB 870 ciphersuite defined later in Section 4.3.) Others apply the 871 authenticator after encryption, that is, to the ciphertext. This 872 ordering is generally recommended and minimizes attacks which, in 873 some cases, can lead to recovery of the encryption key. 875 There are no doubt other valid ways to combine PIB and PCB instances, 876 but these are the "core" set supported in this specification. Having 877 said that, as will be seen, the mandatory ciphersuites defined here 878 are quite specific and restrictive in terms of limiting the 879 flexibility offered by the correlator mechanism. This is primarily 880 in order to keep this specification as simple as possible, while at 881 the same time supporting the above scenarios. 883 3. Security Processing 885 This section describes the security aspects of bundle processing. 887 3.1. Nodes as policy enforcement points 889 All nodes are REQUIRED to have and enforce their own configurable 890 security policies, whether these policies be explicit or default, as 891 defined in Section 6. 893 All nodes serve as Policy Enforcement Points (PEP) insofar as they 894 enforce polices that may restrict the permissions of bundle nodes to 895 inject traffic into the network. Policies may apply to traffic 896 originating at the current node, traffic terminating at the current 897 node and traffic to be forwarded by the current node to other nodes. 898 If a particular transmission request, originating either locally or 899 remotely, satisfies the node's policy or policies and is therefore 900 accepted, then an outbound bundle can be created and dispatched. If 901 not, then in its role as a PEP, the node will not create or forward a 902 bundle. Error handling for such cases is currently considered out of 903 scope of this document.[Comment.5] 905 Policy enforcing code MAY override all other processing steps 906 described here and elsewhere in this document. For example, it is 907 valid to implement a node which always attempts to attach a PIB. 908 Similarly it is also valid to implement a node which always rejects 909 all requests which imply the use of a PIB. 911 Nodes MUST consult their security policy to determine the criteria 912 that a received bundle ought to meet before it will be forwarded. 913 These criteria MUST include a determination of whether or not the 914 received bundle must include a valid BAB, PIB or PCB. If the bundle 915 does not meet the node's policy criteria, then the bundle MUST be 916 discarded and processed no further; in this case, a bundle status 917 report indicating the failure MAY be generated.[Comment.6] 919 The node's policy MAY call for the node to add or subtract some 920 security blocks, for example, requiring the node attempt to encrypt 921 (parts of) the bundle for some security-destination, or requiring 922 that the node add a PIB. If the node's policy requires a BAB to be 923 added to the bundle, it MUST be added last so that the calculation of 924 its security result may take into consideration the values of all 925 other blocks in the bundle. 927 3.2. Processing order of security blocks 929 The processing order of security actions for a bundle is critically 930 important for the actions to complete successfully. In general, the 931 actions performed at the originating node must be executed in the 932 reverse sequence at the destination. There are variations and 933 exceptions, and these are noted below. 935 The sequence is maintained in the ordering of security blocks in the 936 bundle. It is for this reason that blocks may not be rearranged at 937 forwarding nodes, whether they support the security protocols or not. 938 The only blocks that participate in this ordering are the primary and 939 payload blocks, and the security blocks themselves. All other 940 extension blocks are ignored for purposes of determining the 941 processing order. 943 The security blocks are added to and removed from a bundle in a last- 944 in-first-out (LIFO) manner, with the top of the stack immediately 945 after the primary block. A newly-created bundle has just the primary 946 and payload blocks, and the stack is empty. As security actions are 947 requested for the bundle, security blocks are pushed onto the stack 948 immediately after the primary block. The early actions have security 949 blocks close to the payload, later actions have blocks nearer to the 950 primary block. The actions deal with only those blocks in the bundle 951 at the time so, for example, the first to be added processes only the 952 payload and primary blocks, the next might process the first if it 953 chooses and the payload and primary, and so on. The last block to be 954 added can process all the blocks. 956 When the bundle is received, this process is reversed and security 957 processing begins at the top of the stack, immediately after the 958 primary block. The security actions are performed and the block is 959 popped from the stack. Processing continues with the next security 960 block until finally only the payload and primary blocks remain. 962 The simplicity of this description is undermined by various real- 963 world requirements. Nonetheless it serves as a helpful initial 964 framework for understanding the bundle security process. 966 The first issue is a very common one and easy to handle. The bundle 967 may be sent indirectly to its destination, requiring several 968 forwarding hops to finally arrive there. Security processing happens 969 at each node, assuming that the node supports bundle security. For 970 the following discussion, we assume that a bundle is created and that 971 confidentiality, then payload security and finally bundle 972 authentication are applied to it. The block sequence would therefore 973 be primary-BA-PS-C-payload. Traveling from source to destination 974 requires going through one intermediate node, so the trip consists of 975 two hops. 977 When the bundle is received at the intermediate node, the receive 978 processing validates the BA block and pops it from the stack. 980 However the PS and C blocks have the final destination as their 981 security destination, so these can't be processed and removed. The 982 intermediate node then begins the send process with the four 983 remaining blocks in the bundle. The outbound processing adds any 984 security blocks required by local policy, and these are pushed on the 985 stack immediately after the primary block, ahead of the PS block. In 986 this example, the intermediate node adds a PS block as a signature 987 that the bundle has passed through the node. 989 The receive processing at the destination first handles the 990 intermediate node's PS block and pops it, next is the originator's PS 991 block, also popped, and finally the originator's confidentiality 992 block which allows the payload to be decrypted and the bundle handled 993 for delivery. 995 This simple scheme can easily be extended to very complex networks. 996 It cannot deal with security zones that overlap partially but not 997 completely and these are discussed further below Section 3.3. 998 Administrators SHOULD NOT configure security-sources and security- 999 destinations in a network such that overlapping security zones are 1000 created. 1002 The second issue relates to the reversibility of certain security 1003 process actions. In general, the actions fall into two categories: 1004 those which do not affect other parts of the bundle, and those which 1005 are fully reversible. Creating a bundle signature, for example, does 1006 not change the bundle content except for the result. The encryption 1007 performed as part of the confidentiality processing does change the 1008 bundle, but the reverse processing at the destination restores the 1009 original content. 1011 The third category is the one where the bundle content has changed 1012 slightly and in a non-destructive way, but there is no mechanism to 1013 reverse the change. The simplest example is the addition of an EID- 1014 reference to a security block. The addition of the reference causes 1015 the text to be added to the bundle's dictionary. The text may be 1016 used also by other references so removal of the block and this 1017 specific eid-reference does not cause removal of the text from the 1018 dictionary. This shortcoming is of no impact to the "sequential" or 1019 "wrapping" security schemes described above, but does cause failures 1020 with "parallel" authentication mechanisms. Solutions for this 1021 problem are implementation-specific and typically involve multi-pass 1022 processing such that blocks are added at one stage and the security 1023 results calculated at a later stage of the overall process. 1025 Certain ciphersuites have sequence requirements for their correct 1026 operation, most notably the BundleAuthentication ciphersuites. 1027 Processing for BundleAuthentication is required to happen after all 1028 other sending operations, and prior to any receive operations at the 1029 next hop node. It follows therefore that BA blocks must always be 1030 pushed onto the stack after all others. 1032 Although we describe the security block list as a stack, there are 1033 some blocks which are placed after the payload and therefore are not 1034 part of the stack. The BundleAuthentication ciphersuite #1 ("BA1") 1035 requires a second, correlated block to contain the security-result 1036 and this block is placed after the payload, usually as the last block 1037 in the bundle. We can apply the stack rules even to these blocks by 1038 specifying that they be added to the end of the bundle at the same 1039 time that their "owner" or "parent" block is pushed on the stack. In 1040 fact, they form a stack beginning at the payload but growing in the 1041 other direction. Also, not all blocks in the main stack have a 1042 corresponding entry in the trailing stack. The only blocks which 1043 MUST follow the payload are those mandated by ciphersuites as 1044 correlated blocks for holding a security-result. No other blocks are 1045 required to follow the payload block and it is RECOMMENDED that they 1046 NOT do so. 1048 3.3. Security Zones 1050 Each security block has a security zone, as described in the 1051 discussion for Figure 1, and the zones for various blocks are often 1052 different. 1054 BA blocks are always for a single hop and these restricted zones 1055 never cause conflict. 1057 The zones for PS and C blocks are often from bundle source to bundle 1058 destination, to provide end-to-end protection. A bundle-source-to- 1059 bundle-destination zone likewise never causes a problem. 1061 Another common scenario is for gateway-to-gateway protection of 1062 traffic between two sub-networks. 1064 Looking at Figure 1 and the simplified version shown in Figure 4, we 1065 can regard BN2 and BN3 as gateways connecting the two subnetworks 1066 labeled "An Internet". As long as they provide security for the BN2- 1067 BN3 zone, all is well. Problems begin, for example, when BN2 adds 1068 blocks with BN4 as the security-destination, and originating node BN1 1069 has created blocks with BN3 as security-destination. We now have two 1070 zones and neither is a subset of the other. 1072 +---------v-| +->>>>>>>>>>v-+ +->>>>>>>>>>v-+ +-^---------+ 1073 | BN1 v | | ^ BN2 v | | ^ BN3 v | | ^ BN4 | 1074 +---------v-+ +-^---------v-+ +-^---------v-+ +-^---------+ 1075 >>>>>>>>^ >>>>>>>>>>^ >>>>>>>>^ 1077 <------------- BN1 to BN3 zone ------------> 1079 <------------- BN2 to BN4 zone ------------> 1081 Overlapping security zones 1083 Figure 4 1085 Consider the case where the security concern is for data integrity, 1086 so the blocks are PayloadIntegrity. BN1 creates one ("PSa") along 1087 with the new bundle, and BN2 pushes its own PS block "PSb" on the 1088 stack, with security-destination BN4. When this bundle arrives at 1089 BN3, the bundle blocks are 1091 primary - PSb - PSa - payload 1093 Block PSb is not destined for this node BN3 so must be forwarded. 1094 This is the security-destination for block PSa so, after validation, 1095 it should be removed from the bundle. But that will invalidate the 1096 PSb signature when the block is checked at the final destination. 1097 The PSb signature includes the primary block, PSb itself, PSa and the 1098 payload block, so PSa MUST remain in the bundle. This is why 1099 security blocks are treated as a stack and add/remove operations are 1100 permitted only at the top-of-stack. 1102 The situation would be worse if the security concern is 1103 confidentiality, so C blocks are employed, such as the 1104 confidentiality ciphersuite #3 ("C3") described in Section 4.3. In 1105 this scenario, BN1 would encrypt the bundle with BN3 as security- 1106 destination, BN2 would super-encrypt the payload and encapsulate the 1107 C3 block for security-destination BN4. BN3 forwards all the blocks 1108 without change. BN4 decrypts the payload from its super-encryption 1109 and decapsulates the C3 block, only to find that it should have been 1110 processed earlier. Assuming that BN4 has no access to BN3's key 1111 store, BN4 has no way to decrypt the bundle and recover the original 1112 content. 1114 3.4. Canonicalisation of bundles 1116 In order to verify a signature or MAC on a bundle the exact same 1117 bits, in the exact same order, must be input to the calculation upon 1118 verification as were input upon initial computation of the original 1119 signature or MAC value. Consequently, a node MUST NOT change the 1120 encoding of any URI in the dictionary field, e.g., changing the DNS 1121 part of some HTTP URL from lower case to upper case. Because bundles 1122 may be modified while in transit (either correctly or due to 1123 implementation errors), a canonical form of any given bundle (that 1124 contains a BAB or PIB) must be defined. 1126 This section defines two bundle canonicalisation algorithms which can 1127 be used by various ciphersuites. 1129 3.4.1. Strict canonicalisation 1131 The first algorithm that can be used permits no changes at all to the 1132 bundle between the security-source and the security-destination. It 1133 is mainly intended for use in BAB ciphersuites. This algorithm 1134 conceptually catenates all blocks in the order presented, but omits 1135 all security result data fields in blocks of this ciphersuite type. 1136 That is, when a BA ciphersuite specifies this algorithm then we omit 1137 all BAB security results for all BA ciphersuites, when a PIB 1138 ciphersuite specifies this algorithm then we omit all PIB security 1139 results for all PS ciphersuites. All security result length fields 1140 are included, even though their corresponding security result data 1141 fields are omitted. 1143 Notes: 1145 - In the above we specify that security result data is omitted. 1146 This means that no bytes of the security result data are input. 1147 We do not set the security result length to zero. Rather, we 1148 assume that the security result length will be known to the module 1149 that implements the ciphersuite before the security result is 1150 calculated, and require that this value be in the security result 1151 length field even though the security result data itself will be 1152 omitted. 1154 - The 'res' bit of the ciphersuite ID, which indicates whether or 1155 not the security result length and security result data field are 1156 present, is part of the canonical form. 1158 -The value of the block data length field, which indicates the 1159 length of the block, is also part of the canonical form. Its 1160 value indicates the length of the entire bundle when the bundle 1161 includes the security result data field. 1163 -BABs are always added to bundles after PIBs, so when a PIB 1164 ciphersuite specifies this strict canonicalisation algorithm and 1165 the PIB is received with a bundle that also includes one or more 1166 BABs, application of strict canonicalisation as part of the PIB 1167 security result verification process requires that all BABs in the 1168 bundle be ignored entirely. 1170 3.4.2. Mutable canonicalisation 1172 This algorithm is intended to protect parts of the bundle which 1173 should not be changed in-transit. Hence it omits the mutable parts 1174 of the bundle. 1176 The basic approach is to define a canonical form of the primary block 1177 and catenate it with the security and payload blocks in the order 1178 that they will be transmitted. This algorithm ignores all other 1179 blocks because it cannot be determined whether or not they will 1180 change as the bundle transits the network. 1182 Many fields in various blocks are stored as variable-length SDNVs. 1183 These are canonicalized in unpacked form, as eight-byte fixed-width 1184 fields in network byte order. The size of eight bytes is chosen 1185 because implementations may handle larger values as invalid, as noted 1186 in [2]. 1188 The canonical form of the primary block is shown in Figure 5. 1189 Essentially, it de-references the dictionary block, adjusts lengths 1190 where necessary and ignores flags that may change in transit. 1192 +----------------+----------------+----------------+----------------+ 1193 | Version | Processing flags (incl. COS and SRR) | 1194 +----------------+----------------+---------------------------------+ 1195 | Canonical primary block length | 1196 +----------------+----------------+---------------------------------+ 1197 | Destination endpoint ID length | 1198 +----------------+----------------+---------------------------------+ 1199 | | 1200 | Destination endpoint ID | 1201 | | 1202 +----------------+----------------+---------------------------------+ 1203 | Source endpoint ID length | 1204 +----------------+----------------+----------------+----------------+ 1205 | | 1206 | Source endpoint ID | 1207 | | 1208 +----------------+----------------+---------------------------------+ 1209 | Report-to endpoint ID length | 1210 +----------------+----------------+----------------+----------------+ 1211 | | 1212 | Report-to endpoint ID | 1213 | | 1214 +----------------+----------------+----------------+----------------+ 1215 | | 1216 + Creation Timestamp (2 x SDNV) + 1217 | | 1218 +---------------------------------+---------------------------------+ 1219 | Lifetime | 1220 +----------------+----------------+----------------+----------------+ 1222 The canonical form of the primary bundle block. 1224 Figure 5 1226 The fields shown in Figure 5 are: 1228 Version is the single-byte value in the primary block. 1230 Processing flags in the primary block is an SDNV, and includes the 1231 class-of-service (COS) and status report request (SRR) fields. 1232 For purposes of canonicalization, the SDNV is unpacked into a 1233 fixed-width field and some bits are masked out. The unpacked 1234 field is ANDed with mask 0x0000 0000 003E 031F to set to zero all 1235 reserved bits and the "bundle is a fragment" bit. 1237 Length - a four-byte value containing the length (in bytes) of 1238 this structure, in network byte order.[Comment.7] 1239 Destination endpoint ID length and value - are the length (as a 1240 four byte value in network byte order) and value of the 1241 destination endpoint ID from the primary bundle block. The URI is 1242 simply copied from the relevant part(s) of the dictionary block 1243 and is not itself canonicalised. Although the dictionary entries 1244 contain null-terminators, the null-terminators are not included in 1245 the length or the canonicalization. 1247 Source endpoint ID length and value are handled similarly to the 1248 destination. 1250 Report-to endpoint ID length and value are handled similarly to 1251 the destination. 1253 Creation time (2 x SDNV) and Lifetime (SDNV) are simply copied 1254 from the primary block, with the SDNV values being represented as 1255 eight-byte unpacked values. 1257 Fragment offset and Total application data unit length are 1258 ignored, as is the case for the "bundle is a fragment" bit 1259 mentioned above. If the payload data to be canonicalized is less 1260 than the complete, original bundle payload, the offset and length 1261 are specified in the security-parameters. 1263 For non-primary blocks being included in the canonicalization, the 1264 block processing flags value used for canonicalization is the 1265 unpacked SDNV value with reserved and mutable bits masked to zero. 1266 The unpacked value is ANDed with mask 0x0000 0000 0000 0057 to zero 1267 reserved bits and the "last block" flag. The "last block" flag is 1268 ignored because BABs and other security blocks may be added for some 1269 parts of the journey but not others so the setting of this bit might 1270 change from hop to hop. 1272 Endpoint ID references in security blocks are canonicalized using the 1273 de-referenced text form in place of the reference pair. The 1274 reference count is not included, nor is the length of the endpoint ID 1275 text. 1277 The block-length is canonicalized as an eight-byte unpacked value in 1278 network byte order. If the payload data to be canonicalized is less 1279 than the complete, original bundle payload, this field contain the 1280 size of the data being canonicalized (the "effective block") rather 1281 that the actual size of the block. 1283 Payload blocks are generally cononicalized as-is with the exception 1284 that in some instances only a portion of the payload data is to be 1285 protected. In such a case, only those bytes are included in the 1286 canonical form, and additional ciphersuite parameters are required to 1287 specify which part of the payload is protected, as discussed further 1288 below. 1290 Security blocks are handled likewise, except that the ciphersuite 1291 will likely specify that the "current" security block security result 1292 field not be considered part of the canonical form. This differs 1293 from the strict canonicalisation case since we might use the mutable 1294 canonicalisation algorithm to handle sequential signatures such that 1295 signatures cover earlier ones. 1297 Notes: 1299 - The canonical form of the bundle is not transmitted. It is 1300 simply an artifact used as input to digesting. 1302 - We omit the reserved flags because we cannot determine if they 1303 will change in transit. The masks specified above may have to be 1304 revised if additional flags are defined and they need to be 1305 protected. 1307 - Our URI encoding does not preserve the "null-termination" 1308 convention from the dictionary field, nor do we separate the 1309 scheme and ssp as is done there. 1311 - The URI encoding will cause errors if any node rewrites the 1312 dictionary content (e.g. changing the DNS part of an HTTP URL from 1313 lower-case to upper case). This could happen transparently when a 1314 bundle is synched to disk using one set of software and then read 1315 from disk and forwarded by a second set of software. Because 1316 there are no general rules for canonicalising URIs (or IRIs), this 1317 problem may be an unavoidable source of integrity failures. 1319 - All SDNV fields here are canonicalized as eight-byte unpacked 1320 values in network byte order. Length fields are canonicalized as 1321 four-byte values in network byte order. Encoding does not need 1322 optimization since the values are never sent over the network. 1324 If a bundle is fragmented before the PIB is applied then the PIB 1325 applies to a fragment and not the entire bundle. However, the 1326 protected fragment could be subsequently further fragmented, which 1327 would leave the verifier unable to know which bytes were protected 1328 by the PIB. Even in the absence of frgmentation the same 1329 situation applies if the ciphersuite is defined to allow 1330 protection of less than the entire, original bundle payload. 1332 For this reason, PIB ciphersuites which support applying a PIB to 1333 less than the complete, original bundle payload MUST specify, as 1334 part of the ciphersuite parameters, which bytes of the bundle 1335 payload are protected. When verification occurs, only the 1336 specified range of the payload bytes are input to PIB 1337 verification. It is valid for a ciphersuite to be specified so as 1338 to only apply to entire bundles and not to fragments. A 1339 ciphersuite may be specified to apply to only a portion of the 1340 payload, regardless of whether the payload is a fragment or the 1341 complete original bundle payload. 1343 The same fragmentation issue applies equally to PCB ciphersuites. 1344 Ciphersuites which support applying confidentiality to fragments 1345 MUST specify, as part of the ciphersuite parameters, which bytes 1346 of the bundle payload are protected. When decrypting a fragment, 1347 only the specified bytes are processed. It is also valid for a 1348 confidentiality ciphersuite to be specified so as to only apply to 1349 entire bundles and not to fragments. 1351 3.5. Endpoint ID confidentiality 1353 Every bundle MUST contain a primary block that cannot be encrypted 1354 which also contains the source and destinations endpoint IDs, and 1355 others. If endpoint ID confidentiality is required, then a fake 1356 primary block with false values for these fields must be constructed 1357 and with a new block type to contain the actual values. There is 1358 presently no mechanism defined that supports such a "fake block" or 1359 possibly "fake dictionary". Bundle-in-bundle encapsulation may solve 1360 this problem in some instances. 1362 Similarly, confidentiality requirements may also apply to other parts 1363 of the primary block (e.g. the current-custodian) and that is 1364 supported in the same manner. 1366 3.6. Bundles received from other nodes 1368 Nodes implementing this specification SHALL consult their security 1369 policy to determine whether or not a received bundle is required by 1370 policy to include a BAB. If the bundle is not required to have a 1371 BAB, then BAB processing on the received bundle is complete and the 1372 bundle is ready to be further processed for PCB/PIB handling or 1373 delivery or forwarding. 1375 If the bundle is required to have a BAB but does not, then the bundle 1376 MUST be discarded and processed no further. If the bundle is 1377 required to have a BAB but all of its BABs identify a different node 1378 other than the receiving node as the BAB security destination, then 1379 the bundle MUST be discarded and processed no further. 1381 If the bundle has one or more BABs that identify the receiving node 1382 as the BAB security destination, or for which there is no security 1383 destination, then the value in the security result field(s) of the 1384 BAB(s) MUST be verified according to the ciphersuite specification. 1385 If for all such BABs in the bundle either the BAB security source 1386 cannot be determined or the security result value check fails, the 1387 bundle has failed to authenticate and the bundle MUST be discarded 1388 and processed no further. Otherwise, if any of the BABs present 1389 verify, the bundle is ready for further processing as determined by 1390 extension blocks and/or policy. 1392 BABs received in a bundle MUST be stripped before the bundle is 1393 forwarded. New BABs MAY be added as required by policy. This may 1394 require correcting the "last block" field of the to-be-forwarded 1395 bundle. 1397 Further processing of the bundle must take place in the order 1398 indicated by the various blocks from the primary block to the payload 1399 block, except as defined by an applicable specification. 1401 If the bundle has a PCB and the receiving node is the PCB destination 1402 for the bundle (either because the node is listed as the bundle's 1403 PCB-dest or because the node is listed as the bundle's destination 1404 and there is no PCB-dest), the node MUST decrypt the relevant parts 1405 of the bundle in accordce with the ciphersuite specification. The 1406 PCB SHALL be deleted. If the relevant parts of the bundle cannot be 1407 decrypted (i.e., the decryption key cannot be deduced or decryption 1408 fails), then the bundle MUST be discarded and processed no further; 1409 in this case a bundle deletion status report (see the Bundle Protocol 1410 [2]) indicating the decryption failure MAY be generated. If the PCB 1411 security result included the ciphertext of a block other than the 1412 payload block, the recovered plaintext block MUST be placed in the 1413 bundle at the location from which the PCB was deleted.[Comment.8] 1415 If the bundle has one or more PIBs for which the receiving node is 1416 the bundle's PIB destination (either because the node is listed in 1417 the bundle's PIB-dest or because the node is listed as the bundle's 1418 destination and there is no PIB-dest), the node MUST verify the value 1419 in the PIB security result field(s) in accordance with the 1420 ciphersuite specification. If all the checks fail, the bundle has 1421 failed to authenticate and the bundle SHALL be processed according to 1422 the security policy. A bundle status report indicating the failure 1423 MAY be generated. Otherwise, if the PIB verifies, the bundle is 1424 ready to be processed for either delivery or forwarding. Before 1425 forwarding the bundle, the node SHOULD remove the PIB from the 1426 bundle, subject to the requirements of Section 3.2, unless it is 1427 likely that some downstream node will also be able to verify the PIB. 1429 If the bundle has a PIB and the receiving node is not the bundle's 1430 PIB-dest the receiving node MAY attempt to verify the value in the 1431 security result field. If it is able to check and the check fails, 1432 the node SHALL discard the bundle and it MAY send a bundle status 1433 report indicating the failure.[Comment.9][Comment.10] 1435 3.7. The At-Most-Once-Delivery Option 1437 An application may request (in an implementation specific manner) 1438 that a node be registered as a member of an endpoint and that 1439 received bundles destined for that endpoint be delivered to that 1440 application. 1442 An option for use in such cases is known as "at-most-once-delivery". 1443 If this option is chosen, the application indicates that it wants the 1444 node to check for duplicate bundles, discard duplicates, and deliver 1445 at most one copy of each received bundle to the application. If this 1446 option is not chosen, the application indicates that it wants the 1447 node to deliver all received bundle copies to the application. If 1448 this option is chosen, the node SHALL deliver at most one copy of 1449 each received bundle to the application. If the option is not 1450 chosen, the node SHOULD, subject to policy, deliver all bundles. 1452 To enforce this the node MUST look at the source/timestamp pair value 1453 of each complete (reassembled, if necessary) bundle received and 1454 determine if this pair, which uniquely identifies a bundle, has been 1455 previously received. If it has, then the bundle is a duplicate. If 1456 it has not, then the bundle is not a duplicate. The source/timestamp 1457 pair SHALL be added to the list of pair values already received by 1458 that node. 1460 Each node implementation may decide how long to maintain a table of 1461 pair value state. 1463 Additional discussion relevant to at-most-delivery is in the DTN 1464 Retransmission Block specification [11]. 1466 3.8. Bundle Fragmentation and Reassembly 1468 If it is necessary for a node to fragment a bundle and security 1469 services have been applied to that bundle, the fragmentation rules 1470 described in [2] MUST be followed. As defined there and repeated 1471 here for completeness, only the payload may be fragmented; security 1472 blocks, like all extension blocks, can never be fragmented. In 1473 addition, the following security-specific processing is REQUIRED: 1475 The security policy requirements for a bundle must be applied 1476 individually to all the bundles resulting from a fragmentation event. 1478 If the original bundle contained a PIB, then each of the PIB 1479 instances MUST be included in some fragment. 1481 If the original bundle contained one or more PCBs, then any PCB 1482 instances containing a BEK MUST have the "replicate in every 1483 fragment" flag set, and thereby be replicated in every fragment. 1484 This is to ensure that the canonical block-sequence can be recovered 1485 during reassembly. 1487 If the original bundle contained one or more correlated PCBs not 1488 containing a BEK, then each of these MUST be included in some 1489 fragment, but SHOULD NOT be sent more than once. They MUST be placed 1490 in a fragment in accordance with the fragmentation rules described in 1491 [2]. 1493 Note: various fragments may have additional security blocks added at 1494 this or later stages and it is possible that correlators may collide. 1495 In order to facilitate uniqueness, ciphersuites SHOULD include the 1496 fragment-offset of the fragment as a high-order component of the 1497 correlator. 1499 3.9. Reactive fragmentation 1501 When a partial bundle has been received, the receiving node SHALL 1502 consult its security policy to determine if it may fragment the 1503 bundle, converting the received portion into a bundle fragment for 1504 further forwarding. Whether or not reactive fragmentation is 1505 permitted SHALL depend on the security policy and the ciphersuite 1506 used to calculate the BAB authentication information, if required. 1507 (Some BAB ciphersuites, i.e., the mandatory BAB-HMAC ciphersuite 1508 defined in Section 4.1, do not accommodate reactive fragmentation 1509 because the security result in the BAB requires that the entire 1510 bundle be signed. It is conceivable, however, that a BAB ciphersuite 1511 could be defined such that multiple security results are calculated, 1512 each on a different segment of a bundle, and that these security 1513 results could be interspersed between bundle payload segments such 1514 that reactive fragmentation could be accommodated.) 1516 If the bundle is reactively fragmented by the intermediate receiver 1517 and the BAB-ciphersuite is of an appropriate type (e.g. with multiple 1518 security results embedded in the payload), the bundle MUST be 1519 fragmented immediately after the last security result value in the 1520 partial payload that is received. Any data received after the last 1521 security result value MUST be dropped. 1523 If a partial bundle is received at the intermediate receiver and is 1524 reactively fragmented and forwarded, only the part of the bundle that 1525 was not received MUST be retransmitted, though more of the bundle MAY 1526 be retransmitted. Before retransmitting a portion of the bundle, it 1527 SHALL be changed into a fragment and, if the original bundle included 1528 a BAB, the fragmented bundle MUST also, and its BAB SHALL be 1529 recalculated. 1531 This specification does not currently define any ciphersuite which 1532 can handle this reactive fragmentation case. 1534 An interesting possibility is a ciphersuite definition such that the 1535 transmission of a follow-up fragment would be accompanied by the 1536 signature for the payload up to the restart point. 1538 4. Mandatory Ciphersuites 1540 This section defines the mandatory ciphersuites for this 1541 specification. There is currently one mandatory ciphersuite for use 1542 with each security block type (BAB, PIB and PCB). The BAB 1543 ciphersuite is based on shared secrets using HMAC. The PIB 1544 ciphersuite is based on digital signatures using RSA with SHA256. 1545 The PCB ciphersuite is based on using RSA for key transport and AES 1546 for bulk encryption. 1548 4.1. BAB-HMAC 1550 The BAB-HMAC ciphersuite has ciphersuite ID value 0x001. 1552 Security parameters are optional with this scheme, but if used then 1553 the only field that can be present is key information (see 1554 Section 2.5). The exact type of key information to be used is an 1555 implementation issue. In the absence of key information the receiver 1556 is expected to be able to find the correct key based on the sending 1557 identity. The sending identity may be known from the security-source 1558 field or the content of a previous-hop block in the bundle. It may 1559 also be determined using implementation-specific means such as the 1560 convergence layer. 1562 BAB-HMAC uses the strict canonicalisation algorithm in Section 3.4.1. 1564 Strict canonicalization supports digesting of a fragment-bundle. It 1565 does not permit the digesting of only a subset of the payload, but 1566 only the complete contents of the payload of the current bundle, 1567 which might be a fragment. The "fragment range" item for security- 1568 parameters is not used to indicate a fragment, as this information is 1569 digested within the primary block. 1571 The variant of HMAC to be used is HMAC-SHA1 as defined in RFC 2104 1572 [4].[Comment.11] 1574 This ciphersuite requires the use of two related instances of the 1575 BAB. It involves placing the first BAB instance (as defined in 1576 Section 2.2) just after the primary block. The second (correlated) 1577 instance of the BAB MUST be placed after all other blocks (except 1578 possibly other BAB blocks) in the bundle. 1580 This means that normally, the BAB will be the second and last blocks 1581 of the bundle. If a forwarder wishes to apply more than one 1582 correlated BAB pair, then this can be done. There is no requirement 1583 that each application "wrap" the others, but the forwarder MUST 1584 insert all the "up front" BABs, and their "at back" "partners" 1585 (without any security result), before canonicalising. 1587 Inserting more than one correlated BAB pair would be useful if the 1588 bundle could be routed to more than one potential "next-hop" or if 1589 both an old or a new key were valid at sending time, with no 1590 certainty about the situation that will obtain at reception time. 1592 The security result is the output of the HMAC-SHA1 calculation with 1593 input being the result of running the entire bundle through the 1594 strict canonicalisation algorithm. Both required BAB instances MUST 1595 be included in the bundle before canonicalisation. 1597 4.2. PIB-RSA-SHA256 1599 The PIB-RSA-SHA256 ciphersuite has ciphersuite ID value 0x002. 1601 If the bundle being signed has been fragmented before signing, then 1602 we have to specify which bytes were signed in case the signed bundle 1603 is subsequently fragmented for a second time. If the bundle is a 1604 fragment, then the ciphersuite parameters MUST include a fragment- 1605 range field, as described in Section 2.5, specifying the offset and 1606 length of the signed fragment. If the entire bundle is signed then 1607 these numbers MUST be omitted. 1609 The ciphersuite parameters field MAY also contain a key identifier. 1610 The exact type of key identifier to be used is an implementation 1611 issue. In the absence of a key identifier, the verifier of the PIB 1612 is expected to be able to use the security source (if supplied) or 1613 else the bundle source (if no security source is present) in order to 1614 determine the correct public key to use for PIB verification. 1616 PIB-RSA-SHA256 uses the mutable canonicalisation algorithm 1617 Section 3.4.2, with the security-result data field for only the 1618 "current" block being excluded from the canonical form. The 1619 resulting canonical form of the bundle is the input to the signing 1620 process. This ciphersuite requires the use of a single instance of 1621 the PIB. 1623 RSA is used with SHA256 as specified for the sha256WithRSAEncryption 1624 PKCSv1.5 signature scheme in RFC 4055 [5]. The output of the signing 1625 process is the security result item for the PIB. 1627 "Commensurate strength" cryptography is generally held to be a good 1628 idea. A combination of RSA with SHA256 is reckoned to require a 3076 1629 bit RSA key according to this logic. Few implementations will choose 1630 this length by default (and probably some just won't support such 1631 long keys). Since this is an experimental protocol, we expect that 1632 1024 or 2048 bit RSA keys will be used in many cases, and that that 1633 will be fine since we also expect that the hash function "issues" 1634 will be resolved before any standard would be derived from this 1635 protocol.[Comment.12] 1637 4.3. PCB-RSA-AES128-PAYLOAD-PIB-PCB 1638 [Comment.13] 1640 The PCB-RSA-AES128-PAYLOAD-PIB-PCB ciphersuite has ciphersuite ID 1641 value 0x003. 1643 This scheme encrypts PIBs, PCBs and the payload. The key size for 1644 this ciphersuite is 128 bits. 1646 Encryption is done using the AES algorithm in Galois/Counter Mode 1647 (GCM) as described in RFC 5084 [12] [Note: parts of the following 1648 description are borrowed from RFC 4106]. 1650 The choice of GCM avoids expansion of the payload, which causes 1651 problems with fragmentation/reassembly and custody transfer. GCM 1652 also includes authentication, essential in preventing attacks that 1653 can alter the decrypted plaintext or even recover the encryption key. 1655 GCM is a block cipher mode of operation providing both 1656 confidentiality and data origin authentication. The GCM 1657 authenticated encryption operation has four inputs: a secret key, an 1658 initialization vector (IV), a plaintext, and an input for additional 1659 authenticated data (AAD) which is not used here. It has two outputs, 1660 a ciphertext whose length is identical to the plaintext, and an 1661 authentication tag, also known as the Integrity Check Value (ICV). 1663 For consistency with the description in [12], we refer to the GCM IV 1664 as a nonce. The same key and nonce combination MUST NOT be used more 1665 than once. The nonce has the following layout 1667 +----------------+----------------+---------------------------------+ 1668 | salt | 1669 +----------------+----------------+---------------------------------+ 1670 | | 1671 | initialization vector | 1672 | | 1673 +----------------+----------------+---------------------------------+ 1675 Nonce format. 1677 Figure 6 1679 The salt field is a four-octet value, usually chosen at random. It 1680 MUST be the same for all PCBs which have the same correlator value. 1681 The salt need not be kept secret. 1683 The initialization vector (IV) is an eight-octet value, usually 1684 chosen at random. It MUST be different for all PCBs which have the 1685 same correlator value. The value need not be kept secret. 1687 The key (bundle encryption key, BEK) is a sixteen-octet (128 bits) 1688 value, usually chosen at random. The value MUST be kept secret, as 1689 described below. 1691 The integrity check value is a sixteen-octet value used to verify 1692 that the protected data has not been altered. The value need not be 1693 kept secret. 1695 This ciphersuite requires the use of a single PCB instance to deal 1696 with payload confidentiality. If the bundle already contains PIBs or 1697 PCBs then the ciphersuite will create additional correlated blocks to 1698 protect these PIBs and PCBs. These "additional" blocks replace the 1699 original blocks on a one-for-one basis, so the number of blocks 1700 remains unchanged. All these related blocks MUST have the same 1701 correlator value. The term "first PCB" in this section refers to the 1702 single PCB if there is only one or, if there are several, then to the 1703 one containing the key or key-identifier. This MUST be the first of 1704 the set. 1706 First PCB - the first PCB may contain a correlator value, and may 1707 specify security-source and/or security-destination in the eid-list. 1708 If not specified, the bundle-source and bundle-destination 1709 respectively are used for these values, as with other ciphersuites. 1710 The block MUST contain security-parameters and security-result 1711 fields. Each field may contain several items formatted as described 1712 in Section 2.5. 1714 Security-parameters 1716 salt 1718 IV (this instance applies only to payload) 1720 fragment offset and length, if bundle is a fragment 1722 Security-result 1724 key information 1726 ICV 1728 Subsequent PCBs MUST contain a correlator value to link them to the 1729 first PCB. Security-source and security-destination are implied from 1730 the first PCB, however see the discussion below concerning eid-list 1731 entries. They MUST contain security-parameters and security-result 1732 fields as follows: 1734 Security-parameters 1736 IV for this specific block 1738 Security-result 1740 encapsulated block 1742 The security-parameters and security-result fields in the subsequent 1743 PCBs MUST NOT contain any items other than these two. Items such as 1744 key and salt are supplied in the first PCB and MUST NOT be repeated. 1746 Protection of the key is performed as defined in the Key Management 1747 Specification [tbd]. Key management for this ciphersuite MUST 1748 support PKCSv1.5 rsaEncryption as specified in RFC 3370 [6] and MAY 1749 support other schemes. The output from the key management protection 1750 scheme ("key information") is placed in the security-result field of 1751 the first PCB. 1753 If the bundle being encrypted is a fragment-bundle we have to specify 1754 which bytes are encrypted in case the bundle is subsequently 1755 fragmented again. If the bundle is a fragment the ciphersuite 1756 parameters MUST include a fragment-range field, as described in 1757 Section 2.5, specifying the offset and length of the encrypted 1758 fragment. Note that this is not the same pair of fields which appear 1759 in the primary block as "offset and length". The "length" in this 1760 case is the length of the fragment, not the original length. If the 1761 bundle is not a fragment then this field MUST be omitted. 1763 The confidentiality processing for payload and other blocks is 1764 different, mainly because the payload might be fragmented later at 1765 some other node. 1767 For the payload, only the bytes of the bundle payload field are 1768 affected, being replaced by ciphertext. The salt, IV and key values 1769 specified in the first PCB are used to encrypt the payload, and the 1770 resultant authentication tag (ICV) is placed in an ICV item in the 1771 security-result field of that first PCB. The other bytes of the 1772 payload block, such as type, flags and length, are not modified. 1774 For each PIB or PCB to be protected, the entire original block is 1775 encapsulated in a "replacing" PCB. This replacing PCB is placed in 1776 the outgoing bundle in the same position as the original block, PIB 1777 or PCB. As mentioned above, this is one-for-one replacement and 1778 there is no consolidation of blocks or mixing of data in any way. 1780 The encryption process uses AES-GCM with the salt and key values from 1781 the first PCB, and an IV unique to this PCB. The process creates 1782 ciphertext for the entire original block, and an authentication tag 1783 for validation at the security destination. For this encapsulation 1784 process, unlike the processing of the bundle payload, the 1785 authentication tag is appended to the ciphertext for the block and 1786 the combination is stored into the "encapsulated block" item in 1787 security-result. 1789 The replacing block, of course, also has the same correlator value as 1790 the first PCB with which it is associated. It also contains the 1791 block-specific IV in security-parameters, and the combination of 1792 original-block-ciphertext and authentication tag, stored as an 1793 "encapsulated block" item in security-result. 1795 Any existing eid-list in the to-be-encapsulated original block 1796 remains exactly as-is, and become the eid-list for the replacing 1797 block. The encapsulation process MUST NOT replace or remove the 1798 existing eid-list entries. This is critically important for correct 1799 updating of entries at the security-destination. 1801 At the security-destination, either specific destination or the 1802 bundle destination, the processes described above are reversed. The 1803 payload is decrypted in-place using the salt, IV and key values in 1804 the first PCB, including verification using the ICV. Each correlated 1805 PCB is also processed at the same destination, using the salt and key 1806 values from the first PCB and the block-specific IV item. The 1807 "encapsulated block" item in security-result is decrypted, and 1808 validated using the tag which was appended to the ciphertext of the 1809 original block data. Assuming the validation succeeds, the resultant 1810 plaintext, which is the entire content of the original block, 1811 replaces the PCB at the same place in the bundle. The block type 1812 reverts to that of the original block prior to encapsulation, and the 1813 other block-specific data fields also return to their original 1814 values. Implementors are cautioned that this "replacement" process 1815 requires delicate stitchery, as the eid-list contents in the 1816 decapsulated block are invalid. As noted above, the eid-list 1817 references in the original block were preserved in the replacing PCB, 1818 and will have been updated as necessary as the bundle has toured the 1819 dtnet. The references from the PCB MUST replace the references 1820 within the eid-list of the newly-decapsulated block. Caveat 1821 implementor. 1823 If the payload was fragmented after encryption then all those 1824 fragments MUST be present and reassembled before decryption. This 1825 process mighht be repeated several times at different destinations if 1826 multiple fragmentation actions have occurred. 1828 The size of the GCM counter field limits the payload size to 2^39 - 1829 256 bytes, about half a terabyte. A future revision of this 1830 specification will address the issue of handling payloads in excess 1831 of this size. 1833 5. Key Management 1835 Since key management in delay tolerant networks is still a research 1836 topic we cannot provide much in the way of useful key management 1837 here. However, solely in order to support implementation and 1838 testing, implementations SHOULD support: 1840 - Long-term pre-shared-symmetric keys for the BAB-HMAC 1841 ciphersuite. 1843 - The use of well-known RSA public keys for PIB-RSA-SHA256 and 1844 PCB-RSA-AES128-PAYLOAD-PIB-PCB ciphersuites. 1846 Since endpoint IDs are URIs and URIs can be placed in X.509 [7] 1847 public key certificates (in the subjectAltName extension) 1848 implementations SHOULD support this way of distributing public keys. 1849 Implementations SHOULD NOT be very strict in how they process X.509 1850 though, for example, it would probably not be correct to insist on 1851 Certificate Revocation List (CRL) checking in many DTN contexts. 1853 Other than that, key management is for future study. 1855 6. Default Security Policy 1857 Every node serves as a Policy Enforcement Point insofar as it 1858 enforces some policy that controls the forwarding and delivery of 1859 bundles via one or more convergence layer protocol implementation. 1860 Consequently, every node SHALL have and operate according to its own 1861 configurable security policy, whether the policy be explicit or 1862 default. The policy SHALL specify: 1864 Under what conditions received bundles SHALL be forwarded. 1866 Under what conditions received bundles SHALL be required to 1867 include valid BABs. 1869 Under what conditions the authentication information provided in a 1870 bundle's BAB SHALL be deemed adequate to authenticate the bundle. 1872 Under what conditions received bundles SHALL be required to have 1873 valid PIBs and/or PCBs. 1875 Under what conditions the authentication information provided in a 1876 bundle's PIB SHALL be deemed adequate to authenticate the bundle. 1878 Under what conditions a BAB SHALL be added to a received bundle 1879 before that bundle is forwarded. 1881 Under what conditions a PIB SHALL be added to a received bundle 1882 before that bundle is forwarded. 1884 Under what conditions a PCB SHALL be added to a received bundle 1885 before that bundle is forwarded. 1887 The actions that SHALL be taken in the event that a received 1888 bundle does not meet the receiving node's security policy 1889 criteria. 1891 This specification does not address how security policies get 1892 distributed to nodes. It only REQUIRES that nodes have and enforce 1893 security policies. [Comment.14] 1895 If no security policy is specified at a given node, or if a security 1896 policy is only partially specified, that node's default policy 1897 regarding unspecified criteria SHALL consist of the following: 1899 Bundles that are not well-formed do not meet the security policy 1900 criteria. 1902 The mandatory ciphersuites MUST be used. 1904 All bundles received MUST have a BAB which MUST be verified to 1905 contain a valid security result. If the bundle does not have a 1906 BAB, then the bundle MUST be discarded and processed no further; a 1907 bundle status report indicating the authentication failure MAY be 1908 generated. 1910 No received bundles SHALL be required to have a PIB; if a received 1911 bundle does have a PIB, however, the PIB can be ignored unless the 1912 receiving node is the PIB-dest, in which case the PIB MUST be 1913 verified. 1915 No received bundles SHALL be required to have a PCB; if a received 1916 bundle does have a PCB, however, the PCB can be ignored unless the 1917 receiving node is the PCB-dest, in which case the PCB MUST be 1918 processed. If processing of a PCB yields a PIB, that PIB SHALL be 1919 processed by the node according to the node's security policy. 1921 A PIB SHALL NOT be added to a bundle before sourcing or forwarding 1922 it. 1924 A PCB SHALL NOT be added to a bundle before sourcing or forwarding 1925 it. 1927 A BAB MUST always be added to a bundle before that bundle is 1928 forwarded. 1930 If a destination node receives a bundle that has a PIB-dest but 1931 the value in that PIB-dest is not the EID of the destination node, 1932 the bundle SHALL be delivered at that destination node. 1934 If a received bundle does not satisfy the node's security policy 1935 for any reason, then the bundle MUST be discarded and processed no 1936 further; in this case, a bundle deletion status report (see the 1937 Bundle Protocol [2]) indicating the failure MAY be generated. 1939 7. Security Considerations 1940 [Comment.15] 1942 If a BAB ciphersuite uses digital signatures but doesn't include the 1943 security destination (which for a BAB is the next host), then this 1944 allows the bundle to be sent to some node other than the intended 1945 adjacent node. Because the BAB will still authenticate, the 1946 receiving node may erroneously accept and forward the bundle. When 1947 asymmetric BAB ciphersuites are used, the security destination field 1948 SHOULD therefore be included in the BAB. 1950 If a bundle's PIB-dest is not the same as its destination, then some 1951 node other than the destination (the node identified as the PIB-dest) 1952 is expected to validate the PIB security result while the bundle is 1953 en route. However, if for some reason the PIB is not validated, 1954 there is no way for the destination to become aware of this. 1955 Typically, a PIB-dest will remove the PIB from the bundle after 1956 verifying the PIB and before forwarding it. However, if there is a 1957 possibility that the PIB will also be verified at a downstream node, 1958 the PIB-dest will leave the PIB in the bundle. Therefore, if a 1959 destination receives a bundle with a PIB that has a PIB-dest (which 1960 isn't the destination), this may, but does not necessarily, indicate 1961 a possible problem. 1963 If a bundle is fragmented after being forwarded by its PIB-source but 1964 before being received by its PIB-dest, the payload in the bundle MUST 1965 be reassembled before validating the PIB security result in order for 1966 the security result to validate correctly. Therefore, if the PIB- 1967 dest is not capable of performing payload reassembly, its utility as 1968 a PIB-dest will be limited to validating only those bundles that have 1969 not been fragmented since being forwarded from the PIB-source. 1970 Similarly, if a bundle is fragmented after being forwarded by its 1971 PIB-source but before being received by its PIB-dest, all fragments 1972 MUST be received at that PIB-dest in order for the bundle payload to 1973 be able to be reassembled. If not all fragments are received at the 1974 PIB-dest node, the bundle will not be able to be authenticated, and 1975 will therefore never be forwarded by this PIB-dest node. 1977 Specification of a security-destination other than the bundle 1978 destination creates a routing requirement that the bundle somehow be 1979 directed to the security-destination node on its way to the final 1980 destination. This requirement is presently private to the 1981 ciphersuite, since routing nodes are not required to implement 1982 security processing. 1984 8. IANA Considerations 1986 None at this time. If the bundle protocol becomes a standards track 1987 protocol, then we may want to consider having IANA establish a 1988 register of block types, and in particular for this specification a 1989 separate register of ciphersuite specifications. 1991 9. References 1993 9.1. Normative References 1995 [1] Bradner, S. and J. Reynolds, "Key words for use in RFCs to 1996 Indicate Requirement Levels", RFC 2119, October 1997. 1998 [2] Scott, K. and S. Burleigh, "Bundle Protocol Specification", 1999 RFC 5050, November 2007. 2001 [3] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3369, 2002 August 2002. 2004 [4] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing 2005 for Message Authentication", RFC 2104, February 1997. 2007 [5] Schaad, J., Kaliski, B., and R. Housley, "Additional Algorithms 2008 and Identifiers for RSA Cryptography for use in the Internet 2009 X.509 Public Key Infrastructure Certificate and Certificate 2010 Revocation List (CRL) Profile", RFC 4055, June 2005. 2012 [6] Housley, R., "Cryptographic Message Syntax (CMS) Algorithms", 2013 RFC 3370, August 2002. 2015 [7] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet X.509 2016 Public Key Infrastructure Certificate and Certificate 2017 Revocation List (CRL) Profile", RFC 3280, April 2002. 2019 [8] Viega, J. and D. McGrew, "The Use of Galois/Counter Mode (GCM) 2020 in IPsec Encapsulating Security Payload (ESP)", RFC 4106, 2021 June 2005. 2023 9.2. Informative References 2025 [9] Farrell, S., Symington, S., Weiss, H., and P. Lovell, "Delay- 2026 Tolerant Networking Security Overview", 2027 draft-irtf-dtnrg-sec-overview-04.txt, work-in-progress, 2028 February 2008. 2030 [10] Cerf, V., Burleigh, S., Durst, R., Fall, K., Hooke, A., Scott, 2031 K., Torgerson, L., and H. Weiss, "Delay-Tolerant Network 2032 Architecture", RFC 4838, April 2007. 2034 [11] Symington, S., "Delay-Tolerant Network Retransmission Block", 2035 draft-irtf-dtnrg-bundle-retrans-00.txt, work-in-progress, 2036 April 2007. 2038 [12] Housley, R., "Using AES-CCM and AES-GCM Authenticated 2039 Encryption in the Cryptographic Message Syntax (CMS)", 2040 RFC 5084, November 2007. 2042 Editorial Comments 2044 [Comment.1] Stephen: I guess there could be some weird corner case 2045 where a PCB ciphersuite using counter-mode would allow 2046 fragments to be individually decrypted, and in that 2047 case, we might want to set replication for each 2048 fragment. So we can't fully rule out setting that flag 2049 for all PIB/PCB. 2051 [Comment.2] plovell: in fact, we do need it set for C blocks (first 2052 only if a correlated set) in order to recover canonical 2053 processing order after fragmentation/reassembly 2055 [Comment.3] Stephen: This to be revisited! 2057 [Comment.4] Note: there is no ciphersuite definition which supports 2058 this "parallel" encryption scheme -- needs thought. All 2059 definitions so far are for sequential encryptors, and 2060 we don't have a way to indicate "parallel". Maybe it's 2061 just that the PCB-dest is different? I hate to think 2062 what the API would look like :) 2064 [Comment.5] Stephen: Do we need to specify error handling for the 2065 case where a node drops a bundle for policy reasons? 2066 Does/can it signal back to the source that its done so? 2068 [Comment.6] Howie: The security policy database will need to be 2069 discussed somewhere. Does it belong in this document, 2070 the bundle protocol spec., both, some other document? 2072 [Comment.7] Editors: Check that mask value at the very last moment 2073 (incl. during auth-48) to be sure its (still) correct. 2075 [Comment.8] plovell: do we generate a report even if the failure 2076 was a security failure? That's often regarded as poor 2077 practice. 2079 [Comment.9] plovell: should this be "SHALL discard" or "SHALL 2080 delete" ? 2082 [Comment.10] plovell: do we generate a report even if the failure 2083 was a security failure? That's often regarded as poor 2084 practice. 2086 [Comment.11] Editors: At the moment there appears to be no security 2087 reason to move away from HMAC-SHA1 since the HMAC 2088 construct is not as far as we know affected by 2089 collisions in the underlying digest algorithm (which 2090 are nearly practically computable for SHA-1). 2091 Nevertheless, since we use SHA-256 in the signature 2092 ciphersuite (since collisions do matter there), it may 2093 be desirable to move to HMAC-SHA-256 as specified in 2094 RFC 4321. So if you're writing code based on this...be 2095 warned! 2097 [Comment.12] Editors: There are currently unresolved "issues" with 2098 digest algorithms which might cause a change here prior 2099 to, but more likely, after, an RFC has issued. So 2100 expect change! 2102 [Comment.13] Editors: This section has progressed to Woodman status. 2104 [Comment.14] Howie: Eventually we will need to state where the 2105 security policy information/DB does get discussed/ 2106 specified. 2108 [Comment.15] Editors: Much more text is needed here no doubt. 2110 Authors' Addresses 2112 Susan Flynn Symington 2113 The MITRE Corporation 2114 7515 Colshire Drive 2115 McLean, VA 22102 2116 US 2118 Phone: +1 (703) 983-7209 2119 Email: susan@mitre.org 2120 URI: http://mitre.org/ 2122 Stephen Farrell 2123 Trinity College Dublin 2124 Distributed Systems Group 2125 Department of Computer Science 2126 Trinity College 2127 Dublin 2 2128 Ireland 2130 Phone: +353-1-608-1539 2131 Email: stephen.farrell@cs.tcd.ie 2133 Howard Weiss 2134 SPARTA, Inc. 2135 7110 Samuel Morse Drive 2136 Columbia, MD 21046 2137 US 2139 Phone: +1-443-430-8089 2140 Email: hsw@sparta.com 2142 Peter Lovell 2143 SPARTA, Inc. 2144 7110 Samuel Morse Drive 2145 Columbia, MD 21046 2146 US 2148 Phone: +1-443-430-8052 2149 Email: peter.lovell@sparta.com 2151 Full Copyright Statement 2153 Copyright (C) The IETF Trust (2008). 2155 This document is subject to the rights, licenses and restrictions 2156 contained in BCP 78, and except as set forth therein, the authors 2157 retain all their rights. 2159 This document and the information contained herein are provided on an 2160 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 2161 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 2162 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 2163 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 2164 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 2165 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 2167 Intellectual Property 2169 The IETF takes no position regarding the validity or scope of any 2170 Intellectual Property Rights or other rights that might be claimed to 2171 pertain to the implementation or use of the technology described in 2172 this document or the extent to which any license under such rights 2173 might or might not be available; nor does it represent that it has 2174 made any independent effort to identify any such rights. Information 2175 on the procedures with respect to rights in RFC documents can be 2176 found in BCP 78 and BCP 79. 2178 Copies of IPR disclosures made to the IETF Secretariat and any 2179 assurances of licenses to be made available, or the result of an 2180 attempt made to obtain a general license or permission for the use of 2181 such proprietary rights by implementers or users of this 2182 specification can be obtained from the IETF on-line IPR repository at 2183 http://www.ietf.org/ipr. 2185 The IETF invites any interested party to bring to its attention any 2186 copyrights, patents or patent applications, or other proprietary 2187 rights that may cover technology that may be required to implement 2188 this standard. Please address the information to the IETF at 2189 ietf-ipr@ietf.org. 2191 Acknowledgment 2193 Funding for the RFC Editor function is provided by the IETF 2194 Administrative Support Activity (IASA).