<?xml version="1.0" encoding="US-ASCII"?> encoding="UTF-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY RFC4838 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4838.xml"> nbsp    "&#160;">
  <!ENTITY RFC6257 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6257.xml"> zwsp   "&#8203;">
  <!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"> nbhy   "&#8209;">
  <!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC8949 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8949.xml">
<!ENTITY RFC6255 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6255.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"> wj     "&#8288;">
]>
<?rfc toc="yes"?>
<!-- generate a table of contents -->
<?rfc symrefs="yes"?>
<!-- use anchors instead of numbers for references -->
<?rfc sortrefs="yes" ?>
<!-- alphabetize the references -->
<?rfc compact="yes" ?>
<!-- conserve vertical whitespace -->
<?rfc subcompact="no" ?>
<!-- but keep a blank line between list items -->

<rfc category="std" xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-ietf-dtn-bpsec-27" number="9172" ipr="trust200902" obsoletes="" submissionType="IETF" category="std"
consensus="true" updates="" xml:lang="en"> xml:lang="en" tocInclude="true" symRefs="true"
sortRefs="true" version="3">

  <!-- xml2rfc v2v3conversion 3.6.0 -->
  <front>
    <title>Bundle Protocol Security Specification</title> (BPSec)</title>
    <seriesInfo name="RFC" value="9172"/>
    <author fullname="Edward J. Birrane, III" initials="E.J."
   surname="Birrane"> initials="E" surname="Birrane, III">
      <organization abbrev="JHU/APL">The Johns Hopkins University Applied
      Physics Laboratory</organization>
      <address>
        <postal>
          <street>11100 Johns Hopkins Rd.</street>
          <city>Laurel</city>
          <region>MD</region>
          <code>20723</code>
        <country>US</country>
          <country>United States of America</country>
        </postal>
        <phone>+1 443 778 7423</phone>
        <email>Edward.Birrane@jhuapl.edu</email>
      </address>
    </author>
    <author fullname="Kenneth McKeever" initials="K.R." initials="K" surname="McKeever">
      <organization abbrev="JHU/APL">The Johns Hopkins University Applied
      Physics Laboratory</organization>
      <address>
        <postal>
          <street>11100 Johns Hopkins Rd.</street>
          <city>Laurel</city>
          <region>MD</region>
          <code>20723</code>
        <country>US</country>
          <country>United States of America</country>
        </postal>
        <phone>+1 443 778 2237</phone>
        <email>Ken.McKeever@jhuapl.edu</email>
      </address>
    </author>
    <date month="February" day="15" year="2021"/>

<!-- Meta-data --> month="January" year="2022"/>

