<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-timbru-sidrops-rpki-publication-v2-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="false" consensus="true">

<front>
<title abbrev="Publication Protocol V2">RPKI Publication Protocol Version 2</title><seriesInfo value="draft-timbru-sidrops-rpki-publication-v2-00" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="T." surname="Bruijnzeels" fullname="Tim Bruijnzeels"><organization>NLnet Labs</organization><address><postal><street></street>
</postal><email>tim@nlnetlabs.nl</email>
<uri>https://www.nlnetlabs.nl/</uri>
</address></author><date/>
<area>Internet</area>
<workgroup></workgroup>

<abstract>
<t>The RPKI Publication Protocol first described in RFC 8181 has worked
very well. That said, as it turns out, there are a number of requirements
emerging from operational experience which cannot be supported by the current
protocol. In particular, identity key roll overs, support for publication
quota and stricter verification of content by the server.</t>
<t>This document is an early write-up with the following goals: (1) support
discussions about requirements for additional work and (2) explore a
possible version 2 with solutions to meet those requirements.</t>
</abstract>

</front>

<middle>

<section anchor="requirements-notation"><name>Requirements notation</name>
<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;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in
this document are to be interpreted as described in BCP 14 <xref target="RFC2119"></xref>
<xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>
</section>

<section anchor="introduction"><name>Introduction</name>
<t>The RPKI Publication Protocol first described in RFC 8181 has worked
very well. At the time of this writing, there are at least four completely
independent interoperable software implementations, and over 50 separate
deployments. At least one server deployment has well over 1000 remote
publishers communicating to it using the RFC 8181 protocol.</t>
<t>That said, as it turns out, there are a number of requirements emerging
from operational experience which cannot be supported by the current
protocol. In particular, identity key roll overs, support for publication
quota and stricter verification of content by the server.</t>
<t>This document is an early write-up with the following goals: (1) support
discussions about requirements for additional work and (2) explore a
possible version 2 with solutions to meet those requirements.</t>
<t>It should be noted that a key feature in the possible solution discussed
in this document is the support for seamless version negotiations between
publishers (RPKI Certification Authorities) and the RPKI Publication
Server. Any version 2 capable publisher will simply continue to use
version 1 (RFC 8181) if the Publication Server is not capable to do
version 2, and vice versa, version 2 capable servers will simply continue
to use version 1 for version 2 non-capable publishers. This is important
because it allows for incremental deployment of this new version without
the need for centralised coordination on upgrades.</t>
</section>

<section anchor="naming-conventions-in-this-document"><name>Naming Conventions in this Document</name>

<section anchor="publisher"><name>Publisher</name>
<t>An RPKI Certification Authority which implements the client side
of the protocol defined in this document - i.e. it uses a 'server'
to publish its RPKI content.</t>
</section>

<section anchor="query"><name>Query</name>
<t>A request sent by a Publisher.</t>
</section>

<section anchor="server"><name>Server</name>
<t>An RPKI Publication Server that implements the server side of the
protocol defined in this document.</t>
</section>

<section anchor="reply"><name>Reply</name>
<t>A reply returned by the Server in response to a Query sent by a Publisher.</t>
</section>

<section anchor="v1"><name>V1</name>
<t>The RPKI Publication Protocol as defined in <xref target="RFC8181"></xref>.</t>
</section>

<section anchor="v2"><name>V2</name>
<t>The RPKI Publication Protocol version 2 defined in this document.</t>
</section>
</section>

<section anchor="protocol-version-negotiation"><name>Protocol Version Negotiation</name>
<t>Publishers and servers can negotiate whether to use V1 or V2 without
requiring either party to implement V2. This is important because it
allows for incremental deployment of V2 without the need for centralised
coordination.</t>
<t>For this reason all V2 capable Publishers and Servers SHOULD also
support V1. An exception can be made if the Publisher and Server have
prior knowledge that both support V2, in which case this protocol version
negotiation is not applicable.</t>
<t>Given that Publishers contact the Server in V1 over an HTTP based client-
server protocol, we can leverage HTTP &quot;Accept&quot; and &quot;Content-Type&quot; headers
to support version negotiation.</t>
<t>The Publisher MUST use V1 queries as long as the Server is not known to
be V2 capable. The publisher SHOULD initiate version negotiation
whenever it sends any V1 query by including the following additional
HTTP header:</t>

