idnits 2.17.1 draft-ietf-dtn-bpsec-default-sc-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 28, 2021) is 1117 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'AES-GCM' -- Possible downref: Non-RFC (?) normative reference: ref. 'HMAC' ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Delay-Tolerant Networking E. Birrane 3 Internet-Draft JHU/APL 4 Intended status: Standards Track March 28, 2021 5 Expires: September 29, 2021 7 BPSec Default Security Contexts 8 draft-ietf-dtn-bpsec-default-sc-03 10 Abstract 12 This document defines default integrity and confidentiality security 13 contexts that may be used with the Bundle Protocol Security Protocol 14 (BPSec) implementations. These security contexts are intended to be 15 used for both testing the interoperability of BPSec implementations 16 and for providing basic security operations when no other security 17 contexts are defined or otherwise required for a network. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on September 29, 2021. 36 Copyright Notice 38 Copyright (c) 2021 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 54 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 55 3. Integrity Security Context BIB-HMAC-SHA2 . . . . . . . . . . 3 56 3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 3 57 3.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 3.3. Parameters . . . . . . . . . . . . . . . . . . . . . . . 5 59 3.3.1. SHA Variant . . . . . . . . . . . . . . . . . . . . . 6 60 3.3.2. Encapsulated Key . . . . . . . . . . . . . . . . . . 6 61 3.3.3. Integrity Scope Flags . . . . . . . . . . . . . . . . 6 62 3.3.4. Enumerations . . . . . . . . . . . . . . . . . . . . 7 63 3.4. Results . . . . . . . . . . . . . . . . . . . . . . . . . 7 64 3.5. Key Considerations . . . . . . . . . . . . . . . . . . . 8 65 3.6. Canonicalization Algorithms . . . . . . . . . . . . . . . 8 66 3.7. Processing . . . . . . . . . . . . . . . . . . . . . . . 9 67 3.7.1. Keyed Hash Generation . . . . . . . . . . . . . . . . 9 68 3.7.2. Keyed Hash Verification . . . . . . . . . . . . . . . 10 69 4. Security Context BCB-AES-GCM . . . . . . . . . . . . . . . . 11 70 4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 11 71 4.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 12 72 4.3. Parameters . . . . . . . . . . . . . . . . . . . . . . . 14 73 4.3.1. Initialization Vector (IV) . . . . . . . . . . . . . 14 74 4.3.2. AES Variant . . . . . . . . . . . . . . . . . . . . . 14 75 4.3.3. Encapsulated Key . . . . . . . . . . . . . . . . . . 15 76 4.3.4. AAD Scope Flags . . . . . . . . . . . . . . . . . . . 15 77 4.3.5. Enumerations . . . . . . . . . . . . . . . . . . . . 15 78 4.4. Results . . . . . . . . . . . . . . . . . . . . . . . . . 16 79 4.4.1. Authentication Tag . . . . . . . . . . . . . . . . . 16 80 4.4.2. Enumerations . . . . . . . . . . . . . . . . . . . . 17 81 4.5. Key Considerations . . . . . . . . . . . . . . . . . . . 17 82 4.6. GCM Considerations . . . . . . . . . . . . . . . . . . . 18 83 4.7. Canonicalization Algorithms . . . . . . . . . . . . . . . 18 84 4.7.1. Cipher text related calculations . . . . . . . . . . 19 85 4.7.2. Additional Authenticated Data . . . . . . . . . . . . 19 86 4.8. Processing . . . . . . . . . . . . . . . . . . . . . . . 20 87 4.8.1. Encryption . . . . . . . . . . . . . . . . . . . . . 20 88 4.8.2. Decryption . . . . . . . . . . . . . . . . . . . . . 22 89 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 90 5.1. Security Context Identifiers . . . . . . . . . . . . . . 23 91 6. Security Considerations . . . . . . . . . . . . . . . . . . . 23 92 6.1. Key Handling . . . . . . . . . . . . . . . . . . . . . . 24 93 6.2. AES GCM . . . . . . . . . . . . . . . . . . . . . . . . . 24 94 6.3. Bundle Fragmentation . . . . . . . . . . . . . . . . . . 24 95 7. Normative References . . . . . . . . . . . . . . . . . . . . 25 96 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 26 97 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 26 99 1. Introduction 101 The Bundle Protocol Security Protocol (BPSec) [I-D.ietf-dtn-bpsec] 102 specification provides inter-bundle integrity and confidentiality 103 operations for networks deploying the Bundle Protocol (BP) 104 [I-D.ietf-dtn-bpbis]. BPSec defines BP extension blocks to carry 105 security information produced under the auspices of some security 106 context. 108 This document defines two security contexts (one for an integrity 109 service and one for a confidentiality service) for populating BPSec 110 Block Integrity Blocks (BIBs) and Block Confidentiality Blocks 111 (BCBs). 113 These contexts generate information that MUST be encoded using the 114 CBOR specification documented in [RFC8949]. 116 2. Requirements Language 118 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 119 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 120 "OPTIONAL" in this document are to be interpreted as described in BCP 121 14 [RFC2119] [RFC8174] when, and only when, they appear in all 122 capitals, as shown here. 124 3. Integrity Security Context BIB-HMAC-SHA2 126 3.1. Overview 128 The BIB-HMAC-SHA2 security context provides a keyed hash over a set 129 of plain text information. This context uses the Secure Hash 130 Algorithm 2 (SHA-2) discussed in [SHS] combined with the HMAC keyed 131 hash discussed in [HMAC]. The combination of HMAC and SHA-2 as the 132 integrity mechanism for this security context was selected for two 133 reasons: 135 1. The use of symmetric keys allows this security context to be used 136 in places where an asymmetric-key infrastructure (such as a 137 public key infrastructure) may be impractical. 139 2. The combination HMAC-SHA2 represents a well-supported and well- 140 understood integrity mechanism with multiple implementations 141 available. 143 BIB-HMAC-SHA2 supports three variants of HMAC-SHA, based on the 144 supported length of the SHA-2 hash value. These variants correspond 145 to "HMAC 256/256", "HMAC 384/384", and "HMAC 512/512" as defined in 146 [RFC8152] Table 7: HMAC Algorithm Values. The selection of which 147 variant is used by this context is provided as a security context 148 parameter. 150 The output of the HMAC MUST be equal to the size of the SHA2 hashing 151 function: 256 bits for SHA-256, 384 bits for SHA-384, and 512 bits 152 for SHA-512. 154 The BIB-HMAC-SHA2 security context MUST have the security context 155 identifier specified in Section 5.1. 157 3.2. Scope 159 The scope of BIB-HMAC-SHA2 is the set of information used to produce 160 the plain text over which a keyed hash is calculated. This plain 161 text is termed the "Integrity Protected Plain Text" (IPPT). The 162 content of the IPPT is constructed as the concatenation of 163 information whose integrity is being preserved from the BIB-HMAC-SHA2 164 security source to its security acceptor. There are four types of 165 information that can be used in the generation of the IPPT, based on 166 how broadly the concept of integrity is being applied. These four 167 types of information, whether they are required, and why they are 168 important for integrity, are discussed as follows. 170 Security target contents 171 The contents of the block-type-specific data field of the 172 security target MUST be included in the IPPT. Including this 173 information protects the security target data and is considered 174 the minimal, required set of information for an integrity service 175 on the security target. 177 Primary block 178 The primary block identifies a bundle and, once created, the 179 contents of this block are immutable. Changes to the primary 180 block associated with the security target indicate that the 181 security target (and BIB) may no longer be in the correct bundle. 183 For example, if a security target and associated BIB are copied 184 from one bundle to another bundle, the BIB may still contain a 185 verifiable signature for the security target unless information 186 associated with the bundle primary block is included in the keyed 187 hash carried by the BIB. 189 Including this information in the IPPT protects the integrity of 190 the association of the security target with a specific bundle. 192 Security target other fields 193 The other fields of the security target include block 194 identification and processing information. Changing this 195 information changes how the security target is treated by nodes 196 in the network even when the "user data" of the security target 197 are otherwise unchanged. 199 For example, if the block processing control flags of a security 200 target are different at a security verifier than they were 201 originally set at the security source then the policy for 202 handling the security target has been modified. 204 Including this information in the IPPT protects the integrity of 205 the policy and identification of the security target data. 207 BIB other fields 208 The other fields of the BIB include block identification and 209 processing information. Changing this information changes how 210 the BIB is treated by nodes in the network, even when other 211 aspects of the BIB are unchanged. 213 For example, if the block processing control flags of the BIB are 214 different at a security verifier than they were originally set at 215 the security source, then the policy for handling the BIB has 216 been modified. 218 Including this information in the IPPT protects the integrity of 219 the policy and identification of the security service in the 220 bundle. 222 NOTE: The security context identifier and security context 223 parameters of the security block are not included in the IPPT 224 because these parameters, by definition, are required to verify 225 or accept the security service. Successful verification at 226 security verifiers and security acceptors implies that these 227 parameters were unchanged since being specified at the security 228 source. 230 The scope of the BIB-HMAC-SHA2 security context is configured using 231 an optional security context parameter. 233 3.3. Parameters 235 BIB-HMAC-SHA2 can be parameterized to select SHA-2 variants, 236 communicate key information, and define the scope of the IPPT. 238 3.3.1. SHA Variant 240 This optional parameter identifies which variant of the SHA-2 241 algorithm is to be used in the generation of the authentication code. 243 This value MUST be encoded as a CBOR unsigned integer. 245 Valid values for this parameter are as follows. 247 SHA Variant Parameter Values 249 +-------+-----------------------------------------------------------+ 250 | Value | Description | 251 +-------+-----------------------------------------------------------+ 252 | 5 | HMAC 256/256 as defined in [RFC8152] Table 7: HMAC | 253 | | Algorithm Values | 254 | 6 | HMAC 384/384 as defined in [RFC8152] Table 7: HMAC | 255 | | Algorithm Values | 256 | 7 | HMAC 512/512 as defined in [RFC8152] Table 7: HMAC | 257 | | Algorithm Values | 258 +-------+-----------------------------------------------------------+ 260 Table 1 262 When not provided, implementations SHOULD assume a value of 6 263 (indicating use of HMAC 384/384), unless an alternate default is 264 established by security policy at the security source, verifiers, or 265 acceptor of this integrity service. 267 3.3.2. Encapsulated Key 269 This optional parameter contains the output of a Key Encapsulation 270 Mechanism (KEM) run at the security source of this security context. 272 This value MUST be encoded as a CBOR byte string. 274 If provided, this information is used to retrieve the symmetric HMAC 275 key used in the generation of security results for this security 276 context. If not provided, security verifiers and acceptors MUST 277 determine the proper key as a function of their local BPSec policy 278 and configuration, as discussed in Section 3.5. 280 3.3.3. Integrity Scope Flags 282 This optional parameter contains a series of flags that describe what 283 information is to be included with the block-type-specific data when 284 constructing the IPPT value. 286 This value MUST be represented as a CBOR unsigned integer, the value 287 of which MUST be processed as a bit field containing no more than 8 288 bits. 290 Bits in this field represent additional information to be included 291 when generating an integrity signature over the security target. 292 These bits are defined as follows. 294 - Bit 0 (the low-order bit, 0x1): Primary Block Flag. 296 - Bit 1 (0x02): Target Header Flag. 298 - Bit 2 (0x03): Security Header Flag. 300 - Bits 3-7 are reserved. 302 3.3.4. Enumerations 304 BIB-HMAC-SHA2 defines the following security context parameters. 306 BIB-HMAC-SHA2 Security Parameters 308 +----+-----------------------+--------------------+---------------+ 309 | Id | Name | CBOR Encoding Type | Default Value | 310 +----+-----------------------+--------------------+---------------+ 311 | 1 | SHA Variant | UINT | 6 | 312 | 2 | Encapsulated Key | Byte String | NONE | 313 | 3 | Integrity Scope Flags | UINT | 0x7 | 314 +----+-----------------------+--------------------+---------------+ 316 Table 2 318 3.4. Results 320 BIB-HMAC-SHA2 defines the following security results. 322 BIB-HMAC-SHA2 Security Results 324 +--------+----------+-------------+---------------------------------+ 325 | Result | Result | CBOR | Description | 326 | Id | Name | Encoding | | 327 | | | Type | | 328 +--------+----------+-------------+---------------------------------+ 329 | 1 | Expected | byte string | The output of the HMAC | 330 | | HMAC | | calculation at the security | 331 | | | | source. | 332 +--------+----------+-------------+---------------------------------+ 334 Table 3 336 3.5. Key Considerations 338 BIB-HMAC-SHA2 does not define or otherwise mandate any method for key 339 exchange, encryption, or encapsulation. The derivation of an 340 appropriate key for use in the integrity service is considered 341 separate from the application of the integrity service for this 342 context. 344 HMAC keys used with this context MUST be symmetric and MUST have a 345 key length equal to the output of the HMAC. 347 It is assumed that any security verifier or security acceptor 348 performing an integrity verification can determine the proper HMAC 349 key to be used. Potential sources of the HMAC key include (but are 350 not limited to) the following: 352 Pre-placed keys selected based on local policy. 354 Keys extracted from encapsulated key material carried in the BIB. 356 Session keys negotiated via a mechanism external to the BIB. 358 As discussed in Section 6 and emphasized here, it is strongly 359 recommended that keys be protected once generated, both when they are 360 stored and when they are transmitted. 362 3.6. Canonicalization Algorithms 364 This section defines the canonicalization algorithm used to prepare 365 the IPPT input to the BIB-HMAC-SHA2 integrity mechanism. The 366 construction of the IPPT depends on the settings of the integrity 367 scope flags that may be provided as part of customizing the behavior 368 of this security context. 370 In all cases, the canonical form of any portion of an extension block 371 MUST be performed as described in [I-D.ietf-dtn-bpsec]. The 372 canonicalization algorithms defined in [I-D.ietf-dtn-bpsec] adhere to 373 the canonical forms for extension blocks defined in 374 [I-D.ietf-dtn-bpbis] but resolve ambiguities related to how values 375 are represented in CBOR. 377 The IPPT is constructed using the following process. 379 1. The canonical form of the IPPT starts as the empty set with 380 length 0. 382 2. If the integrity scope parameter is present and the primary block 383 flag is set to 1, then a canonical form of the bundle's primary 384 block MUST be calculated and the result appended to the IPPT. 386 3. If the integrity scope parameter is present and the target header 387 flag is set to 1, then the canonical form of the block type code, 388 block number, and block processing control flags associated with 389 the security target MUST be calculated and, in that order, 390 appended to the IPPT. 392 4. If the integrity scope parameter is present and the security 393 header flag is set to 1, then the canonical form of the block 394 type code, block number, and block processing control flags 395 associated with the BIB MUST be calculated and, in that order, 396 appended to the IPPT. 398 5. The canonical form of the security target block-type-specific 399 data MUST be calculated and appended to the IPPT. 401 3.7. Processing 403 3.7.1. Keyed Hash Generation 405 During keyed hash generation, two inputs are prepared for the the 406 appropriate HMAC/SHA2 algorithm: the HMAC key and the IPPT. These 407 data items MUST be generated as follows. 409 The HMAC key MUST have the appropriate length as required by local 410 security policy. The key can be generated specifically for this 411 integrity service, given as part of local security policy, or 412 through some other key management mechanism as discussed in 413 Section 3.5. 415 Prior to the generation of the IPPT, if a CRC value is present for 416 the target block of the BIB, then that CRC value MUST be removed 417 from the target block. This involves both removing the CRC value 418 from the target block and setting the CRC Type field of the target 419 block to "no CRC is present." 421 Once CRC information is removed, the IPPT MUST be generated as 422 discussed in Section 3.6. 424 Upon successful hash generation the following actions MUST occur. 426 The keyed hash produced by the HMAC/SHA2 variant MUST be added as 427 a security result for the BIB representing the security operation 428 on this security target, as discussed in Section 3.4). 430 Finally, the BIB containing information about this security operation 431 MUST be updated as follows. These operations may occur in any order. 433 The security context identifier for the BIB MUST be set to the 434 context identifier for BIB-HMAC-SHA2. 436 Any local flags used to generate the IPPT SHOULD be placed in the 437 integrity scope flags security parameter for the BIB unless these 438 flags are expected to be correctly configured at security 439 verifiers and acceptors in the network. 441 The HMAC key MAY be encapsulated using some key encapsulation 442 mechanism (to include encrypting with a key encryption key) and 443 the results of the encapsulation added as the encapsulated key 444 security parameter for the BIB. 446 The SHA variant used by this security context SHOULD be added as 447 the SHA variant security parameter for the BIB if it differs from 448 the default key length. Otherwise, this parameter MAY be omitted 449 if doing so provides a useful reduction in message sizes. 451 Problems encountered in the keyed hash generation MUST be processed 452 in accordance with local BPSec security policy. 454 3.7.2. Keyed Hash Verification 456 During keyed hash verification, the input of the security target and 457 a HMAC key are provided to the appropriate HMAC/SHA2 algorithm. 459 During keyed hash verification, two inputs are prepared for the 460 appropriate HMAC/SHA2 algorithm: the HMAC key and the IPPT. These 461 data items MUST be generated as follows. 463 The HMAC key MUST be derived using the encapsulated key security 464 parameter if such a parameter is included in the security context 465 parameters of the BIB. Otherwise, this key MUST be derived in 466 accordance with security policy at the verifying node as discussed 467 in Section 3.5. 469 The IPPT MUST be generated as discussed in Section 3.6 with the 470 value of integrity scope flags being taken from the integrity 471 scope flags security context parameter. If the integrity scope 472 flags parameter is not included in the security context parameters 473 then these flags MAY be derived from local security policy. 475 The calculated HMAC output MUST be compared to the expected HMAC 476 output encoded in the security results of the BIB for the security 477 target. If the calculated HMAC and expected HMAC are identical, the 478 verification MUST be considered a success. Otherwise, the 479 verification MUST be considered a failure. 481 If the verification fails or otherwise experiences an error, or if 482 any needed parameters are missing, then the verification MUST be 483 treated as failed and processed in accordance with local security 484 policy. 486 This security service is removed from the bundle at the security 487 acceptor as required by the BPSec specification. If the security 488 acceptor is not the bundle destination and if no other integrity 489 service is being applied to the target block, then a CRC MUST be 490 included for the target block. The CRC type, as determined by 491 policy, is set in the target block's CRC type field and the 492 corresponding CRC value is added as the CRC field for that block. 494 4. Security Context BCB-AES-GCM 496 4.1. Overview 498 The BCB-AES-GCM security context replaces the block-type-specific 499 data field of its security target with cipher text generated using 500 the Advanced Encryption Standard (AES) cipher operating in Galois/ 501 Counter Mode (GCM) [AES-GCM]. The use of AES-GCM was selected as the 502 cipher suite for this confidentiality mechanism for several reasons: 504 1. The selection of a symmetric-key cipher suite allows for 505 relatively smaller keys than asymmetric-key cipher suites. 507 2. The selection of a symmetric-key cipher suite allows this 508 security context to be used in places where an asymmetric-key 509 infrastructure (such as a public key infrastructure) may be 510 impractical. 512 3. The use of the Galois/Counter Mode produces cipher-text with the 513 same size as the plain text making the replacement of target 514 block information easier as length fields do not need to be 515 changed. 517 4. The AES-GCM cipher suite provides authenticated encryption, as 518 required by the BPSec protocol. 520 Additionally, the BCB-AES-GCM security context generates an 521 authentication tag based on the plain text value of the block-type- 522 specific data and other additional authenticated data that may be 523 specified via parameters to this security context. 525 This security context supports two variants of AES-GCM, based on the 526 supported length of the symmetric key. These variants correspond to 527 A128GCM and A256GCM as defined in [RFC8152] Table 9: Algorithm Value 528 for AES-GCM. 530 The BCB-AES-GCM security context shall have the security context 531 identifier specified in Section 5.1. 533 4.2. Scope 535 There are two scopes associated with BCB-AES-GCM: the scope of the 536 confidentiality service and the scope of the authentication service. 537 The first defines the set of information provided to the AES-GCM 538 cipher for the purpose of producing cipher text. The second defines 539 the set of information used to generate an authentication tag. 541 The scope of the confidentiality service defines the set of 542 information provided to the AES-GCM cipher for the purpose of 543 producing cipher text. This MUST be the full set of plain text 544 contained in the block-type-specific data field of the security 545 target. 547 The scope of the authentication service defines the set of 548 information used to generate an authentication tag carried with the 549 security block. This information includes the data included in the 550 confidentiality service and MAY include other information (additional 551 authenticated data), as follows. 553 Primary block 554 The primary block identifies a bundle and, once created, the 555 contents of this block are immutable. Changes to the primary 556 block associated with the security target indicate that the 557 security target (and BCB) may no longer be in the correct bundle. 559 For example, if a security target and associated BCB are copied 560 from one bundle to another bundle, the BCB may still be able to 561 decrypt the security target even though these blocks were never 562 intended to exist in the copied-to bundle. 564 Including this information as part of additional authenticated 565 data ensures that security target (and security block) appear in 566 the same bundle at the time of decryption as at the time of 567 encryption. 569 Security target other fields 570 The other fields of the security target include block 571 identification and processing information. Changing this 572 information changes how the security target is treated by nodes 573 in the network even when the "user data" of the security target 574 are otherwise unchanged. 576 For example, if the block processing control flags of a security 577 target are different at a security verifier than they were 578 originally set at the security source then the policy for 579 handling the security target has been modified. 581 Including this information as part of additional authenticated 582 data ensures that the cipher text in the security target will not 583 be used with a different set of block policy than originally set 584 at the time of encryption. 586 BCB other fields 587 The other fields of the BCB include block identification and 588 processing information. Changing this information changes how 589 the BCB is treated by nodes in the network, even when other 590 aspects of the BCB are unchanged. 592 For example, if the block processing control flags of the BCB are 593 different at a security acceptor than they were originally set at 594 the security source then the policy for handling the BCB has been 595 modified. 597 Including this information as part of additional authenticated 598 data ensures that the policy and identification of the security 599 service in the bundle has not changed. 601 NOTE: The security context identifier and security context 602 parameters of the security block are not included as additional 603 authenticated data because these parameters, by definition, are 604 those needed to verify or accept the security service. 605 Therefore, it is expected that changes to these values would 606 result in failures at security verifiers and security acceptors. 608 The scope of the BCB-AES-GCM security context is configured using an 609 optional security context parameter. 611 4.3. Parameters 613 BCB-AES-GCM can be parameterized to specify the AES variant, 614 initialization vector, key information, and identify additional 615 authenticated data. 617 4.3.1. Initialization Vector (IV) 619 This optional parameter identifies the initialization vector (IV) 620 used to initialize the AES-GCM cipher. 622 The length of the initialization vector, prior to any CBOR encoding, 623 MUST be between 8-16 bytes. A value of 12 bytes SHOULD be used 624 unless local security policy requires a different length. 626 This value MUST be encoded as a CBOR byte string. 628 The initialization vector may have any value with the caveat that a 629 value MUST NOT be re-used for multiple encryptions using the same 630 encryption key. This value MAY be re-used when encrypting with 631 different keys. For example, if each encryption operation using BCB- 632 AES-GCM uses a newly generated key, then the same IV may be reused. 634 4.3.2. AES Variant 636 This optional parameter identifies the AES variant being used for the 637 AES-GCM encryption, where the variant is identified by the length of 638 key used. 640 This value MUST be encoded as a CBOR unsigned integer. 642 Valid values for this parameter are as follows. 644 AES Variant Parameter Values 646 +-------+-----------------------------------------------------------+ 647 | Value | Description | 648 +-------+-----------------------------------------------------------+ 649 | 1 | A128GCM as defined in [RFC8152] Table 9: Algorithm Values | 650 | | for AES-GCM | 651 | 3 | A256GCM as defined in [RFC8152] Table 9: Algorithm Values | 652 | | for AES-GCM | 653 +-------+-----------------------------------------------------------+ 654 When not provided, implementations SHOULD assume a value of 3 655 (indicating use of A256GCM), unless an alternate default is 656 established by security policy at the security source, verifier, or 657 acceptor of this integrity service. 659 Regardless of the variant, the generated authentication tag MUST 660 always be 128 bits. 662 4.3.3. Encapsulated Key 664 This optional parameter contains the output of a Key Encapsulation 665 Mechanism (KEM) run at the security source of this security context. 667 This value MUST be encoded as a CBOR byte string. 669 If provided, this information is used to retrieve the symmetric AES 670 key used in the generation of security results for this security 671 context. If not provided, security verifiers and acceptors MUST 672 determine the proper key as a function of their local BPSec policy 673 and configuration, as discussed in Section 4.5. 675 4.3.4. AAD Scope Flags 677 This optional parameter contains a series of flags that describe what 678 information is to be included with the block-type-specific data of 679 the security target as part of additional authenticated data (AAD). 681 This value MUST be represented as a CBOR unsigned integer, the value 682 of which MUST be processed as a bit field containing no more than 8 683 bits. 685 Bits in this field represent additional information to be included 686 when generating an integrity signature over the security target. 687 These bits are defined as follows. 689 - Bit 0 (the low-order bit, 0x1): Primary Block Flag. 691 - Bit 1 (0x02): Target Header Flag. 693 - Bit 2 (0x03): Security Header Flag. 695 - Bits 3-7 are reserved. 697 4.3.5. Enumerations 699 BCB-AES-GCM defines the following security context parameters. 701 BCB-AES-GCM Security Parameters 703 +----+-----------------------+--------------------+---------------+ 704 | Id | Name | CBOR Encoding Type | Default Value | 705 +----+-----------------------+--------------------+---------------+ 706 | 1 | Initialization Vector | Byte String | NONE | 707 | 2 | AES Variant | UINT | 3 | 708 | 3 | Encapsulation Key | Byte String | NONE | 709 | 4 | AAD Scope Flags | UINT | 0x7 | 710 +----+-----------------------+--------------------+---------------+ 712 Table 4 714 4.4. Results 716 The BCB-AES-GCM security context produces a single security result 717 carried in the security block: the authentication tag. 719 NOTES: 721 The cipher text generated by the cipher suite is not considered a 722 security result as it is stored in the block-type-specific data 723 field of the security target block. When operating in GCM mode, 724 AES produces cipher text of the same size as its plain text and, 725 therefore, no additional logic is required to handle padding or 726 overflow caused by the encryption in most cases (see below). 728 If the generated cipher text contains the authentication tag and 729 the tag can be separated from the cipher text then the tag MUST be 730 separated and stored in the authentication tag security result 731 field. 733 If the generated cipher text contains the authentication tag and 734 the tag cannot be separated from the cipher text then the tag MUST 735 NOT be included in the authentication tag security result field. 736 Instead the security target block MUST be resized to accommodate 737 the additional 128 bits of authentication tag included in the 738 generated cipher text. 740 4.4.1. Authentication Tag 742 The authentication tag is generated by the cipher suite over the 743 security target plain text input to the cipher suite as combined with 744 any optional additional authenticated data. This tag is used to 745 ensure that the plain text (and important information associated with 746 the plain text) is authenticated prior to decryption. 748 If the authentication tag is included in the cipher text placed in 749 the security target block-type-specific data field, then this 750 security result MUST NOT be included in the BCB for that security 751 target. 753 The length of the authentication tag, prior to any CBOR encoding, 754 MUST be 128 bits. 756 This value MUST be encoded as a CBOR byte string. 758 4.4.2. Enumerations 760 BCB-AES-GCM defines the following security context parameters. 762 BCB-AES-GCM Security Results 764 +-----------+--------------------+--------------------+ 765 | Result Id | Result Name | CBOR Encoding Type | 766 +-----------+--------------------+--------------------+ 767 | 1 | Authentication Tag | Byte String | 768 +-----------+--------------------+--------------------+ 770 Table 5 772 4.5. Key Considerations 774 BCB-AES-GCM does not define or otherwise mandate any method for key 775 exchange, encryption, or encapsulation. The derivation of an 776 appropriate key is considered separate from the application of the 777 authenticated confidentiality service provided by this context. 779 Keys used with this context MUST be symmetric and MUST have a key 780 length equal to the key length defined in the security context 781 parameters or as defined by local security policy at security 782 verifiers and acceptors. 784 It is assumed that any security verifier or security acceptor can 785 determine the proper key to be used. Potential sources of the key 786 include (but are not limited to) the following. 788 Pre-placed keys selected based on local policy. 790 Keys extracted from encapsulated key material carried in the BCB. 792 Session keys negotiated via a mechanism external to the BCB. 794 The security provided by block ciphers is reduced as more data is 795 processed with the same key. The total number of bytes processed 796 with a single key for AES-GCM is recommended to be less than 2^64, as 797 described in Appendix B of [AES-GCM]. 799 As discussed in Section 6 and emphasized here, it is strongly 800 recommended that keys be protected once generated, both when they are 801 stored and when they are transmitted. 803 4.6. GCM Considerations 805 The GCM cryptographic mode of AES has specific requirements that MUST 806 be followed by implementers for the secure function of the BCB-AES- 807 GCM security context. While these requirements are well documented 808 in [AES-GCM], some of them are repeated here for emphasis. 810 The pairing of an IV and a security key MUST be unique. An IV 811 MUST NOT be used with a security key more than one time. If an IV 812 and key pair are repeated then the GCM implementation may be 813 vulnerable to forgery attacks. More information regarding the 814 importance of the uniqueness of the IV value can be found in 815 Appendix A of [AES-GCM]. 817 While any tag-based authentication mechanism has some likelihood 818 of being forged, this probability is increased when using AES-GCM. 819 In particular, short tag lengths combined with very long messages 820 SHOULD be avoided when using this mode. The BCB-AES-GCM security 821 context requires the use of 128-bit authentication tags at all 822 times. Concerns relating to the size of authentication tags is 823 discussed in Appendices B and C of [AES-GCM]. 825 As discussed in Appendix B of [AES-GCM], implementations SHOULD 826 limit the number of unsuccessful verification attempts for each 827 key to reduce the likelihood of guessing tag values. 829 As discussed in the Security Considerations section of 830 [I-D.ietf-dtn-bpsec], delay-tolerant networks may have a higher 831 occurrence of replay attacks due to the store-and-forward nature 832 of the network. Because GCM has no inherent replay attack 833 protection, implementors SHOULD attempt to detect replay attacks 834 by using mechanisms such as those described in Appendix D of 835 [AES-GCM]. 837 4.7. Canonicalization Algorithms 839 This section defines the canonicalization algorithms used to prepare 840 the inputs used to generate both the cipher text and the 841 authentication tag. 843 In all cases, the canonical form of any portion of an extension block 844 MUST be performed as described in [I-D.ietf-dtn-bpsec]. The 845 canonicalization algorithms defined in [I-D.ietf-dtn-bpsec] adhere to 846 the canonical forms for extension blocks defined in 847 [I-D.ietf-dtn-bpbis] but resolve ambiguities related to how values 848 are represented in CBOR. 850 4.7.1. Cipher text related calculations 852 The plain text used during encryption MUST be calculated as the 853 single, definite-length CBOR byte string representing the block-type- 854 specific data field of the security target excluding the CBOR byte 855 string identifying byte and optional CBOR byte string length field. 857 For example, consider the following two CBOR byte strings and the 858 plain text that would be extracted from them. 860 CBOR Byte String Examples 862 +------------------------------+---------+--------------------------+ 863 | CBOR Byte String (Hex) | CBOR | Plain Text Part (Hex) | 864 | | Part | | 865 | | (Hex) | | 866 +------------------------------+---------+--------------------------+ 867 | 18ED | 18 | ED | 868 +------------------------------+---------+--------------------------+ 869 | C24CDEADBEEFDEADBEEFDEADBEEF | C24C | DEADBEEFDEADBEEFDEADBEEF | 870 +------------------------------+---------+--------------------------+ 872 Table 6 874 Similarly, the cipher text used during decryption MUST be calculated 875 as the single, definite-length CBOR byte string representing the 876 block-type-specific data field excluding the CBOR byte string 877 identifying byte and optional CBOR byte string length field. 879 All other fields of the security target (such as the block type code, 880 block number, block processing control flags, or any CRC information) 881 MUST NOT be considered as part of encryption or decryption. 883 4.7.2. Additional Authenticated Data 885 The construction of additional authenticated data depends on the AAD 886 scope flags that may be provided as part of customizing the behavior 887 of this security context. 889 The canonical form of the AAD input to the BCB-AES-GCM mechanism is 890 constructed using the following process. This process MUST be 891 followed when generating AAD for either encryption or decryption. 893 1. The canonical form of the AAD starts as the empty set with length 894 0. 896 2. If the AAD scope parameter is present and the primary block flag 897 is set to 1, then a canonical form of the bundle's primary block 898 MUST be calculated and the result appended to the AAD. 900 3. If the AAD scope parameter is present and the target header flag 901 is set to 1, then the canonical form of the block type code, 902 block number, and block processing control flags associated with 903 the security target MUST be calculated and, in that order, 904 appended to the AAD. 906 4. If the AAD scope parameter is present and the security header 907 flag is set to 1, then the canonical form of the block type code, 908 block number, and block processing control flags associated with 909 the BIB MUST be calculated and, in that order, appended to the 910 AAD. 912 If, after this process, the AAD remains at length 0, then no AAD 913 exists to be input to the cipher suite. 915 4.8. Processing 917 4.8.1. Encryption 919 During encryption, four inputs are prepared for input to the AES/GCM 920 cipher: the encryption key, the IV, the security target plain text to 921 be encrypted, and any additional authenticated data. These data 922 items MUST be generated as follows. 924 Prior to encryption, if a CRC value is present for the target block, 925 then that CRC value MUST be removed. This requires removing the CRC 926 field from the target block and setting the CRC type field of the 927 target block to "no CRC is present." 929 The encryption key MUST have the appropriate length as required by 930 local security policy. The key may be generated specifically for 931 this encryption, given as part of local security policy, or 932 through some other key management mechanism as discussed in 933 Section 4.5. 935 The IV selected MUST be of the appropriate length. Because 936 replaying an IV in counter mode voids the confidentiality of all 937 messages encrypted with said IV, this context also requires a 938 unique IV for every encryption performed with the same key. This 939 means the same key and IV combination MUST NOT be used more than 940 once. 942 The security target plain text for encryption MUST be generated as 943 discussed in Section 4.7.1. 945 Additional authenticated data, if present, MUST be generated as 946 discussed in Section 4.7.2 with the value of AAD scope flags being 947 taken from local security policy. 949 Upon successful encryption the following actions MUST occur. 951 The cipher text produced by AES/GCM MUST replace the bytes used to 952 define the plain text in the security target block's block-type- 953 specific data field. The block length of the security target MUST 954 be updated if the generated cipher text is larger than the plain 955 text (which can occur when the authentication tag is included in 956 the cipher text calculation, as discussed in Section 4.4). 958 The authentication tag calculated by the AES/GCM cipher MUST be 959 added as a security result for the security target in the BCB 960 holding results for this security operation. 962 Cases where the authentication tag is generated as part of the 963 cipher text MUST be processed as described in Section 4.4. 965 Finally, the BCB containing information about this security operation 966 MUST be updated as follows. These operations may occur in any order. 968 The security context identifier for the BCB MUST be set to the 969 context identifier for BCB-AES-GCM. 971 The IV input to the cipher MUST be added as the IV security 972 parameter for the BCB. 974 Any local flags used to generated AAD for this cipher MUST be 975 added as the AAD scope flags security parameter for the BCB. 977 The encryption key MAY be encapsulated using some key 978 encapsulation mechanism (to include encrypting with a key 979 encryption key) and the results of the encapsulation added as the 980 encapsulated key security parameter for the BCB. 982 The key length used by this security context MUST be considered 983 when setting the AES variant security parameter for the BCB if it 984 differs from the default AES variant. Otherwise, the AES variant 985 MAY be omitted if doing so provides a useful reduction in message 986 sizes. 988 Problems encountered in the encryption MUST be processed in 989 accordance with local security policy. This MAY include restoring a 990 CRC value removed from the target block prior to encryption, if the 991 target block is allowed to be transmitted after an encryption error. 993 4.8.2. Decryption 995 During encryption, five inputs are prepared for input to the AES/GCM 996 cipher: the decryption key, the IV, the security target cipher text 997 to be decrypted, any additional authenticated data, and the 998 authentication tag generated from the original encryption. These 999 data items MUST be generated as follows. 1001 The decryption key MUST be derived using the encapsulated key 1002 security parameter if such a parameter is included in the security 1003 context parameters of the BCB. Otherwise this key MUST be derived 1004 in accordance with security policy at the decrypting node as 1005 discussed in Section 4.5. 1007 The IV MUST be set to the value of the IV security parameter 1008 included in the BCB. If the IV parameter is not included as a 1009 security parameter, an IV MAY be derived as a function of local 1010 security policy and other BCB contents or a lack of an IV security 1011 parameter in the BCB MAY be treated as an error by the decrypting 1012 node. 1014 The security target cipher text for decryption MUST be generated 1015 as discussed in Section 4.7.1. 1017 Additional authenticated data, if present, MUST be generated as 1018 discussed in Section 4.7.2 with the value of AAD scope flags being 1019 taken from the AAD scope flags security context parameter. If the 1020 AAD scope flags parameter is not included in the security context 1021 parameters then these flags MAY be derived from local security 1022 policy in cases where the set of such flags is determinable in the 1023 network. 1025 The authentication tag MUST be present in the BCB security context 1026 parameters field if additional authenticated data are defined for 1027 the BCB (either in the AAD scope flags parameter or as specified 1028 by local policy). This tag MUST be 128 bits in length. 1030 Upon successful decryption the following actions MUST occur. 1032 The plain text produced by AES/GCM MUST replace the bytes used to 1033 define the cipher text in the security target block's block-type- 1034 specific data field. Any changes to the security target block 1035 length field MUST be corrected in cases where the plain text has a 1036 different length than the replaced cipher text. 1038 If the security acceptor is not the bundle destination and if no 1039 other integrity or confidentiality service is being applied to the 1040 target block, then a CRC MUST be included for the target block. The 1041 CRC type, as determined by policy, is set in the target block's CRC 1042 type field and the corresponding CRC value is added as the CRC field 1043 for that block. 1045 If the cipher text fails to authenticate, if any needed parameters 1046 are missing, or if there are other problems in the decryption then 1047 the decryption MUST be treated as failed and processed in accordance 1048 with local security policy. 1050 5. IANA Considerations 1052 5.1. Security Context Identifiers 1054 This specification allocates two security context identifiers from 1055 the "BPSec Security Context Identifier" registry defined in 1056 [I-D.ietf-dtn-bpsec]. 1058 Additional Entries for the BPSec Security Context Identifiers 1059 Registry: 1061 +-------+---------------+---------------+ 1062 | Value | Description | Reference | 1063 +-------+---------------+---------------+ 1064 | TBA | BIB-HMAC-SHA2 | This document | 1065 | TBA | BCB-AES-GCM | This document | 1066 +-------+---------------+---------------+ 1068 Table 7 1070 6. Security Considerations 1072 Security considerations specific to a single security context are 1073 provided in the description of that context. This section discusses 1074 security considerations that should be evaluated by implementers of 1075 any security context described in this document. Considerations may 1076 also be found in documents listed as normative references and they 1077 should also be reviewed by security context implementors. 1079 6.1. Key Handling 1081 In addition to the key considerations listed in each security 1082 context, the following also apply to the generation, transmission, 1083 and use of keys associated with all of the security contexts defined 1084 in this document. 1086 It is strongly RECOMMENDED that implementations protect keys both 1087 when they are stored and when they are transmitted. 1089 In the event that a key is compromised, any security operations 1090 using a security context associated with that key SHOULD also be 1091 considered compromised. This means that the BIB-HMAC-SHA2 1092 security context SHOULD NOT provide integrity when used with a 1093 compromised key and BCB-AES-GCM SHOULD NOT provide confidentiality 1094 when used with a compromised key. 1096 When keys are extracted from key material carried in a security 1097 block, the encapsulated key SHOULD be protected by an approved 1098 algorithm such as NIST SP-800-38F. The determination to use 1099 approved algorithms increases interoperability and the specific 1100 algorithm used is expected to be specified as part of local 1101 security policy. 1103 The same key SHOULD NOT be used for different algorithms as doing 1104 so may leak information about the key. 1106 6.2. AES GCM 1108 There are a significant number of considerations related to the use 1109 of the GCM mode of AES to provide a confidentiality service. These 1110 considerations are provided in Section 4.6 as part of the 1111 documentation of the BCB-AES-GCM security context. 1113 6.3. Bundle Fragmentation 1115 Bundle fragmentation may prevent security services in a bundle from 1116 being verified after a bundle is fragmented and before the bundle is 1117 re-assembled. Examples of potential issues include the following. 1119 If a security block and its security target do not exist in the 1120 same fragment, then the security block cannot be processed until 1121 the bundle is re-assembled. If a fragment includes an encrypted 1122 target block, but not its BCB, then a receiving bundle processing 1123 agent (BPA) will not know that the target block has been 1124 encrypted. 1126 If a security block is cryptographically bound to a bundle, it 1127 cannot be processed even if the security block and target both 1128 coexist in the fragment. This is because fragments have different 1129 primary blocks than the original bundle. 1131 If security blocks and their target blocks are repeated in 1132 multiple fragments, policy must determine how to deal with issues 1133 where a security operation verifies in one fragment but fails in 1134 another fragment. This may happen, for example, if a BIB block 1135 becomes corrupted in one fragment but not in another fragment. 1137 Implementors should consider how security blocks are processed when a 1138 BPA fragments a received bundle. For example, security blocks and 1139 their targets could be placed in the same fragment if the security 1140 block is not otherwise cryptographically bound to the bundle being 1141 fragmented. Alternatively, if security blocks are cryptographically 1142 bound to a bundle, then a fragmenting BPA should consider 1143 encapsulating the bundle first and then fragmenting the encapsulating 1144 bundle. 1146 7. Normative References 1148 [AES-GCM] Dworkin, M., "NIST Special Publication 800-38D: 1149 Recommendation for Block Cipher Modes of Operation: 1150 Galois/Counter Mode (GCM) and GMAC.", November 2007. 1152 [HMAC] US NIST, "The Keyed-Hash Message Authentication Code 1153 (HMAC).", FIPS-198-1, Gaithersburg, MD, USA, July 2008. 1155 https://csrc.nist.gov/publications/detail/fips/198/1/final 1157 [I-D.ietf-dtn-bpbis] 1158 Burleigh, S., Fall, K., and E. Birrane, "Bundle Protocol 1159 Version 7", draft-ietf-dtn-bpbis-31 (work in progress), 1160 January 2021. 1162 [I-D.ietf-dtn-bpsec] 1163 Birrane, E. and K. McKeever, "Bundle Protocol Security 1164 Specification", draft-ietf-dtn-bpsec-27 (work in 1165 progress), February 2021. 1167 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1168 Requirement Levels", BCP 14, RFC 2119, 1169 DOI 10.17487/RFC2119, March 1997, 1170 . 1172 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 1173 RFC 8152, DOI 10.17487/RFC8152, July 2017, 1174 . 1176 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1177 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1178 May 2017, . 1180 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 1181 Representation (CBOR)", STD 94, RFC 8949, 1182 DOI 10.17487/RFC8949, December 2020, 1183 . 1185 [SHS] US NIST, "Secure Hash Standard (SHS).", FIPS- 1186 180-4, Gaithersburg, MD, USA, August 2015. 1188 https://csrc.nist.gov/publications/detail/fips/180/4/final 1190 Appendix A. Acknowledgements 1192 The following participants contributed useful review and analysis of 1193 these security contexts: Amy Alford and Sarah Heiner of the Johns 1194 Hopkins University Applied Physics Laboratory. 1196 Author's Address 1198 Edward J. Birrane, III 1199 The Johns Hopkins University Applied 1200 Physics Laboratory 1201 11100 Johns Hopkins Rd. 1202 Laurel, MD 20723 1203 US 1205 Phone: +1 443 778 7423 1206 Email: Edward.Birrane@jhuapl.edu