<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.nl" -->
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" submissionType="IETF" category="exp" xml:lang="en" consensus="yes" docName="draft-michaelson-rpki-rta-02">
<?rfc toc="yes"?><?rfc symrefs="yes"?><?rfc sortrefs="yes"?><?rfc compact="yes"?><?rfc subcompact="no"?><?rfc comments="no"?>
<front>
<title abbrev="RTA">A profile for Resource Tagged Attestations (RTAs)</title><author initials="G." surname="Michaelson" fullname="George G. Michaelson"><organization abbrev="APNIC">Asia Pacific Network Information Centre</organization><address><postal><street>6 Cordelia St</street>
<city>South Brisbane</city>
<code>4101</code>
<country>Australia</country>
<region>QLD</region>
</postal><phone></phone>
<email>ggm@apnic.net</email>
<uri></uri>
</address></author>
<author initials="G." surname="Huston" fullname="Geoff Huston"><organization abbrev="APNIC">Asia Pacific Network Information Centre</organization><address><postal><street>6 Cordelia St</street>
<city>South Brisbane</city>
<code>4101</code>
<country>Australia</country>
<region>QLD</region>
</postal><phone></phone>
<email>gih@apnic.net</email>
<uri></uri>
</address></author>
<author initials="T." surname="Harrison" fullname="Tom Harrison"><organization abbrev="APNIC">Asia Pacific Network Information Centre</organization><address><postal><street>6 Cordelia St</street>
<city>South Brisbane</city>
<code>4101</code>
<country>Australia</country>
<region>QLD</region>
</postal><phone></phone>
<email>tomh@apnic.net</email>
<uri></uri>
</address></author>
<author initials="T." surname="Bruijnzeels" fullname="Tim Bruijnzeels"><organization abbrev="opennetlabs">Open Netlabs B.V.</organization><address><postal><street>Science Park 400</street>
<city>Amsterdam</city>
<code>1098 XH</code>
<country>The Netherlands</country>
<region></region>
</postal><phone></phone>
<email>timb@opennetlabs.nl</email>
<uri></uri>
</address></author>
<author initials="M." surname="Hoffmann" fullname="Martin Hoffmann"><organization abbrev="opennetlabs">Open Netlabs B.V.</organization><address><postal><street>Science Park 400</street>
<city>Amsterdam</city>
<code>1098 XH</code>
<country>The Netherlands</country>
<region></region>
</postal><phone></phone>
<email>martin@nlnetlabs.nl</email>
<uri></uri>
</address></author>
<date/>
<area>Internet</area><workgroup></workgroup><keyword>rpki</keyword>

<abstract><t>This document defines a Cryptographic Message Syntax (CMS) profile
for a general purpose Resource Tagged Attestation (RTA), for use
with the Resource Public Key Infrastructure (RPKI).  The objective
is to allow an attestation, in the form of an arbitrary digital
object, to be signed &quot;with resources&quot;, and for validation to provide
an outcome of &quot;valid with resources&quot;.  The profile is intended to
provide for the signing of an attestation with an arbitrary set of
resources.</t>
</abstract>