<artwork>  Accept: application/rpki-publication, application/rpki-publication-v2
</artwork>
<t>If the Server is not V2 capable then it can ignore this header and
respond with the normal applicable V1 reply which will include a
Content-Type header with the value &quot;application/rpki-publication&quot;.</t>
<t>If the server supports V2 then it MUST respond with a V2 &quot;Repository Info
Reply&quot; and use a Content-Type header with the value
&quot;application/rpki-publication-v2&quot;, instead of performing any action that
would normally be done in response to the V1 query. The Publisher MUST
then proceed to use V2 for subsequent queries using the (possibly new)
service URI in that reply.</t>
<t>In case a server receives a V2 request, and for some reason it no longer
supports V2, then it may be expected according to <xref target="RFC8181"></xref> that a V1
&lt;report_error/&gt; is returned and the content type &quot;application/rpki-publication&quot;
is used in the response.</t>
<t>If the Publisher gets the V1 content type &quot;application/rpki-publication&quot; in
response to any V2 request that it sent, then it MUST fall back to using
using the V1 protocol. But, it MAY continue to initiate protocol version
negotiation as described above in future requests.</t>
</section>

<section anchor="protocol-message-specification"><name>Protocol Message Specification</name>
<t>The publication protocol uses a simple request/response interaction over
HTTPS. We will refer to requests sent by the publisher as 'queries',
and we will refer to responses returned by the server as 'replies'.</t>
<t>All queries and replies MUST use the Content-Type header. The value
of this header MUST be:</t>

<artwork>application/rpki-publication-v2
</artwork>
<t>Queries and replies are RPKI Publication Protocol Version 2 Messages,
which are signed Cryptographic Message Syntax (CMS) messages. The CMS
encapsulation is similar to the definition in V1 (section 2 of <xref target="RFC8181"></xref>),
and almost identical to that used in Section 3.1 of <xref target="RFC6492"></xref>, with
the following notable differences.</t>

<section anchor="econtent"><name>eContent</name>
<t>A key difference with the eContent specification from Section 3.1.1.3.2
of <xref target="RFC6492"></xref> is that we will use DER encoded content here, rather than
the XML message content that is used in <xref target="RFC6492"></xref> and <xref target="RFC8181"></xref>.</t>
<t>Note that one of the reasons for preferring DER over XML is that it will
allow for more concise messages. For example V1 uses base64 encoded (DER)
objects wrapped in XML for publication queries. This is rather wasteful.</t>
<t>Another reason is that we may benefit from formal ASN.1 notations, rather
than XML schema definitions. While ASN.1 may not be very widely known in
general, implementing Publishers and Servers are already required to
understand and deal with ASN.1 and DER in many other parts of this protocol,
and the RPKI standards in general, so using it here does not seem to
place a huge additional burden.</t>
<t>On the other hand, it is understood that the threshold to implement may
be lower if XML is used as it will require fewer changes in existing
code. So, this idea is not cast in stone.</t>

<artwork>eContent ::= SEQUENCE {
  nonce           UUID,
  MessageType     MessageType,
  MessageContent  [0] EXPLICIT OCTET STRING OPTIONAL,
}

UUID ::= OCTET STRING (SIZE(16))
  -- constrained to a UUID

MessageType ::= PrintableString (SIZE (1..32))

MessageContent ::= OCTET STRING
  -- constrained to DER encoded message type
  -- specific content - specified in the relevant
  -- sections of this document.
</artwork>
<t>Note that each query and response type defined in this document will
specify its own MessageType value and MessageContent definition.</t>
</section>

<section anchor="econtenttype"><name>eContentType</name>
<t>Because we no longer use XML based eContent, we will also use a new
eContentType OID, rather the value defined in Section 3.1.1.3.1 of
<xref target="RFC6492"></xref>.</t>
<t>The eContentType for the RPKI Publication Protocol Version 2 Message
object is defined as &quot;To be determined&quot;, and has numerical value of &quot;To
be determined&quot;. TODO: Request OID from IANA.</t>
</section>

