Delay-Tolerant Networking                                     E. Birrane
Internet-Draft                                                   JHU/APL                                               K. McKeever
Intended status: Experimental                                   J. Mayer                                    JHU/APL
Expires: September 20, 2016                                    INSYEN AG
                                                             D. Iannicca
                                                                NASA GRC
                                                          March 19, January 7, 2017                                    July 6, 2016

                 Bundle Protocol Security Specification
                        draft-ietf-dtn-bpsec-01
                        draft-ietf-dtn-bpsec-02

Abstract

   This document defines a security protocol providing end to end data
   integrity and confidentiality services for the Bundle Protocol.  Capabilities
   are provided to protect blocks in a bundle along a single path
   through a network.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 20, 2016. January 7, 2017.

Copyright Notice

   Copyright (c) 2016 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Related Documents  Motivation  . . . . . . . . . . . . . . . . . . . . . . .   3
     1.2.  Terminology  Supported Security Services . . . . . . . . . . . . . . .   3
     1.3.  Specification Scope . . . . . . . . . .   4
   2.  Key Properties . . . . . . . . .   4
     1.4.  Related Documents . . . . . . . . . . . . . .   6
     2.1.  Block-Level Granularity . . . . . .   5
     1.5.  Terminology . . . . . . . . . . .   6
     2.2.  Multiple Security Sources . . . . . . . . . . . .   5
   2.  Key Properties  . . . . .   6
     2.3.  Mixed Security Policy . . . . . . . . . . . . . . . . . .   7
     2.4.  User-Selected Ciphersuites
     2.1.  Block-Level Granularity . . . . . . . . . . . . . . .   8
     2.5.  Deterministic Processing . .   7
     2.2.  Multiple Security Sources . . . . . . . . . . . . . .   8
   3. . .   7
     2.3.  Mixed Security Block Definitions Policy . . . . . . . . . . . . . . . . . .   8
     3.1.  Block Identification
     2.4.  User-Selected Ciphersuites  . . . . . . . . . . . . . . .   8
     2.5.  Deterministic Processing  . . . . . . . . . . . . . . . .   9
     3.2.
   3.  Security Block Representation  . Definitions  . . . . . . . . . . . . . . . . .   9
       3.2.1.  CMS
     3.1.  Block Type-Specific Data Fields Identification  . . . . . . . . .  10
       3.2.2.  BIB and BCB Block Type-Specific Data Fields . . . . .  10
     3.3.  Block Ordering . . . .  10
     3.2.  Block Representation  . . . . . . . . . . . . . . . . .  11
     3.4. .  10
     3.3.  Block Integrity Block . . . . . . . . . . . . . . . . . .  12
     3.5.  13
     3.4.  Block Confidentiality Block . . . . . . . . . . . . . . .  13
     3.6.  Cryptographic Message Syntax  14
     3.5.  Block Interactions  . . . . . . . . . . . .  15
     3.7.  Block Interactions . . . . . . .  16
     3.6.  Multi-Target Block Definitions  . . . . . . . . . . . .  16
     3.8. .  17
     3.7.  Parameters and Result Fields  . . . . . . . . . . . . . .  17
     3.9.
     3.8.  BSP Block Example . . . . . . . . . . . . . . . . . . . .  19  18
   4.  Security Processing  Canonical Forms . . . . . . . . . . . . . . . . . . . . .  22 . .  20
     4.1.  Canonical Forms  Technical Notes . . . . . . . . . . . . . . . . . . . . .  22
       4.1.1.  20
     4.2.  Primary Block Canonicalization  . . . . . . . . . . . . . . .  22
       4.1.2.  Considerations  . .  21
     4.3.  Non-Primary-Block Canonicalization  . . . . . . . . . . .  22
   5.  Security Processing . . . . . .  25
     4.2.  Endpoint ID Confidentiality . . . . . . . . . . . . . . .  25
     4.3.  22
     5.1.  Bundles Received from Other Nodes . . . . . . . . . . . .  26
       4.3.1.  23
       5.1.1.  Receiving BCB Blocks  . . . . . . . . . . . . . . . .  26
       4.3.2.  23
       5.1.2.  Receiving BIB Blocks  . . . . . . . . . . . . . . . .  26
     4.4.  Receiving CMSB Blocks  23
     5.2.  Bundle Fragmentation and Reassembly . . . . . . . . . . .  24
   6.  Key Management  . . . . . . .  27
     4.5.  Bundle Fragmentation and Reassembly . . . . . . . . . . .  27
     4.6.  Reactive Fragmentation . . . . .  25
   7.  Policy Considerations . . . . . . . . . . . .  28
   5.  Key Management . . . . . . . .  25
   8.  Security Considerations . . . . . . . . . . . . . . .  28
   6.  Policy Considerations . . . .  26
     8.1.  Attacker Capabilities and Objectives  . . . . . . . . . .  27
     8.2.  Attacker Behaviors and BPSec Mitigations  . . . . . .  28
   7.  Security Considerations . .  28
       8.2.1.  Eavesdropping Attacks . . . . . . . . . . . . . . . .  28
       8.2.2.  Modification Attacks  .  29
   8.  Conformance . . . . . . . . . . . . . . .  28
       8.2.3.  Topology Attacks  . . . . . . . . . .  29
   9.  IANA Considerations . . . . . . . .  29
       8.2.4.  Message Injection . . . . . . . . . . . . .  30
     9.1.  Bundle Block Types . . . . .  30
   9.  Ciphersuite Authorship Considerations . . . . . . . . . . . .  30
   10. Conformance . . .  30
     9.2. . . . . . . . . . . . . . . . . . . . . . .  31
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  31
     11.1.  Bundle Block Types . . . . . . . . . . . . . . . . . . .  31
     11.2.  Cipher Suite Flags . . . . . . . . . . . . . . . . . . .  30
     9.3.  31
     11.3.  Parameters and Results . . . . . . . . . . . . . . . . .  31
   10.  32
   12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  31
     10.1.  33
     12.1.  Normative References . . . . . . . . . . . . . . . . . .  31
     10.2.  33
     12.2.  Informative References . . . . . . . . . . . . . . . . .  32  33
   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .  32  34
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  32  34

1.  Introduction

   This document defines security features for the Bundle Protocol
   [BPBIS] intended for use in delay-tolerant networks, in order to
   provide Delay-Tolerant Networking (DTN) security services.

1.1.  Motivation

   The Bundle Protocol is used in DTNs that overlay multiple networks,
   some of which may be challenged by limitations such as intermittent
   and possibly unpredictable loss of connectivity, long or variable
   delay, asymmetric data rates, and high error rates.  The purpose of
   the Bundle Protocol is to support interoperability across such
   stressed networks.

   The stressed environment of the underlying networks over which the
   Bundle Protocol operates makes it important for the DTN to be
   protected from unauthorized use, and this stressed environment poses
   unique challenges for the mechanisms needed to secure the Bundle
   Protocol.  Furthermore, DTNs may be deployed in environments where a
   portion of the network might become compromised, posing the usual
   security challenges related to confidentiality, integrity, confidentiality and
   availability.

   This document describes the Bundle Protocol integrity.

1.2.  Supported Security Specification
   (BPSec), which provides security Services

   This specification supports end-to-end integrity and confidentiality
   services for blocks associated with BP bundles.

   Integrity services ensure data within a bundle
   from are not changed.  Data
   changes may be caused by processing errors, environmental conditions,
   or intentional manipulation.  An integrity service is one that
   provides sufficient confidence to a data receiver that data has not
   changed since its value was last asserted.

   Confidentiality services ensure that the values of some data within a
   bundle source to can only be determined by authorized receivers of the data.
   When a bundle destination.  Specifically,
   BPSec provides integrity and confidentiality for bundles along traverses a path
   through DTN, many nodes in the network other than
   the destination node MAY see the contents of a DTN.

   BPSec applies, by definition, only bundle.  A
   confidentiality service allows a destination node to those nodes that implement it,
   known generate data
   values from otherwise encrypted contents of a bundle.

   NOTE: Hop-by-hop authentication is NOT a supported security service
   in this specification, for three reasons.

   1.  The term "hop-by-hop" is ambiguous in a BP overlay, as "security-aware" nodes.  There MAY be other nodes that
       are adjacent in the DTN
   that do overlay may not implement be adjacent in physical
       connectivity.  This condition is difficult or impossible to
       predict in the overlay and therefore makes the concept of hop-by-
       hop authentication difficult or impossible to enforce at the
       overlay.

   2.  Networks in which BPSec may be deployed may have a mixture of
       security-aware and not-security-aware nodes.  Hop-by-hop
       authentication cannot be deployed in a network if adjacent nodes
       in the network have different security capabilities.

   3.  Hop-by-hop authentication can be viewed as a special case of data
       integrity.  As such, it is possible to develop policy that
       provides a version of authentication using the integrity
       mechanisms defined in this specification.

1.3.  Specification Scope

   This document describes the Bundle Protocol Security Specification
   (BPSec), which provides security services for blocks within a bundle.
   This includes the data specification for individual BP extension
   blocks and the processing instructions for those blocks.

   BPSec applies, by definition, only to those nodes that implement it,
   known as "security-aware" nodes.  There MAY be other nodes in the DTN
   that do not implement BPSec.  All nodes can interoperate with the
   exception that BPSec security operations can only happen at BPSec
   security-aware nodes.

1.1.

   This specification does not address individual cipher suite
   implementations.  The definition and enumeration of cipher suites
   should be undertaken in separate specification documents.

   This specification does not address the implementation of security
   policy and does not provide a security policy for the BPSec.
   Security policies are typically based on the nature and capabilities
   of individual networks and network operational concepts.  However,
   this specification does recommend policy considerations when building
   a security policy.

   This specification does not address how to combine the BPSec security
   blocks with other protocols, other BP extension blocks, or other best
   practices to achieve security in any particular network
   implementation.

1.4.  Related Documents

   This document is best read and understood within the context of the
   following other DTN documents:

   "Delay-Tolerant Networking Architecture" [RFC4838] defines the
   architecture for delay-tolerant networks, but does not discuss
   security at any length.

   The DTN Bundle Protocol [BPBIS] defines the format and processing of
   the blocks used to implement the Bundle Protocol, excluding the
   security-specific blocks defined here.

   The Bundle Security Protocol [RFC6257] and Streamlind Bundle Security
   Protocol [SBSP] introduce the concepts of security blocks for
   security services.  BPSec is based off of these documents.

1.2.