<area>General</area>
    <workgroup>Delay-Tolerant Networking</workgroup>
    <keyword>security</keyword>
    <keyword>bundle</keyword>
    <keyword>integrity</keyword>
    <keyword>confidentiality</keyword>
    <abstract>
      <t>
      This document defines a security protocol providing data
      integrity and confidentiality services for the Bundle Protocol. Protocol (BP).
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" title="Introduction" toc="default"> toc="default" numbered="true">
      <name>Introduction</name>
      <t>
      This document defines security features for the Bundle Protocol
      (BP) <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/> and is intended for use
      in Delay Tolerant Networks (DTNs) Delay-Tolerant Networking (DTN) to provide security
      services between a security source and a security acceptor. When the
      security source is the bundle source and when the security acceptor is
      the bundle destination, the security service provides end-to-end
      protection.
      </t>
      <t>
      The Bundle Protocol specification <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/>
      defines DTN as referring to "a networking network architecture providing
      communications in and/or through highly stressed environments"
      where "BP may be viewed as sitting at the application layer of some
      number of constituent networks, forming a store-carry-forward
      overlay network". The term "stressed" environment phrase "stressed environment" refers to multiple
      challenging conditions including intermittent connectivity, large
      and/or variable delays, asymmetric data rates, and high bit error
      rates.
      </t>
      <t>
   It should be presumed that the BP will be deployed such that the network cannot
      be trusted, posing in an untrusted
   network, which poses the usual security challenges
   related to confidentiality and integrity. However, the stressed nature of the BP
      operating environment imposes unique conditions where usual transport
      security mechanisms may not be sufficient. For example, the
      store-carry-forward nature of the network may require protecting
      data at rest, preventing unauthorized consumption of critical
      resources such as storage space, and operating without regular
      contact with a centralized security oracle (such as a certificate
      authority).
      </t>
      <t>
      An end-to-end security service is needed that operates in all of the
      environments where the BP operates. operates is needed.
      </t>
      <section anchor="sup_sec_svc" title="Supported numbered="true" toc="default">
        <name>Supported Security Services"> Services</name>
        <t>
         BPSec provides integrity and confidentiality
         services for BP bundles, as defined in this section.
        </t>
        <t>
         Integrity services ensure that changes to target data
         within a bundle can be discovered. Data changes
         may be caused by processing errors, environmental conditions,
         or intentional manipulation. In the context of BPSec, integrity
         services apply to plain text plaintext in the bundle.
        </t>
        <t>
         Confidentiality services ensure that target data is unintelligible
         to nodes in the DTN, except for authorized nodes possessing
         special information. This generally Generally, this means producing cipher text ciphertext from
         plain text
         plaintext and generating authentication information for that
         cipher text. Confidentiality, in
         ciphertext. In this context, confidentiality applies
         to the contents of target data and does not extend to hiding
         the fact that confidentiality exists in the bundle.
        </t>
        <t>
         NOTE: Hop-by-hop authentication is NOT a supported security service
         in this specification, for two reasons.
         <list style="numbers">
            <t> reasons:
        </t>
        <ol spacing="normal" type="1"><li>
               The term "hop-by-hop" is ambiguous in a BP overlay, as nodes
               that are adjacent in the overlay may not be adjacent in
               physical connectivity. This condition is difficult or
               impossible to detect and therefore detect; therefore, hop-by-hop authentication is
               difficult or impossible to enforce.
            </t>
            <t>
            </li>
          <li>
               Hop-by-hop authentication cannot be deployed in a network if adjacent
               nodes in the network have incompatible security capabilities.
            </t>
         </list>
      </t>
            </li>
        </ol>
      </section>
      <section title="Specification Scope"> numbered="true" toc="default">
        <name>Specification Scope</name>
        <t>
         This document defines the security services provided by the BPSec.
         This includes the data specification for representing these
         services as BP extension blocks, blocks and the rules for adding,
         removing, and processing these blocks at various points during
         the bundle's traversal of the DTN. a delay-tolerant network.
        </t>
        <t>
         BPSec addresses only the security of data traveling over the
         DTN, not the underlying DTN itself. Furthermore, while the BPSec
         protocol can provide security-at-rest in a store-carry-forward
         network, it does not address threats which that share computing resources
         with the DTN and/or BPSec software implementations.  These threats
         may be malicious software or compromised libraries which that intend
         to intercept data or recover cryptographic material. Here, it is
         the responsibility of the BPSec implementer to ensure that any
         cryptographic material, including shared secret secrets or private keys,
         is protected against access within both memory and storage devices.
        </t>
        <t>
         Completely trusted networks are extremely uncommon. Amongst Among
         untrusted networks, different networking conditions and
         operational considerations require varying strengths of security
         mechanism. mechanisms of
         varying strengths.
   Mandating a single security context context, which is a set of assumptions,
   algorithms, configurations, and policies used to implement security
   services, may result in too much security for some networks and too
   little security in others. It is expected that separate
         documents define different security contexts for use in different networks.
         A set of default Default security contexts are
   defined in (<xref target="I-D.ietf-dtn-bpsec-default-sc"/>)
         and <xref target="RFC9173" format="default"/> to provide basic security services for
   interoperability testing and for operational use on the terrestrial
   Internet. It is expected that separate documents will define
   different security contexts for use in different networks.
        </t>
        <t>
         This specification addresses neither the fitness of
         externally-defined
         externally defined cryptographic methods nor the security of
         their implementation.
        </t>
        <t>
         This specification does not address the implementation of
         security policy policies and does not provide a security policy for the
         BPSec.  Similar to cipher suites, security policies are based on
         the nature and capabilities of individual networks and network
         operational concepts. This specification does provide policy considerations that
         can be taken into account when building a security policy.
        </t>
        <t>
         With the exception of the Bundle Protocol, 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.
        </t>
      </section>
      <section anchor="reldoc" title="Related Documents" toc="default"> toc="default" numbered="true">
        <name>Related Documents</name>
        <t>
         This document is best read and understood within the context of
         the following other DTN documents:
        </t>

      <t>
         "Delay-Tolerant Networking Architecture"
        <ul>
         <li>"<xref target="RFC4838" format="title"/>" <xref target="RFC4838"/> target="RFC4838" format="default"/>
         defines the architecture for DTNs DTN and identifies certain security
         assumptions made by existing Internet protocols that are not valid in
         a
         DTN.
      </t>

      <t>
         The Bundle Protocol
        </li>
        <li>
         "<xref target="RFC9171" format="title"/>" <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/> defines
         the format and processing of bundles, defines the extension
         block format used to represent BPSec security blocks, and defines
         the canonical block structure used by this specification.
      </t>

      <t>
         The Concise Binary Object Representation (CBOR) format
        </li>
        <li>
         "<xref target="RFC8949" format="title"/>" <xref target="RFC8949"/> target="RFC8949" format="default"/>
         defines a data format that allows for small code size, fairly small
         message size, and extensibility  without version negotiation. The
         block-specific-data
         block-type-specific data associated with BPSec security blocks are is encoded
         in this data format.
      </t>

      <t>
         The Bundle Security Protocol <xref target="RFC6257"/> and
         Streamlined Bundle Security Protocol
         <xref target="I-D.birrane-dtn-sbsp"/> documents introduced
        </li>
        <li>
         "<xref target="RFC6257" format="title"/>" <xref target="RFC6257" format="default"/>
         introduces the
         concepts
         concept of using BP extension blocks for security services
         in a DTN. The BPSec is a continuation and refinement of these
         documents.
      </t> this
         document.
        </li>
	</ul>
      </section>
      <section anchor="term" title="Terminology" toc="default"> toc="default" numbered="true">
        <name>Terminology</name>
        <t>
         The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
         NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
         "MAY", "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
         NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
         "<bcp14>MAY</bcp14>", and "OPTIONAL" "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
         described in BCP 14 BCP&nbsp;14 <xref target="RFC2119"/> target="RFC2119" format="default"/> <xref target="RFC8174"/> target="RFC8174" format="default"/> when, and only when, they
         appear in all capitals, as shown here.
        </t>
        <t>
         This section defines terminology that either is unique to the BPSec or
         otherwise
         is necessary for understanding the concepts defined in
         this specification.

         <list style="symbols">

            <t>

        </t>
        <dl spacing="normal">
          <dt>Bundle Destination:</dt><dd>the Bundle Destination - the node which Protocol Agent (BPA)
          that receives a bundle and delivers the payload of the bundle
          to an application. Application Agent.  Also, an endpoint comprising the Node ID of
               the Bundle Protocol Agent (BPA) receiving
          node(s) at which the bundle. bundle is to be delivered. The bundle
          destination acts as the security acceptor for every security
          target in every security block in every bundle it receives.
            </t>

            <t>
               Bundle Source - the node which
            </dd>
          <dt>Bundle Source:</dt><dd>the BPA that originates a
          bundle. Also, the
               Node any node ID of the BPA originating node of which the bundle.
            </t>

            <t>
               Cipher Suite - BPA is a
          component.
            </dd>
          <dt>Cipher Suite:</dt><dd>a set of one or more algorithms
          providing integrity and/or confidentiality services. Cipher
          suites may define user parameters (e.g. (e.g., secret keys to use)
          use), but they do not provide values for those parameters.
            </t>

            <t>
               Forwarder - any node
            </dd>
          <dt>Forwarder:</dt><dd>any BPA that transmits a bundle in the
          DTN. Also, the Node any node ID of the node of which the BPA that
          sent the bundle on its most recent hop.
            </t>

            <t>
               Intermediate hop is a component.
            </dd>
          <dt>Intermediate Receiver, Waypoint, or Next Hop - any node
          Hop:</dt><dd>any BPA that receives a bundle from a Forwarder
          forwarder that is not the
               Bundle Destination. bundle destination. Also, the Node any node
          ID of the BPA at any such node.
            </t>

            <t>
               Path - node of which the BPA is a component.
            </dd>
          <dt>Path:</dt><dd>the ordered sequence of nodes through
          which a bundle passes on its way from Source source to Destination.
          destination. The path is not necessarily known in advance by
          the bundle or any BPAs in the DTN.
            </t>

            <t>
               Security Acceptor - a bundle node
            </dd>
          <dt>Security Acceptor:</dt><dd>a BPA that processes
          and dispositions one or more security blocks in a bundle.
          Security acceptors act as the endpoint of a security service
          represented in a security block. They remove the security
          blocks they act upon as part of processing and disposition.
          Also, the Node any node ID of that node.
            </t>

            <t>
               Security Block - the node of which the BPA is a component.
            </dd>
          <dt>Security Block:</dt><dd>a BPSec extension block in a
          bundle.
            </t>

            <t>
               Security Context - the
            </dd>
          <dt>Security Context:</dt><dd>the set of assumptions,
          algorithms,
               configurations configurations, and policies used to implement
          security services.
            </t>

            <t>
               Security Operation - the
            </dd>
          <dt>Security Operation:</dt><dd>the application of a given
          security service to a security target, notated as
          OP(security service, security target). For example,
          OP(bcb-confidentiality, payload).  Every security operation
          in a bundle MUST <bcp14>MUST</bcp14> be unique, meaning that a
          given security service can only be applied to a security
          target once in a bundle. A security operation is implemented
          by a security block.
            </t>

            <t>
               Security Service - a
            </dd>
          <dt>Security Service:</dt><dd>a process that gives some
          protection to a security target. For example, this
          specification defines security services for plain text plaintext
          integrity (bib-integrity), (bib-integrity) and authenticated
               plain text plaintext
          confidentiality with additional authenticated data
          (bcb-confidentiality).
            </t>

            <t>
               Security Source - a bundle node
            </dd>
          <dt>Security Source:</dt><dd>a BPA that adds a
          security block to a bundle. Also, the Node any node ID of that node.
            </t>

            <t>
               Security Target - the node
          of which the BPA is a component.
            </dd>
          <dt>Security Target:</dt><dd>the block within a bundle that
          receives a security service as part of a security operation.
            </t>

            <t>
               Security Verifier - a bundle node
             </dd>
          <dt>Security Verifier:</dt><dd>a BPA that verifies
          the correctness data integrity of one or more security blocks in a bundle.
          Unlike security acceptors, security verifiers do not act as
          the endpoint of a security service service, and they do not remove
          verified security blocks. Also, the Node any node ID of that node.
            </t>

         </list>
      </t> the node of
          which the BPA is a component.
            </dd>
        </dl>
      </section>
    </section>
    <section title="Design Decisions"> numbered="true" toc="default">
      <name>Design Decisions</name>
      <t>
      The application of security services in a DTN is a complex endeavor
      that must consider physical properties of the network (such as connectivity and
      propagation times), policies at
      each node, application security requirements, and current and future
      threat environments. This section
      identifies those desirable properties that guide design decisions for
      this specification and that are necessary for understanding the format and
      behavior of the BPSec protocol.
      </t>
      <section title="Block-Level Granularity"> numbered="true" toc="default">
        <name>Block-Level Granularity</name>
        <t>
         Security services within this specification must allow different
         blocks within a bundle to have different security services
         applied to them.
        </t>
        <t>
         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, payload or that
         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 represent different
         types of information with different security needs.
        </t>
        <t>
         For example, a payload block might be encrypted to
         protect its contents and an extension block containing
         summary information related to the payload might be integrity
         signed but unencrypted to provide waypoints access
         to payload-related data without providing access to the payload.
        </t>
      </section>
      <section title="Multiple numbered="true" toc="default">
        <name>Multiple Security Sources"> Sources</name>
        <t>
         A bundle can have multiple security blocks blocks, and these blocks can
         have different security sources. BPSec implementations MUST
         NOT <bcp14>MUST
         NOT</bcp14> assume that all blocks in a bundle have the same security
         operations applied to them.
        </t>
        <t>
         The Bundle Protocol allows extension blocks to be added to a bundle
         at any time during its existence in the DTN. When a waypoint
         adds a new extension block to a bundle, that extension block
         MAY
         <bcp14>MAY</bcp14> have security services applied to it by that waypoint. Similarly,
         a waypoint MAY <bcp14>MAY</bcp14> add a security service to an existing
         block, consistent with its security policy.
        </t>
        <t>
         When a waypoint adds a security service to the bundle, the waypoint
         is the security source for that service. The security block(s)
         which
         that represent that service in the bundle may need to record this
         security source source, as the bundle destination might need this information
         for processing.
        </t>
        <t>
         For example, a bundle source may choose to apply an integrity service
         to its plain text plaintext payload. Later a waypoint node, representing a
         gateway to another portion of the DTN, delay-tolerant network, may receive the bundle and
         choose to apply a confidentiality service. In this case, the
         integrity security source is the bundle source and the
         confidentiality security source is the waypoint node.
        </t>
        <t>
         In cases where the security source and security acceptor are not the
         bundle source and bundle destination, respectively, it is possible that the bundle
         will reach the bundle destination prior to reaching a security
         acceptor. In cases where this may be a practical problem, it is
         recommended that solutions such as bundle encapsulation can be
         used to ensure that a bundle be delivered to a security acceptor
         prior to being delivered to the bundle destination. Generally,
         if a bundle reaches a waypoint that has the appropriate configuration
         and policy to act as a security acceptor for a security service in
         the bundle, then the waypoint should act as that security acceptor.
        </t>
      </section>
      <section title="Mixed numbered="true" toc="default">
        <name>Mixed Security Policy"> Policy</name>
        <t>
         The security policy enforced by nodes in the DTN delay-tolerant network may differ.
        </t>
        <t>
   Some waypoints will have security policies that require
         evaluating the waypoint
   to evaluate security services even if they are not the waypoint is neither the
   bundle destination or nor the final intended acceptor of the service.
         For example, a waypoint could choose to
         verify an integrity service even though the waypoint is not
         the bundle destination and the integrity service will be needed
         by other nodes along the bundle's path.
        </t>
        <t>
         Some waypoints will determine, through policy, that they are the
         intended recipient of the security service and will terminate the
         security service in the bundle.  For example, a gateway node could
         determine that, even though it is not the destination of the bundle,
         it should verify and remove a particular integrity service or
         attempt to decrypt a confidentiality service, before forwarding the
         bundle along its path.
        </t>
        <t>
         Some waypoints could understand security blocks but refuse to
         process them unless they are the bundle destination.
        </t>
      </section>
      <section title="User-Defined numbered="true" toc="default">
        <name>User-Defined Security Contexts"> Contexts</name>
        <t>
         A security context is the union of security algorithms (cipher
         suites), policies associated with the use set of those assumptions, algorithms, configurations,
      and
         configuration values. policies used to implement security services. Different contexts may specify different
         algorithms, different polices, or different configuration values used
         in the implementation of their security services. BPSec provides
         a mechanism to define security contexts. Users may select from
         registered security contexts and customize those contexts through
         security context parameters.
        </t>
        <t>
         For example, some users might prefer a
         SHA2 hash function for integrity integrity, whereas other users might prefer a
         SHA3 hash function. Providing either separate security contexts or a single,
         parameterized security context allows users flexibility in applying
         the desired cipher suite, policy, and configuration when populating
         a security block.
        </t>
      </section>
      <section title="Deterministic Processing"> numbered="true" toc="default">
        <name>Deterministic Processing</name>
        <t>
         Whenever a node determines that it must process more than one
         security block in a received bundle (either because the policy
         at a waypoint states that it should process security blocks or
         because the node is the bundle destination) destination), the order in which
         security blocks are processed must be deterministic. All nodes
         must impose this same deterministic processing order for all
         security blocks. This specification provides
         determinism in the application and evaluation of security
         services, even when doing so results in a loss of flexibility.
        </t>
      </section>
    </section>
    <section anchor="sec_blocks" title="Security Blocks"> numbered="true" toc="default">
      <name>Security Blocks</name>
      <section anchor="sec_blocks_def" title="Block Definitions"> numbered="true" toc="default">
        <name>Block Definitions</name>
        <t>
         This specification defines two types of security block: the Block
         Integrity Block (BIB) and the Block Confidentiality Block (BCB).

         <list>
            <t>

        </t>
        <ul spacing="normal">
          <li>
               The BIB is used to ensure the integrity of its plain text plaintext
               security target(s). The integrity information in the BIB MAY <bcp14>MAY</bcp14> be
               verified by any node along the bundle path from the BIB
               security source to the bundle destination. Waypoints add or remove BIBs from bundles in accordance with
               their security policy. BIBs are never used for integrity protection
               of the cipher text ciphertext provided by a BCB. Because security policy at
               BPSec nodes may differ regarding integrity verification, BIBs do not
               guarantee hop-by-hop authentication, as discussed in <xref target="sup_sec_svc"/>.
            </t>

            <t> target="sup_sec_svc" format="default"/>.
            </li>
          <li>
               The BCB indicates that the security target(s) target or targets have been
               encrypted at the BCB security source in order to protect their
               content while in transit. The As a matter of security policy, the BCB is decrypted by security acceptor
               nodes in the network, up to and including the bundle
               destination, as a matter of security policy.
               destination. BCBs additionally
               provide integrity protection integrity-protection mechanisms for the cipher text ciphertext they
               generate.
            </t>
         </list>
      </t>
            </li>
        </ul>
      </section>
      <section anchor="sec_blocks_uni" title="Uniqueness" toc="default"> toc="default" numbered="true">
        <name>Uniqueness</name>
        <t>
         Security operations in a bundle MUST <bcp14>MUST</bcp14> be unique; the same security
         service MUST NOT <bcp14>MUST NOT</bcp14> be applied to a security target more than once in a
         bundle. Since a security operation is represented by a security
         block, this means that multiple security blocks of the same type cannot
         share the same security targets. A new security block MUST NOT <bcp14>MUST NOT</bcp14> be added
         to a bundle if a pre-existing preexisting security block of the same type is
         already defined for the security target of the new security block.
        </t>
        <t>
         This uniqueness requirement ensures that there is no ambiguity related
         to the order in which security blocks are processed or how security policy
         can be specified to require certain security services be present in a
         bundle.
        </t>
        <t>
         Using the notation OP(service, target), several examples illustrate
         this uniqueness requirement.

         <list style="symbols">
            <t>
               Signing

        </t>
        <dl spacing="normal">
          <dt>Signing the payload twice: The twice:</dt><dd>The two operations OP(bib-integrity,
               payload) and OP(bib-integrity, payload) are redundant and MUST NOT <bcp14>MUST NOT</bcp14>
               both be present in the same bundle at the same time.
            </t>

            <t>
               Signing
            </dd>
          <dt>Signing different blocks: The blocks:</dt><dd>The two operations
          OP(bib-integrity, payload) and OP(bib-integrity,
          extension_block_1) are not redundant and both may be present
          in the same bundle at the same time.  Similarly, the two
          operations OP(bib-integrity, extension_block_1) and
          OP(bib-integrity, extension_block_2) are also not redundant
          and may both be present in the bundle at the same time.
            </t>
            <t>
               Different Services
            </dd>
          <dt>Different services on same block: The block:</dt><dd>The two
          operations OP(bib-integrity, payload) and
          OP(bcb-confidentiality, payload) are not inherently
          redundant and may both be present in the bundle at the same
          time, pursuant to other processing rules in this
          specification.
            </t>
            <t>
               Different
            </dd>
          <dt>Different services from different block types: The
          types:</dt><dd>The notation OP(service, target) refers
          specifically to a security block, as the security block is
          the embodiment of a security service applied to a security
          target in a bundle. Were some Other Security Block (OSB) to
          be defined providing an integrity service, then the
          operations OP(bib-integrity, target) and OP(osb-integrity,
          target) MAY <bcp14>MAY</bcp14> both be present in the same
          bundle if so allowed by the definition of the OSB, as
          discussed in <xref target="Extensions"/>.
            </t>
         </list>
      </t> target="Extensions" format="default"/>.
            </dd>
        </dl>
        <t>
         NOTES:
         <list style="bullets">
            <t>
        </t>
        <ul spacing="normal">
          <li>
               A security block may be removed from a bundle as part
               of security processing at a waypoint node with a new
               security block being added to the bundle by that
               node. In this case, conflicting security blocks never co-exist
               coexist in the bundle at the same time and the
               uniqueness requirement is not violated.
            </t>

            <t>
            </li>
          <li>
               A cipher text integrity ciphertext integrity-protection mechanism (such as associated
               authenticated data) calculated by a cipher suite and
               transported in a BCB is considered part of the
               confidentiality
               service and, service; therefore, it is unique from the plain text
               plaintext integrity service provided by a BIB.
            </t>

            <t>
            </li>
          <li>
               The security blocks defined in this specification (BIB
               and BCB) are designed with the intention that the BPA
               adding these blocks is the authoritative source of the
               security service. If a BPA adds a BIB on a security
               target, then the BIB is expected to be the
               authoritative source of integrity for that security
               target. If a BPA adds a BCB to a security target, then
               the BCB is expected to be the authoritative source of
               confidentiality for that security target. More complex
               scenarios, such as having multiple nodes in a network
               sign the same security target, can be accommodated
               using the definition of custom security contexts
               (<xref target="sec_ctx"/>) (see <xref
               target="sec_ctx" format="default"/>) and/or the
               definition of other security blocks (<xref target="Extensions"/>).
            </t>

         </list>

      </t> OSBs (see <xref
               target="Extensions" format="default"/>).
            </li>
        </ul>
      </section>
      <section anchor="sec_blocks_mult" title="Target Multiplicity" toc="default"> toc="default" numbered="true">
        <name>Target Multiplicity</name>
        <t>
         A single security block MAY <bcp14>MAY</bcp14> represent
         multiple security operations as a way of reducing the overall number
         of security blocks present in a bundle.  In these circumstances,
         reducing the number of security blocks in the bundle reduces the
         amount of redundant information in the bundle.
        </t>
        <t>
         A set of security operations can be represented by a single security
         block when all of the following conditions are true.

         <list style="symbols">
            <t>

        </t>
        <ul spacing="normal">
          <li>
               The security operations apply the same security service. For
               example, they are all integrity operations or all
               confidentiality operations.
            </t>
            <t>
            </li>
          <li>
               The security context parameters for the
               security operations are identical.
            </t>
            <t>
            </li>
          <li>
               The security source for the security operations is the same,
               meaning the set of operations are being added by the
               same node.
            </t>
            <t>
            </li>
          <li>
               No security operations have the same security target, as that
               would violate the need for security operations to be unique.
            </t>
            <t>
            </li>
          <li>
               None of the security operations conflict with security
               operations already present in the bundle.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <t>
         When representing multiple security operations in a single security
         block, the information that is common across all operations is
         represented once in the security block, and block; the information which that is
         different (e.g., the security targets) are is represented individually.
        </t>
        <t>
         It is RECOMMENDED that if
         If a node processes any security operation in a security block block, it is <bcp14>RECOMMENDED</bcp14> that it process all
         security operations in the security block. This allows
         security sources to assert that the set of security
         operations in a security block are expected to be processed
         by the same security acceptor. However, the determination of
         whether a node actually is a security acceptor or not is a
         matter of the policy of the node itself. In cases where a
         receiving node determines that it is the security acceptor of
         only a subset of the security operations in a security block,
         the node may choose to only process that subset of security
         operations.
        </t>
      </section>
      <section anchor="sec_blocks_tgtid" title="Target Identification"> numbered="true" toc="default">
        <name>Target Identification</name>
        <t>
         A security target is a block in the bundle to which a security
         service applies. This target must be uniquely and unambiguously
         identifiable when processing a security block. The definition of the
         extension block header from <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/>
         provides a "Block Number" "block number" field suitable for this purpose. Therefore,
         a security target in a security block MUST <bcp14>MUST</bcp14> be represented as the
         Block Number
         block number of the target block.
        </t>
      </section>
      <section anchor="sec_blocks_rep" title="Block Representation" toc="default"> toc="default" numbered="true">
        <name>Block Representation</name>
        <t>
         Each security block uses the Canonical Bundle Block Format as
         defined in <xref target="I-D.ietf-dtn-bpbis"/>. target="RFC9171" format="default"/>. That is, each
         security block is comprised of the following elements:

         <list style="symbols">
            <t>block

        </t>
        <ul spacing="compact">
          <li>block type code</t>
            <t>block code</li>
          <li>block number </t>
            <t>block </li>
          <li>block processing control flags</t>
            <t>CRC type</t>
            <t>block-type-specific-data</t>
            <t>CRC flags</li>
          <li>cyclic redundancy check (CRC) type</li>
          <li>block-type-specific data</li>
          <li>CRC field (if present)</t>
         </list>
      </t> present)</li>
        </ul>
        <t>
         Security-specific information for a security block is captured in the
         block-type-specific-data
         block-type-specific data field.
        </t>
      </section>
      <section anchor="sec_blocks_asb" title="Abstract numbered="true" toc="default">
        <name>Abstract Security Block"> Block</name>
        <t>
         The structure of the security-specific portions of a security block
         is identical for both the BIB and BCB Block Types. block types. Therefore, this
         section defines an Abstract Security Block (ASB) data structure and
         discusses the its definition, its processing, and other constraints for using
         this structure. An ASB is never directly instantiated within a
         bundle, it is only a mechanism for discussing the common aspects of
         BIB and BCB security blocks.
        </t>
        <t>
         The fields of the ASB SHALL <bcp14>SHALL</bcp14> be as follows,
         listed in the order in which they must appear. The encoding
         of these fields MUST <bcp14>MUST</bcp14> be in accordance with the
         canonical forms provided in <xref target="CanonBundle"/>.

         <list style="hanging" hangIndent="6">

            <t hangText="Security Targets:"> <vspace/> target="CanonBundle"
         format="default"/>.

        </t>
        <dl newline="true" spacing="normal" indent="6">
          <dt>Security Targets:</dt>
          <dd>
               This field identifies the block(s) targeted by the
               security operation(s) represented by this security
               block. Each target block is represented by its unique Block Number.
               block number. This field
               SHALL <bcp14>SHALL</bcp14> be
               represented by a CBOR Concise Binary Object Representation
               (CBOR) array of data items. Each target within this
               CBOR array SHALL <bcp14>SHALL</bcp14> be represented by a
               CBOR unsigned integer. This array MUST <bcp14>MUST</bcp14>
               have at least 1 one entry and each entry
               MUST
               <bcp14>MUST</bcp14> represent the Block Number block number of a
               block that exists in the bundle. There MUST NOT <bcp14>MUST
               NOT</bcp14> be duplicate entries in this array. The
               order of elements in this list has no semantic meaning
               outside of the context of this block. Within the block,
               the ordering of targets must match the ordering of
               results associated with these targets.
            </t>

            <t hangText="Security
            </dd>
          <dt>Security Context Id:"> <vspace/> Id:</dt>
          <dd>
               This field identifies the security context used to
               implement the security service represented by this
               block and applied to each security target. This field SHALL
               <bcp14>SHALL</bcp14> be represented by a CBOR unsigned
               integer. The values for this Id should come from the
               registry defined in <xref target="SecCtx"/>
            </t>

            <t hangText="Security target="SecCtx"
               format="default"/>.
          </dd>
          <dt>Security Context Flags:"> <vspace/> Flags:</dt>
          <dd>
            <t>
               This field identifies which optional fields are present
               in the security block. This field SHALL <bcp14>SHALL</bcp14>
               be represented as a CBOR unsigned integer whose
               contents shall be interpreted as a bit field. Each bit
               in this bit field indicates the presence (bit set to 1)
               or absence (bit set to 0) of optional data in the
               security block. The association of bits to security
               block data is defined as follows.

               <list style="hanging" hangIndent="7">
                  <t hangText="Bit 0">

            </t>
            <dl newline="false" spacing="normal" indent="10">
              <dt>Bit 0</dt>
              <dd> (the least-significant bit, 0x01): Security Context
                     Parameters Present Flag. </t>
                  <t hangText="Bit >0">Reserved </t>
               </list> "Security context
                     parameters present" flag. </dd>
              <dt>Bit &gt;0</dt>
              <dd>Reserved </dd>
            </dl>
            <t>

               Implementations MUST <bcp14>MUST</bcp14> set reserved bits
               to 0 when writing this field and MUST <bcp14>MUST</bcp14>
               ignore the values of reserved bits when reading this
               field.  For unreserved bits, a value of 1 indicates
               that the associated security block field MUST
               <bcp14>MUST</bcp14> be included in the security
               block. A value of 0 indicates that the associated
               security block field
               MUST NOT <bcp14>MUST NOT</bcp14> be in the
               security block.
            </t>

            <t hangText="Security Source:"> <vspace/>
          </dd>
          <dt>Security Source:</dt>
          <dd>
               This field identifies the Endpoint BPA that inserted the security block
               in the bundle. Also, any node ID of the node of which the BPA
               is a component.  This field SHALL <bcp14>SHALL</bcp14> be
               represented by a CBOR array in accordance with
               <xref target="I-D.ietf-dtn-bpbis"/> the rules in
               <xref target="RFC9171" format="default"/> for
               representing Endpoint Identifiers endpoint IDs (EIDs).
            </t>

            <t hangText="Security
            </dd>
          <dt>Security Context Parameters (Optional):"> <vspace/> (Optional):</dt>
          <dd>
            <t>
               This field captures one or more security context parameters
               that should be used when processing
               the security service described by this security block. This
               field SHALL <bcp14>SHALL</bcp14> be represented by a CBOR array.  Each entry in this
               array is a single security context parameter.  A single
               parameter SHALL <bcp14>SHALL</bcp14> also be represented as a CBOR array comprising
               a 2-tuple of the id Id and value of the parameter, as follows.

               <list style="symbols">
                  <t>
                     Parameter Id. This

            </t>
            <dl spacing="normal">
              <dt>Parameter Id:</dt><dd>This field identifies which
                     parameter is being specified. This field SHALL <bcp14>SHALL</bcp14> be
                     represented as a CBOR unsigned integer.  Parameter Ids
                     are selected as described in <xref target="parmresult"/>.
                  </t>
                  <t>
                     Parameter Value.  This target="parmresult" format="default"/>.
                  </dd>
              <dt>Parameter Value:</dt><dd>This field captures the value
                     associated with this parameter. This field SHALL <bcp14>SHALL</bcp14> be
                     represented by the applicable CBOR representation of the
                     parameter, in accordance with <xref target="parmresult"/>.
                  </t>
               </list>
               <vspace/><vspace/> target="parmresult" format="default"/>.
                  </dd>
            </dl>
            <t>

               The logical layout of the parameters array is
               illustrated in <xref target="parms_tbl"/>. target="parms_tbl" format="default"/>.

            </t>
            <figure anchor="parms_tbl" title="Security anchor="parms_tbl">
              <name>Security Context Parameters"> Parameters</name>
              <artwork align="center">&#xA;<!--
                     -->+----------------+----------------+     +----------------+&#xA;<!--
                     -->| align="center" name="" type="" alt="">