<section anchor="ee-certificate-and-timing-parameters"><name>EE Certificate and Timing Parameters</name>
<t>Single use EE certificates MUST be used in the CMS wrapper. Each EE
certificate MUST use a new unique key-pair. As specified in <xref target="RFC6492"></xref>
either the signing-time attribute, or binary-signing-time attribute, or
both attributes MUST be present. Their values MUST represent the actual
time of signing the CMS.</t>
<t>The EE certificate SHOULD use a 'notBefore' time that is set to 5
minutes before the signing time, and a 'notAfter' time that is set to 5
minutes after the signing time. The reason for this is there may be a
small amount of clock skew between a publisher and server, and because
the protocol messages are generated moments before they are sent, small
time differences could lead to rejection of all messages. Note that this
protocol uses additional measures to protect against replays.</t>
</section>

<section anchor="replay-protection"><name>Replay Protection</name>

<section anchor="publisher-to-server"><name>Publisher to Server</name>
<t>The publisher MUST generate a new unique UUID that will be used as the
nonce value for any query that it sends to the server. The server MUST
keep track of received nonce values for all received queries for which
the EE certificate is not yet expired, and the server MUST reject any
query that is found to re-use any such existing nonce.</t>
</section>

<section anchor="server-to-publisher"><name>Server to Publisher</name>
<t>The server MUST use the nonce value from the applicable query whenever
it generates a reply for that query. The publisher MUST verify that the
nonce is any reply matches the query that they sent, and MUST reject the
reply if this is not the case.</t>
</section>
</section>
</section>

<section anchor="protocol-exchanges"><name>Protocol Exchanges</name>
<t>All protocol exchanges are initiated by the Publisher. In a typical
exchange the Publisher sends a specific type of Query and then gets a
matching Reply from the Server in response.</t>

<section anchor="general-replies"><name>General Replies</name>
<t>There are a number of generic replies that the server could return in
response to a query:</t>

<section anchor="rate-limit-reply"><name>Rate Limit Reply</name>
<t>The server MAY enforce a rate limit on publisher connections. If the
server does this, then it SHOULD enforce rate limits on a per publisher
basis in order to avoid that a bad actor publisher can impact other
publishers. Furthermore, if a rate limit is used then it MUST be
included in the Status Reply to publishers.</t>
<t>One of the main motivations for rate limiting publisher connections is
to protect the server from resource exhaustion because of publisher
query parsing and validation, and generating and signing replies.</t>
<t>For this reason the rate limit response will use a plain &quot;429 Too Many
Requests&quot; response (section 4 of <xref target="RFC6585"></xref>) in case the rate limit
threshold is set. If a rate limit response is sent then the query MUST
NOT be processed by the server.</t>
<t>When a publisher encounters a rate limit response, then it MUST NOT try
to contact the server again for at least the last known rate limit
period received in a status reply, or 5 minutes if no such limit is
known to the publisher.</t>
</section>

<section anchor="unknown-publisher-reply"><name>Unknown Publisher Reply</name>
<t>The server SHOULD return a '404 Not Found' response (<xref target="RFC9110"></xref>) if a
publisher is not known.</t>
<t>Note that all publishers SHOULD each get a unique unguessable service
URI in their initial <xref target="RFC8183"></xref> response so that the server can
efficiently determine that a publisher is unknown. Strictly speaking it
is possible to guess which publisher sent a message by looking at the
Authority Key Identifier of the embedded EE certificate in a query
message CMS wrapper, but doing so would be extremely inefficient and
leave the server vulnerable to denial of service attacks.</t>
</section>

<section anchor="bad-request-reply"><name>Bad Request Reply</name>
<t>This type of Reply is used in case of general issues with the request
that was sent, rather than the content of the query in the request CMS.</t>
<t>The server SHOULD return a '400 Bad Request' response (<xref target="RFC9110"></xref>) in
case the protocol message could not be parsed or validated. The message
body MAY contain a clear text hint as a courtesy to the publisher. The
message MUST NOT be longer 128 characters, SHOULD use visible 7-bit ASCII
characters, and SHOULD be written in english.</t>
<t>Theoretically, we could have the server return detailed and signed error
replies. However, this (signing) would cause load on the server and
could be abused as an attack vector, and on top of that detailed errors
could aid malicious attackers.</t>
<t>The following fairly minimal message bodies are RECOMMENDED for error
conditions:</t>
<table>
<thead>
<tr>
<th>message</th>
<th>explanation</th>
</tr>
</thead>