1.5.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   [RFC2119].

   We introduce

   This section defines those terms whose definition is important to the following terminology for purposes
   understanding of clarity. concepts within this specification.

   o  Source - the bundle node from which a bundle originates.

   o  Destination - the bundle node to which a bundle is ultimately
      destined.

   o  Forwarder - the bundle node that forwarded the bundle on its most
      recent hop.

   o  Intermediate Receiver, Waypoint, or "Next Hop" - the neighboring
      bundle node to which a forwarder forwards a bundle.

   o  Path - the ordered sequence of nodes through which a bundle passes
      on its way from source to destination.  The path is not
      necessarily known by the bundle, or any bundle-aware nodes.

   Figure 1 below

   The application of these terms applied to a sample network topology
   is adapted from [BPBIS] and shown in Figure 1.  This figure shows four bundle nodes
   (denoted BN1, (BN1, BN2,
   BN3, and BN4) that reside residing above some transport layer(s).  Three distinct
   transport and network protocols (denoted
   T1/N1, (T1/N1, T2/N2, and T3/N3) are also
   shown.

   +---------v-|   +->>>>>>>>>>v-+     +->>>>>>>>>>v-+   +-^---------+
   | BN1     v |   | ^   BN2   v |     | ^   BN3   v |   | ^  BN4    |
   +---------v-+   +-^---------v-+     +-^---------v-+   +-^---------+
   | T1      v |   + ^  T1/T2  v |     + ^  T2/T3  v |   | ^  T3     |
   +---------v-+   +-^---------v-+     +-^---------v +   +-^---------+
   | N1      v |   | ^  N1/N2  v |     | ^  N2/N3  v |   | ^  N3     |
   +---------v-+   +-^---------v +     +-^---------v-+   +-^---------+
   |         >>>>>>>>^         >>>>>>>>>>^         >>>>>>>>^         |
   +-----------+   +------------+      +-------------+   +-----------+
   |                     |                    |                      |
   |<--  An Internet --->|                    |<--- An Internet  --->|
   |                     |                    |                      |

         Figure 1: Bundle Nodes Sitting at Above the Application Layer of Transport Layer.

   Consider the
                              Internet Model case where BN1 originates a bundle that it forwards to
   BN2.  BN2 forwards the bundle to BN3, and BN3 forwards the bundle to
   BN4.  BN1 is the source of the bundle and BN4 is the destination of
   the bundle.  BN1 is the first forwarder, and BN2 is the first
   intermediate receiver; BN2 then becomes the forwarder, and BN3 the
   intermediate receiver; BN3 then becomes the last forwarder, and BN4
   the last intermediate receiver, as well as the destination.

   If node BN2 originates a bundle (for example, a bundle status report
   or a custodial signal), which is then forwarded on to BN3, and then
   to BN4, then BN2 is the source of the bundle (as well as being the
   first forwarder of the bundle) and BN4 is the destination of the
   bundle (as well as being the final intermediate receiver).

   We introduce the

   The following security-specific DTN terminology. terminology is also defined to
   clarify security operations in this specifiation.

   o  Security-Service - the security features supported by this
      specification: authentication, integrity, integrity and confidentiality.

   o  Security-Source - a bundle node that adds a security block to a
      bundle.

   o  Security-Target - the portion of block within a bundle (e.g., the primary
      block, payload block, extension block, or entire bundle) that receives a
      security-service as part of a security-operation.

   o  Security Block - a single instance of a BPSec extension block in a bundle.

   o  Security-Operation - the application of a security-service to a
      specific
      security-target, notated as OP(security-service, security-target).
      For example, OP(authentication, bundle) or OP(confidentiality, payload).  Every security-operation security-
      operation in a bundle MUST be unique, meaning that a security-service security-
      service can only be applied to a security-target once in a bundle.
      A security- security operation MAY be is implemented by one or more a security blocks. block.

2.  Key Properties

   The application of security services in a DTN is a complex endeavor
   that must consider physical properties of the network, policies at
   each node, and various application security requirements.  Rather
   than enumerate all potential security implementations in all
   potential DTN topologies, this specification defines a set of key
   properties of a security system.  The security primitives outlined in
   this document MUST enable the realization of these properties in a
   DTN deploying the Bundle Protocol.

2.1.  Block-Level Granularity

   Blocks within a bundle represent different types of information.  The
   primary block contains identification and routing information.  The
   payload block carries application data.  Extension blocks carry a
   variety of data that may augment or annotate the payload, or
   otherwise provide information necessary for the proper processing of
   a bundle along a path.  Therefore, applying a single level and type
   of security across an entire bundle fails to recognize that blocks in
   a bundle may represent different types of information with different
   security needs.

   Security services within this specification MUST provide block level
   granularity where applicable such that different blocks within a
   bundle may have different security services applied to them.

   For example, within a bundle, a payload might be encrypted to protect
   its contents, whereas an extension block containing summary
   information related to the payload might be integrity signed but
   otherwise unencrypted to provide certain nodes access to payload-
   related data without providing access to the payload.

   Each security block in a bundle will be associated with a specific
   security-operation.

2.2.  Multiple Security Sources

   A bundle MAY have multiple security blocks and these blocks MAY have
   different security-sources.

   The Bundle Protocol allows extension blocks to be added to a bundle
   at any time during its existence in the DTN.  When a waypoint node
   adds a new extension block to a bundle, that extension block may have
   security services applied to it by that waypoint.  Similarly, a
   waypoint node may add a security service to an existing extension
   block, consistent with its security policy.  For example, a node
   representing a boundary between a trusted part of the network and an
   untrusted part of the network may wish to apply payload encryption
   for bundles leaving the trusted portion of the network.

   In each case, a node other than the bundle originator may be adding add a
   security service to the bundle and, as such, the source for the
   security service will be different than the source of the bundle
   itself.  Security services MUST track their orginating node so as to
   properly apply policy and key selection associated with processing
   the security service at the bundle destination.

   Referring to Figure 1, if the bundle that originates at BN1 is given
   security blocks by BN1, then BN1 is the security-source for those
   blocks as well as being the source of the bundle.  If the bundle that
   originates at BN1 is then given a security block by BN2, then BN2 is
   the security-source for that block even though BN1 remains the bundle
   source.

   A bundle MAY have multiple security blocks and these blocks MAY have
   different security-sources.  Each security block in a bundle will be
   associated with a specific security-operation.  All security blocks
   comprising a security-operation MUST have the same security-source.

   As required in [BPBIS], forwarding nodes MUST transmit blocks in a
   bundle in the same order in which they were received.  This
   requirement applies to all DTN nodes, not just ones that implement
   security processing.  Blocks in a bundle MAY be added or deleted
   according to the applicable specification, but those blocks that are
   both received and transmitted MUST be transmitted in the same order
   that they were received.

2.3.  Mixed Security Policy

   Different nodes in a DTN may have different security-related
   capabilities.  Some nodes may not be security-aware and will not
   understand any security-related extension blocks.  Other nodes may
   have security policies that require evaluation of security services
   at places other than the bundle destination (such as verifying
   integrity signatures at certain waypoint nodes).  Other nodes may
   ignore any security processing if they are not the destination of the
   bundle.  The security services described in this specification must
   allow each of these scenarios.

   Extension blocks representing security services MUST have their block
   processing flags set such that the block (and bundle, where
   applicable) will be treated
   appropriately by non-security-aware nodes.

   Extension blocks providing integrity services within a bundle MUST
   support options to allow waypoint nodes to evaluate these signatures
   if such nodes have the proper configuraton to do so.

2.4.  User-Selected Ciphersuites

   The security services defined in this specification rely on a a variety
   of ciphersuites cipher suites providing integrity signatures, ciphertext, and
   other information necessary to populate security blocks.  Users may
   wish to select differing ciphersuites different cipher suites to implement different
   security services.  For example, some users may wish to use a SHA-1 SHA-256
   based hash for integrity whereas other users may require a SHA-2 SHA-384
   hash instead.  The security services defined in this specification
   MUST provide a mechanism for identifying what ciphersuite cipher suite has been
   used to populate a security block.

2.5.  Deterministic Processing

   In all cases, the processing order of security services within a
   bundle must avoid ambiguity when evaluating security at the bundle
   destination.  This specification MUST provide determinism in the
   application and evaluation of security services, even when doing so
   results in a loss of flexibility.

3.  Security Block Definitions

   There are three two types of security blocks that MAY may be included in a
   bundle.  These are the Block Integrity Block (BIB), (BIB) and the Block
   Confidentiality Block (BCB), and the Cryptographic Messaging Syntax
   Block (CMSB). (BCB).

      The BIB is used to ensure the integrity of its security-target. security-target(s).
      The integrity information in the BIB MAY (when possible) be
      verified by any node in between the BIB security-source and the
      bundle destination.  BIBs MAY be added to, and removed from,
      bundles as a matter of security policy.

      The BCB indicates that the security-target security-target(s) has been encrypted,
      in whole or in part, at the BCB security-source in order to
      protect its content while in transit.  The BCB may be decrypted by
      appropriate nodes in the network, up to and including the bundle
      destination, as a matter of security policy.

      The CMSB contains a Cryptographic Message Syntax (CMS) payload
      used to describe a security service applied to another extension
      block.  NOTE: Applications may choose to simply place CMS text as
      the payload to the bundle.  In such cases, security is considered
      to be implemented at the application layer and CMSBs are not
      required in that case.

   Certain cipher suites may allow or require multiple instances of a
   block to appear in the bundle.  For example, an integrity cipher
   suite may require two security blocks, one before the payload block
   and one after.  Despite the presence of two security blocks, they
   both comprise the same security-operation - OP(integirty, target) in
   this example.

   A security-operation MUST NOT be

   A security-operation MUST NOT be applied more than once in a bundle.
   For example, the two security-operations: OP(integrity, payload) and
   OP(integrity, payload) are considered redundant and MUST NOT appear
   together in a bundle.  However, the two security operations
   OP(integrity, payload) and OP(integrity, extension_block_1) MAY both
   be present in the bundle.  Also, the two security operations
   OP(integrity, extension_block_1) and OP(integrity, extension_block_2)
   are unique and may both appear in the same bundle.

   Many of the fields in these block definitions use

   If the Self-Delimiting
   Numeric Value (SDNV) type whose format and encoding same security-service is to be applied to multiple security-
   targets, and cipher suite parameters for each security service are
   identical, then the set of security-operations can be represented as defined
   a single security-block with multiple security-targets.  In such a
   case, all security-operations represented in
   [BPBIS]. the security-block MUST
   be applied/evaluated together.

3.1.  Block Identification

   This specification requires that every target block of a security
   operation be uniquely identifiable.  The definition of the extension
   block header from [BPBIS] provides such a mechanism in the "block
   number", "Block
   Number" field, which provides a unique identifier for a block within
   a bundle.  Within this specification, a target block security-target will be
   identified by its unique block number. Block Number.

3.2.  Block Representation

   Each security block uses the Canonical Bundle Block Format as defined
   in [BPBIS].  That is, each security block is comprised of the
   following elements:

   o  Block Type Code

   o  Block Number

   o  Block Processing Control Flags

   o  CRC Type and CRC Field

   o  Block Data Length

   o  Block Type Specific Data Fields

3.2.1.  CMS Block Type-Specific Data Fields

   The contents of the CMS block is a single field structure of CMS data whose
   length is specified by the BLock Data Length parameter.

3.2.2. BIB and BCB Block Type-Specific Type Specific Data Fields

   The structure of the BIB and BCB type-specific data fields are
   identifcal and given illustrated in Figure 2.  Although the diagram hints at a
   fixed-format layout,  In this is purely for the purpose of exposition.
   Except for the "type" field, all fields are variable in length.
   Fields annotated figure, field names
   prefaced with an '*' are optional, with optional and their inclusion in the block is
   indicated by the cipher suite flags Cipher Suite Flags field.

   +---------------------------+-------------------------+

   +=================================================
   |    Field Name       |     Field Data Type      |
   +=================================================
   | # Security Target (SDNV) Targets  | Unsigned Integer         |
   +---------------------+--------------------------+
   | Security Targets    | Array (Unsigned Integer) |
   +---------------------+--------------------------+
   | Cipher suite Suite ID (SDNV)     |
   +---------------------------+-------------------------+ Unsigned Integer         |
   +---------------------+--------------------------+
   | Cipher suite Suite Flags (SDNV)  | *Source EID (Compound) Unsigned Integer         |
   +---------------------+--------------------------+
   | Security Source     | URI - OPTIONAL           |
   +---------------------------+-------------------------+
   +---------------------+--------------------------+
   |  *Parameters (Compound) Cipher Parameters   | Byte Array - OPTIONAL    | *Sec.
   +---------------------+--------------------------+
   | Security Result (Compound)     |
   +---------------------------+-------------------------+ Byte Array               |
   +---------------------+--------------------------+

                   Figure 2: BIB and BCB Block Structure

   The BIB and BCB type-specific data fields consist of

   Where the following
   fields, some of which block fields are optional. identified as follows.

   o  Security-Target (SDNV)  # Security Targets - Uniquely identifies the target The number of the
      associated security-operation. security targets for this
      security block.  This value MUST be at least 1.

   o  Security-Targets - This array contains the block number unique identifier of
      the blocks targetted by this security operation.  Each security-
      target MUST represent a block present in the bundle.  A security-
      target MUST NOT be repeated in this array.

   o  Cipher suite ID (SDNV) - Identifies the ciphersuite cipher suite used to implement
      the security service reprsented represented by this block. block and applied to each
      security-target.

   o  Cipher suite flags (SDNV) - Identifies which optional security block
      fields are present in the block.  The structure of the
      cipher suite flags Cipher
      Suite Flags field is shown in Figure 3.  The presence of an
      optional field is indicated by setting the value of the
      corresponding flag to one.  A value of zero indicates the
      corresponding optional field is not present.  The BPSEC cipher
      suite flags Cipher
      Suite Flags are defined as follows.

               Bit   Bit   Bit   Bit   Bit   Bit   Bit   Bit
                7     6     5     4     3     2     1     0
             +-----------------------------------+-----+-----+
             |    reserved                       | src |parm |
             +-----------------------------------+-----+-----+
               MSB                                       LSB

                       Figure 3: Cipher Suite Flags

      Where:

      *  bits 6-3 7-2 are reserved for future use.

      *  src - bit 2 1 indicates whether the security source Security Source EID is
         present in the block.

      *  parm - bit 0 indicates whether or not the Cipher Suite
         Parameters field is present in the block.

   o  (OPTIONAL) Security Source (URI) - This identifief identifies the EID that
      inserted the security service in the bundle.  If the security
      source is not present then the souce of the block MAY be taken to
      be the bundle source, the previous hop, or some other EID as
      defined by security policy.

      *  parm - bit 1 indicates whether or not the cipher suite
         parameters fields are present in the block.

      *  res - bit 0 indicates whether or not the security result fields
         are present in the block.

                  Bit   Bit   Bit   Bit   Bit   Bit   Bit
                   6     5     4     3     2     1     0
                +-----+-----+-----+-----+-----+-----+-----+
                |    reserved           | src |parm | res |
                +-----+-----+-----+-----+-----+-----+-----+

                       Figure 3: Cipher suite flags

   o  (OPTIONAL) Parameters (Byte Array) - compound Compound field of the
      following two items.

      *  Length (SDNV) (Unsigned Integer) - specifies the length of the next
         field, which captures the parameters data.

      *  Data (Byte Array) - A byte array encoding one or more cipher
         suite parameters, with each parameter represented as a Type-Length-
         Value Type-
         Length-Value (TLV) triplet.  In this triplet, the type and length are
         represented defined as SDNVs and the value is a byte array holding follows.

         +  Type (Byte) - The parameter type.

         +  Length (Unsigned Integer) - The length of the
         parmeter. parameter.

         +  Value (Byte Array) - The parameter value.

         See Section 3.8 3.7 for a list of parameter types that MUST be
         supported by BPSEC implementations.  BPSEC cipher suite
         specifications MAY define their own parameters to be
         represented in this byte array.

   o  (OPTIONAL)  Security Result (Byte Array) - compound Compound field of the next two
      items.

      *  Length (SDNV) (Unsigned Integer) - specifies the length of the next
         field, which is the security-result data.

      *  Data (Byte Array) - A byte array containing the results of the appropriate
         cipher suite specific calculation (e.g., encoding a signature, Message
         Authentication Code (MAC), or cipher-text block key).

3.3.  Block Ordering

   A security-operation may be implemented in a bundle using either one
   or two security blocks.  For example, the operation OP(integrity,
   block) MAY be accomplished by a single BIB block in the bundle, or it
   MAY be accomplished result for
         each security-target covered by two BIB blocks in the bundle.  To avoid
   confusion, we use the following terminology to identify the block or
   blocks comprising security-block, with each
         entry represented as a security-operation.

   The terms "First" TLV and "Last" are used ONLY when describing multiple
   security blocks comprising a single security-operation.  A "First"
   block refers to the security block that optionally prepended with
         information on which security-target is closest to the primary
   block in referenced by the canonical form of
         result, as follows.

         +  Target (Optional Unsigned Integer) - If the bundle.  A "Last" block refers to security-block
            has multiple security-targets, the security block that target field is furthest from the primary block in the
   canonical form Block
            Number of the bundle. security-target to which this result field
            applies.  If the security-block only has a single security-
            target, this field is omitted.

         +  Type (Unsigned Integer)(Byte) - The type of security block implements result
            field.

         +  Length (Unsigned Integer) - The length of the security-operation, then it
   is referred to as a "Lone" block.  For example, when a bundle
   authentication result field.

         +  Value (Byte Array) - The results of the appropriate cipher
            suite requires specific calculation (e.g., a single BIB signature, Message
            Authentication Code (MAC), or cipher-text block we refer to
   it as a Lone BAB.  When a bundle authentication cipher suite requires
   two BIB blocks we refer to them as the First BIB and the Last BIB.

   This specification and individual cipher suites impose restrictions
   on what optional fields must and must not appear in First blocks,
   Last blocks, and Lone blocks.

3.4. key).

3.3.  Block Integrity Block

   A BIB is an ASB with the following additional restrictions: characteristics:

      The block-type code Block Type Code value MUST be 0x02.

      The block processing control Block Processing Control flags value can be set to whatever
      values are required by local policy.  Cipher suite designers
      should carefully consider the effect of setting flags that either
      discard the block or delete the bundle in the event that this
      block cannot be processed.

      The security-target MUST match the BLock Number of a block within
      the bundle.  The

      A security-target for a BIB MUST NOT reference a
      security block security-block
      defined in this specification (BIB, BCB, (e.g., a BIB or CMSB). a BCB).

      The cipher suite ID MUST be documented as an end-to-end
      authentication-cipher suite or as an end-to-end error-detection-
      cipher suite.

      The cipher suite parameters field MAY be present in either a Lone
      BIB or a First BIB.  This field MUST NOT be present in a Last BIB.

      An EID-reference to the security-source MAY be present in either a
      Lone BIB or a First BIB.  This present.  If this
      field MUST NOT is not present, then the security-source of the block SHOULD
      be present inferred according to security policy and MAY default to the
      bundle source.  The security-source may also be specified as part
      of key-information described in a Last
      BIB. Section 3.7.

      The security-result captures the result of applying the cipher
      suite calculation (e.g., the MAC or signature) to the relevant
      parts of the security-target, as specified in the cipher suite
      definition.  This field MUST be present in either a Lone BIB or a
      Last BIB.  This field MUST NOT be present in a First BIB. present.

      The cipher suite MAY process less than the entire security-target.
      If the cipher suite processes less than the complete, original
      security-target, the cipher suite parameters MUST specify which
      bytes of the security-target are protected.

   Notes:

   o  Since OP(integrity, target) is allowed only once in a bundle per
      target, it is RECOMMENDED that users wishing to support multiple
      integrity signatures for the same target define a multi-signature
      cipher suite, capturing multiple security results in cipher suite
      parameters. suite.

   o  For some cipher suites, (e.g., those using asymmetric keying to
      produce signatures or those using symmetric keying with a group
      key), the security information MAY be checked at any hop on the
      way to the destination that has access to the required keying
      information, in accordance with Section 3.7. 3.5.

   o  The use of a generally available key is RECOMMENDED if custodial
      transfer is employed and all nodes SHOULD verify the bundle before
      accepting custody.

3.5.

3.4.  Block Confidentiality Block

   A BCB is an ASB with the following additional restrictions: characteristics:

      The block-type code Block Type Code value MUST be 0x03.

      The block processing control Block Processing Control flags value can be set to whatever
      values are required by local policy, except that a Lone BCB or
      First BCB this block MUST
      have the "replicate in every fragment" flag set.
      This set if the target of
      the BCB is the Payload Block.  Having that BCB in each fragment
      indicates to a receiving node that the payload portion in of each
      fragment represents cipher-text.  This flag SHOULD NOT be set
      otherwise.  Cipher suite designers should
      carefully consider the effect of setting flags that either discard
      the block or delete the bundle in the event that this block cannot
      be processed.

      The security-target MUST match the BLock Number of a block within
      the bundle.  The

      A security-target for a BCB MAY reference the payload block, a
      non-security extension block, or a BIB block.  A security-target
      in a BCB MUST NOT be another BCB.

      The cipher suite ID MUST be documented as a confidentiality cipher
      suite.

      Key-information, if available, MUST appear only in a Lone BCB or a
      First BCB.

      Any additional bytes generated as a result of encryption and/or
      authentication processing of the security-target SHOULD be placed
      in an "integrity check value" field (see Section 3.8) 3.7) or other
      such appropriate area in the security-result of the Lone BCB or Last BCB.

      The cipher suite parameters field MAY be present in either a Lone
      BCB or a First BCB.  This field MUST NOT be present in a Last BCB.

      An EID-reference to the security-source MAY be present in either a
      Lone BCB or a First BCB.  This present.  If this
      field MUST NOT be present in a Last
      BCB.  The is not present, then the security-source can also be specified as part of key-
      information the block SHOULD
      be inferred according to security policy and MAY default to the
      bundle source.  The security-source may also be specified as part
      of key-information described in Section 3.8. 3.7.

      The security-result MAY be present in either a Lone BCB or a Last
      BCB.  This field MUST NOT be present in a First the BCB.  This compound
      field normally contains fields such as an encrypted bundle
      encryption key and/or authentication tag.

   The BCB is the only security block that modifies the contents of its security-target.  When a BCB is
   applied, the security-target body data are encrypted "in-place".
   Following encryption, the security-
   target security-target body data contains cipher-text, cipher-
   text, not plain-text.  Other security-target block fields (such as
   type, processing control flags, and length) remain unmodified.

   Fragmentation, reassembly, and custody transfer are adversely
   affected by a change in size of the payload due to ambiguity about
   what byte range of the block is actually in any particular fragment.
   Therefore, when the security-target of a BCB is the bundle payload,
   the BCB MUST NOT alter the size of the payload block body data.
   Cipher suites SHOULD place any block expansion, such as
   authentication tags (integrity check values) and any padding
   generated by a block-mode cipher, into an integrity check value item
   in the security-result field (see Section 3.8) 3.7) of the BCB.  This "in-
   place" encryption allows fragmentation, reassembly, and custody
   transfer to operate without knowledge of whether or not encryption
   has occurred.

   Notes:

   o  The cipher suite MAY process less than the entire original
      security-target body data.  If the cipher suite processes less
      than the complete, original security-target body data, the BCB for
      that security-target MUST specify, as part of the cipher suite
      parameters, which bytes of the body data are protected.

   o  The BCB's "discard" flag may be set independently from its
      security-target's "discard" flag.  Whether or not the BCB's
      "discard" flag is set is an implementation/policy decision for the
      encrypting node.  (The "discard" flag is more properly called the
      "Discard if block cannot be processed" flag.)

   o  A BCB MAY include information as part of additional authenticated
      data to address parts of the target block, such as EID references,
      that are not converted to cipher-text.

