<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2822 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2822.xml">
<!ENTITY RFC4880 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4880.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC5870 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5870.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-atkins-openpgp-device-certificates-03" ipr="trust200902" updates="4880">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="OpenPGP Device Certificates">OpenPGP Extensions for Device Certificates</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Derek Atkins" initials="D.A."
            surname="Atkins">
      <organization>SecureRF Corporation</organization>

      <address>
        <postal>
          <street>100 Beard Sawmill Rd, Suite 350</street>

          <!-- Reorder these if your country does things differently -->

          <city>Shelton</city>

          <region>CT</region>

          <code>06484</code>

          <country>US</country>
        </postal>

        <phone>+1 617 623 3745</phone>

        <email>datkins@securerf.com, derek@ihtfp.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date month="June" year="2015" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>Security</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>openpgp</keyword>
    <keyword>device</keyword>
    <keyword>certificate</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>The OpenPGP Message Formats defined in RFC 4880 specify packet formats and methods for combining those packets to form messages and certificates.  However RFC 4880 made an architectural decision that keys are owned by users and must be self-certified.  New use cases have emerged where that is not the case.  There is a desire to have certificates that are not tied to a user (e.g. device certificates) which may only have encryption keys so may not be self certifiable.  Moreover, devices might be space constrained so reducing size is important.  This draft specifies extensions to (and updates) RFC 4880 that loosen the definitions of certificates in order to enable userless certificates without self-certifications and specifies a set of notations to enable compact device certifications.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>OpenPGP <xref target="RFC4880" /> defines a standard, compact format for, among other things, sharing keys and signature certificates.  Unfortunately the specification is user-focused, assuming that there are people sitting at the ends and creating and managing those keys.  New use cases have come up where that is not the case and the endpoint for these keys are devices, not users.  Yet we still want to be able to certify these device keys.</t>

      <t>Since the publication of RFC 4880, new use cases have emerged that don't fit into the existing standard models.  For example, the Internet of Things have introduced devices that need to certify device-level encryption keys but cannot self-certify and have no user associated.  This draft suggests extensions to RFC 4880 that enable those use cases and make it easier to have device certificates using OpenPGP.</t>

      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>
      </section>
    </section>

    <section title="Device Certificate Format">
      <t>RFC 4880 section 12.1 defines a v4 Public Key Format as a sequence of packets starting with a Primary Key and then a sequence of packets and subpackets that add Revocations, User IDs, and Signatures.</t>

      <t>The description in RFC 4880 requires a User ID.  Implementors of this specification can loosen that requirement such that an augmented V4 device certificate looks like the following sequence (no longer requiring a User ID packet):</t>
      <figure>
        <artwork align="left"><![CDATA[
           Primary-Key
              [Revocation Self Signature]
              [Direct Key Signature...]
              [User ID [Signature ...] ...]
              [User Attribute [Signature ...] ...]
              [[Subkey [Binding-Signature-Revocation]
                      Primary-Key-Binding-Signature] ...]
		      ]]></artwork>
      </figure>

      <t>Note that RFC 4880 section 11.1 defines this same sequence in text for transferable public keys.  Implementors of this specification can change that definition from "One or more User ID packets" to "Zero or more User ID packets".</t>
      <t>Moreover, one more relaxation from section 12.1.  RFC 4880 states that "In a V4 key, the primary key MUST be a key capable of certification."  Implementors of this specification can loosen that restriction as well, such that in V4 augmented key, the primary key MAY be a key capable of certification.</t>

      <t>A primary key capable of making signatures SHOULD be accompanied by either a certification signature (on a User ID or User Attribute) or a signature directly on the key.</t>

      <t>Implementations MUST accept encryption-only primary keys without a signature.  It also MUST allow importing any key accompanied either by a certification signature or a signature on itself.  It MAY accept signature-capable primary keys without an accompanying signature.</t>

    </section>

    <section title="User ID Attribute Subpacket" anchor="userid_attr">
      <t>Section 5.12 of RFC 4880 defines the User Attribute Packet which can be used in lieu of a User ID Packet.  Whereas the User ID Packet only allows a single UTF-8 string content, the User Attribute Packet allows the addition of multiple attributes in subtype packets.  Unfortunately RFC 4880 only defined a single Attribute Subpacket, the Image Attribute.  This means that you need two signatures if you want to have an ID and an image.</t>

      <t>To solve that problem for device certificates we define a new User Attribute Subpacket, the User ID Attribute Subpacket, type #[IANA -- assignment TBD1].  A User ID Attribute subpacket, just like a User ID packet, consists of UTF-8 text that is intended to represent the name and email address of the key holder.  By convention, it includes an <xref target="RFC2822">RFC&nbsp;2822</xref> mail name-addr, but there are no restrictions on its content.  For devices, it may be the device identifier.  The packet length in the header specifies the length of the User ID.</t>

      <t>Note that RFC 4880 already allows a User Attribute packet anywhere a User ID packet can be used.  See RFC 4880 section 5.2.3.19 (Primary User ID) for more information on self-signatures over these kinds of packets.  Any signature on a User Attribute packet covers all subpackets.  Implementations MAY decide to trust the User ID Subpacket.</t>

    </section>

    <section title="Device Certification Notations" anchor="notations">
      <t>OpenPGP defines a signature notation data packet that allows implementors and users to add extra data to signatures.  RFC 4880 defined a registry for a global namespace and requires using name@dom.ain domain-name notations otherwise.  Many of the devices targeted by this specification have limited storage capability, so it behooves an implementor to limit the extraneous storage.</t>

      <t>These notations can be important when you have a third-party device certification.  That third party might want to add extra data about the device to its signature certification.  In order to keep the certificate smaller we define a set of notations that MAY be used when signing a device certificate.</t>

      <section title="The 'manu' Notation" anchor="manu_not">
	<t>The "manu" notation is a string that declares the device manufacturer's name.  The certifier key is asserting this string (which may or may not be related to the User ID of the certifier's key).</t>
      </section>

      <section title="The 'make' Notation" anchor="make_not">
	<t>This notation defines the product make.  It is a free form string.</t>
      </section>

      <section title="The 'model' Notation" anchor="model_not">
	<t>This notation defines the product model name/number.  It is a free form string.</t>
      </section>

      <section title="The 'prodid' Notation" anchor="prodid_not">
	<t>This notation contains the product identifier.  It is a free form string.</t>
      </section>

      <section title="The 'pvers' Notation" anchor="pvers_not">
	<t>This notation defines the product version number (which could be a release number, year, or some other identifier to differentiate different versions of the same make/model).  It is a free form string.</t>
      </section>

      <section title="The 'lot' Notation" anchor="lot_not">
	<t>This notation defines the product lot number (which is an indicator of the batch of product).  It is a free form string.</t>
      </section>

      <section title="The 'qty' Notation" anchor="qty_not">
	<t>This notation defines the quantity of items in this package.  It is a decimal integer representation with no punctuation, e.g. "10", "1000", "10000", etc.</t>
      </section>

      <section title="The 'loc' and 'dest' Notations" anchor="geo_not">
	<t>The "loc" and 'dest' notations declare a GeoLocation as defined by <xref target="RFC5870">RFC&nbsp;5870</xref> but without the leading "geo:" header.  For example, if you had a GeoLocation URI of "geo:13.4125,103.8667" you would encode that in these notations as "13.4125,103.8667".</t>

	<t>The 'loc' notation is meant to encode the geo location where the signature was made.  The 'dest' notation is meant to encode the geo location where the device is "destined" (i.e., a "destination" for the device).</t>
      </section>

      <section title="The 'hash' Notation" anchor="hash_not">
	<t>A 'hash' notation is a means to include external data in the contents of a signature without including the data itself.  This is done by hashing the external data separately and then including the data's name and hash in the signature via this notation.  This is useful, for example, to have an external "manifest," "image," or other data that might not be vital to the signature itself but still needs to be protected and authenticated without requiring a second signature.</t>

	<t>The 'hash' notation has the following structure:</t>
	<t><list style="symbols">
          <t>A single byte specifying the length of the name of the hashed data</t>
	  <t>A UTF-8 string of the name of the hashed data</t>
	  <t>A single byte specifying the hash algorithm (see RFC 4880 section 9.4)</t>
	  <t>The binary hash output of the hashed data using the specified algorithm.  (The length of this data is implicit based on the algorithm specified).</t>
	</list></t>

	<t>Due to its nature a 'hash' notation is not human readable and MUST NOT be marked as such when used.</t>

      </section>

    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>A big thank you to Werner Koch, David Shaw, Jon Callas, Daniel Nagy, and David Leon Gil for their input on the concepts and text of this document.</t>
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requests IANA to register several items within the OpenPGP parameters (or the "name space" in the terminology of <xref target="RFC5226" />) created by <xref target="RFC4880" />.</t>

      <section title="PGP User Attribute Types">
	<t>This specification asks IANA to register a PGP User Attribute Type:</t>
	<texttable anchor="user_attr_table" title="User Attribute Types">

          <ttcol align="center">Value</ttcol>
          <ttcol align="center">Attribute</ttcol>
          <ttcol align="center">Reference</ttcol>

	  <c>TBD1</c>
	  <c>User ID</c>
	  <c>This Doc <xref target="userid_attr" /></c>
	</texttable>
      </section>

      <section title="Signature Notation Data Subpacket Types">
	<t>This specification asks IANA to register a set of OpenPGP Signature Notation Data Subpacket Types defined in <xref target="notations" />.  The following table is a summary of the requested registrations.</t>

	<texttable anchor="notation_table" title="Device Certificate Notations" style="all">

          <ttcol align="center">Allowed Values</ttcol>
          <ttcol align="center">Name</ttcol>
          <ttcol align="center">Type</ttcol>
          <ttcol align="center">Reference</ttcol>

          <c>Any String</c>
          <c>manu</c>
          <c>Manufacturer Name</c>
          <c>This doc <xref target="manu_not" /></c>

          <c>Any String</c>
          <c>make</c>
          <c>Product Make</c>
          <c>This doc <xref target="make_not" /></c>

          <c>Any String</c>
          <c>model</c>
          <c>Product Model</c>
          <c>This doc <xref target="model_not" /></c>

          <c>Any String</c>
          <c>prodid</c>
          <c>Product ID</c>
          <c>This doc <xref target="prodid_not" /></c>

          <c>Any String</c>
          <c>pvers</c>
          <c>Product Version</c>
          <c>This doc <xref target="pvers_not" /></c>

          <c>Any String</c>
          <c>lot</c>
          <c>Product Lot Number</c>
          <c>This doc <xref target="lot_not" /></c>

          <c>Decimal Integer String</c>
          <c>qty</c>
          <c>Package Quantity</c>
          <c>This doc <xref target="qty_not" /></c>

          <c>A geo: URI without the "geo:"</c>
          <c>loc</c>
          <c>Current Geo-location Latitude/Longitude</c>
          <c>This doc <xref target="geo_not" /></c>

          <c>A geo: URI without the "geo:"</c>
          <c>dest</c>
          <c>Destination Geo-location Latitude/Longitude</c>
          <c>This doc <xref target="geo_not" /></c>

          <c>Hash Notation data</c>
          <c>hash</c>
          <c>The Hash of external data</c>
          <c>This doc <xref target="hash_not" /></c>

	</texttable>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The Security Considerations of <xref target="RFC4880" /> apply.</t>

      <t>OpenPGP was designed with security in mind, with many smart, intelligent people spending a lot of time thinking about the ramifications of their decisions.  Removing the requirement for self-certifying User ID (and User Attribute) packets on a key means that someone could surreptitiously add an unwanted ID to a key and sign it.  If enough "trusted" people sign that surreptitious identity then other people might believe it.  The attack could wind up sending encrypted mail destined for alice to some other target, bob, because someone added "alice" to bob's key without bob's consent.</t>

      <t>In the case of device certificates the device itself does not have any consent.  It is given an identity by the device manufacturer and the manufacturer can insert that ID on the device certificate, signing it with the manufacturer's key.  If another people wants to label the device by another name, they can do so.  There is no harm in multiple IDs, because the verification is all done based on who has signed those IDs.</t>

      <t>When a key can self-sign, it is still suggested to self-certify IDs, even if it no longer required by this modification to OpenPGP.  This at least signals to recipients of keys that yes, the owner of this key asserts that this identity belongs to herself.  Note, however, that mallet could still assert that he is 'alice' and could even self-certify that.  So the attack is not truly different.  Moreover, in the case of device certificates, it's more the manufacturer than the device that wants to assert an identity (even if the device could self-certify).</t>

      <t>There is no signaling whether a key is using this new, looser-requirement key format.  An attacker could therefore just remove the self-signature off a published key.  However one would hope that wide publication would result in another copy still having that signature and it being returned quickly.  However, the lack of signaling also means that a user with an application following RFC 4880 directly would see a key following this specification as "broken" and may not accept it.</t>

      <t>On a different note, including the "geo" notation could leak information about where a signer is located.  However it is just an assertion (albeit a signed assertion) so there is no verifiable truth to the location information released.  Similarly, all the rest of the signature notations are pure assertions, so they should be taken with the trustworthiness of the signer.</t>

      <t>Combining the User ID with the User Attribute means that an ID and image would not be separable.  For a person this is probably not good, but for a device it's unlikely the image will change so it makes sense to combine the ID and image into a single signed packet with a single signature.</t>

    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;

      &RFC4880;

      &RFC5226;

    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      <!-- A reference written by by an organization not a person. -->
      &RFC2822;

      &RFC5870;

    </references>

    <!--
    <section anchor="app-additional" title="Additional Stuff">
      <t>This becomes an Appendix.</t>
    </section>
    -->

    <!-- Change Log

v00 2014-08-14  DA    Initial version

v01 2014-09-02  DA    Fixes from Werner, added new notations

v02 2014-12-08  DA    Wording fixed from Daniel

v03 2015-06-09  DA    Minor wording updates and document refresh
    -->
  </back>
</rfc>