<tbody>
<tr>
<td>&quot;invalid syntax&quot;</td>
<td>Message could not be parsed</td>
</tr>

<tr>
<td>&quot;replay detected&quot;</td>
<td>Message may be valid, but was seen before</td>
</tr>

<tr>
<td>&quot;key unknown&quot;</td>
<td>Message EE AKI does not match key for publisher</td>
</tr>

<tr>
<td>&quot;not yet valid&quot;</td>
<td>Message EE not-before is after now</td>
</tr>

<tr>
<td>&quot;expired&quot;</td>
<td>Message EE not-after is before now</td>
</tr>

<tr>
<td>&quot;message invalid&quot;</td>
<td>Message validation failed for some other reason</td>
</tr>
</tbody>
</table><t>Publishers SHOULD log any Bad Request Response in a way that would be
visible to the operators of the publisher, because in many cases manual
intervention will be required to resolve the issue.</t>
<t>If the error is caused by &quot;message key unknown&quot; then this is indicative
of an issue where the publisher and server are out-of-sync with regards
to the BPKI TA key pair used by the publisher. In this case the operator
of the publisher should try to re-exchanges <xref target="RFC8183"></xref> XML with the
server.</t>
<t>Other errors are most likely caused by clock skew, or a bug on either
the publisher or server side. Because the issue could be on the server
side and be fixed there, the publisher SHOULD keep retrying to contact
the server albeit with the same timing constrains as mentioned in
relation to Rate Limit Responses.</t>
</section>

<section anchor="server-error-5xx-responses"><name>Server Error 5xx Responses</name>
<t>The server SHOULD NOT return any 5xx type HTTP error responses. However,
this kind of response can occur as a result of an unrecoverable error at
the server.</t>
<t>Publishers SHOULD treat any 5xx responses they encounter as though they
were Rate Limit Responses, but it is RECOMMENDED that they are logged in
order to help debugging should they persist.</t>
</section>

<section anchor="general-server-error-reply"><name>General Server Error Reply</name>
<t>Note that exchanges define their own typed error replies where
applicable. That said, the server SHOULD return a General Server Error
Reply in case it encountered some unexpected error that it could recover
from.</t>
<t>Publisher MUST treat this type of reply similar to a 5xx response.</t>

<section anchor="messagetype"><name>MessageType</name>
<t>The MessageType for this query is: &quot;general-server-error&quot;</t>
</section>

<section anchor="messagecontent"><name>MessageContent</name>
<t>This response MAY include a human readable, preferably english, error
message directed at operators. Note that the publisher software can only
log this information, but it cannot take any specific action based on
the content.</t>

<artwork>MessageContent ::= PrintableString(SIZE (0..127))
</artwork>
</section>
</section>

<section anchor="ok-reply"><name>Ok Reply</name>
<t>The Ok Reply is used in some exchanges where the server wants to inform
the publisher that their query was successfully processed, but there is
no additional information to include in the response.</t>

<section anchor="messagetype-1"><name>MessageType</name>
<t>The MessageType for this query is: &quot;ok-reply&quot;</t>
</section>

<section anchor="messagecontent-1"><name>MessageContent</name>
<t>There is no content to include for this reply.</t>
</section>
</section>
</section>

<section anchor="repository-info-exchange"><name>Repository Info Exchange</name>
<t>The reply of this exchange is used in protocol version negotiation and
serves to inform the Publisher about the possibly new service URI that
it should use for V2, as well as further applicable constrains.</t>
<t>The Publisher MAY initiate a new repository info exchange later, but the
response SHOULD NOT change over time, with the possible exception of the
value of &quot;SupportedTypes&quot;. (perhaps that means that does not belong here)</t>

<artwork>Publisher ---- Repository Info Query -----&gt;  Server
          &lt;--- Repository Info Reply ------
</artwork>

<section anchor="repository-info-query"><name>Repository Info Query</name>
<t>The MessageType for this query is &quot;repository-info-query&quot;, and the
MessageContent is omitted.</t>
</section>