+----------------+----------------+     +----------------+
|  Parameter 1   |  Parameter 2   | ... |  Parameter N   |&#xA;<!--
                     -->+------+---------+------+---------+     +------+---------+&#xA;<!--
                     -->|   |
+------+---------+------+---------+     +------+---------+
|  Id  |  Value  |  Id  |  Value  |     |  Id  |  Value  |&#xA;<!--
                     -->+------+---------+------+---------+     +------+---------+
                  </artwork>  |
+------+---------+------+---------+     +------+---------+</artwork>
            </figure>
            </t>

            <t hangText="Security Results:"> <vspace/>
          </dd>

          <dt>Security Results:</dt>
          <dd>
            <t>
               This field captures the results of applying a security service
               to the security targets of the security block. This field SHALL <bcp14>SHALL</bcp14>
               be represented as a CBOR array of target results. Each entry in
               this array represents the set of security results for a
               specific security target. The target results MUST <bcp14>MUST</bcp14> be ordered
               identically to the Security Targets field of the security block.
               This means that the first set of target results in this array
               corresponds to the first entry in the Security Targets field of
               the security block, and so on. There MUST <bcp14>MUST</bcp14> be one entry in this
               array for each entry in the Security Targets field of the
               security block.
               <vspace/> <vspace/>
            </t>
            <t>
               The set of security results for a target is also represented as
               a CBOR array of individual results. An individual result is
               represented as a CBOR array comprising a 2-tuple of a result id Id and a result value,
               defined as follows.

               <list style="symbols">
                  <t>
                     Result Id. This

            </t>
            <dl spacing="normal">
              <dt>Result Id:</dt><dd>This field identifies which security result is
                     being specified. Some security results capture the
                     primary output of a cipher suite. Other security results
                     contain additional annotative information from cipher
                     suite processing. This field SHALL <bcp14>SHALL</bcp14> be represented as a
                     CBOR unsigned integer.  Security result Ids will be as
                     specified in <xref target="parmresult"/>.
                  </t>
                  <t>
                     Result Value.  This target="parmresult" format="default"/>.
                  </dd>
              <dt>Result Value:</dt><dd>This field captures the value associated
                     with the result. This field SHALL <bcp14>SHALL</bcp14> be represented by the
                     applicable CBOR representation of the result value, in
                     accordance with <xref target="parmresult"/>.
                  </t>
               </list> target="parmresult" format="default"/>.
                  </dd>
            </dl>
            <t>

               The logical layout of the security results array is illustrated
               in <xref target="res_tbl"/>. target="res_tbl" format="default"/>. In this figure figure, there are N
               security targets for this security block. The first security
               target contains M results and the Nth security target contains
               K results.

            </t>
            <figure anchor="res_tbl" title="Security Results"> anchor="res_tbl">
              <name>Security Results</name>
              <artwork align="center">&#xA;<!--
                     -->+------------------------------+     +------------------------------+&#xA;<!--
                     -->| align="center" name="" type="" alt="">
+--------------------------+     +---------------------------+
|          Target 1        |     |         Target N           |&#xA;<!--
                     -->+------------+----+------------+     +------------------------------+&#xA;<!--
                     -->|          |
+----------+----+----------+     +---------------------------+
| Result 1 |    | Result M | ... | Result 1 |    |  Result K  |&#xA;<!--
                     -->+----+-------+ |
+----+-----+ .. +----+-------+     +----+-------+ +----+-----+     +---+------+ .. +----+-------+&#xA;<!--
                     -->| Id | Value | +----+------+
| Id | Value | |Value|    | Id |Value|     | Value | Id |Value|    | Id | Value |&#xA;<!--
                     -->+----+-------+    +----+-------+     +----+-------+    +----+-------+
                  </artwork> Value|
+----+-----+    +----+-----+     +----+-----+    +----+------+</artwork>
            </figure>
            </t>
         </list>
      </t>
          </dd>
        </dl>
      </section>
      <section anchor="BIB" title="Block toc="default" numbered="true">
        <name>Block Integrity Block" toc="default"> Block</name>
        <t>
         A BIB is a bundle BP extension block with the following characteristics.

         <list>
            <t>

        </t>
        <ul spacing="normal">
          <li>
               The Block Type Code block type code value is as specified in
               <xref target="BlockType"/>.
            </t>

            <t> target="BlockType" format="default"/>.
            </li>
          <li>
               The block-type-specific-data block-type-specific data field follows the structure of the
               ASB.
            </t>

            <t>
            </li>
          <li>
               A security target listed in the Security Targets field MUST NOT <bcp14>MUST NOT</bcp14>
               reference a security block defined in this specification (e.g.,
               a BIB or a BCB).
            </t>

            <t>
            </li>
          <li>
               The Security Context MUST security context <bcp14>MUST</bcp14> utilize an authentication mechanism or
               an error detection mechanism.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <t>
         Notes:
         <list style="symbols">
            <t>
        </t>
        <ul spacing="normal">
          <li>
               Designers SHOULD <bcp14>SHOULD</bcp14> 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.
            </t>

            <t>
            </li>
          <li>
               Since OP(bib-integrity, target) is allowed only once in a bundle
               per target, it is RECOMMENDED <bcp14>RECOMMENDED</bcp14> that users wishing to support
               multiple integrity integrity-protection mechanisms for the same target define a
               multi-result security context. Such a context could generate
               multiple security results for the same security target using different
               integrity-protection mechanisms or different configurations for the
               same integrity-protection mechanism.
            </t>

            <t>
            </li>
          <li>
               A BIB is used to verify the plain text plaintext integrity of its security
               target. However, a single BIB MAY <bcp14>MAY</bcp14> include security results for
               blocks other than its security target when doing so establishes a
               needed relationship between the BIB security target and other blocks
               in the bundle (such as the primary block).
            </t>

            <t>
            </li>
          <li>
               Security information MAY <bcp14>MAY</bcp14> be checked at any hop on the
               way to the bundle destination that has access to the required keying
               information, in accordance with <xref target="interact"/>.
            </t>

         </list>
      </t> target="interact" format="default"/>.
            </li>
        </ul>
      </section>
      <section anchor="BCB" title="Block toc="default" numbered="true">
        <name>Block Confidentiality Block" toc="default"> Block</name>
        <t>
         A BCB is a bundle BP extension block with the following characteristics.

         <list>
            <t>

        </t>
        <ul spacing="normal">
          <li>
               The Block Type Code block type code value is as specified in
               <xref target="BlockType"/>.
            </t>
            <t> target="BlockType" format="default"/>.
            </li>
            <li><t>
               The Block Processing Control block processing control flags value can be set to
               whatever values are required by local policy with the
               following exceptions.
               BCB blocks MUST exceptions: </t>