3.6.  Cryptographic Message Syntax

3.5.  Block

   A CMSB is an ASB with the following additional restrictions:

      The block-type code value MUST be 0x04. Interactions

   The content of the block must contain valid CMS data, as security-block types defined in [RFC5652] , and encoded in X.690 BER or DER encoding.

      The block processing control flags value can be set this specification are designed
   to whatever
      values be as independent as possible.  However, there are required by local policy.  This flag SHOULD NOT some cases
   where security blocks may share a security-target creating processing
   dependencies.

   If confidentiality is being applied to a target that already has
   integrity applied to it, then an undesirable condition occurs where a
   security-aware intermediate node would be set
      otherwise.  Cipher suite designers should carefully consider unable to check the
      effect
   integrity result of setting flags that either discard the block or delete
      the bundle in the event that this block cannot be processed.

      The security-target MUST uniquely identify a block within because the
      bundle.  The reserved block type 0x01 specifies the singleton
      payload block.

      The security operation(s) will be performed on contents have been
   encrypted after the security-target
      block's data and integrity signature was generated.  To address
   this concern, the resulting CMS content will following processing rules MUST be stored within
      the CMSB block's security-result field.  The security-target
      block's data will then followed.

   o  If confidentiality is to be removed.

      A CMSB block MAY include multiple CMS security operations within a
      single block to allow for multiple nested operations to be
      performed on a bundle block.  Multiple CMSB blocks MAY be included
      in a bundle as long as the security-target for each is unique.

      Key-information, if available, MUST appear within the CMS content
      contained in the security-result field.

   A CMSB block is created with its corresponding security-target field
   pointing to a unique bundle block.  The CMS security operations are
   performed upon the security-target's data field and the resulting
   encoded CMS content is stored within the CMS security-result field of
   the CMSB's payload.  The security-target block's data MAY be left
   intact, replaced with alternate data, or completely erased based on
   the specification of the utilized CMS ciphersuite definition and
   applicable policy.

   Multiple CMS operations may be nested within a single CMSB block to
   allow more than one security operation to be performed upon a
   security-target.

   CMS Operations can be considered to have BPSec parallels: CMSB
   Enveloped-Data content type SHALL be considered as equivalent to a
   BPSec BCB block, and a CMSB Signed-Data type SHALL be considered as
   equivalent to a BPSec BIB block.