<section anchor="repository-info-reply"><name>Repository Info Reply</name>
<t>The MessageType for this reply is &quot;repository-info-reply&quot;, and the
MessageContent is as follows:</t>

<artwork>MessageContent ::= SEQUENCE {
    ServiceUri     [0] ServiceUri,
    RsyncModuleUri [1] RsyncModuleUri,
    BasePath       [2] BasePath,
    RrdpNotifyUri  [3] RrdpNotifyUri OPTIONAL,
    SupportedTypes [4] SupportedTypes OPTIONAL,
}

HttpsUri ::= IA5String
  -- Constrained to an HTTPS URI

BasePath ::= IA5String,
  -- relative base path for the publisher

RsyncModuleUri  ::= IA5String
  -- Constrained to an rsync URI
  -- MUST end with a slash and refer to the base
  -- directory of the publication server's
  -- rsync module.

RrdpNotifyUri ::= IA5String
  -- Constrained to an HTTP(s) URI
  -- MUST refer to the RRDP Notification URI [RFC8182]
  -- for this publication server.


SupportedTypes ::= SEQUENCE (SIZE(1..MAX)) OF RpkiObjectType

RpkiObjectType ::= PrintableString (SIZE (4))
  -- Constrained to a '.' character followed
  -- by a three letter extension specified in
  -- the IANA &quot;RPKI Repository Name Scheme&quot; registry
</artwork>

<section anchor="serviceuri"><name>ServiceUri</name>
<t>Contains the unique service URI for this publisher. If this is a new
URI, then it MUST be on the same host (avoid key theft and MiTM
redirecting publishers).</t>
<t>V2 will require unique URIs so that we do not need to send publisher
handles in each query but can do it as a path parameter. It also allows
more efficient processing for unknown publishers and per publisher rate
limits to be enforced more intuitively and without the need for object
parsing which could be a DoS vector otherwise.</t>
</section>

<section anchor="rsyncbaseuri"><name>RsyncBaseUri</name>
<t>This is an rsync URI <xref target="RFC5781"></xref> pointing to the base rsync module used
by the publication server.</t>
</section>

<section anchor="basepath"><name>BasePath</name>
<t>This is the relative base path under the rsync module where the querying
publisher is allowed to publish their objects. The BasePath MUST NOT
be empty if the server supports multiple publishers.</t>
<t>The BasePath MUST be a unix style relative directory path. It MUST use
the following ABNF syntax <xref target="RFC5234"></xref>:</t>

<artwork>BasePath =  empty / sub-dir

empty    = &quot;&quot;
sub-dir  = dir *(dir)

dir      = *(DIGIT / ALPHA / &quot;-&quot; / &quot;_&quot; ) &quot;/&quot;
</artwork>
<t>Note that publishers will specify relative object paths under their base
path during the publication exchange defined below to ensure that <em>all</em>
objects are always constrained to the publishers space. This eliminates
the possibility of Publishers trying to update any object outside of their
own &quot;jail&quot;. In V1 the full path was used for objects, and the Server would
response with a &quot;permission_failure&quot; error code in case a Publisher tried
to use an URI it was not authorised to use.</t>
<t>The publisher can derive public URIs for their objects, e.g. for use in
SIA and AIA fields of certificates and objects they sign, by concatenating
the following:</t>

<artwork>URI = Rsync Base Uri / Base Path / Relative Object Path
</artwork>
</section>

<section anchor="rrdpnotifyuri"><name>RrdpNotifyUri</name>
<t>If the publication server supports the RRDP <xref target="RFC8182"></xref>, then it MUST
include the public HTTPS URI <xref target="RFC8820"></xref> for the RRDP notification file
here.</t>
</section>

<section anchor="supportedtypes"><name>SupportedTypes</name>
<t>If the server enforces RPKI object type restrictions, then it MUST
include the full list of supported object types. Object types are
defined by the extension registered in the IANA &quot;RPKI Repository Name
Scheme&quot; registry. E.g. the object type for ROA is &quot;.roa&quot;.</t>
</section>
</section>
</section>

<section anchor="status-exchange"><name>Status Exchange</name>
<t>The status exchange is used to query the server for the current objects
and quota state for this publisher. Furthermore, the server can
communicate a planned key rollover of its identity key in this exchange.</t>
<t>Publishers SHOULD initiate a status exchange before initiating any
publication exchange.</t>