<ul>
               <li>
               BCBs <bcp14>MUST</bcp14>
               have the "block "Block must be replicated in every fragment"
               flag set if one of the targets is the payload
               block. Having that BCB in each fragment indicates to a
               receiving node that the payload portion of each
               fragment represents cipher text. BCB blocks MUST NOT ciphertext. </li>
              <li>
              BCBs <bcp14>MUST
               NOT</bcp14> have the "block "Block must be removed from bundle
               if it can't be processed" flag set. Removing a BCB from
               a bundle without decrypting its security targets
               removes information from the bundle necessary for their
               later decryption.
            </t>

            <t>
            </li>
          </ul>
          </li>
          <li>
               The block-type-specific-data block-type-specific data fields follow the structure of the
               ASB.
            </t>

            <t>
            </li>
          <li>
               A security target listed in the Security Targets field
               can reference the payload block, a non-security
               extension block, or a BIB. A BCB MUST NOT <bcp14>MUST
               NOT</bcp14> include another BCB as a security target. A
               BCB MUST NOT <bcp14>MUST NOT</bcp14> target the primary block. A
               BCB MUST
               NOT <bcp14>MUST NOT</bcp14> target a BIB block unless
               it shares a security target with that BIB block.
            </t>

            <t> BIB.
            </li>
          <li>
               Any Security Context security context used by a BCB MUST <bcp14>MUST</bcp14> utilize a confidentiality
               cipher that provides authenticated encryption with
               associated data (AEAD).
            </t>

            <t>
            </li>
          <li>
               Additional information created by a cipher suite (such as
               an authentication tag) can be placed either in a
               security result field or in the generated cipher text. ciphertext. The
               determination of where to place this information is a function of the
               cipher suite and security context used.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <t>
         The BCB modifies the contents of its security target(s).  When a BCB
         is applied, the security target body data are encrypted "in-place".
         Following encryption, the security target block-type-specific-data block-type-specific data
         field contains cipher text, ciphertext, not plain text. plaintext.
        </t>
        <t>Notes:
         <list style="symbols">
            <t>
        </t>
        <ul spacing="normal">
          <li>
               It is RECOMMENDED <bcp14>RECOMMENDED</bcp14> that designers carefully
               consider the effect of setting flags that delete the bundle in
               the event that this block cannot be processed.
            </t>
            <t>
            </li>
          <li>
               The BCB block processing control flags can be set independently
               from the processing control flags of the security target(s). The
               setting of such flags should be an implementation/policy
               decision for the encrypting node.
            </t>
         </list>
      </t>
            </li>
        </ul>
      </section>
      <section anchor="interact" title="Block Interactions" toc="default"> toc="default" numbered="true">
        <name>Block Interactions</name>
        <t>
         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 target; this sharing creates processing dependencies.
        </t>
        <t>
	 If a security target of a BCB is also and a security target of BIB share a BIB, security target, an undesirable
         condition occurs where occurs: a waypoint would be unable to validate the BIB
         because one of its the shared security target's
         contents have target has been encrypted by a the BCB.
         To address this situation situation, the
         following processing rules MUST <bcp14>MUST</bcp14> be followed. followed:
        </t>

      <t>
         <list style="symbols">
            <t>
        <ul spacing="normal">
          <li>
               When adding a BCB to a bundle, if some (or all) of the
               security targets of the BCB also match all of the
               security targets of an existing BIB, then the existing
               BIB MUST <bcp14>MUST</bcp14> also be encrypted.  This can be
               accomplished by either by adding a new BCB that targets
               the existing BIB, BIB or by adding the BIB to the list of
               security targets for the BCB. Deciding which way to
               represent this situation is a matter of security
               policy.
            </t>
            <t>
            </li>
          <li>
               When adding a BCB to a bundle, if some (or all) of the
               security targets of the BCB match some (but not all) of
               the security targets of a BIB BIB, then that BIB MUST
               <bcp14>MUST</bcp14> be altered in the following
               way. Any security results in the BIB associated with
               the BCB security targets MUST <bcp14>MUST</bcp14> be removed
               from the BIB and placed in a new BIB. This newly
               created BIB MUST <bcp14>MUST</bcp14> then be encrypted.  The
               encryption of the new BIB can be accomplished by either by
               adding a new BCB that targets the new BIB, BIB or by adding
               the new BIB to the list of security targets for the
               BCB.  Deciding which way to represent this situation is
               a matter of security policy.
            </t>

            <t>
            </li>
          <li>
               A BIB MUST NOT <bcp14>MUST NOT</bcp14> be added for a security
               target that is already the security target of a BCB as
               this would cause ambiguity in block processing order.
            </t>

            <t>
            </li>
          <li>
               A BIB integrity value MUST NOT <bcp14>MUST NOT</bcp14> be
               checked if the BIB is the security target of an
               existing BCB. In this case, the BIB data is encrypted.
            </t>
            <t>
            </li>
          <li>
               A BIB integrity value MUST NOT <bcp14>MUST NOT</bcp14> be
               checked if the security target associated with that
               value is also the security target of a BCB. In such a
               case, the security target data contains cipher text ciphertext as
               it has been encrypted.
            </t>
            <t>
            </li>
          <li>
               As mentioned in <xref target="BIB"/>, target="BIB" format="default"/>,
               a BIB MUST NOT <bcp14>MUST NOT</bcp14> have a BCB as its
               security target.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <t>
         These restrictions on block interactions impose a necessary
         ordering when applying security operations within a
         bundle. Specifically, for a given security target, BIBs MUST
         <bcp14>MUST</bcp14> be added before BCBs.  This ordering MUST
         <bcp14>MUST</bcp14> be preserved in cases where the current
         BPA is adding all of the security blocks for the bundle or whether
         where the BPA is a waypoint adding new security blocks to a
         bundle that already contains security blocks.
        </t>
        <t>
         In cases where a security source wishes to calculate both a plain text integrity
         plaintext integrity-protection mechanism and encrypt a security target,
         a BCB with a security context that generates an
         integrity-protection mechanism as one or more additional
         security results MUST <bcp14>MUST</bcp14> be used instead of
         adding both a BIB and then a BCB for the security target at
         the security source.
        </t>
      </section>
      <section anchor="parmresult" title="Parameter numbered="true" toc="default">
        <name>Parameter and Result Identification"> Identification</name>
        <t>
         Each security context MUST <bcp14>MUST</bcp14> define its own
         context parameters and results.  Each defined parameter and
         result is represented as the tuple of an identifier and a
         value. Identifiers are always represented as a CBOR unsigned
         integer. The CBOR encoding of values is as defined by the
         security context specification.
        </t>
        <t>
         Identifiers MUST <bcp14>MUST</bcp14> be unique for a given
         security context but do not need to be unique amongst all
         security contexts.
        </t>
        <t>
         An example of a security context can be found at in <xref target="I-D.ietf-dtn-bpsec-default-sc"/>.
         target="RFC9173" format="default"/>.
        </t>
      </section>
      <section anchor="bsp_example" title="BSP toc="default" numbered="true">
        <name>BPSec Block Examples" toc="default"> Examples</name>
        <t>
         This section provides two examples of BPSec blocks applied to
         a bundle.
         bundles. In the first example, a single node adds several
         security operations to a bundle. In the second example, a
         waypoint node received the bundle created in the first
         example and adds additional security operations. In both
         examples, the first column represents blocks within a bundle
         and the second column represents the Block Number block number for the
         block, using the terminology B1...Bn for the purpose of
         illustration.
        </t>
        <section title="Example numbered="true" toc="default">
          <name>Example 1: Constructing a Bundle with Security"> Security</name>
          <t>
            In this example example, a bundle has four non-security-related
            blocks: the primary block (B1), two extension blocks (B4,B5),
            (B4, B5), and a payload block (B6). The bundle source
            wishes to provide an integrity signature of the plain text plaintext
            associated with the primary block, the second extension
            block, and the payload. The bundle source also wishes to
            provide confidentiality for the first extension block.
            The resultant bundle is illustrated in <xref target="bsp_ex1"/>
            target="bsp_ex1" format="default"/> and the security
            actions are described below.

          </t>
          <figure anchor="bsp_ex1" title="Security anchor="bsp_ex1">
            <name>Security at Bundle Creation"> Creation</name>
            <artwork align="center">&#xA;<!--

                 --> align="center" name="" type="" alt="">
              Block in Bundle                ID&#xA;<!--
                 -->+==========================================+====+&#xA;<!--
                 -->|                ID
+==========================================+====+
|              Primary Block               | B1 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|                    BIB                   | B2 |&#xA;<!--
                 -->| |
|   OP(bib-integrity, targets=B1, targets = B1, B5, B6) B6)|    |
+------------------------------------------+----+
|    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->|                    BCB                   | B3 |&#xA;<!--
                 -->| |
|    OP(bcb-confidentiality, target=B4) target = B4)  |    |
+------------------------------------------+----+
|    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->|       Extension Block (encrypted)        | B4 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|              Extension Block             | B5 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|               Payload Block              | B6 |&#xA;<!--
                 -->+------------------------------------------+----+
               </artwork> |
+------------------------------------------+----+</artwork>
          </figure>
         </t>
          <t>
            The following security actions were applied to this bundle at its
            time of creation.

            <list style="symbols">

               <t>

          </t>
          <ul spacing="normal">
            <li>
                  An integrity signature applied to the canonical form of the
                  primary block (B1), the canonical form of the block-type-specific-data block-type-specific data field
                  of the second extension block (B5) (B5), and the canonical form of the
                  payload block (B6). This is accomplished by a single BIB (B2)
                  with multiple targets. A single BIB is used in this case
                  because all three targets share a security source, security
                  context, and security context parameters. Had this not been
                  the case, multiple BIBs could have been added instead.
               </t>

               <t>
               </li>
            <li>
                  Confidentiality for the first extension block (B4). This is
                  accomplished by a BCB (B3). Once applied, the block-type-specific-data block-type-specific data
                  field of extension block B4 is encrypted. The BCB MUST <bcp14>MUST</bcp14>
                  hold an authentication tag for the cipher text ciphertext either
                  in the cipher text ciphertext that now populates the first extension
                  block or as a security result in the BCB itself, depending
                  on which security context is used to form the BCB. A plain text plaintext
                  integrity signature may also exist as a security result in
                  the BCB if one is provided by the selected confidentiality
                  security context.
               </t>
            </list>
         </t>
               </li>
          </ul>
        </section>
        <section title="Example numbered="true" toc="default">
          <name>Example 2: Adding More Security At A at a New Node"> Node</name>
          <t>
            Consider that the bundle as it is illustrated in <xref target="bsp_ex1"/>
            target="bsp_ex1" format="default"/> is now received by a
            waypoint node that wishes to encrypt the second extension
            block and the bundle payload.  The waypoint security
            policy is to allow existing BIBs for these blocks to
            persist, as they may be required as part of the security
            policy at the bundle destination.
          </t>
          <t>
            The resultant bundle is illustrated in <xref target="bsp_ex2"/> target="bsp_ex2" format="default"/>
            and the security actions are described below. Note that block IDs
            provided here are ordered solely for the purpose of this example
            and are not meant to impose an ordering for block creation. The
            ordering of blocks added to a bundle MUST <bcp14>MUST</bcp14> always be in compliance
            with <xref target="I-D.ietf-dtn-bpbis"/>. target="RFC9171" format="default"/>.

          </t>
          <figure anchor="bsp_ex2" title="Security At anchor="bsp_ex2">
            <name>Security at Bundle Forwarding"> Forwarding</name>
            <artwork align="center">&#xA;<!--
                 --> align="center" name="" type="" alt="">
              Block in Bundle                ID&#xA;<!--
                 -->+==========================================+====+&#xA;<!--
                 -->|                ID
+==========================================+====+
|              Primary Block               | B1 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|                    BIB                   | B2 |&#xA;<!--
                 -->| |
|      OP(bib-integrity, targets=B1) target = B1)      |    |
+------------------------------------------+----+
|    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->|                    BIB (encrypted)       | B7 |&#xA;<!--
                 -->| |
|      OP(bib-integrity, targets=B5, targets = B5, B6) |    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->|    |
+------------------------------------------+----+
|                    BCB                   | B8 |&#xA;<!--
                 -->| OP(bcb-confidentiality,targets=B5,B6,B7) |    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
|OP(bcb-confidentiality,targets = B5,B6,B7)|    |
+------------------------------------------+----+
|                    BCB                   | B3 |&#xA;<!--
                 -->| |
|    OP(bcb-confidentiality, target=B4) target = B4)  |    |
+------------------------------------------+----+
|    |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->|       Extension Block (encrypted)        | B4 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|       Extension Block (encrypted)        | B5 |&#xA;<!--
                 -->+------------------------------------------+----+&#xA;<!--
                 -->| |