3.7.  Block Interactions

   The security-block types defined in this specification are designed
   to be as independent as possible.  However, there are some cases
   where security blocks may share a security-target creating processing
   dependencies.

   If confidentiality is being applied to a target that already has
   integrity applied to it, then an undesirable condition occurs where a
   security-aware intermediate node would be unable to check the
   integrity result of a block because the block contents have been
   encrypted after the integrity signature was generated.  To address
   this concern, the following processing rules MUST be followed.

   o  If confidentiality is to be applied applied to a target, it MUST also be
      applied to every any integrity operation already defined for that
      target.  This means that if a BCB is added to encrypt a block,
      another BCB MUST also be added to encrypt a BIB also targeting
      that block.

   o  An integrity operation MUST NOT be applied to a security-target if
      a BCB in the bundle shares the same security-target.  This
      prevents ambiguity in the order of evaluation when receiving a BIB
      and a BCB for a given security-target.

   o  An integrity value MUST NOT be evaluated if the BIB providing the
      integrity value is the security target of an existing BCB block in
      the bundle.  In such a case, the BIB data contains cipher-text as
      it has been encrypted.

   o  An integrity value MUST NOT be evaluated if the security-target of
      the BIB is also the security-target of a BCB in the bundle.  In
      such a case, the security-target data contains cipher-text as it
      has been encrypted.

   o  As mentioned in Section 3.5, 3.3, a BIB MUST NOT have a BCB as its
      security target.  BCBs may embed integrity results as part of
      cipher suite parameters.

   o  As mentioned in Section 4.4, CMS operations are considered to have
      operational parallels.  When a CMSB is used, these parallels MUST
      be considered for block interactions (e.g., a Signed-Data
      structure MUST NOT be evaluated if the security-target of the
      operation is also the security-target of a BCB)

   o  If a single bundle is going to contain a CMSB as well as other
      security blocks, the CMS operations MUST be performed and the CMSB
      MUST be created before any other security operation is applied.

   Additionally, since the CMSB block may contain either integrity or
   confidentiality information in its encapsulated CMS, there is no way
   to evaluate conflicts when a BIB/BCB and a CMSB have the same
   security target.  To address this concern, the following processing
   rules MUST be followed.

   o  If an extension block is the target of a BIB or a BCB, then the
      extension block MUST NOT also be the target of a CMSB, and vice-
      versa.

   o  Generally, a CMSB MUST be processed before any BIB or BCB blocks
      are processed.

   These restrictions on block interactions impose a necessary ordering
   when applying security operations within a bundle.  Specifically, for
   a given security-target, BIBs MUST be added before BCBs.  This
   ordering MUST be preserved in cases where the current BPA is adding
   all of the security blocks for the bundle or whether the BPA is a
   waypoint adding new security blocks to a bundle that already contains
   security blocks.

3.8.

3.6.  Multi-Target Block Definitions

   A security-block MAY target multiple security-targets if and only if
   all cipher suite parameters, security source, and key information are
   common for each security operation.  The following processing
   directives apply for these multi-target blocks.

   o  If a security-block has more than one security-target, then each
      type identifier in the security result TLV MUST be interpretted as
      a tuple with the first entry being the security-target for which
      the security result applies and the second entry being the type
      value enumeration of the security result value.

   o  If the security-block has a single security-target, the type field
      of every entry in the security result array MUST simply be the
      type field and MUST NOT be a tuple as described above.

3.7.  Parameters and Result Fields

   Various cipher suites include several items in the cipher suite
   parameters and/or security-result fields.  Which items MAY appear is
   defined by the particular cipher suite description.  A cipher suite
   MAY support several instances of the same type within a single block.

   Each item is represented as a type-length-value.  Type is a single
   byte indicating the item.  Length is the count of data bytes to
   follow, and is an SDNV-encoded integer. Unsigned Integer.  Value is the data content of the
   item.

   Item types, name, and descriptions are defined as follows.

                Cipher suite parameters and result fields.

   +-------+----------------+------------------------------------------+

   +-------+----------------+-----------------------------+------------+
   |  Type |      Name      | Description                 |
   +-------+----------------+------------------------------------------+ Field      |
   +-------+----------------+-----------------------------+------------+
   |   0   |    Reserved    |                             |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   |   1   | Initialization | A random value, typically eight to   | Cipher     |
   |       |  Vector (IV)   | eight to sixteen bytes.     |
   +-------+----------------+------------------------------------------+ Suite      |
   |       |                |                             | Parameters |
   +-------+----------------+-----------------------------+------------+
   |   2   |    Reserved    |                             |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   |   3   |      Key       | Material encoded or         | Cipher     |
   |       |  Information   | protected by the key        | Suite      |
   |       |  Information                | management system and used to transport  | Parameters |
   |       |                | to transport an ephemeral   |            |
   |       |                | key protected by a long-    |            |
   |       |                | term key.                   |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   |   4   | Content Range  | Pair of SDNV values (offset,length) Unsigned Integers   | Cipher     |
   |       |                | (offset,length) specifying  | Suite      |
   |       |                | the range of payload bytes to  | Parameters |
   |       |                | to which an operation       |            |
   |       |                | applies. The offset MUST be |            |
   |       |                | MUST be the offset within the original       |            |
   |       |                | original bundle, even if    |            |
   |       |                | the current bundle is a     |            |
   |       |                | fragment.                   |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   |   5   |   Integrity    | Result of BAB or BIB digest or other | Security   |
   |       |   Signatures   | or other signing operation. |
   +-------+----------------+------------------------------------------+ Results    |
   +-------+----------------+-----------------------------+------------+
   |   6   |   Unassigned   |                             |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   |   7   |      Salt      | An IV-like value used by certain    | Cipher     |
   |       |                | certain confidentiality     | Suite      |
   |       |                | suites.                     |
   +-------+----------------+------------------------------------------+ Parameters |
   +-------+----------------+-----------------------------+------------+
   |   8   | BCB Integrity  | Output from certain confidentiality         | Security   |
   |       |  Check Value   | confidentiality cipher      | Results    |
   |       |    (ICV) /     | suite operations to be used at |            |
   |    (ICV) /       | Authentication | at the destination to       |            |
   |       |      Tag       | verify that the protected   |            |
   |       | Authentication                | protected data has not been modified. |            |
   |      Tag       |                | This value MAY contain padding if      |            |
   |       |                | padding if required by the  |            |
   |       |                | cipher suite.               |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+
   | 9-255 |    Reserved    |                             |
   +-------+----------------+------------------------------------------+            |
   +-------+----------------+-----------------------------+------------+

                                  Table 1

3.9.