<artwork>Publisher ---------- Status Query ---------&gt;  Server
          &lt;--------- Status Reply ----------
</artwork>

<section anchor="status-query"><name>Status Query</name>
<t>The MessageType for this query is: &quot;status-query&quot;, the
MessageContent is omitted.</t>
</section>

<section anchor="status-reply"><name>Status Reply</name>
<t>The MessageType for this query is: &quot;status-reply&quot;. The
MessageContent is as follows:</t>

<artwork>MessageContent ::= SEQUENCE {
  CurrentFiles     CurrentFiles,
  QuotaNumberInfo  [0] QuotaNumberInfo OPTIONAL
  QuotaSizeInfo    [1] QuotaSizeInfo OPTIONAL
  NewBpkiTaCert    [2] NewBpkiTaCert OPTIONAL
}

CurrentFiles ::= SEQUENCE (SIZE(0..MAX)) OF CurrentFile

CurrentFile  ::= SEQUENCE {
  RelativePath     IA5String,
  Hash             BitString
}

QuotaNumberInfo ::= SEQUENCE {
  used    Integer,
  warn    Integer,
  limit   Integer
}

QuotaSizeInfo ::= SEQUENCE {
  used    Integer,
  warn    Integer,
  limit   Integer
}

NewBpkiTaCert ::= OCTET STRING
  -- constrained to a DER encoded self-signed
  -- BPKI TA certificate
</artwork>

<section anchor="currentfiles"><name>CurrentFiles</name>
<t>Contains the full list of current published files. Files are described
by their relative path under the publisher's base path and use the
SHA-256 hash.</t>
</section>

<section anchor="quotanumberinfo"><name>QuotaNumberInfo</name>
<t>Optional element that MUST be included if the server enforces any quota
based on the number of files published by a publisher. It is RECOMMENDED
that servers enforce such quota. If they do, they SHOULD choose a number
for the warn level that is significantly lower than the limit.</t>
</section>

<section anchor="quotanumbersize"><name>QuotaNumberSize</name>
<t>Optional element that MUST be included if the server enforces any quota
based on the combined size of files published by a publisher. Numbers
are in kB, rounded up in case of 'used'. It is RECOMMENDED that servers
enforce this type of quota. If they do, they SHOULD choose a number
for the warn level that is significantly lower than the limit.</t>
</section>
</section>

<section anchor="newbpkitacert"><name>NewBpkiTaCert</name>
<t>Servers may wish to perform a key roll of their BPKI TA certificate
(see <xref target="RFC8183"></xref>). To achieve this the server can generate a new keypair
and self-signed BPKI TA certificate - which can be used for publishers
in future <xref target="RFC8183"></xref> out-of-band setup exchanges.</t>
<t>However, it would be extremely impractical to require that all existing
publishers re-do such an exchange. Furthermore, the server has no active
way to reach out to publishers because all exchanges are initiated by
the publishers.</t>
<t>By including the optional NewBpkiTaCert element in a status reply the
Server MAY communicate to Publishers that they intend to migrate to a
new identity key.</t>
<t>If a publisher sees a new BPKI TA certificate included this way, then
they SHOULD perform a &quot;Server Key Accept Exchange&quot; (see elsewhere in doc)
at their earliest convenience.  The server MUST NOT include this element
to publishers which have accepted the new key.</t>
<t>Note that if a publisher wishes to perform a key roll of their own BPKI
TA certificate, they need to initiate a &quot;Publisher Key Change Exchange&quot;
(section ..).</t>
</section>
</section>

<section anchor="publication-exchange"><name>Publication Exchange</name>
<t>The publishers initiates a publication exchange in order to request
adding, updating, or withdrawing objects under its designated
publication point at the server.</t>
<t>The server reply can be an empty ok reply, a warning reply which
indicates that publication was successful but the publisher should be
aware of certain things (like quota warnings), or an error reply which
indicates that publication was rejected.</t>

<artwork>Publisher ---- Publication Query ----------&gt;  Server

          &lt;-- Publication Ok Reply ---------
one of:   &lt;-- Publication Warning Reply ----
          &lt;-- Publication Error Reply ------
</artwork>