</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>This document defines a Cryptographic Message Syntax (CMS) [RFC5652]
profile for a general purpose Resource Tagged Attestation (RTA),
for use with the Resource Public Key Infrastructure (RPKI) [RFC6480].
An RTA allows an arbitrary digital object to be signed &quot;with
resources,&quot; and for validation of the digital signature to provide
an outcome of &quot;valid with resources.&quot;  The profile is intended to
provide for the signing of a arbitrary attestation with a set of
resources by the duly delegated resource holder(s).</t>
<t>The RTA makes use of the template for RPKI Digitally Signed Objects
[RFC6488], which defines a CMS wrapper for the RTA content, as well
as a generic validation procedure for RPKI signed objects.  However,
this specification does not comply to the profile in [RFC6488] in
all respects.  This document describes the areas of difference to
the template profile, the ASN.1 syntax for the RTA eContent, and
the additional steps required to validate RTAs (in addition to the
validation steps specified in [RFC6488].</t>
<t>An RTA is a detached signature CMS model, it leverages concepts
documented in <xref target="RFC8358"></xref> and <xref target="RFC5485"></xref>. Text from these RFCs has
been repurposed removing references to internet-drafts and RFCs
since this is a general detached signature signing model.</t>
</section>

<section anchor="conventions-used-in-this-document" title="Conventions Used In This Document">
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;,
&quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,
&quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as
described in <xref target="RFC2119"></xref> when they appear in ALL CAPS.  These words may
also appear in this document in lower case as plain English words,
absent their normative meanings.</t>
</section>

<section anchor="rta-profile" title="RTA Profile">
<t>An RTA conforms to the template for RPKI Digitally Signed Objects
<xref target="RFC6488"></xref>, with the exception that in order to allow for arbitrary
resource sets to be used to sign an RTA, it may be necessary to use
multiple signatures to sign an RTA.</t>
<t>The differences between this RTA profile and the profile specified
by the RPKI Digitally Signed Object template are as follows:</t>
<t>
<list style="symbols">
<t>Section 2.1 of <xref target="RFC6488"></xref> specifies a single SignerInfo object.
An RTA MAY contain more than one SignerInfo object.</t>
<t>Section 2.1.4, and Section 3 of <xref target="RFC6488"></xref> specify that the
certificates field contains a single EE certificate.  The certificates
field of an RTA contains precisely the same number of EE certificates
as there are SignerInfo objects in the RTA, where each EE certificate
is needed to validate the signature in each SignerInfo.  In addition,
the certificates field MAY contain a collection of CA certificates
that would allow a RP to validate the EE certificates.</t>
<t>Section 2.1.5 of <xref target="RFC6488"></xref> specifies that the crls field be
omitted.  For RTAs the crls field MUST contain the current CRL for
each CA certificate that has been included in the certificates
field of the RTA.</t>
<t>Section 3 of <xref target="RFC6488"></xref> describes the signed object validation
checks that are to be performed by a Relying Party.  Additional
validation checks for an RTA are required, as described in section
5 of this profile.</t>
</list>
</t>
</section>

<section anchor="the-rta-contenttype" title="The RTA ContentType">
<t>The ContentType for an RTA is defined as resourceTaggedAttestation,
and has the numerical value of 1.2.840.113549.1.9.16.1.36</t>
<t>This OID MUST appear both within the eContentType in the encapContentInfo
object as well as the ContentType signed attribute in the signerInfo
object (see <xref target="RFC6488"></xref>).</t>
</section>

<section anchor="the-rta-econtent" title="The RTA eContent">
<t>The content of an RTA indicates that an arbitrary digital object has
been signed &quot;with resources&quot;.  An RTA is formally defined as:</t>

<figure><artwork>   ResourceTaggedAttestationDefinitions DEFINITIONS ::=
   BEGIN

     -- definition from rfc3029
    id-ct OBJECT IDENTIFIER ::= { iso(1) member-body(2)
               us(840) rsadsi(113549) pkcs(1) pkcs-9(9) id-smime(16) 1 }

    id-ct-resourceTaggedAttestation OBJECT IDENTIFIER ::=
               { id-ct(1) 36 }

     ResourceTaggedAttestation ::= SEQUENCE {
         version  [0]          INTEGER DEFAULT 0,
         subjectKeyIdentifers  SubjectKeys,
         resources             ResourceBlock,
         digestAlgorithm       AlgorithmIdentifer,
         messageDigest         OCTET STRING }

      SubjectKeys         ::= SET SIZE (1..MAX) OF SubjectKeyIdentifier
             -- defined in RFC5280

      ResourceBlock       ::= SEQUENCE {
        asID         [0]       AsList OPTIONAL,
        ipAddrBlocks [1]       IPList OPTIONAL }
            -- at least one of asID or ipAddrBlocks must be present

      AsList              ::= SEQUENCE (SIZE(1..MAX)) OF ASIdOrRange
      ASIdOrRange         ::= CHOICE {
         id                   ASId,
         range                ASRange }

      ASRange             ::= SEQUENCE {
         min                  ASId,
         max                  ASId }

      ASId                ::= INTEGER

      IPList              ::= SEQUENCE (SIZE(1..MAX)) OF IPAddressFamily

      IPAddressFamily     ::= SEQUENCE {    -- AFI &amp; optional SAFI --
         addressFamily        OCTET STRING (SIZE (2..3)),
         addressesOrRanges    SEQUENCE OF IPAddressOrRange }

      IPAddressOrRange    ::= CHOICE {
         addressPrefix        IPAddress,
         addressRange         IPAddressRange }

      IPAddressRange      ::= SEQUENCE {
         min                  IPAddress,
         max                  IPAddress }

      IPAddress           ::= BIT STRING

      -- imported from [@!RFC5280]
      AlgorithmIdentifer  ::= SEQUENCE {
         algorithm            OBJECT IDENTIFIER,
         parameters           ANY DEFINED BY algorithm OPTIONAL }
   END
</artwork></figure>

<t>Note that this content appears as the eContent within the
encapContentInfo (see <xref target="RFC6488"></xref>).</t>
<t>[TODO: this needs some work. The AttestationSet is from prior pre-00 state. What is this referring to?]</t>
<t>Note that AttestationSet is a SET OF EncapsulatedContentInfo from <xref target="RFC5485"></xref></t>

<section anchor="version" title="version">
<t>The version number of the ResourceTaggedAttestation MUST be 0.</t>
</section>

<section anchor="subjectkeyidentifiers" title="subjectKeyIdentifiers">
<t>The subjectKeyIdentifiers MUST be the set of SubjectKeyIdentifier
values contained in each of the EE certificates carried in the CMS
certificates field.</t>
</section>

<section anchor="resources" title="resources">
<t>The resources contained here are the resources used to tag the
attestation, and MUST match the set of resources listed by the set
of EE certificates carried in the CMS certificates field.</t>
<t>The ordering of resources is defined in <xref target="RFC3779"></xref>.</t>
</section>

<section anchor="digestalgorithm" title="digestAlgorithm">
<t>The digest algorithm used to create the message digest of the attested
digital object. This algorithm MUST be a hashing algorithm defined in
<xref target="RFC7935"></xref>.</t>
</section>

<section anchor="messagedigest" title="messageDigest">
<t>The message digest of the attested digital object using the algorithm
specified in the digestAlgorithm field.</t>
</section>

<section anchor="attestations" title="attestations">
<t>The SET OF EncapsulatedContentInfo <xref target="RFC5485"></xref> which form the individual digital signatures, made by each signing party. For
each instance in the set, one of the subjectKeyIdentifiers MUST identify a certificate which can validate the signature. This means that there will be an instance of a SignedData and SignerInfo for that subjectKeyIdentifier (SignerInfo.sid)</t>
<t>The eContentType is id-ct-anyContentType, which refers to the ASN.1 ANY octet sequence.</t>
</section>
</section>

<section anchor="rta-validation" title="RTA Validation">
<t>To validate an RTA the relying party MUST perform all the validation
checks specified in <xref target="RFC6488"></xref> as well as the following additional
RTA-specific validation steps.</t>
<t>
<list style="symbols">
<t>Canonicalization of the attested object MUST be performed.</t>
<t>The message digest of the attested object using the digest algorithm
specified in the the digestAlgorithm field MUST be calculated and MUST
match the value given in the messageDigest field of the RTA content.</t>
<t>The signature verification process defined section 5.6 of
<xref target="RFC5652"></xref> MUST be performed for all public keys referenced in
each SignerInfo of the CMS.  If any signature cannot be verified,
then the RTA MUST NOT be validated. This process includes CRL
checks which may require fetching from the CRLDP of any certificate
without an embedded CRL in the CMS which is current.</t>
</list>
</t>
<t>[TODO more text needed about CRL/CRLDP and handling expired CRLS]</t>
<t>
<list style="symbols">
<t>The set of public keys contained in the subjectKeyIdentifers of
the RTA MUST exactly match the set of subjectKeyIdentifiers contained
in the set of SignerInfo objects of the CMS object.</t>
<t>The set of resources contained in resources of the RTA MUST
exactly match the set of resources contained in the set of EE
certificates of the CMS object.</t>
<t>The number of certificates in the CMS object MUST equal the
number of signerInfo objects in the CMS, and the subjectKeyidentifiers
in these certificates MUST match one and only one subjectkeyidentifier
of a signerinfo object.</t>
</list>
</t>
</section>

<section anchor="need-for-canonicalization" title="Need for Canonicalization">
<t>As in <xref target="RFC5485"></xref> and <xref target="RFC8358"></xref> there is a need for canonicalization.</t>
<t>The following text is based on section 4 of <xref target="RFC8358"></xref> with changes to remove
references to internet-drafts and RFCs.</t>
<t>In general, the content is treated like a single
octet string for the generation of the digital signature.
Unfortunately, text and HTML files require canonicalization to
avoid signature validation problems.  The primary concern is the
manner in which different operating systems indicate the end of a
line of text.  Some systems use a single new-line character, other
systems use the combination of the carriage-return character followed
by a line-feed character, and other systems use fixed-length records
padded with space characters.  For the digital signature to validate
properly, a single convention must be employed.</t>

<section anchor="ascii-utf-8-and-html-file-canonicalization" title="ASCII, UTF-8, and HTML File Canonicalization">
<t>The canonicalization procedure follows the conventions used for text
files in the File Transfer Protocol (FTP) [FTP].  Such files must be
supported by FTP implementations, so code reuse seems likely.</t>
<t>The canonicalization procedure converts the data from its internal
character representation to the standard 8-bit NVT-ASCII
representation (see TELNET [TELNET]).  In accordance with the NVT
standard, the &lt;CRLF&gt; sequence MUST be used to denote the end of a
line of text.  Using the standard NVT-ASCII representation means that
data MUST be interpreted as 8-bit bytes.</t>
<t>Trailing space characters MUST NOT appear on a line of text.  That
is, the space character must not be followed by the &lt;CRLF&gt; sequence.</t>
<t>Thus, a blank line is represented solely by the &lt;CRLF&gt; sequence.</t>
<t>The form-feed nonprintable character (0x0C) is expected.</t>
<t>Other non-printable characters, such as tab and backspace,
are not expected, but they do occur.  Non-printable or non-ASCII
characters (ones outside the range 0x20 to 0x7E) MUST NOT be changed
in any way not covered by the rules for end-of-line handling in the
previous paragraph.</t>
<t>Trailing blank lines MUST NOT appear at the end of the file.  That
is, the file must not end with multiple consecutive &lt;CRLF&gt; sequences.</t>
<t>In some environments, a Byte Order Mark (BOM) (U+FEFF) is used at the
beginning of a file to indicate that it contains non-ASCII
characters.  In UTF-8 or HTML files, a BOM at the beginning of the
file is not considered to be part of the file content.  One or more
consecutive leading BOMs, if present, MUST NOT be processed by the
digital signature algorithm.</t>
<t>Any end-of-file marker used by an operating system is not considered
to be part of the file content.  When present, such end-of-file
markers MUST NOT be processed by the digital signature algorithm.</t>
<t>Note: This text file canonicalization procedure is consistent with
the NVT-ASCII definition offered in Appendix B of RFC 5198 [UFNI].</t>
</section>

<section anchor="xml-file-canonicalization" title="XML File Canonicalization">
<t>Utilities that produce XML files are expected to follow the guidance
provided by the World Wide Web Consortium (W3C) in Section 2.11 of
[R20081126].  If this guidance is followed, no canonicalization is
needed.</t>
<t>A robust signature generation process MAY perform canonicalization to
ensure that the W3C guidance has been followed.  This guidance says
that a &lt;LF&gt; character MUST be used to denote the end of a line of
text within an XML file.  Therefore, any two-character &lt;CRLF&gt;
sequence and any &lt;CR&gt; that is not followed by &lt;LF&gt; are to be
translated to a single &lt;LF&gt; character.</t>
</section>

<section anchor="no-canonicalization-of-other-file-formats" title="No Canonicalization of Other File Formats">
<t>No canonicalization is needed for file formats currently used or
planned other than ASCII, UTF-8, HTML, and XML files.  Other file
formats, including PDF [PDF], PostScript [PS], and EPUB [EPUB] are
treated as a simple sequence of octets by the digital signature
algorithm.</t>
</section>
</section>

<section anchor="standalone-use" title="Standalone Use">
<t>An RTA MAY include the set of certificates and CRL which permit the RTA and
the object which has been signed to be validated cryptographically
given a set of applicable trust anchors. The set of certificates and CRLs
must form a complete path from a trust anchor to each end-entity
certificate used to sign.</t>
<t>No publication protocol is specified, or expected. RTA objects are
standalone, and intended to be exchanged freely as attachments to
email or lodged in the web, or other mechanisms.</t>
<t>The EE certificates generated and used to sign MAY omit the Subject
Information Access (SIA) extension mandated by RFC 6487 as that
extension requires an rsync URI for the accessLocation form and
the RTA method does not require repository access via rsync.</t>
<t>An RTA and its associated EE certificates MAY appear on an RPKI
Manifest and MAY be published in a repository.</t>
</section>

<section anchor="iana-considerations" title="IANA Considerations">
<t>IANA is entirely off the hook on this one.</t>
</section>

<section anchor="security-considerations" title="Security Considerations">
<t>Security is explicitly a consideration in the whole of this draft.</t>
<t>The intent is to make testable digital signatures over data to associate
the data with specific INR.</t>
<t>
<list style="symbols">
<t>If the private key of any RPKI certificate leaks, anyone could
in theory make signatures.</t>
<t>The applicability of the INR to the INR in the data is not
specified. Validity is taken to mean the cryptographic validity
of the certification chains, and associated signatures. The
applicability of the specific RFC3779 resources to the signed data
is out of scope.</t>
<t>Given the lack of constraint on signed objects, there is no
intention to have the signed object placed in a repository or
appear on a manifest, or in any other way interfere with the
operations of the distributed RPKI system. RTA objects themselves
may appear in repositories, and are constrained in size to the
ASN.1 encoded burden of the set of certificates which are sufficient
to describe the RFC3779 resources associated with the signatures.</t>
<t>By design, each signing party signs the RTA object discretely.
Since the RTA object includes the set of subjectKeyIdentifiers
there is partial closure over the question &quot;who agrees to sign&quot;
since the object is only valid if the set of signing parties matches
the list of expected signing keys. However, in principle a sub-set
(down to one) of these signing parties can assert an RTA which
specifies only that subset, or itself solely to sign, and make a
valid RTA which cannot be disproved. Since the RTA can only refer
to RFC3779 data which is within scope of the set of signers, the
impact of this is to refine (narrow down) the relevant set of
internet resources which can relate to the (detached) signed object.
However, this places the burden of semantic validation of the
meaning of those resources, contextually, on the consumer. Caveat
Emptor.</t>
</list>
</t>
</section>

<section anchor="acknowledgments" title="Acknowledgments">
<t>Russ Housely advised informally on the use of CMS signed objects around 2012.</t>
<t>Russ's work on CMS signed internet drafts in <xref target="RFC8358"></xref> and
<xref target="RFC5485"></xref> has been re-purposed here to apply to arbitrary signed
objects, not just internet-drafts and text documents.</t>
<t>An early implementation of RTA was coded by Robert Loomans and Gary
Kennedy at APNIC before 2011 which used simpler ASN.1 semantics to
specify the signed object.</t>
<t>Jamie Gillespie (APNIC) provided valuable feedback and critique of the 00 draft.</t>
<t>NLNet Labs implemented RTA in Krill and Routinator in 2021.</t>
</section>

<section anchor="revision-history" title="Revision history">
<t>
<list style="symbols">
<t>00 draft initial upload from older text, inclusion of CMS references.</t>
<t>01 draft explicit language for the lack of repository references, use of CRL, spellcheck nits.</t>
<t>02 draft released with new code from NLNet, waking up the work</t>
</list>
</t>
</section>

</middle>

<back>
<references title="Normative References">
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5652.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8358.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5485.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6488.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3779.xml"?>
<?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7935.xml"?>
</references>

</back>

</rfc>