3.8.  BSP Block Example

   An example of BPSec blocks applied to a bundle is illustrated in
   Figure 4.  In this figure the first column represents blocks within a
   bundle and the second column represents a unique identifier for each
   block, suitable for use as the security-target of a BPSec security-
   block.  Since the mechanism and format of a security-target is not
   specified in this document, the terminology B1...Bn is used to
   identify blocks in the bundle for the purposes of illustration.

            Block in Bundle            ID
   +=================================+====+
   +===================================+====+
   |         Primary Block             | B1 |
   +---------------------------------+----+
   +-----------------------------------+----+
   |          Lone             BIB                   | B2 |
   |  OP(integrity, target=B1)         |    |
   +---------------------------------+----+
   +-----------------------------------+----+
   |          Lone             BCB                   | B3 |
   |  OP(confidentiality, target=B4)   |    |
   +---------------------------------+----+
   +-----------------------------------+----+
   |      Extension Block              | B4 |
   +---------------------------------+----+
   +-----------------------------------+----+
   |          Lone             BIB                   | B5 |
   |  OP(integrity, target=B6)         |    |
   +---------------------------------+----+
   +-----------------------------------+----+
   |      Extension Block              | B6 |
   +---------------------------------+----+
   +-----------------------------------+----+
   |          Lone             BCB                   | B7 |
   |  OP(confidentiality, target=B8)  OP(confidentiality,target=B8,B9) |    |
   +---------------------------------+----+
   +-----------------------------------+----+
   |   Lone   BIB  (encrypted by B7)          | B8 |
   |  OP(integrity, target=B10)       |    |
   +---------------------------------+----|
   |          Lone BCB               | B9 |
   | OP(confidentiality, target=B10) target=B9)         |    |
   +---------------------------------+----+
   +-----------------------------------+----|
   |         Payload Block           |B10             |
   +---------------------------------+----+ B9 |
   +-----------------------------------+----+

                    Figure 4: Sample Use of BSP Blocks

   In this example a bundle has five four non-security-related blocks: the
   primary block (B1), three extension blocks (B4,B6,B9), (B4,B6), and a payload
   block (B11). (B9).  The following security applications are applied to this
   bundle.

   o  An integrity signature applied to the canonicalized primary block.
      This is accomplished by a single BIB (B2).

   o  Confidentiality for the first extension block (B4).  This is
      accomplished by a single BCB block (B3).

   o  Integrity for the second extension block (B6).  This is
      accomplished by a single BIB block (B5).  NOTE: If the extension block B6
      contains a representation of the serialized bundle (such as a hash
      over all blocks in the bundle at the time of its last
      transmission) then the BIB block is also providing an
      authentication service from the prior BPSEC-BPA to this BPSEC-BPA.

   o  An integrity signature on the payload (B10).  This is accomplished
      by a single BIB block (B8).

   o  Confidentiality for the payload block and it's integrity
      signature.  This is accomplished by two Lone a BCB blocks: B7
      encrypting B8, and B9 block, B7, encrypting B10.

            Block in Bundle                    ID
   +=========================================+====+
   |         Primary Block                   | B1 |
   +-----------------------------------------+----+
   |          First BAB                      | B2 |
   |   OP(authentication, Bundle)            |    |
   +-----------------------------------------+----+
   |          Lone CMSB                      | B3 |
   |     security-target=0x01                |    |
   |     security-result=                    |    |
   |                                         |    |
   |  Signed-Data {                          |    |
   |   Digest Algorithm(s),                  |    |
   |   Enveloped-Data {                      |    |
   |     Encrypted Data,                     |    |
   |     Encrypted Encryption Key(s)         |    |
   |   },                                    |    |
   |   Signature(s) B8
      and Certificate Chain(s) |    |
   |  }                                      |    |
   |                                         |    |
   +-----------------------------------------+----+
   |         Payload Block                   | B4 |
   |        (Empty Data Field)               |    |
   +-----------------------------------------+----+
   |          Last BAB                       | B5 |
   |   OP(authentication, Bundle)            |    |
   +-----------------------------------------+----+

                  Figure 5: Sample Bundle With CMS Block

   In this example B9.

4.  Canonical Forms

   By definition, an integrity service determines whether any aspect of
   a bundle has two non-security-related blocks: the
   primary block (B1) and a payload block (B4).  This method would allow
   for was changed from the moment the bundle to carry multiple CMS payloads by utilizing a multiple
   CMSB ASBs.  The following security applications are service was applied to this
   bundle.

   o  Authentication over the bundle.  This is accomplished by two BAB
      blocks: B2 and B5.

   o  Encrypted and signed CMS content contained within the CMSB block.
      The first CMS operation, encryption, is performed on the data
      contained within the block the security-target points to, in this
      case, the payload block.  The resulting encrypted data is then
      signed and the final CMS content is stored within the CMSB block's
      security-result field.  The payload block's data is subsequently
      removed now that the original data has been encoded within the
      CMSB block.

4.  Security Processing

   This section describes
   at the security aspects source until the point of bundle processing.

4.1.  Canonical Forms

   In order to current evaluation.  To
   successfully verify a signature the integrity of a block, the exact data passed to the
   verifying cipher suite MUST be the same bits, in the exact same order, MUST be input as
   those passed to the calculation upon
   verification as were input upon initial computation of signature-generating cipher suite at the original
   signature value.

   Many fields in various blocks are stored as variable-length SDNVs.
   These are canonicalized into an "unpacked form" as eight-byte fixed-
   width fields in network byte order.

4.1.1.  Block Canonicalization

   This algorithm protects those parts security
   source.

   However, [BPBIS] does not specify a single on-the-wire encoding of
   bundles.  In cases where a block security source generates a different
   encoding than that SHOULD NOT used at a receiving node, care MUST be
   changed in transit.

   There are three types of blocks taken to
   ensure that may undergo block
   canonicalization: the primary block, the payload block, or an
   extension block.

4.1.1.1.  Primary Block Canonicalization

   The canonical form of inputs to cipher suites at the primary block receiving node is shown in Figure 6.
   Essentially, it de-references the dictionary block, adjusts lengths
   where necessary, and ignores flags that may change in transit.

   +----------------+----------------+----------------+----------------+
   |    Version     |      Processing flags (incl. COS and  SRR)       |
   +----------------+----------------+---------------------------------+
   |                Canonical primary block length                     |
   +----------------+----------------+---------------------------------+
   |                Destination endpoint ID length                     |
   +----------------+----------------+---------------------------------+
   |                      Destination endpoint ID                      |
   +----------------+----------------+---------------------------------+
   |                    Source endpoint ID length                      |
   +----------------+----------------+----------------+----------------+
   |                        Source endpoint ID                         |
   +----------------+----------------+---------------------------------+
   |                  Report-to endpoint ID length                     |
   +----------------+----------------+----------------+----------------+
   |                      Report-to endpoint ID                        |
   +----------------+----------------+----------------+----------------+
   +                    Creation Timestamp (2 x SDNV)                  +
   +---------------------------------+---------------------------------+
   |                             Lifetime                              |
   +----------------+----------------+----------------+----------------+

         Figure 6: The Canonical Form a
   bitwise match to inputs provided at the security source.

   This section provides guidance on how to create a canonical form for
   each type of block in a bundle.  This form MUST be used when
   generating inputs to cipher suites for use by BPSec blocks.

   This specification does not define any security operation over the Primary Bundle Block
   entire bundle and, therefore, provides no canonical form for a
   serialized bundle.

4.1.  Technical Notes

   The following technical considerations hold for all canonicalizations
   in this section.

   o  Any numeric fields shown defined as variable-length MUST be expanded to
      their "unpacked" form.  For example, a 32-bit integer value MUST
      be unpacked to a four-byte representation.

   o  Each block encoding MUST follow the CBOR encodings provided in Figure 6
      [BPBISCBOR].

   o  Canonical forms are as follows: not transmitted, they are used to generate
      input to a cipher suite for secuity processing at a security-aware
      node.

   o  The version value  Reserved flags MUST NOT be included in any canonicalization as it
      is not known if those flags will chaneg in transit.

   o  These canonicalization algorithms assume that endpoint IDs
      themselves are immutable and they are unsuitable for use in
      environments where that assumption might be violated.

   o  Cipher suites MAY define their own canonicalization algorithms and
      require the single-byte value use of those algorithms over the ones provided in this
      specification.  In the event of conflicting canonicalization
      algorithms, cipher suite algorithms take precedence over this
      specification.

4.2.  Primary Block Canonicalization

   The primary block canonical form is the same as the CBOR encoding of
   the block, with certain modifications to account for allowed block
   changes as the bundle traverses the DTN.  The fields that compromise
   the primary block, and any special considerations for their
   representation in a canonical form, are as follows.

   o  The Version field is included, without modification.

   o  The Bundle Processing Flags field is used, with modification.
      Certain bundle processing flags MAY change as a bundle transits
      the DTN without indicating an integrity error.  These flags, which
      are identified below, MUST NOT be represented in the canonicalized
      form of the bundle processing flags and, instead, be represented
      by the bit 0.

      *  Reserved flags.

      *  Bundle is a Fragment flag.

   o  The CRC Type, Destination EID, Source Node ID, Report-To EID,
      Creation Timestamp, and Lifetime fields are included, without
      modification.

   o  The fragment ID field MAY change if the bundle is fragmented in
      transit and, as such, this field MUST NOT be included in the
      canonicalization.

   o  The CRC field MAY change at each hop - for example, if a bundle
      becomes fragmented, each fragment will have a different CRC value
      from the original signed primary block.  As such, this field MUST
      NOT be included in the canonicalization.

4.3.  Non-Primary-Block Canonicalization

   All non-primary blocks (NPBs) in [BPBIS] share the same block
   structure and should be canonicalized in the same way.

   Canonicalization for NPBs is dependent on whether the security
   operation being performed is integrity or confidentiality.  Integrity
   operations consider every field in the block, whereas confidentiality
   operations only consider the block-type-specific data.  Since
   confidentiality is applied to hide information (replacing plaintext
   with ciphertext) it provides no benefit to include in the
   confidentiality calculation information that MUST remain readable,
   such as block fields other than the block-type-specific data.

   The fields that comprise a NPB, and any special considerations for
   their representation in a canonical form, are as follows.

   o  The Block Type Code field is included, without modification, for
      integrity operations and omitted for confidentiality operations.

   o  The Block Number field is included, without modification, for
      integrity operations and omitted for confidentiality operations.

   o  The Block Processing Control Flags field is included, without
      modification, for integrity operations and omitted for
      confidentiality operations, with the exception of reserved flags
      which are treated as 0 in both cases.

   o  The CRC type and CRC fields are included, without modification,
      for integrity operations and omitted for confidentiality
      operations.

   o  The Block Type Specific Data field is included, without
      modification, for both integrity and confidentiality operations,
      with the exception that in some cases only a portion of the
      payload data is to be processed.  In such a case, only those bytes
      are included in the canonical form and additional cipher suite
      parameters are required to specify which part of the field is
      included.

5.  Security Processing

   This section describes the security aspects of bundle processing.

5.1.  Bundles Received from Other Nodes

   Security blocks MUST be processed in a specific order when received
   by a security-aware node.  The processing order is as follows.

   o  All BCB blocks in the bundle MUST be evaluated prior to evaluating
      any BIBs in the bundle.  When BIBs and BCBs share a security-
      target, BCBs MUST be evaluated first and BIBs second.