<section anchor="publication-query"><name>Publication Query</name>
<t>The MessageType for this query is: &quot;publication-query&quot;. The
MessageContent is as follows:</t>

<artwork>MessageContent ::= SEQUENCE {
  Additions   SEQUENCE (SIZE(0..MAX)) OF AddedFile
  Updates     SEQUENCE (SIZE(0..MAX)) OF UpdatedFile
  Withdrawals SEQUENCE (SIZE(0..MAX)) OF WithdrawnFile
}

AddedFile  ::= SEQUENCE {
  RelativePath     RelativePath,
  Content          OctetString
}

UpdatedFile  ::= SEQUENCE {
  RelativePath     RelativePath,
  Content          OctetString,
  OldFileHash      Hash
}

WithdrawnFile ::= SEQUENCE {
  RelativePath     RelativePath,
  OldFileHash      Hash
}

RelativePath ::= IA5String

Hash ::= BIT STRING
</artwork>
</section>

<section anchor="publication-ok-reply"><name>Publication Ok Reply</name>
<t>The MessageType for this reply is: &quot;publication-ok-reply&quot;, and the
MessageContent is omitted.</t>
</section>

<section anchor="publication-warning-reply"><name>Publication Warning Reply</name>
<t>The MessageType for this reply is: &quot;publication-warning-reply&quot;, the
MessageContent is as follows:</t>

<artwork>MessageContent ::= SEQUENCE {
  QuotaNumberWarning [0] QuotaNumberInfo OPTIONAL
  QuotaSizeWarning   [1] QuotaSizeInfo OPTIONAL
}

QuotaNumberInfo ::= SEQUENCE {
  used    Integer,
  warn    Integer,
  limit   Integer
}

QuotaSizeInfo ::= SEQUENCE {
  used    Integer,
  warn    Integer,
  limit   Integer
}
</artwork>
<t>A publication warning reply MUST contain at least one of the possible
warnings. If there is nothing to warn about then either a &quot;Publication
Ok Replay&quot; or &quot;Publication Error Reply&quot; would be applicable.</t>
<t>Publisher software SHOULD log any publication warning reply it receives
in a way that is visible to operators so that they could enter in a
dialogue with their server operator.</t>
<t>Publisher software MAY try to reduce the number and size of objects by
aggregating ROAs for the same origin ASN. Normally it is recommended
that separate ROA objects are made for each ROA prefix and origin ASN
because otherwise the loss of one prefix on a covering certificate would
invalidate the complete ROA object. But, in case of quota issues this
risk aversion may not outweigh the potential benefit of space saving
through aggregation.</t>
</section>

<section anchor="publication-error-reply"><name>Publication Error Reply</name>

<section anchor="messagetype-2"><name>MessageType</name>
<t>The MessageType for this reply is: &quot;publication-error-reply&quot;</t>
</section>

<section anchor="messagecontent-2"><name>MessageContent</name>
<t>Format to be determined.</t>
<t>Publication rejected. Some possible reasons from V1: adding duplicate
object, trying update/withdraw object for unknown relative path - or hash
mismatch.</t>
<t>Some new reasons we may wish to support: unsupported object type included,
object could not be parsed, publication point inconsistent (w.r.t. manifest).</t>
<t>We will need more discussion on which errors we wish to flag, how to
communicate relevant constraints at setup / protocol negotiation time,
and how to report run time errors here. Some errors may be general, others
may be specific to objects.</t>
<t>Dependent on the errors we define, we may need specific instructions to
Publishers about how to deal with them. For example, if an object type
is not supported by the Server, then the Publisher may still wish to
publish other object types and inform their user - who may then wish to
migrate to another publication server.</t>
</section>
</section>
</section>

<section anchor="server-key-accepted-exchange"><name>Server Key Accepted Exchange</name>
<t>This exchange SHOULD be initiated by the publisher at its earliest
convenience after learning (Status Exchange) that a new key exists.
It will confirm to the server that it can now use the new key instead
of the previous key to sign replies.</t>
<t>The typical reply is an ok reply signed with the new key. Or an error
reply.</t>

<section anchor="server-key-accepted-query"><name>Server Key Accepted Query</name>