+------------------------------------------+----+
|         Payload Block (encrypted)        | B6 |&#xA;<!--
                 -->+------------------------------------------+----+
               </artwork> |
+------------------------------------------+----+</artwork>
          </figure>
         </t>
          <t>
            The following security actions were applied to this bundle prior to
            its forwarding from the waypoint node.

            <list style="symbols">
               <t>

          </t>
          <ul spacing="normal">
            <li>
                  Since the waypoint node wishes to encrypt the
                  block-type-specific-data
                  block-type-specific data field of blocks B5 and B6,
                  it MUST <bcp14>MUST</bcp14> also encrypt the block-type-specific-data block-type-specific data field of
                  the BIBs providing plain text plaintext integrity
                  over those blocks. However, BIB B2 could not be encrypted
                  in its entirety because it also held a signature for the
                  primary block (B1). Therefore, a new BIB (B7) is created and
                  security results associated with B5 and B6 are moved out
                  of BIB B2 and into BIB B7.
               </t>
               <t>
               </li>
            <li>
                  Now that there is no longer confusion of about which plain text plaintext
                  integrity signatures must be encrypted, a BCB is added to the
                  bundle with the security targets being the second extension
                  block (B5) and the payload (B6) as well as the newly created
                  BIB holding their plain text plaintext integrity signatures (B7). A
                  single new BCB is used in this case because all three
                  targets share a security source, security context, and
                  security context parameters. Had this not been the case,
                  multiple BCBs could have been added instead.
               </t>
            </list>
         </t>
               </li>
          </ul>
        </section>
      </section>
    </section>
    <section anchor="CanonBundle" title="Canonical Forms" toc="default"> toc="default" numbered="true">
      <name>Canonical Forms</name>
      <t>
      Security services require consistency and determinism in how information
      is presented to cipher suites at security sources, verifiers, and acceptors.
      For example, integrity services require that the same target
      information (e.g., the same bits in the same order) is provided to the
      cipher suite when generating an original signature and when validating a
      signature. Canonicalization algorithms transcode the contents of a security
      target into a canonical form.
      </t>
      <t>
      Canonical forms are used to generate input to a security context for
      security processing at a BP node. If the values of a security target are
      unchanged, then the canonical form of that target will be the same even
      if the encoding of those values for wire transmission is different.
      </t>
      <t>
      BPSec operates on data fields within bundle blocks
      (e.g., the block-type-specific-data block-type-specific data field). In their canonical form, these
      fields MUST <bcp14>MUST</bcp14> include their own CBOR encoding and MUST NOT <bcp14>MUST NOT</bcp14> include any
      other encapsulating CBOR encoding.
      For example, the canonical form of the block-type-specific-data block-type-specific data field
      is a CBOR byte string existing within the CBOR array containing the fields of
      the extension block. The entire CBOR byte string is considered the canonical
      block-type-specific-data
      block-type-specific data field. The CBOR array
      framing is not considered part of the field.
      </t>
      <t>
      The canonical form of the primary block is as specified in <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/> with
      the following constraint.

      <list style="symbols">
         <t>

      </t>
      <ul spacing="normal">
        <li>
            CBOR values from the primary block MUST <bcp14>MUST</bcp14> be canonicalized using the rules for Deterministically Encoded CBOR,
            as specified in <xref target="RFC8949"/>.
         </t>
      </list>
   </t> target="RFC8949" format="default"/>.
         </li>
      </ul>
      <t>
      All non-primary blocks share the same block structure and are
      canonicalized as specified in <xref target="I-D.ietf-dtn-bpbis"/> target="RFC9171" format="default"/> with
      the following constraints.

      <list style="symbols">
         <t>

      </t>
      <ul spacing="normal">
        <li>
            CBOR values from the non-primary block MUST <bcp14>MUST</bcp14> be canonicalized using the rules for Deterministically Encoded CBOR,
            as specified in <xref target="RFC8949"/>.
         </t>
         <t> target="RFC8949" format="default"/>.
         </li>
        <li>
            Only the block-type-specific-data block-type-specific data field may be provided to a cipher suite for
            encryption as part of a confidentiality security service. Other fields within a non-primary-block
            MUST NOT non-primary block
            <bcp14>MUST NOT</bcp14> be encrypted or decrypted and MUST NOT <bcp14>MUST NOT</bcp14> be included in the canonical form used by the
            cipher suite for encryption and decryption. These other fields MAY have an integrity protection
      An integrity-protection mechanism <bcp14>MAY</bcp14> be applied to them these other
      fields as supported by treating them the security context. For example, these
      fields might be treated as associated authenticated data.
         </t>
         <t>
         </li>
        <li>
            Reserved and unassigned flags in the block processing control flags field MUST <bcp14>MUST</bcp14> be set to 0 in
            a canonical form as it is not known if those flags will change in transit.
         </t>
      </list>
   </t>
         </li>
      </ul>
      <t>
      Security contexts MAY <bcp14>MAY</bcp14> define their own canonicalization algorithms and require the use of those algorithms
      over the ones provided in this specification. In the event of conflicting canonicalization algorithms, algorithms
      defined in a security context take precedence over this specification when constructing canonical forms for that
      security context.
      </t>
    </section>
    <section anchor="SecProc" title="Security Processing" toc="default"> toc="default" numbered="true">
      <name>Security Processing</name>
      <t>
      This section describes the security aspects of bundle processing.
      </t>
      <section anchor="BundleRX" title="Bundles numbered="true" toc="default">
        <name>Bundles Received from Other Nodes"> Nodes</name>
        <t>
         Security blocks must be processed in a specific order when received
         by a BP node. The processing order is as follows.

         <list style="symbols">
            <t>

        </t>
        <ul spacing="normal">
          <li>
               When BIBs and BCBs share a security target, BCBs MUST <bcp14>MUST</bcp14> be
               evaluated first and BIBs second.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <section title="Receiving BCBs" toc="default"> toc="default" numbered="true">
          <name>Receiving BCBs</name>
          <t>
            If a received bundle contains a BCB, the receiving node MUST <bcp14>MUST</bcp14>
            determine whether it is the security acceptor for any of
            the security operations in the BCB. If so, the node MUST <bcp14>MUST</bcp14>
            process those operations and remove any operation-specific
            information from the BCB prior to delivering data to an application at the node
            or forwarding the bundle. If processing a security operation fails,
            the target SHALL <bcp14>SHALL</bcp14> be processed according to the security policy.
            A bundle status report indicating the failure MAY <bcp14>MAY</bcp14> be generated.
            When all security operations for a BCB have been removed from
            the BCB, the BCB MUST <bcp14>MUST</bcp14> be removed from the bundle.
          </t>
          <t>
            If the receiving node is the destination of the bundle,
            the node
            MUST <bcp14>MUST</bcp14> decrypt any BCBs remaining in
            the bundle. If the receiving node is not the destination
            of the bundle, the node MUST <bcp14>MUST</bcp14> process the
            BCB if directed to do so as a matter of security policy.
          </t>
          <t>
            If the security policy of a node specifies that a node
            should have applied confidentiality to a specific security
            target and no such BCB is present in the bundle, then the
            node
            MUST <bcp14>MUST</bcp14> process this security target in
            accordance with the security policy. It is RECOMMENDED
            <bcp14>RECOMMENDED</bcp14> that the node remove the
            security target from the bundle because the
            confidentiality (and possibly the integrity) of the
            security target cannot be guaranteed. If the removed
            security target is the payload block, the bundle MUST
            <bcp14>MUST</bcp14> be discarded.
          </t>
          <t>
            If an encrypted payload block cannot be decrypted (i.e.,
            the
            cipher text ciphertext cannot be authenticated), then the bundle MUST
            <bcp14>MUST</bcp14> be discarded and processed no
            further. If an encrypted security target other than the
            payload block cannot be decrypted decrypted, then the associated
            security target and all security blocks associated with
            that target MUST <bcp14>MUST</bcp14> be discarded and processed
            no further. In both cases, requested status reports (see
            <xref target="I-D.ietf-dtn-bpbis"/>) MAY target="RFC9171" format="default"/>)
            <bcp14>MAY</bcp14> be generated to reflect bundle or block
            deletion.
          </t>
          <t>
            When a BCB is decrypted, the recovered plain text plaintext for each
            security target MUST <bcp14>MUST</bcp14> replace the cipher text ciphertext in each of the
            security targets' block-type-specific-data block-type-specific data fields. If the
            plain text
            plaintext is of a different size than the cipher text, ciphertext, the framing of the CBOR byte
            string framing of this field must be updated to ensure this field
            remains a valid CBOR byte string. The length of the recovered plain
            text plaintext
            is known by the decrypting security context.
          </t>
          <t>
            If a BCB contains multiple security operations, each operation processed
            by the node MUST <bcp14>MUST</bcp14> be treated as if the security operation
            has been represented by a single BCB with a single
            security operation for the purposes of report generation and policy
            processing.
          </t>
        </section>
        <section title="Receiving BIBs" toc="default"> toc="default" numbered="true">
          <name>Receiving BIBs</name>
          <t>
            If a received bundle contains a BIB, the receiving node MUST
            <bcp14>MUST</bcp14> determine whether it is the security
            acceptor for any of the security operations in the BIB. If
            so, the node MUST <bcp14>MUST</bcp14> process those operations
            and remove any operation-specific information from the BIB
            prior to delivering data to an application at the node or
            forwarding the bundle. If processing a security operation
            fails, the target SHALL <bcp14>SHALL</bcp14> be processed
            according to the security policy. A bundle status report
            indicating the failure MAY <bcp14>MAY</bcp14> be
            generated. When all security operations for a BIB have
            been removed from the BIB, the BIB MUST <bcp14>MUST</bcp14> be
            removed from the bundle.
          </t>
          <t>
            A BIB MUST NOT <bcp14>MUST NOT</bcp14> be processed if the security
            target of the BIB is also the security target of a BCB in
            the bundle. Given the order of operations mandated by this
            specification, when both a BIB and a BCB share a security
            target, it means that the security target must have been
            encrypted after it was integrity signed and, signed; therefore, the
            BIB cannot be verified until the security target has been
            decrypted by processing the BCB.
          </t>
          <t>
            If the security policy of a node specifies that a node
            should have applied integrity to a specific security
            target and no such BIB is present in the bundle, then the
            node MUST <bcp14>MUST</bcp14> process this security target in
            accordance with the security policy. It is RECOMMENDED
            <bcp14>RECOMMENDED</bcp14> that the node remove the
            security target from the bundle if the security target is
            not the payload or primary block. If the security target
            is the payload or primary block, the bundle MAY
            <bcp14>MAY</bcp14> be discarded. This action can occur at
            any node that has the ability to verify an integrity
            signature, not just the bundle destination.
          </t>
          <t>
            If a receiving node is not the security acceptor of a
            security operation in a BIB BIB, it MAY <bcp14>MAY</bcp14> attempt
            to verify the security operation anyway to prevent
            forwarding corrupt data. If the verification fails, the
            node SHALL <bcp14>SHALL</bcp14> process the security target in
            accordance to with local security policy. It is RECOMMENDED that if
            If a payload integrity check fails at a waypoint that waypoint, it is
            <bcp14>RECOMMENDED</bcp14> that it be processed in the
            same way as
            if the a failure of a payload
            integrity check fails at the bundle destination.  If
            the check passes, the node MUST NOT <bcp14>MUST NOT</bcp14> remove
            the security operation from the BIB prior to forwarding.
          </t>
          <t>
            If a BIB contains multiple security operations, each operation processed
            by the node MUST <bcp14>MUST</bcp14> be treated as if the security operation
            has been represented by a single BIB with a single
            security operation for the purposes of report generation and policy
            processing.
          </t>
        </section>
      </section>
      <section anchor="FragRe" title="Bundle numbered="true" toc="default">
        <name>Bundle Fragmentation and Reassembly"> Reassembly</name>
        <t>
         If it is necessary for a node to fragment a bundle payload, and
         security services have been applied to that bundle, the fragmentation
         rules described in <xref target="I-D.ietf-dtn-bpbis"/> MUST target="RFC9171" format="default"/> <bcp14>MUST</bcp14> be
         followed. As defined there and summarized here for completeness, only
         the payload block can be fragmented; security blocks, like all
         extension blocks, can never be fragmented.
        </t>
        <t>
         Due to the complexity of payload block payload-block fragmentation, including the
         possibility of fragmenting payload block payload-block fragments, integrity and
         confidentiality operations are not to be applied to a bundle
         representing a fragment. Specifically, a BCB or BIB MUST NOT <bcp14>MUST NOT</bcp14> be
         added to a bundle if the "Bundle is a Fragment" fragment" flag is set in the
         Bundle Processing Control Flags
         bundle processing control flags field.
        </t>
        <t>
         Security processing in the presence of payload block payload-block fragmentation may
         be handled by other mechanisms outside of the BPSec protocol or
         by applying BPSec blocks in coordination with an encapsulation
         mechanism. A node should apply any confidentiality
         protection prior to performing any fragmentation.
        </t>
      </section>
    </section>
    <section anchor="KeyMgmt" title="Key Management" toc="default"> toc="default" numbered="true">
      <name>Key Management</name>
      <t>
      There exist exists a myriad of ways to establish, communicate, and
      otherwise manage key information in a DTN. Certain DTN
      deployments might follow established protocols for key management
      management, whereas other DTN deployments might require new and
      novel approaches. BPSec assumes that key management is handled
      as a separate part of network management and management; this specification
      neither defines nor requires a specific strategy for key management
      strategy. management.
      </t>
    </section>
    <section anchor="PolCons" title="Security toc="default" numbered="true">
      <name>Security Policy Considerations" toc="default"> Considerations</name>
      <t>
      When implementing BPSec, several policy decisions must be
      considered. This section describes key policies that affect the
      generation, forwarding, and receipt of bundles that are secured using
      this specification. No single set of policy decisions is envisioned to
      work for all secure DTN deployments.

      <list style="symbols">
         <t>

      </t>
      <ul spacing="normal">
        <li>
            If a bundle is received that contains combinations of
            security operations that are disallowed by this specification
            specification, the BPA must determine how to handle the bundle. The
            bundle: the bundle may be discarded, the block affected by
            the security operation may be discarded, or one security
            operation may be favored over another.
         </t>

         <t>
         </li>
        <li>
            BPAs in the network must understand what security operations they
            should apply to bundles. This decision may be based on the source
            of the bundle, the destination of the bundle, or some other
            information related to the bundle.
         </t>

         <t>
         </li>
        <li>
            If a waypoint has been configured to add a security
            operation to a bundle, and the received bundle already has
            the security operation applied, then the receiver must
            understand what to do. The receiver may discard the
            bundle, discard the security target and associated BPSec
            blocks, replace the security operation, or take some other
            action.
         </t>

         <t>
         </li>
        <li>
            It is RECOMMENDED <bcp14>RECOMMENDED</bcp14> that security operations
            be applied to every block in a bundle and that the default
            behavior of a bundle agent is BPA be to use the security services
            defined in this specification. Designers should only
            deviate from the use of security operations when the
            deviation can be justified - -- such as when doing so causes
            downstream errors when processing blocks whose contents
            must be inspected or changed at one or more hops along the
            path.
         </t>

         <t>
         </li>
        <li>
            BCB security contexts can alter the size of extension
            blocks and the payload block. Security policy SHOULD
            <bcp14>SHOULD</bcp14> consider how changes to the size of
            a block could negatively effect bundle processing (e.g.,
            calculating storage needs and scheduling transmission
            times).
         </t>
         </li>
        <li>
          <t>
            Adding a BIB to a security target that has already been encrypted
            by a BCB is not allowed. If this condition is likely to be
            encountered, there are (at least) three possible policies that
            could handle this situation.
            <list style="numbers">
               <t>
          </t>
          <ol spacing="normal" type="1"><li>
                  At the time of encryption, a security context can be
                  selected which that computes a plain text plaintext integrity-protection mechanism
                  that is included as a security context result field.
               </t>
               <t>
               </li>
            <li>
                  The encrypted block may be replicated as a new block with
                  a new block number and may be given integrity protection.
               </t>
               <t>
               </li>
            <li>
                  An encapsulation scheme may be applied to encapsulate the
                  security target (or the entire bundle) such that the
                  encapsulating structure is, itself, no longer the security
                  target of a BCB and may therefore be the security target of
                  a BIB.
               </t>
            </list>
         </t>

         <t>
               </li>
          </ol>
        </li>
        <li>
            Security policy SHOULD <bcp14>SHOULD</bcp14> address whether cipher
            suites whose cipher text ciphertext is larger than the initial
            plain text
            plaintext are permitted and, if so, for what types of blocks.
            Changing the size of a block may cause processing difficulties for
            networks that calculate block offsets into bundles or predict
            transmission times or storage availability as a function of bundle
            size. In other cases, changing the size of a payload as part of
            encryption has no significant impact.
         </t>
      </list>
   </t>
         </li>
      </ul>
      <section anchor="ReasonCodes" title="Security numbered="true" toc="default">
        <name>Security Reason Codes"> Codes</name>
        <t>
         Bundle protocol agents (BPAs)
         BPAs must process blocks and bundles in
         accordance with both BP policy and BPSec policy.  The decision to
         receive, forward, deliver, or delete a bundle may be communicated to
         the report-to address of the bundle, bundle in the form of a status report,
         as a method of tracking the progress of the bundle through the
         network.  The status report for a bundle may be augmented with a
         "reason code" explaining why the particular action was taken on the
         bundle.
        </t>
        <t>
         This section describes a set of reason codes associated with the
         security processing of a bundle. The communication of security-related
         status reports might reduce the security of a network if these reports
         are intercepted by unintended recipients. BPSec policy SHOULD <bcp14>SHOULD</bcp14> specify
         the conditions in which sending security reason codes are appropriate.
         Examples of appropriate conditions for the use of security reason codes
         could include the following.
         <list style="symbols">
            <t>
        </t>
        <ul spacing="normal">
          <li>
               When the report-to address is verified as unchanged
               from the bundle source.  This can occur by placing an
               appropriate BIB on the bundle primary block.
            </t>
            <t>
            </li>
          <li>
               When the block containing a status report with a
               security reason code is encrypted by a BCB.
            </t>
            <t>
            </li>
          <li>
               When a status report containing a security reason code
               is only sent for security issues relating to bundles
               and/or blocks associated with non-operational user data
               or otherwise with test data.
            </t>
            <t>
            </li>
          <li>
               When a status report containing a security reason code
               is only sent for security issues associated with
               non-operational security contexts, or security contexts
               using non-operational configurations, such as test
               keys.
            </t>
         </list>
      </t>
            </li>
        </ul>
        <t>
         Security reason codes are assigned in accordance with <xref target="secreasoncode"/>
         target="secreasoncode" format="default"/> and are as
         described below.

         <list style="hanging" hangIndent="6">
            <t hangText="Missing Security Operation:"> <vspace/>

        </t>
        <dl newline="true" spacing="normal" indent="6">
          <dt>Missing security operation:</dt>
          <dd>
               This reason code indicates that a bundle was missing
               one or more required security operations.  This reason
               code is typically used by a security verifier or
               security acceptor.
            </t>

            <t hangText="Unknown Security Operation:"> <vspace/>
            </dd>
          <dt>Unknown security operation:</dt>
          <dd>
               This reason code indicates that one or more security
               operations present in a bundle cannot be understood by
               the security verifier or security acceptor for the
               operation.  For example, this reason code may be used
               if a security block references an unknown security
               context identifier or security context parameter. This
               reason code should not be used for security operations
               for which the node is not a security verifier or
               security acceptor; there is no requirement that all
               nodes in a network understand all security contexts,
               security context parameters, and security services for
               every bundle in a network.
            </t>

            <t hangText="Unexpected Security Operation:"> <vspace/>
            </dd>
          <dt>Unexpected security operation:</dt>
          <dd>
               This reason code indicates that a receiving node is neither a
               security verifier nor a security acceptor for at least one
               security operation in a bundle. This reason code should not
               be seen as an error condition; condition: not every node is a security
               verifier or security acceptor for every security operation in
               every bundle. In certain networks, this reason code may be
               useful in identifying misconfigurations of security policy.
            </t>

            <t hangText="Failed Security Operation:"> <vspace/>
            </dd>
          <dt>Failed security operation:</dt>
          <dd>
               This reason code indicates that one or more security
               operations in a bundle failed to process as expected
               for reasons other than misconfiguration. This may occur
               when a security-source is unable to add a security
               block to a bundle.  This may occur if the target of a
               security operation fails to verify using the defined
               security context at a security verifier.  This may also
               occur if a security operation fails to be processed
               without error at a security acceptor.
            </t>

            <t hangText="Conflicting Security Operations:"> <vspace/>
            </dd>
          <dt>Conflicting security operation:</dt>
          <dd>
               This reason code indicates that two or more security
               operations in a bundle are not conformant with the
               BPSec specification and that security processing was
               unable to proceed because of a BPSec protocol
               violation.
            </t>
         </list>
      </t>
            </dd>
        </dl>
      </section>
    </section>
    <section anchor="SecCons" title="Security Considerations" toc="default"> toc="default" numbered="true">
      <name>Security Considerations</name>
      <t>
      Given the nature of DTN applications, it is expected that
      bundles may traverse a variety of environments and devices
      which that
      each pose unique security risks and requirements on the
      implementation of security within BPSec.  For these reasons, this reason, it
      is important to introduce key threat models and describe the
      roles and responsibilities of the BPSec protocol in protecting
      the confidentiality and integrity of the data against those
      threats. This section provides additional discussion on security
      threats that BPSec will face and describes how BPSec security
      mechanisms operate to mitigate these threats.
      </t>
      <t>
      The threat model described here is assumed to have a set of
      capabilities identical to those described by the Internet Threat
      Model in <xref target="RFC3552"/>, target="RFC3552" format="default"/>, but the
      BPSec threat model is scoped to illustrate threats specific to
      BPSec operating within DTN environments
      and therefore environments; therefore, it focuses on on-path-attackers
      on-path attackers (OPAs). In doing so, it is assumed that the DTN
      delay-tolerant network (or significant portions of the DTN) delay-tolerant network) are completely under
      the control of an attacker.
      </t>
      <section anchor="SecConsAttack" title="Attacker numbered="true" toc="default">
        <name>Attacker Capabilities and Objectives"> Objectives</name>
        <t>
         BPSec was designed to protect against OPA threats which that may
         have access to a bundle during transit from its source,
         Alice, to its destination, Bob.
	 An OPA node, Olive, is a non-cooperative
         noncooperative node operating on the DTN delay-tolerant network between Alice and
         Bob that has the ability to receive bundles, examine bundles,
         modify bundles, forward bundles, and generate bundles at will
         in order to compromise the confidentiality or integrity of
         data within the DTN. delay-tolerant network.  There are three classes of OPA nodes which
         that are differentiated based on their access to
         cryptographic material:

         <list style="symbols">

            <t>
               Unprivileged Node: Olive

        </t>
        <dl spacing="normal">
          <dt>Unprivileged Node:</dt><dd>Olive has not been provisioned
               within the secure environment and only has access to
               cryptographic material which that has been publicly-shared.
            </t>

            <t>
               Legitimate Node: Olive publicly shared.
            </dd>
          <dt>Legitimate Node:</dt><dd>Olive is within the secure environment and therefore environment;
               therefore,  Olive has access to cryptographic material which
               that has been provisioned to Olive (i.e., K_M) K<sub>M</sub>) as well
               as material which that has been publicly-shared.
            </t>

            <t>
               Privileged Node: Olive publicly shared.
            </dd>
          <dt>Privileged Node:</dt><dd>Olive is a privileged node within the
               secure environment
               and therefore environment; therefore, Olive has access to
               cryptographic material which that has been provisioned to
               Olive, Alice Alice, and/or Bob (i.e. K_M, K_A, (i.e., K<sub>M</sub>, K<sub>A</sub>, and/or K_B) K<sub>B</sub>) as
               well as material which that has been publicly-shared.
            </t>
         </list>
      </t> publicly shared.
            </dd>
        </dl>
        <t>
         If Olive is operating as a privileged node, this is
         tantamount to compromise; BPSec does not provide mechanisms
         to detect or remove Olive from the DTN delay-tolerant network or BPSec secure
         environment.  It is up to the BPSec implementer or the
         underlying cryptographic mechanisms to provide appropriate
         capabilities if they are needed.  It should also be noted
         that if the 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<sub>M</sub> == K_A K<sub>A</sub> == K_B.
         K<sub>B</sub>. For this reason, sharing cryptographic material in this
         way is not recommended.
        </t>
        <t>
         A special case of the legitimate node is when Olive is either
         Alice or Bob (i.e., K_M K<sub>M</sub> == K_A K<sub>A</sub> or K_M K<sub>M</sub> == K_B). K<sub>B</sub>).  In this case,
         Olive is able to impersonate traffic as either Alice or Bob,
         respectively, which means that traffic to and from that node
         can be decrypted and encrypted, respectively.  Additionally,
         messages may be signed as originating from one of the
         endpoints.
        </t>
      </section>
      <section anchor="SecConsBehave" title="Attacker toc="default" numbered="true">
        <name>Attacker Behaviors and BPSec Mitigations" toc="default"> Mitigations</name>
        <section title="Eavesdropping Attacks" toc="default"> toc="default" numbered="true">
          <name>Eavesdropping Attacks</name>
          <t>
            Once Olive has received a bundle, she is able to examine
            the contents of that bundle and attempt to recover any
            protected data or cryptographic keying material from the
            blocks contained within.  The protection mechanism that
            BPSec provides against this action is the BCB, which
            encrypts the contents of its security target, providing
            confidentiality of the data.  Of course, it should be
            assumed that Olive is able to attempt offline recovery of
            encrypted data, so the cryptographic mechanisms selected
            to protect the data should provide a suitable level of
            protection.
          </t>
          <t>
            When evaluating the risk of eavesdropping attacks, it is
            important to consider the lifetime of bundles on a DTN.
            Depending on the network, bundles may persist for days or
            even years.  Long-lived bundles imply that the data exists
            in the network for a longer period of time and, thus,
            there may be more opportunities to capture those
            bundles. Additionally, bundles the implication is that
            are long-lived imply that the bundles store information stored within them may remain that remains relevant and sensitive for long enough that, once
            captured, there is sufficient time to crack encryption
            associated with the bundle. If a bundle does persist on
            the network for years and the cipher suite used for a BCB
            provides inadequate protection, Olive may be able to
            recover the protected data either before that bundle
            reaches its intended destination or before the information
            in the bundle is no longer considered sensitive.
          </t>
          <t>
            NOTE: Olive is not limited by the bundle lifetime and may
            retain a given bundle indefinitely.
          </t>
          <t>
            NOTE: Irrespective of whether BPSec is used, traffic
            analysis will be possible.
          </t>
        </section>
        <section title="Modification Attacks" toc="default"> toc="default" numbered="true">
          <name>Modification Attacks</name>
          <t>
            As a node participating in the DTN delay-tolerant network between Alice and Bob,
            Olive will also be able to modify the received bundle,
            including non-BPSec data such as the primary block,
            payload blocks, or block processing control flags as
            defined in <xref target="I-D.ietf-dtn-bpbis"/>. target="RFC9171" format="default"/>.
            Olive will be able to undertake activities which include including
            modification of data within the blocks, replacement of
            blocks, addition of blocks, or removal of blocks.  Within
            BPSec, both the BIB and BCB provide integrity protection integrity-protection
            mechanisms to detect or prevent data manipulation attempts
            by Olive.
          </t>
          <t>
            The BIB provides that protection to another block which that is
            its security target.  The cryptographic mechanisms used to
            generate the BIB should be strong against collision attacks
            attacks, and Olive should not have access to the
            cryptographic material used by the originating node to
            generate the BIB (e.g., K_A). K<sub>A</sub>). If both of these conditions
            are true, Olive will be unable to modify the security
            target or the BIB BIB, and thus she cannot lead Bob to validate the security
            target as originating from Alice.
          </t>
          <t>
            Since BPSec security operations are implemented by placing
            blocks in a bundle, there is no in-band mechanism for
            detecting or correcting certain cases where Olive removes
            blocks from a bundle. If Olive removes a BCB, but keeps
            the security target, the security target remains encrypted
            and there is a possibility that there may no longer be
            sufficient information to decrypt the block at its
            destination.  If Olive removes both a BCB (or BIB) and its
            security target target, there is no evidence left in the bundle of
            the security operation. Similarly, if Olive removes the BIB
            BIB, but not the security target target, there is no evidence left
            in the bundle of the security operation.  In each of these
            cases, the implementation of BPSec must be combined with
            policy configuration at endpoints in the network which that
            describe the expected and required security operations
            that must be applied on transmission and that are expected to
            be present on receipt.  This or other similar out-of-band
            information is required to correct for removal of security
            information in the bundle.
          </t>
          <t>
            A limitation of the BIB may exist within the
            implementation of BIB validation at the destination node.
            If Olive is a legitimate node within the DTN, delay-tolerant network, the BIB
            generated by Alice with K_A K<sub>A</sub> can be replaced with a new BIB
            generated with K_M K<sub>M</sub> and forwarded to Bob.  If Bob is only
            validating that the BIB was generated by a legitimate
            user, Bob will acknowledge the message as originating from
            Olive instead of Alice. Validating a BIB indicates only
            that the BIB was generated by a holder of the relevant
            key; it does not provide any guarantee that the bundle or
            block was created by the same entity. In order to provide
            verifiable integrity checks checks, the BCB should require an
            encryption scheme that is Indistinguishable under adaptive
            Chosen Ciphertext Attack (IND-CCA2) secure. Such an
            encryption scheme will guard against signature
            substitution attempts by Olive. In this case, 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.
          </t>
        </section>
        <section anchor="SecConsTopAtck" title="Topology Attacks" toc="default"> toc="default" numbered="true">
          <name>Topology Attacks</name>
          <t>
             If Olive is in a an OPA position within the DTN, delay-tolerant network, she is able
             to influence how any bundles that come to her may pass
             through the network.  Upon receiving and processing a
             bundle that must be routed elsewhere in the network,
             Olive has three options as to how to proceed: not forward
             the bundle, forward the bundle as intended, or forward
             the bundle to one or more specific nodes within the
             network.
          </t>
          <t>
            Attacks that involve re-routing rerouting the packets bundles throughout the
            network are essentially a special case of the modification
            attacks described in this section section, one where the attacker is
            modifying fields within the primary block of the bundle.
            Given that BPSec cannot encrypt the contents of the
            primary block, alternate methods must be used to prevent
            this situation. These methods may include requiring BIBs
            for primary blocks, using encapsulation, or otherwise
            strategically manipulating primary block data. The specifics
            details of any such mitigation technique are specific to
            the implementation of the deploying network and are outside of
            the scope of this document.
          </t>
          <t>
            Furthermore, routing rules and policies may be 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
            scope of this specification.
          </t>
        </section>
        <section  title="Message Injection" toc="default"> toc="default" numbered="true">
          <name>Message Injection</name>
          <t>
            Olive is also able to generate new bundles and transmit
            them into the DTN delay-tolerant network at will.
	    These bundles may either be either 1)
            copies or slight modifications of previously-observed previously observed
            bundles (i.e., a replay attack) or 2) entirely new bundles
            generated based on the Bundle Protocol, BPSec, or other
            bundle-related protocols.  With these attacks attacks, Olive's
            objectives may vary, but may be targeting either the bundle protocol
            Bundle Protocol or application-layer protocols conveyed by
            the bundle protocol. Bundle Protocol. The target could also be the storage
            and compute computing capabilities of the nodes running the bundle or application layer
            application-layer protocols (e.g., a denial of service to
            flood on the storage of the store-and-forward mechanism; mechanism or compute which
            a computation that would process the packets bundles and perhaps
            prevent other activities).
          </t>
          <t>
            BPSec relies on cipher suite capabilities to prevent
            replay or forged message attacks.  A BCB used with
            appropriate cryptographic mechanisms may provide replay
            protection under certain circumstances.  Alternatively,
            application data itself may be augmented to include
            mechanisms to assert data uniqueness and then be protected
            with a BIB, a BCB, or both along with other block data. In
            such a case, the receiving node would be able to validate
            the uniqueness of the data.
          </t>
          <t>
            For example, a BIB may be used to validate the integrity
            of a bundle's primary block, which includes a timestamp
            and lifetime for the bundle. If a bundle is replayed
            outside of its lifetime, then the replay attack will fail
            as the bundle will be discarded. Similarly, additional blocks
            blocks, such as the Bundle Age Age, may be signed and validated
            to identify replay attacks. Finally, security context
            parameters within BIB BIBs and BCB blocks BCBs may include
            anti-replay mechanisms such as session identifiers,
            nonces, and dynamic passwords as supported by network
            characteristics.
          </t>
        </section>
      </section>
    </section>
    <section anchor="sec_ctx" title="Security numbered="true" toc="default">
      <name>Security Context Considerations"> Considerations</name>
      <section title="Mandating numbered="true" toc="default">
        <name>Mandating Security Contexts"> Contexts</name>
        <t>
         Because of the diversity of networking scenarios and node
         capabilities that may utilize BPSec BPSec, there is a risk that a
         single security context mandated for every possible BPSec
         implementation is not feasible. For example, a security
         context appropriate for a resource-constrained node with
         limited connectivity may be inappropriate for use in a
         well-resourced, well
         connected well-connected node.
        </t>
        <t>
         This does not mean that the use of BPSec in a particular
         network is meant to be used happen without security contexts for
         interoperability and default behavior. Network designers must
         identify the minimal set of security contexts necessary for
         functions in their network. For example, a default set of
         security contexts could be created for use over the
         terrestrial Internet Internet, and they could be required by any BPSec implementation
         communicating over the terrestrial Internet.
        </t>
        <t>
         To ensure interoperability among various implementations, all
         BPSec implementations
         MUST <bcp14>MUST</bcp14> support at least
         the current IETF standards-track current, mandatory security context(s). context(s) defined in IETF Standards Track
         RFCs.  As of this writing, that BCP BP mandatory security
         context is specified in <xref target="I-D.ietf-dtn-bpsec-default-sc"/>, target="RFC9173"
         format="default"/>, but the mandatory security context(s)
         might change over time in accordance with usual IETF
         processes.  Such changes are likely to occur in the future
         if/when flaws are discovered in the applicable cryptographic
         algorithms, for example.
        </t>
        <t>
         Additionally, BPsec BPSec implementations need to support the
         security contexts which that are specified and/or used required by the BP
         networks in which they are deployed.
        </t>
        <t>
         If a node serves as a gateway amongst between two or more networks,
         the BPSec implementation at that node needs to support the
         union of security contexts mandated in those networks.
        </t>
        <t>
         BPSec has been designed to allow for a diversity of security
         contexts and for new contexts to be defined over time. The
         use of different security contexts does not change the BPSec
         protocol itself itself, and the definition of new security contexts
         MUST
         <bcp14>MUST</bcp14> adhere to the requirements of such
         contexts as presented in this section and generally in this
         specification.
        </t>
        <t>
         Implementors
         Implementers should monitor the state of security context
         specifications to check for future updates and replacement.
        </t>
      </section>
      <section title="Identification numbered="true" toc="default">
        <name>Identification and Configuration"> Configuration</name>
        <t>
         Security blocks uniquely identify the security context to be
         used in the processing of their security services. The
         security context for a security block MUST <bcp14>MUST</bcp14> be
         uniquely identifiable and MAY <bcp14>MAY</bcp14> use parameters
         for customization.
        </t>
        <t>
         To reduce the number of security contexts used in a network,
         security context designers should make security contexts
         customizable through the definition of security context
         parameters. For example, a single security context could be
         associated with a single cipher suite and security context
         parameters could be used to configure the use of this
         security context with different key lengths and different key
         management options without needing to define separate
         security contexts for each possible option.
        </t>
        <t>
         A single security context may be used in the application of
         more than one security service. This means that a security
         context identifier MAY <bcp14>MAY</bcp14> be used with a BIB,
         with a BCB, or with any other BPSec-compliant security block.
         The definition of a security context MUST <bcp14>MUST</bcp14>
         identify which security services may be used with the
         security context, how security context parameters are
         interpreted as a function of the security operation being
         supported, and which security results are produced for each
         security service.
        </t>
        <t>
         Network operators must determine the number, type, and
         configuration of security contexts in a system. Networks with
         rapidly changing configurations may define relatively few
         security contexts with each context customized with multiple
         parameters. For networks with more stability, or an increased
         need for confidentiality, a larger number of contexts can be
         defined with each context supporting few, if any, parameters.
        </t>

      <texttable

        <table align="center" anchor="sec_ctx_ex">
         <preamble>
            Security
	  <name>Security Context Examples
         </preamble>

         <ttcol Examples</name>
          <thead>
            <tr>
              <th align="center">Context Type</ttcol>
         <ttcol align="center">Parameters</ttcol>
         <ttcol align="center">Definition</ttcol>

         <c>Key Type</th>
              <th align="center">Parameters</th>
              <th align="center">Definition</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">Key Exchange AES</c>
         <c>Encrypted AES</td>
              <td align="center">Encrypted Key, IV</c>
         <c>AES-GCM-256 IV</td>
              <td align="center">AES-GCM-256 cipher suite with
              provided ephemeral key encrypted with a predetermined
              key encryption key and clear text cleartext initialization vector.</c>

         <c>Pre-shared
              vector.</td>
            </tr>
            <tr>
              <td align="center">Pre-Shared Key AES</c>
         <c>IV</c>
         <c>AES-GCM-256 AES</td>
              <td align="center">IV</td>
              <td align="center">AES-GCM-256 cipher suite with
              predetermined key and predetermined
            key rotation policy.</c>

         <c>Out of Band AES</c>
         <c>None</c>
         <c>AES-GCM-256 key-rotation
              policy.</td>
            </tr>
            <tr>
              <td align="center">Out-of-Band AES</td>
              <td align="center">None</td>
              <td align="center">AES-GCM-256 cipher suite with all
              info predetermined.</c>
      </texttable> predetermined.</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section title="Authorship"> numbered="true" toc="default">
        <name>Authorship</name>
        <t>
         Developers or implementers should consider the diverse
         performance and conditions of networks on which the Bundle
         Protocol
         (and therefore (and, therefore, BPSec) will operate. Specifically,
         the delay and capacity of delay-tolerant networks DTNs can vary
         substantially. Developers should consider these conditions to
         better describe the conditions when in which those contexts will
         operate or exhibit vulnerability, and selection of these
         contexts for implementation should be made with consideration
         for this reality. There are key differences that may limit
         the opportunity for a security context to leverage existing
         cipher suites and technologies that have been developed for
         use in
         traditional, more reliable networks:

         <list style="symbols">
            <t>
               Data Lifetime: Depending

        </t>
        <dl spacing="normal">
          <dt>Data Lifetime:</dt><dd>Depending on the application environment,
               bundles may persist on the network for extended periods of
               time, perhaps even years. Cryptographic algorithms should be
               selected to ensure protection of data against attacks for a
               length of time reasonable for the application.
            </t>

            <t>
               One-Way Traffic: Depending
            </dd>
          <dt>One-Way Traffic:</dt><dd>Depending on the 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 round-
               trip round-trip time may be extremely large. This
          may limit the utility of session key generation mechanisms,
          such as Diffie-Hellman, as a two-way handshake may not be
          feasible or reliable.
            </t>

            <t>
               Opportunistic Access: Depending
            </dd>
          <dt>Opportunistic Access:</dt><dd>Depending on the 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 that rely on a key distribution
               center or other trust center impractical under certain
               conditions.
            </t>
         </list>
      </t>
            </dd>
        </dl>
        <t>
       When developing security contexts for use with BPSec, the following
       information SHOULD <bcp14>SHOULD</bcp14> be considered for inclusion in these specifications.

         <list style="symbols">
            <t>
               Security

        </t>
        <dl spacing="normal">
          <dt>Security Context Parameters.  Security Parameters:</dt><dd>Security contexts MUST
          <bcp14>MUST</bcp14> define their parameter Ids, the data
          types of those parameters, and their CBOR encoding.
            </t>
            <t>
               Security Results. Security
            </dd>
          <dt>Security Results:</dt><dd>Security contexts MUST
          <bcp14>MUST</bcp14> define their security result Ids, the
          data types of those results, and their CBOR encoding.
            </t>
            <t>
               New Canonicalizations. Security
            </dd>
            <dt>New Canonicalizations:</dt><dd>Security contexts may
            define new canonicalization algorithms as necessary.
            </t>
            <t>
               Cipher-Text Size. Security necessary.</dd>

            <dt>Ciphertext Size:</dt><dd><t>Security contexts MUST
            <bcp14>MUST</bcp14> state whether their associated cipher
            suites generate cipher text ciphertext (to include any authentication
            information) that is of a different size than the input plain text.
               <vspace blankLines="1"/>
            plaintext.
            </t>
            <t>
               If a security context does not wish to alter the size of the
               plain text
               plaintext, it should place overflow bytes and authentication tags
               in security result fields.
            </t>
            <t>
               Block
          </dd>
          <dt>Block Header Information. Security Information:</dt><dd>Security contexts SHOULD
          <bcp14>SHOULD</bcp14> include block header information that
          is considered to be immutable for the block. This
          information MAY <bcp14>MAY</bcp14> include the block type code,
          block number, CRC Type type, and CRC field (if present or if
          missing and unlikely to be added later), and possibly
          certain block processing control flags.  Designers should
          input these fields as additional data for integrity
          protection when these fields are expected to remain
          unchanged over the path the block will take from the
          security source to the security acceptor.  Security contexts
          considering block header information MUST <bcp14>MUST</bcp14>
          describe expected behavior when these fields fail their
          integrity verification.
            </t>
            <t>
               Handling
            </dd>
          <dt>Handling CRC Fields. Security Fields:</dt><dd>Security contexts may
          include algorithms that alter the contexts of their security
          target block, such as the case when encrypting the
          block-type-specific data of a target block as part oF of a BCB
          confidentiality service. Security context specifications SHOULD
          <bcp14>SHOULD</bcp14> address how preexisting CRC-Type CRC type and CRC-Value
          CRC value fields be handled. For example, a BCB security
          context could remove the plain-text plaintext CRC value from its
          target upon encryption and replace or recalculate the value
          upon decryption.
            </t>
         </list>
      </t>
            </dd>
        </dl>
      </section>
    </section>
    <section anchor="Extensions" title="Defining toc="default" numbered="true">
      <name>Defining Other Security Blocks" toc="default"> Blocks</name>
      <t>
      Other security blocks Security Blocks (OSBs) may be defined and used in addition to the
      security blocks identified in this specification. Both the usage of
      BIB, BCB, and any future OSBs can co-exist coexist within a bundle and can be
      considered in conformance with BPSec if each all of the following requirements
      are met by any future identified security blocks.

      <list style="symbols">
         <t>
            Other security blocks (OSBs) MUST NOT
      </t>
      <ul spacing="normal">
        <li>
            OSBs <bcp14>MUST NOT</bcp14> reuse any enumerations
            identified in this specification, to include the block type codes
            for BIB and BCB.
         </t>
         <t>
         </li>
        <li>
            An OSB definition MUST <bcp14>MUST</bcp14> state whether it can
            be the target of a BIB or a BCB. The definition MUST
            <bcp14>MUST</bcp14> also state whether the OSB can target
            a BIB or a BCB.
         </t>
         <t>
         </li>
        <li>
            An OSB definition MUST <bcp14>MUST</bcp14> provide a
            deterministic processing order in the event that a bundle
            is received containing BIBs, BCBs, and OSBs.  This
            processing order MUST NOT <bcp14>MUST NOT</bcp14> alter the BIB and
            BCB processing orders identified in this specification.
         </t>

         <t>
         </li>
        <li>
            An OSB definition MUST <bcp14>MUST</bcp14> provide a
            canonicalization algorithm if the default algorithm for
            non-primary-block canonicalization algorithm cannot be
            used to generate a deterministic input for a cipher
            suite. This requirement can be waived if the OSB is
            defined so as to never be the security target of a BIB or
            a BCB.
         </t>

         <t>
         </li>
        <li>
            An OSB definition MUST NOT <bcp14>MUST NOT</bcp14> require any
            behavior of a BPSEC-BPA BPSec BPA that is in conflict with the
            behavior identified in this specification.  In particular,
            the security processing requirements imposed by this
            specification must be consistent across all BPSEC-BPAs BPSec BPAs in
            a network.
         </t>

         <t>
         </li>
        <li>
            The behavior of an OSB when dealing with fragmentation
            must be specified and MUST NOT <bcp14>MUST NOT</bcp14> lead to
            ambiguous processing states. In particular, an OSB
            definition should address how to receive and process an
            OSB in a bundle fragment that may or may not also contain
            its security target.  An OSB definition should also
            address whether an OSB may be added to a bundle marked as
            a fragment.
         </t>
      </list>
   </t>
         </li>
      </ul>
      <t>
      Additionally, policy considerations for the management,
      monitoring, and configuration associated with blocks SHOULD
      <bcp14>SHOULD</bcp14> be included in any OSB definition.
      </t>
      <t>
      NOTE: The burden of showing compliance with processing rules is
      placed upon the specifications defining new security blocks blocks, and
      the identification of such blocks shall not, alone, require
      maintenance of this specification.
      </t>
    </section>
    <section anchor="IANA" title="IANA Considerations" toc="default"> toc="default" numbered="true">
      <name>IANA Considerations</name>
      <t>
      This specification includes fields requiring that require registries managed by
      IANA.
      </t>
      <section anchor="BlockType" title="Bundle toc="default" numbered="true">
        <name>Bundle Block Types" toc="default"> Types</name>
        <t>
         This specification allocates two block types from the
         existing "Bundle Block Types" registry defined in <xref target="RFC6255"/>.
         target="RFC6255" format="default"/>.
        </t>

      <texttable

        <table align="center" anchor="iana_table">
         <preamble>
	  <name> Additional Entries for the Bundle Block-Type Codes Registry:
         </preamble>

         <ttcol align="center">Value</ttcol>
         <ttcol align="center">Description</ttcol>
         <ttcol align="center">Reference</ttcol>

         <c>TBA</c>
         <c>Block Integrity Block</c>
         <c>This document</c>

         <c>TBA</c>
         <c>Block Confidentiality Block</c>
         <c>This document</c>

      </texttable> "Bundle Block Types" Registry</name>
          <thead>
            <tr>
              <th align="center">Value</th>
              <th align="center">Description</th>
              <th align="center">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">11</td>
              <td align="center">Block Integrity</td>
              <td align="center">This document</td>
            </tr>
            <tr>
              <td align="center">12</td>
              <td align="center">Block Confidentiality</td>
              <td align="center">This document</td>
            </tr>
          </tbody>
        </table>
        <t>
         The Bundle "Bundle Block Types namespace Types" registry notes whether a block type is
         meant for use in BP version 6, BP version 7, 7 (BPv7), or both.  The two block types
         defined in this specification are meant for use with BP version 7. BPv7.
        </t>
      </section>
      <section anchor="secreasoncode" title="Bundle numbered="true" toc="default">
        <name>Bundle Status Report Reason Codes"> Codes</name>
        <t>
         This specification allocates five reason codes from the
         existing "Bundle Status Report Reason Codes" registry defined
         in <xref target="RFC6255"/>. target="RFC6255" format="default"/>.
        </t>

      <texttable
        <table align="center">
         <preamble>
	  <name> Additional Entries for the Bundle "Bundle Status Report Reason Codes Registry:
         </preamble>

         <ttcol Codes" Registry</name>
          <thead>
            <tr>
              <th align="center">BP Version</ttcol>
         <ttcol align="center">Value</ttcol>
         <ttcol align="center">Description</ttcol>
         <ttcol align="center">Reference</ttcol>

         <c>7</c>
         <c>TBD</c>
         <c>Missing Security Operation</c>
         <c>This Version</th>
              <th align="center">Value</th>
              <th align="center">Description</th>
              <th align="center">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">7</td>
              <td align="center">12</td>
              <td align="center">Missing security operation</td>
              <td align="center">This document, Section <xref target="ReasonCodes"/> </c>

         <c>7</c>
         <c>TBD</c>
         <c>Unknown Security Operation</c>
         <c>This target="ReasonCodes" format="default"/> </td>
            </tr>
            <tr>
              <td align="center">7</td>
              <td align="center">13</td>
              <td align="center">Unknown security operation</td>
              <td align="center">This document, Section <xref target="ReasonCodes"/></c>

         <c>7</c>
         <c>TBD</c>
         <c>Unexpected Security Operation</c>
         <c>This target="ReasonCodes" format="default"/></td>
            </tr>
            <tr>
              <td align="center">7</td>
              <td align="center">14</td>
              <td align="center">Unexpected security operation</td>
              <td align="center">This document, Section <xref target="ReasonCodes"/></c>

         <c>7</c>
         <c>TBD</c>
         <c>Failed Security Operation</c>
         <c>This target="ReasonCodes" format="default"/></td>
            </tr>
            <tr>
              <td align="center">7</td>
              <td align="center">15</td>
              <td align="center">Failed security operation</td>
              <td align="center">This document, Section <xref target="ReasonCodes"/></c>

         <c>7</c>
         <c>TBD</c>
         <c>Conflicting Security Operation</c>
         <c>This target="ReasonCodes" format="default"/></td>
            </tr>
            <tr>
              <td align="center">7</td>
              <td align="center">16</td>
              <td align="center">Conflicting security operation</td>
              <td align="center">This document, Section <xref target="ReasonCodes"/></c>

      </texttable> target="ReasonCodes" format="default"/></td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="SecCtx" title="Security numbered="true" toc="default">
        <name>Security Context Identifiers"> Identifiers</name>
        <t>
         BPSec has a Security Context Identifier field for which
         IANA is requested to create and maintain has created a new registry
         named "BPSec Security Context Identifiers". Initial values
         for this registry are given below.
        </t>
        <t>
         The registration policy for this registry is: is Specification
         Required.
         Required (see <xref target="RFC8126" format="default"/>).
        </t>
        <t>
         The value range is: range: signed 16-bit integer.
        </t>

      <texttable
        <table align="center" anchor="sec_ctx_table">
         <preamble>
            BPSec
	  <name>"BPSec Security Context Identifier Registry
         </preamble>

         <ttcol align="center">Value</ttcol>
         <ttcol align="center">Description</ttcol>
         <ttcol align="center">Reference</ttcol>

         <c>&lt; Identifier" Registry</name>
          <thead>
            <tr>
              <th align="center">Value</th>
              <th align="center">Description</th>
              <th align="center">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">&lt; 0 </c>
         <c>Reserved</c>
         <c>This document</c>

         <c>0</c>
         <c>Reserved</c>
         <c>This document</c>
      </texttable> </td>
              <td align="center">Reserved</td>
              <td align="center">This document</td>
            </tr>
            <tr>
              <td align="center">0</td>
              <td align="center">Reserved</td>
              <td align="center">This document</td>
            </tr>
          </tbody>
        </table>
        <t>
         Negative security context identifiers are reserved for local/site-specific uses.
         The use of 0 as a security context identifier is for non-operational nonoperational testing purposes only.
        </t>
      </section>
    </section>
  </middle>
  <back>
  <references title="Normative References">

     &RFC3552;
     &RFC8174;
     &RFC2119;
     &RFC8949;
     &RFC6255;

     <?rfc include="reference.I-D.draft-ietf-dtn-bpbis-31"?>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3552.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8949.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6255.xml"/>

<reference anchor="I-D.ietf-dtn-bpsec-default-sc"> anchor='RFC9171' target='https://www.rfc-editor.org/info/rfc9171'>
<front>
         <title> BPSec Default
<title>Bundle Protocol Version 7</title>
<author initials='S' surname='Burleigh' fullname='Scott Burleigh'>
    <organization />
</author>
<author initials='K' surname='Fall' fullname='Kevin Fall'>
    <organization />
</author>
<author initials='E' surname='Birrane, III' fullname='Edward J. Birrane, III'>
    <organization />
</author>
<date month='January' year='2022' />
</front>
<seriesInfo name="RFC" value="9171"/>
<seriesInfo name="DOI" value="10.17487/RFC9171"/>
</reference>

<reference anchor='RFC9173' target='https://www.rfc-editor.org/info/rfc9173'>
<front>
<title>Default Security Contexts </title> for Bundle Protocol Security (BPSec)</title>
<author initials='E' surname='Birrane, III' fullname='Edward J. Birrane, III'>
    <organization />
</author>
<author fullname="Alex White" initials="A." surname="White">
    <organization />
</author>
<author initials="E." surname="Birrane"> fullname="Sarah Heiner" initials="S." surname="Heiner">
    <organization />
</author>
<date month="February" year="2021"/> month='January' year='2022' />
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-dtn-bpsec-default-sc-01"/> name="RFC" value="9173"/>
<seriesInfo name="DOI" value="10.17487/RFC9173"/>
</reference>

      </references>

  <references title="Informative References">

   &RFC4838;
   &RFC6257;

   <?rfc include="reference.I-D.draft-birrane-dtn-sbsp-01"?>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4838.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6257.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
      </references>
    </references>
    <section anchor="contr" title="Acknowledgements" toc="default"> toc="default" numbered="false">
      <name>Acknowledgments</name>
      <t>The following participants contributed technical material, use cases,
      and useful thoughts on the overall approach to this security
      specification: Scott Burleigh  <contact fullname="Scott Burleigh"/> of the Jet Propulsion Laboratory,
      Angela Hennessy IPNGROUP, <contact fullname="Angela Hennessy"/> of the Laboratory for Telecommunications
      Sciences, and Amy Alford, Angela Dalton, and Cherita Corbett <contact fullname="Amy Alford"/> and  <contact fullname="Cherita Corbett"/> of the Johns Hopkins
      University Applied Physics Laboratory.</t> Laboratory (JHU/APL), and <contact fullname="Angela Dalton"/> of AMD Research.</t>
      <t>Additionally, Benjamin Kaduk of Akamai Technologies provided a detailed technical review that resulted in a stronger and more precise specification.  </t>
    </section>

  </back>
</rfc>