5.1.1.  Receiving BCB Blocks

   If a received bundle contains a BCB, the receiving node MUST
   determine whether it has the responsibility of decrypting the BCB
   security target and removing the BCB prior to delivering data to an
   application at the node or forwarding the bundle.

   If the receiving node is the destination of the bundle, the node MUST
   decrypt any BCBs remaining in the bundle.  If the receiving node is
   not the destination of the bundle, the node MAY decrypt the BCB if
   directed to do so as a matter of security policy.

   If the relevant parts of an encrypted payload block cannot be
   decrypted (i.e., the decryption key cannot be deduced or decryption
   fails), then the bundle MUST be discarded and processed no further.
   If an encrypted security-target other than the payload block cannot
   be decrypted then the associated security-target and all security
   blocks associated with that target MUST be discarded and processed no
   further.  In both cases, requested status reports (see [BPBIS]) MAY
   be generated to reflect bundle or block deletion.

   When a BCB is decrypted, the recovered plain-text MUST replace the
   cipher-text in the security-target body data

   If a BCB contains multiple security-targets, all security-targets
   MUST be processed if the BCB is processed by the Node.  The effect of
   this is to be the same as if each security-target had been
   represented by an individual BCB with a single security-target.

5.1.2.  Receiving BIB Blocks

   If a received bundle contains a BIB, the primary block.

   o  The processing flags value in receiving node MUST
   determine whether it has the primary block is an SDNV, and
      includes responsibility of verifying the class-of-service (COS) BIB
   security target and status report request
      (SRR) fields.  For purposes of canonicalization, whether to remove the unpacked SDNV
      is ANDed with mask 0x0000 0000 0007 C1BE BIB prior to set delivering
   data to zero all
      reserved bits and an application at the "bundle is a fragment" bit.

   o  The canonical primary block length value node or forwarding the bundle.

   A BIB MUST NOT be processed if the security-target of the BIB is a four-byte value
      containing also
   the length (in bytes) security-target of this structure, a BCB in network
      byte order.

   o  The destination endpoint ID length and value are the length (as bundle.  Given the order of
   operations mandated by this specification, when both a
      four-byte value in network byte order) BIB and value of a BCB
   share a security-target, it means that the
      destination endpoint ID from security-target MUST have
   been encrypted after it was integrity signed and, therefore, the primary bundle block.  The URI is
      simply copied from BIB
   cannot be verified until the relevant part(s) of security-target has been decrypted by
   processing the dictionary block BCB.

   If the security policy of a security-aware node specifies that a
   bundle should have applied integrity to a specific security-target
   and no such BIB is not itself canonicalized.  Although present in the dictionary entries
      contain "null-terminators", bundle, then the null-terminators are not included node MUST process
   this security-target in accordance with the length security policy.  This
   MAY involve removing the security-target from the bundle.  If the
   removed security-target is the payload or primary block, the canonicalization.

   o  The source endpoint ID length and value are handled similarly to bundle
   MAY be discarded.  This action may occur at any node that has the destination.

   o  The report-to endpoint ID length and value are handled similarly
   ability to verify an integrity signature, not just the bundle
   destination.

   o  The unpacked SDNVs for

   If the creation timestamp bundle has a BIB and lifetime are
      copied from the primary block.

   o  Fragment offset and total application data unit length are
      ignored, as receiving node is the case destination for
   the "bundle is a fragment" bit
      mentioned above.  If the payload data to be canonicalized is less
      than bundle, the complete, original bundle payload, node MUST verify the offset and length
      are specified security-target in accordance
   with the cipher suite parameters.

4.1.1.2.  Payload Block Canonicalization

   When canonicalizing the payload block, the block processing control
   flags value used for canonicalization is specification.  If a BIB check fails, the unpacked SDNV value with
   reserved and mutable bits masked to zero.  The unpacked value is
   ANDed with mask 0x0000 0000 0000 0077
   security-target has failed to zero reserved bits authenticate and the
   "last block" bit.  The "last block" bit is ignored because BABs and
   other security-target
   SHALL be processed according to the security blocks policy.  A bundle status
   report indicating the failure MAY be added for some parts of generated.  Otherwise, if the journey but
   not others, so
   BIB verifies, the setting of this bit might change from hop security-target is ready to hop.

   Payload blocks are canonicalized as-is, with be processed for
   delivery.

   If the exception that, in
   some instances, only bundle has a portion of BIB and the payload data receiving node is not the bundle
   destination, the receiving node MAY attempt to be
   protected.  In such a case, only those bytes are included verify the value in
   the
   canonical form, and additional cipher suite parameters are required
   to specify which part of security-result field.  If the check fails, the node SHALL
   process the security-target in accordance to local security policy.
   It is RECOMMENDED that if a payload integrity check fails at a
   waypoint that it is protected, processed in the same way as discussed
   further below.

4.1.1.3.  Extension Block Canonicalization

   When canonicalizing an extension block, if the block processing control
   flags value used for canonicalization check fails
   at the destination.

   If a BIB contains multiple security-targets, all security-targets
   MUST be processed if the BIB is processed by the unpacked SDNV value with
   reserved and mutable bits masked to zero. Node.  The unpacked value effect of
   this is
   ANDed with mask 0x0000 0000 0000 0057 to zero reserved bits, be the
   "last block" flag same as if each security-target had been
   represented by an individual BIB with a single security-target.

5.2.  Bundle Fragmentation and the "Block was forwarded without being
   processed" bit.  The "last block" flag Reassembly

   If it is ignored because BABs necessary for a node to fragment a bundle and
   other security blocks MAY
   services have been applied to that bundle, the fragmentation rules
   described in [BPBIS] MUST be added followed.  As defined there and repeated
   here for some parts of the journey but
   not others, so the setting of this bit might change from hop to hop.

   The "Block was forwarded without being processed" flag is ignored
   because completeness, only the bundle payload may pass through nodes that do not understand that be fragmented; security
   blocks, like all extension block and this flag would blocks, can never be set.

   Endpoint ID references in blocks are canonicalized using the de-
   referenced text form in place of the reference pair.  The reference
   count is not included, nor is fragmented.

   Due to the length complexity of bundle fragmentation, including the endpoint ID text.

   The EID reference is, therefore, canonicalized as <scheme>:<SSP>,
   which includes the ":" character.

   Since neither the length
   possibility of the canonicalized EID text nor fragmenting bundle fragments, integrity and
   confidentiality operations are not to be applied to a bundle
   representing a fragment (i.e., a bundle whose "bundle is a null-
   terminator Fragment"
   flag is used set in EID canonicalization, the Bundle Processing Control Flags field).
   Specifically, a separator token BCB or BIB MUST NOT be
   used added to determine when one EID ends and another begins.  When
   multiple EIDs are canonicalized together, a bundle fragment,
   even if the character "," SHALL be
   placed between adjacent instances security-target of EID text.

   The block-length the security block is canonicalized as its unpacked SDNV value.  If not the
   data payload.
   When integrity and confidentiality must be applied to a fragment, we
   RECOMMEND that encapsulation be canonicalized used instead.

6.  Key Management

   Key management in delay-tolerant networks is less than the complete, original block
   data, recognized as a
   difficult topic and is one that this field contains the size of the data being canonicalized
   (the "effective block") rather than specification does not attempt
   to solve.

7.  Policy Considerations

   When implementing BPSec, several policy decisions must be considered.
   This section describes key policies that affect the actual size generation,
   forwarding, and receipt of the block.

4.1.2.  Considerations bundles that are secured using this
   specification.

   o  The canonical forms for the  If a bundle and various extension blocks is
      not transmitted.  It is simply an artifact used as input to
      digesting.

   o  We omit received that contains more than one security-
      operation, in violation of BPSec, then the reserved flags because we cannot BPA must determine if they
      will change in transit.  The masks specified above will have to be
      revised if additional flags are defined and they need how
      to handle this bundle.  The bundle may be
      protected.

   o  All SDNV fields here are canonicalized as eight-byte unpacked
      values in network byte order.  Length fields are canonicalized as
      four-byte values in network byte order.  Encoding does not need
      optimization since discarded, the values are never sent block
      affected by the security-operation may be discarded, or one
      security-operation may be favored over the network. another.

   o  These canonicalization algorithms assume that endpoint IDs
      themselves are immutable and they are unsuitable for use  BPAs in
      environments where that assumption might the network MUST understand what security-operations they
      should apply to bundles.  This decision may be violated.

   o  Cipher suites MAY define their own canonicalization algorithms and
      require based on the use source
      of those algorithms over the ones provided in this
      specification.

4.2.  Endpoint ID Confidentiality

   Every bundle has a primary block that contains bundle, the source and destination endpoint IDs, and possibly of the bundle, or some other EIDs (in
      information related to the dictionary
   field) that cannot be encrypted. bundle.

   o  If endpoint ID confidentiality is
   required, an intermediate receiver has been configured to add a security-
      operation to a bundle, and the received bundle already has the
      security-operation applied, then bundle-in-bundle encapsulation can solve this problem
   in some instances.

   Similarly, confidentiality requirements MAY also apply the receiver MUST understand what
      to other parts
   of do.  The receiver may discard the primary block (e.g., bundle, discard the current-custodian), security-
      target and that is
   supported in associated BPSec blocks, replace the same manner.

4.3.  Bundles Received from Other Nodes

   Security blocks MUST security-
      operation, or some other action.

   o  It is recommended that security operations only be processed applied to the
      payload block, the primary block, and any block-types specifically
      identified in the security policy.  If a specific order when received
   by a security-aware node.  The processing order is BPA were to apply
      security operations such as follows.

   o  All BCB blocks integrity or confidentiality to every
      block in the bundle MUST bundle, regardless of the block type, there could be evaluated prior to evaluating
      any BIBs
      downstream errors processing blocks whose contents must be
      inspected at every hop in the bundle.  When BIBs and BCBs share network path.

   o  Adding a security-
      target, BCBs MUST be evaluated first and BIBs second.

4.3.1.  Receiving BCB Blocks

   If the bundle BIB to a security-target that has already been encrypted
      by a BCB and the receiving node is not allowed.  Therefore, we recommend three methods to
      add an integrity signature to an encrypted security-target.

      1.  At the destination for
   the bundle, the node MUST decrypt the relevant parts of the security-
   target in accordance with the cipher suite specification.

   If the relevant parts time of encryption, an encrypted payload cannot integrity signature may be decrypted
   (i.e.,
          generated and added to the decryption key cannot be deduced or decryption fails),
   then BCB for the bundle MUST be discarded and processed no further; security-target as
          additional information in this
   case, a bundle deletion status report (see [BPBIS]) indicating the
   decryption failure MAY be generated.  If any other security-result field.

      2.  The encrypted
   security-target cannot block may be decrypted then the associated security-
   target replicated as a new block and all security blocks associated with that target MUST
          integrity signed.

      3.  An encapsulation scheme may be
   discarded and processed applied to encapsulate the
          security-target (or the entire bundle) such that the
          encapsulating structure is, itself, no further.

   When longer the security-
          target of a BCB is decrypted, and may therefore be the recovered plain-text MUST replace security-target of a
          BIB.