<section anchor="messagetype-3"><name>MessageType</name>
<t>The MessageType for this reply is: &quot;server-key-accept&quot;</t>
</section>

<section anchor="messagecontent-3"><name>MessageContent</name>
<t>The Publisher repeats the new BPKI TA Certificate that it believes the
Server intends to migrate towards:</t>

<artwork>MessageContent ::= SEQUENCE {
  NewBpkiTaCert NewBpkiTaCert
  -- Use a SEQUENCE for extensibility?
}

NewBpkiTaCert ::= OCTET STRING
   -- constrained to a DER encoded self-signed
   -- BPKI TA certificate
</artwork>
</section>
</section>

<section anchor="server-key-accepted-ok-reply"><name>Server Key Accepted Ok Reply</name>
<t>The MessageType for this reply is: &quot;server-key-accept-ok&quot;. There is no
content, but the response is signed using the now accepted key.</t>
<t>The Publisher MAY now forget the (now) old server key and MUST expect the
new (now current) key to be used in future replies signed by the Server.</t>
<t>The Server SHOULD no longer inform this Publisher about the new key in
in new Status Reply responses. If this was the last Publisher to accept
the new key, the Server MAY now delete its old key pair.</t>
</section>

<section anchor="server-key-accepted-error-reply"><name>Server Key Accepted Error Reply</name>
<t>It is not expected that an error is returned. However, it could be that
the Publisher was confused an sent a Server Key Accepted Query for a key
that the Server does not wish to migrate to. Or the server changed its
mind in between last informing the the Publisher in a Status Reply and
now. In any event.. the server MUST return an error in this case, an the
Publisher MUST continue to expect the current server key to be used for
signing replies.</t>
<t>The MessageType for this reply is: &quot;server-key-accepted-error&quot;. There is
no content.</t>
</section>
</section>

<section anchor="publisher-key-change-exchange"><name>Publisher Key Change Exchange</name>

<section anchor="publisher-key-change-query"><name>Publisher Key Change Query</name>

<section anchor="messagetype-4"><name>MessageType</name>
<t>The MessageType for this query is: &quot;client-key-change&quot;</t>
</section>

<section anchor="messagecontent-4"><name>MessageContent</name>
<t>The publisher sends its new key to the server by means of a (validly
self-signed) BPKI TA certificate.</t>

<artwork>MessageContent ::= SEQUENCE {
  NewBpkiTaCert NewBpkiTaCert
    -- Use a SEQUENCE for extensibility?
}

NewBpkiTaCert ::= OCTET STRING
   -- constrained to a DER encoded self-signed
   -- BPKI TA certificate
</artwork>
</section>
</section>

<section anchor="publisher-key-change-ok-reply"><name>Publisher Key Change Ok Reply</name>
<t>The MessageType for this reply is: &quot;client-key-change-ok&quot;. There is no
content.</t>
<t>The Publisher MUST now use the new key in future exchanges, at least until
the new key itself is changed of course. The Server MAY now forget the
previous key for the Publisher and MUST now expect this new key to be
used.</t>
</section>

<section anchor="publisher-key-change-error-reply"><name>Publisher Key Change Error Reply</name>
<t>The MessageType for this reply is: &quot;client-key-change-error&quot;. There is no
content.</t>
<t>The server SHOULD return this error only in case it finds that the new
BPKI TA Certificate is not validly signed. I.e. there was no proof of
possession of the private key.</t>
<t>This is unlikely to happen and it would point at a serious issue with
either the Publisher or the Server software, or both..</t>
<t>Both the Publisher and Server should alert their operators in the
applicable ways that can (log, report status error etc). The Publisher
SHOULD continue to use its previous key, it MUST NOT start to use its
intended new key until this issue is resolved - presumably after operator
and/or developer actions.</t>
</section>
</section>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>OID needs to be requested.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>TBD</t>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>To be determined. As it stands this document represents early ideas about
a possible direction for a next version of the publication protocol. There
have been some informal discussions with various people.</t>
<t>It's not certain yet how we will proceed. Perhaps this will become a
working group document, perhaps it will only serve discussion and another
document or documents follow. So.. to be determined.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<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.5234.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6492.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6585.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.8181.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8182.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8183.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8820.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9110.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5781.xml"/>
</references>

</back>

</rfc>