8.  Security Considerations

   Given the
   cipher-text in nature of delay-tolerant networking applications, it is
   expected that bundles may traverse a variety of environments and
   devices which each pose unique security risks and requirements on the security-target body data

4.3.2.  Receiving BIB Blocks

   A BIB MUST NOT be processed if
   implementation of security within BPSEC.  For these reasons, it is
   important to introduce key threat models and describe the security-target roles and
   responsibilities of the BIB is also BPSEC protocol in protecting the security-target
   confidentiality and integrity of a BCB in the bundle.  Given data against those threats
   throughout the order of
   operations mandated by this specification, when both a BIB DTN.  This section provides additional discussion on
   security threats that BPSEC will face and a BCB
   share a security-target, it means describe in additional
   detail how BPSEC security mechanisms operate to mitigate these
   threats.

   It should be noted that BPSEC addresses only the security-target MUST have
   been encrypted after it was integrity signed and, therefore, security of data
   traveling over the BIB
   cannot be verified until DTN, not the security-target has been decrypted by
   processing underlying DTN itself.  Additionally,
   BPSEC addresses neither the BCB.

   If fitness of externally-defined
   cryptographic methods nor the security policy of a security-aware node specifies that a
   bundle SHOULD apply integrity to a specific security-target and no
   such BIB their implementation.  It
   is present in the bundle, then responsibility of the node MUST process this
   security-target in accordance with BPSEC implementer that appropriate
   algorithms and methods are chosen.  Furthermore, the security policy.  This MAY
   involve removing BPSEC protocol
   does not address threats which share computing resources with the security-target from DTN
   and/or BPSEC software implementations.  These threats may be
   malicious software or compromised libraries which intend to intercept
   data or recover cryptographic material.  Here, it is the bundle.  If
   responsibility of the removed
   security-target BPSEC implementer to ensure that any
   cryptographic material, including shared secret or private keys, is
   protected against access within both memory and storage devices.

   The threat model described here is assumed to have a set of
   capabilities identical to those described by the payload or primary block, Internet Threat
   Model in [RFC3552], but the bundle MAY be
   discarded.  This action BPSEC threat model is scoped to
   illustrate threats specific to BPSEC operating within DTN
   environments and therefore focuses on man-in-the-middle (MITM)
   attackers.

8.1.  Attacker Capabilities and Objectives

   BPSEC was designed to protect against MITM threats which may occur at any have
   access to a bundle during transit from its source, Alice, to its
   destination, Bob.  A MITM node, Mallory, is a non-cooperative node
   operating on the DTN between Alice and Bob that has the ability to
   verify an integrity signature, not just
   receive bundles, examine bundles, modify bundles, forward bundles,
   and generate bundles at will in order to compromise the bundle destination.

   If
   confidentiality or integrity of data within the bundle has a BIB and DTN.  For the receiving
   purposes of this section, any MITM node is assumed to effectively be
   security-aware even if it does not implement the destination for BPSec protocol.
   There are three classes of MITM nodes which are differentiated based
   on their access to cryptographic material:

   o  Unprivileged Node: Mallory has not been provisioned within the bundle,
      secure environment and only has access to cryptographic material
      which has been publicly-shared.

   o  Legitimate Node: Mallory is within the secure environment and
      therefore has access to cryptographic material which has been
      provisioned to Mallory (i.e., K_M) as well as material which has
      been publicly-shared.

   o  Privileged Node: Mallory is a privileged node MUST verify the security-target in accordance
   with within the cipher suite specification. secure
      environment and therefore has access to cryptographic material
      which has been provisioned to Mallory, Alice and/or Bob (i.e.
      K_M, K_A, and/or K_B) as well as material which has been publicly-
      shared.

   If Mallory is operating as a BIB check fails, the
   security-target has failed privileged node, this is tantamount to authenticate and
   compromise; BPSec does not provide mechanisms to detect or remove
   Mallory from the security-target
   SHALL be processed according DTN or BPSec secure environment.  It is up to the security policy.  A bundle status
   report indicating
   BPSec implementer or the failure MAY underlying cryptographic mechanisms to
   provide appropriate capabilities if they are needed.  It should also
   be generated.  Otherwise, noted that if the
   BIB verifies, implementation of BPSec uses a single set of
   shared cryptographic material for all nodes, a legitimate node is
   equivalent to a privileged node because K_M == K_A == K_B.

   A special case of the security-target legitimate node is ready when Mallory is either Alice
   or Bob (i.e., K_M == K_A or K_M == K_B).  In this case, Mallory is
   able to impersonate traffic as either Alice or Bob, which means that
   traffic to and from that node can be decrypted and encrypted,
   respectively.  Additionally, messages may be processed for
   delivery.

   If signed as originating
   from one of the bundle endpoints.

8.2.  Attacker Behaviors and BPSec Mitigations

8.2.1.  Eavesdropping Attacks

   Once Mallory has received a BIB and the receiving node bundle, she is not able to examine the
   contents of that bundle
   destination, the receiving node MAY and attempt to verify the value in recover any protected data or
   cryptographic keying material from the security-result field.  If blocks contained within.  The
   protection mechanism that BPSec provides against this action is the check fails,
   BCB, which encrypts the node SHALL
   process contents of its security-target, providing
   confidentiality of the security-target in accordance to local security policy.
   It is RECOMMENDED that if a payload integrity check fails at a
   waypoint that data.  Of course, it should be assumed that
   Mallory is processed in able to attempt offline recovery of encrypted data, so the same way as if
   cryptographic mechanisms selected to protect the check fails
   at data should provide
   a suitable level of protection.

   When evaluating the destination.

4.4.  Receiving CMSB Blocks

   A CMSB MUST NOT be processed if its security target risk of eavesdropping attacks, it is also important to
   consider the
   security target lifetime of any BIB or BCB in the bundle.

   The security services provided by bundles on a CMSB will be considered
   successful if all services in DTN.  Depending on the CMSB are validated. network,
   bundles may persist for days or even years.  If any one
   service encapsulated in the CMSB fails to validate, then a bundle does persist
   on the CMSB
   MUST be considered as having failed to validate and MUST be
   dispositioned in accordance with security policy.

4.5.  Bundle Fragmentation network for years and Reassembly

   If it is necessary the cipher suite used for a node to fragment a bundle and security
   services have been applied BCB provides
   inadequate protection, Mallory may be able to that bundle, recover the fragmentation rules
   described in [BPBIS] MUST be followed. protected
   data before that bundle reaches its intended destination.

8.2.2.  Modification Attacks

   As defined there a node participating in the DTN between Alice and repeated
   here for completeness, only Bob, Mallory
   will also be able to modify the received bundle, including non-BPSec
   data such as the primary block, payload may be fragmented; security
   blocks, like all extension blocks, can never be fragmented.  In
   addition, the following security-specific or block processing is REQUIRED:

   o  Due
   control flags as defined in [BPBIS].  Mallory will be able to the complexity
   undertake activities which include modification of bundle fragmentation, including data within the
      possibility
   blocks, replacement of fragmenting bundle fragments, blocks, addition of blocks, or removal of
   blocks.  Within BPSec, both the BIB and BCB provide integrity
   protection mechanisms to detect or prevent data manipulation attempts
   by Mallory.

   The BIB provides that protection to another block which is its
   security-target.  The cryptographic mechansims used to generate the
   BIB should be strong against collision attacks and
      confidentiality operations are Mallory should not
   have access to be applied the cryptographic material used by the originating
   node to a bundle
      fragment.  Specifically, a BCB or generate the BIB MUST NOT (e.g., K_A).  If both of these conditions
   are true, Mallory will be added unable to a
      bundle fragment, even if modify the security-target of the security block
      is not or the payload.  When integrity
   BIB and confidentiality must be
      applied lead Bob to a fragment, we RECOMMEND that encapsulation be used
      instead.

   o  The authentication validate the security-target as originating from
   Alice.

   Since BPSec security policy requirements for operations are implemented by placing blocks in
   a bundle MUST
      be applied individually to all the bundles resulting bundle, there is no in-band mechanism for detecting or correcting
   certain cases where Mallory removes blocks from a
      fragmentation event.

   o  The decision to fragment bundle.  If Mallory
   removes a bundle MUST be made prior to adding
      authentication to BCB block, but keeps the bundle.  The bundle MUST first be fragmented security-target, the security-
   target remains encrypted and authentication applied there is a possibility that there may no
   longer be sufficient information to each individual fragment.

4.6.  Reactive Fragmentation

   When decrypt the block at its
   destination.  If Mallory removes both a partial BCB (or BIB) and its
   security-target there is no evidence left in the bundle has been received, of the receiving node SHALL
   consult its
   security policy to determine operation.  Similarly, if it MAY fragment the
   bundle, converting Mallory removes the received portion into a bundle fragment for
   further forwarding.  Whether or BIB but not reactive fragmentation
   the security-target there is
   permitted SHALL depend on no evidence left in the bundle of the
   security policy and operation.  In each of these cases, the cipher suite
   used to calculate implementation of
   BPSec MUST be combined with policy configuration at endpoints in the BAB authentication information, if required.

   Specifically, if
   network which describe the expected and required security policy does not require authentication,
   then reactive fragmentation MAY operations
   that must be permitted.  If the security policy
   does require authentication, then reactive fragmentation MUST NOT applied on transmission and are expected to be
   permitted if the partial bundle present
   on receipt.  This or other similar out-of-band information is not sufficient
   required to allow
   authentication. correct for removal of security information in the
   bundle.

   A limitation of the BIB may exist within the implementation of BIB
   validation at the destination node.  If reactive fragmentation Mallory is allowed, then all BAB blocks must a legitimate node
   within the DTN, the BIB generated by Alice with K_A can be
   removed from created fragments.

5.  Key Management

   Key management in delay-tolerant networks is recognized as replaced
   with a
   difficult topic new BIB generated with K_M and forwarded to Bob.  If Bob is one
   only validating that this specification does not attempt the BIB was generated by a legitimate user, Bob
   will acknowledge the message as originating from Mallory instead of
   Alice.  In order to solve.

6.  Policy Considerations

   When implementing BPSec, several policy decisions must provide verifiable integrity checks, both a BIB
   and BCB should be considered.
   This section describes used.  Alice creates a BIB with the protected data
   block as the security-target and then creates a BCB with both the BIB
   and protected data block as its security-targets.  In this
   configuration, since Mallory is only a legitimate node and does not
   have access to Alice's key policies that affect K_A, Mallory is unable to decrypt the generation,
   forwarding, BCB
   and receipt of bundles that are secured using this
   specification.

   o replace the BIB.

8.2.3.  Topology Attacks

   If a bundle Mallory is received that contains more than one security-
      operation, in violation of BPSec, then a MITM position within the BPA must determine DTN, she is able to
   influence how any bundles that come to handle this bundle.  The bundle her may be discarded, the block
      affected by pass through the security-operation may be discarded, or one
      security-operation may
   network.  Upon receiving and processing a bundle that must be favored over another.

   o  BPAs routed
   elsewhere in the network MUST understand what security-operations they
      should apply network, Mallory has three options as to bundles.  This decision may be based on the source
      of how to
   proceed: not forward the bundle, forward the destination of the bundle, bundle as intended, or some other
      information related to the bundle.

   o  If an intermediate receiver has been configured to add a security-
      operation to a bundle, and
   forward the received bundle already has to one or more specific nodes within the
      security-operation applied, then network.

   Attacks that involve re-routing the receiver MUST understand what
      to do.  The receiver may discard packets throughout the bundle, discard network
   are essentially a special case of the security-
      target and associated BPSec blocks, replace modification attacks described
   in this section where the security-
      operation, or some other action.

   o  It attacker is recommended modifying fields within the
   primary block of the bundle.  Given that security operations only be applied to BPSec cannot encrypt the
      payload block,
   contents of the primary block, and any block-types specifically
      identified in the security policy.  If a BPA were alternate methods must be used to apply
      security operations
   prevent this situation.  These methods MAY include requiring BIBs for
   primary blocks, using encapsulation, or otherwise strategically
   manipulating primary block data.  The specifics of any such as integrity or confidentiality
   mitigation technique are specific to every
      block in the bundle, regardless implementation of the block type, there could be
      downstream errors processing blocks whose contents must
   deploying network and outside of the scope of this document.

   Furthermore, routing rules and policies may be
      inspected at every hop useful in enforcing
   particular traffic flows to prevent topology attacks.  While these
   rules and policies may utilize some features provided by BPSec, their
   definition is beyond the network path.

7.  Security Considerations

   Certain applications scope of DTN need this specification.

8.2.4.  Message Injection

   Mallory is also able to both sign generate new bundles and encrypt transmit them into
   the DTN at will.  These bundles may either be copies or slight
   modifications of previously-observed bundles (i.e., a message,
   and there are security issues replay attack)
   or entirely new bundles generated based on the Bundle Protocol,
   BPSec, or other bundle-related protocols.  With these attacks
   Mallory's objectives may vary, but may be targeting either the bundle
   protocol or application-layer protocols conveyed by the bundle
   protocol.

   BPSec relies on cipher suite capabilities to consider prevent replay or forged
   message attacks.  A BCB used with this.

   o  To provide an assurance that a security-target came from appropriate cryptographic
   mechanisms (e.g., a
      specific source counter-based cipher mode) may provide replay
   protection under certain circumstances.  Alternatively, application
   data itself may be augmented to include mechanisms to assert data
   uniqueness and has not been changed, then it should be signed protected with a BIB.

   o  To ensure that BIB, a security-target cannot be inspected during
      transit, it should be encrypted BCB, or both along with
   other block data.  In such a BCB.

   o  Adding a BIB to a security-target that has already been encrypted
      by a BCB is not allowed.  Therefore, we recommend three methods case, the receiving node would be able
   to
      add an integrity signature validate the uniqueness of the data.

9.  Ciphersuite Authorship Considerations

   Cipher suite developers or implementers should consider the diverse
   performance and conditions of networks on which the Bundle Protocol
   (and therefore BPSec) will operate.  Specifically, the delay and
   capacity of delay-tolerant networks can vary substantially.  Cipher
   suite developers should consider these conditions to an encrypted security-target.
      First, at better describe
   the time conditions when those suites will operate or exhibit
   vulnerability, and selection of encryption, an integrity signature may these suites for implementation
   should be
      generated and added made with consideration to the BCB for reality.  There are key
   differences that may limit the security-target as
      additional information opportunity to leverage existing
   cipher suites and technologies that have been developed for use in
   traditional, more reliable networks:

   o  Data Lifetime: Depending on the security-result field.  Second, the
      encrypted block may be replicated as a new block and integrity
      signed.  Third, an encapsulation scheme application environment, bundles
      may persist on the network for extended periods of time, perhaps
      even years.  Cryptographic algorithms should be applied selected to
      encapsulate ensure
      protection of data against attacks for a length of time reasonable
      for the security-target (or application.

   o  One-Way Traffic: Depending on the entire bundle) such application environment, it is
      possible that only a one-way connection may exist between two
      endpoints, or if a two-way connection does exist, the encapsulating structure is, itself, no longer round-trip
      time may be extremely large.  This may limit the security-
      target utility of
      session key generation mechanisms, such as Diffie-Hellman, as a BCB and
      two-way handshake may therefore not be feasible or reliable.

   o  Opportunistic Access: Depending on the security-target application environment, a
      given endpoint may not be guaranteed to be accessible within a
      certain amount of time.  This may make asymmetric cryptographic
      architectures which rely on a BIB.

8. key distribution center or other
      trust center impractical under certain conditions.

10.  Conformance

   All implementations are strongly RECOMMENDED to provide some method
   of hop-by-hop verification by generating a hash to some canonical
   form of the bundle and placing an integrity signature on that form
   using a BIB.

9.

11.  IANA Considerations

   This protocol has fields that have been registered by IANA.

9.1.

11.1.  Bundle Block Types

   This specification allocates three block types from the existing
   "Bundle Block Types" registry defined in [RFC6255] .

       Additional Entries for the Bundle Block-Type Codes Registry:

          +-------+-----------------------------+---------------+
          | Value |         Description         |   Reference   |
          +-------+-----------------------------+---------------+
          |   2   |    Block Integrity Block    | This document |
          |   3   | Block Confidentiality Block | This document |
          |   4   |          CMS Block          | This document |
          +-------+-----------------------------+---------------+

                                  Table 2

9.2.

11.2.  Cipher Suite Flags

   This protocol has a cipher suite flags field and certain flags are
   defined.  An IANA registry has been set up as follows.

   The registration policy for this registry is: Specification Required

   The Value range is: Variable Length
                        Cipher Suite Flag Registry:

   +--------------------------+-------------------------+--------------+
   |  Bit Position (right to  |       Description       |  Reference   |
   |          left)           |                         |              |
   +--------------------------+-------------------------+--------------+
   |            0             |  Block contains result  |     This     |
   |                          |                         |   document   |
   |            1             |      Block Contains     |     This     |
   |                          |        parameters       |   document   |
   |            2             |  Source EID ref present |     This     |
   |                          |                         |   document   |
   |            >3            |         Reserved        |     This     |
   |                          |                         |   document   |
   +--------------------------+-------------------------+--------------+

                                  Table 3

9.3.

11.3.  Parameters and Results

   This protocol has fields for cipher suite parameters and results.
   The field is a type-length-value triple and a registry is required
   for the "type" sub-field.  The values for "type" apply to both the
   cipher suite parameters and the cipher suite results fields.  Certain
   values are defined.  An IANA registry has been set up as follows.

   The registration policy for this registry is: Specification Required

   The Value range is: 8-bit unsigned integer.

            Cipher Suite Parameters and Results Type Registry:

       +---------+---------------------------------+---------------+

   +---------+-------------------------------------------+-------------+
   |  Value  |                Description                |  Reference  |
       +---------+---------------------------------+---------------+
   +---------+-------------------------------------------+-------------+
   |    0    |                  reserved                 | This document Section 3.7 |
   |    1    |         initialization vector (IV)        | This document Section 3.7 |
   |    2    |                  reserved                 | This document Section 3.7 |
   |    3    |              key-information              | This document Section 3.7 |
   |    4    | content-range (pair of SDNVs) Unsigned Integers) | This document Section 3.7 |
   |    5    |            integrity signature            | This document Section 3.7 |
   |    6    |                 unassigned                | This document Section 3.7 |
   |    7    |                    salt                   | This document Section 3.7 |
   |    8    |      BCB integrity check value (ICV)      | This document Section 3.7 |
   |  9-191  |                  reserved                 | This document Section 3.7 |
   | 192-250 |                private use                | This document Section 3.7 |
   | 251-255 |                  reserved                 | This document Section 3.7 |
       +---------+---------------------------------+---------------+
   +---------+-------------------------------------------+-------------+

                                  Table 4

10.

12.  References

10.1.

12.1.  Normative References

   [BPBIS]    Burleigh, S., Fall, K., and E. Birrane, "Bundle Protocol",
              draft-ietf-dtn-bpbis-03
              draft-ietf-dtn-bpbis-04 (work in progress), March July 2016.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC5652]  Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,

   [RFC3552]  Rescorla, E. and B. Korver, "Guidelines for Writing RFC
              Text on Security Considerations", BCP 72, RFC 5652, 3552,
              DOI 10.17487/RFC5652, September 2009,
              <http://www.rfc-editor.org/info/rfc5652>. 10.17487/RFC3552, July 2003,
              <http://www.rfc-editor.org/info/rfc3552>.

   [RFC6255]  Blanchet, M., "Delay-Tolerant Networking Bundle Protocol
              IANA Registries", RFC 6255, May 2011.

10.2.

12.2.  Informative References

   [BPBISCBOR]
              Burleigh, S., "Bundle Protocol CBOR Representation
              Specification", draft-burleigh-dtn-rs-cbor-01 (work in
              progress), April 2016.

   [RFC4838]  Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst,
              R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant
              Networking Architecture", RFC 4838, April 2007.

   [RFC6257]  Symington, S., Farrell, S., Weiss, H., and P. Lovell,
              "Bundle Security Protocol Specification", RFC 6257, May
              2011.

   [SBSP]     Birrane, E., "Streamlined Bundle Security Protocol",
              draft-birrane-dtn-sbsp-01 (work in progress), October
              2015.

Appendix A.  Acknowledgements

   The following participants contributed technical material, use cases,
   and useful thoughts on the overall approach to this security
   specification: Scott Burleigh of the Jet Propulsion Laboratory, Amy
   Alford and Angela Hennessy of the Laboratory for Telecommunications
   Sciences, and Angela Dalton and Cherita Corbett of the Johns Hopkins
   University Applied Physics Laboratory.

Authors' Addresses

   Edward J. Birrane, III
   The Johns Hopkins University Applied Physics Laboratory
   11100 Johns Hopkins Rd.
   Laurel, MD  20723
   US

   Phone: +1 443 778 7423
   Email: Edward.Birrane@jhuapl.edu

   Jeremy Pierce-Mayer
   INSYEN AG
   Muenchner Str. 20
   Oberpfaffenhofen, Bavaria  DE
   Germany

   Phone: +49 08153 28 2774
   Email: jeremy.mayer@insyen.com
   Dennis C. Iannicca
   NASA Glenn Research Center
   21000 Brookpark

   Kenneth McKeever
   The Johns Hopkins University Applied Physics Laboratory
   11100 Johns Hopkins Rd.
   Brook Park, OH  44135
   Laurel, MD  20723
   US

   Phone: +1-216-433-6493 +1 443 778 2237
   Email: dennis.c.iannicca@nasa.gov Ken.McKeever@jhuapl.edu