<?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 RFC1034 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1034.xml">
<!ENTITY RFC1035 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4033 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4033.xml">
<!ENTITY RFC4034 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4034.xml">
<!ENTITY RFC4035 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4035.xml">
<!ENTITY RFC4250 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4250.xml">
<!ENTITY RFC4251 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4251.xml">
<!ENTITY RFC4253 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml">
<!ENTITY RFC4255 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4255.xml">
<!ENTITY RFC4716 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4716.xml">
<!ENTITY RFC5656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5656.xml">
<!ENTITY RFC6090 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6090.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="yes" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<?rfc rfcedstyle="yes" ?>

<rfc category="std" docName="draft-os-ietf-sshfp-ecdsa-sha2-07"
     ipr="trust200902">
  <!-- category values: std, bcp, info, exp;
     ipr values: trust200902, noModificationTrust200902,
     noDerivativesTrust200902, pre5378Trust200902, ... (historic ipr values);
     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="ECDSA and SHA-256 Algorithms for SSHFP">
    Use of SHA-256 Algorithm with RSA, DSA and ECDSA in SSHFP Resource Records
  </title>

  <author fullname="Ondrej Sury" initials="O.S." surname="Sury">
    <organization>CZ.NIC</organization>
    <address>
      <postal>
        <street>Americka 23</street>
        <city>120 00 Praha 2</city>
        <country>Czech Republic</country>
      </postal>
      <phone>+420 222 745 110</phone>
      <email>ondrej.sury@nic.cz</email>
    </address>
  </author>

  <date year="2012" />

  <!-- Meta-data Declarations -->

  <area>Security</area>

  <workgroup>Network Working Group</workgroup>

  <keyword>DNS</keyword>
  <keyword>Domain Name Ssystem</keyword>
  <keyword>SSHFP</keyword>
  <keyword>SHA-256</keyword>
  <keyword>Secure Shell</keyword>
  <keyword>ECDSA</keyword>

  <abstract>
    <t>
      This document updates IANA registries defined in RFC4255, which
      defines a DNS resource record - SSHFP that contains a standard
      SSH key fingerprint used to verify Secure Shell (SSH) host keys
      using Domain Name System Security (DNSSEC).  This document
      defines additional options supporting Secure Shell (SSH) public
      keys using the Elliptic Curve Digital Signature Algorithm
      (ECDSA) and the use of fingerprints computed using the SHA-256
      message digest algorithm in SSHFP resource records (SSHFP RR).
    </t>
  </abstract>
</front>

<middle>

  <section anchor="intro" title="Introduction">
    <t>
      The Domain Name System (DNS) is the global, hierarchical
      distributed database for Internet Naming.  The Secure Shell
      (SSH) is a protocol for secure remote login and other secure
      network services over an insecure network.  <xref
      target="RFC4253">RFC 4253</xref> defines Public Key Algorithms
      for the Secure Shell server public keys.
    </t>

    <t>
      The DNS has been extended to store fingerprints in a DNS
      resource record named SSHFP <xref target="RFC4255"/>, which
      provides out-of-band verification by looking up a fingerprint of
      the server public key in the DNS <xref target="RFC1034"/>,
      <xref target="RFC1035"/> and using Domain Name System Security
      Extensions (DNSSEC) <xref target="RFC4033"/>,
      <xref target="RFC4034"/>, <xref target="RFC4035"/> to verify the
      lookup.
    </t>

    <t>
      <xref target="RFC4255">RFC 4255</xref> describes how to store
      the cryptographic fingerprint of SSH public keys in SSHFP
      resource records.  SSHFP records contain the fingerprint and two
      index numbers identifying the cryptographic algorithms used:
      <list style="numbers">
	<t>
	  to link the fingerprinted public key with the corresponding
	  private key, and
	</t>
	<t>
	  to derive the message digest stored as the fingerprint in
	  the record.
	</t>
      </list>

      <xref target="RFC4255">RFC 4255</xref> then specifies lists of
      cryptographic algorithms and the corresponding index numbers
      used to identify them in SSHFP records.
    </t>
    <t>
      This document updates the IANA registry "SSHFP RR Types for
      public key algorithms" and "SSHFP RR types for fingerprint
      types" <xref target="SSHFPVALS"/> by adding a new option in each
      list:
      <list style="symbols">
	<t>
	  the Elliptic Curve Digital Signature Algorithm
	  (ECDSA)<xref target="RFC6090"/> which has been added to the Secure Shell
	  Public Key list by <xref target="RFC5656">RFC 5656</xref> in the public key
	  algorithms list;
	</t>
	<t>
	  the SHA-256 algorithm <xref target="FIPS.180-3.2008"/> in the SSHFP
	  Fingerprint Type list.
	</t>
      </list>
    </t>

    <t>
      Familiarity with DNSSEC, SSH Protocol <xref target="RFC4251"/>,
      <xref target="RFC4253"/>, <xref target="RFC4250"/>, SSHFP <xref
      target="RFC4255"/>, and the SHA-2 <xref
      target="FIPS.180-3.2008"/> family of algorithms is assumed in
      this document.
    </t>

  </section>

  <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 anchor="sshfp-rr" title="SSHFP Resource Records">

    <t>
      The format of the SSHFP RR can be found in <xref target="RFC4255">RFC 4255</xref>.
    </t>

    <section anchor="sshfp-fptype" title="SSHFP Fingerprint Type Specification">
      <t>
        The fingerprint type octet identifies the message-digest
        algorithm used to calculate the fingerprint of the public key.
      </t>

      <section anchor="sshfp-sha256" title="SHA-256 SSHFP Fingerprint Type Specification">
        <t>
          SHA-256 fingerprints of the public keys are stored in SSHFP
          Resource Record with the fingerprint type 2.
        </t>
      </section>

    </section>

    <section anchor="sshfp-algonum" title="SSHFP Algorithm Number Specification">
      <t>
        The SSHFP Resource Record algorithm number octet describes the algorithm of
        the public key.
      </t>

      <section anchor="sshfp-ecdsa" title="ECDSA SSHFP Algorithm Number Specification">
        <t>
          ECDSA public keys are stored in SSHFP Resource Records with
          the algorithm number 3.
        </t>
      </section>
    </section>

  </section>

  <section title="Implementation Considerations">

    <section title="Support for SHA-256 fingerprints">
      <t>
	SSHFP-aware Secure Shell implementations SHOULD support the
	SHA-256 fingerprints for verification of the public key.
	Secure Shell implementations which support SHA-256
	fingerprints MUST prefer a SHA-256 fingerprint over SHA-1 if
	both are available for a server.  If the SHA-256 fingerprint
	is tested and does not match the key SSH public key received
	from the SSH server, then the key MUST be rejected rather than
	testing the alternative SHA-1 fingerprint.
      </t>
    </section>

    <section title="Support for ECDSA">
      <t>
	SSHFP-aware Secure Shell implementations which also implement
	ECDSA algorithm for the public key SHOULD support SSHFP
	fingerprints for ECDSA public keys.
      </t>
    </section>

  </section>

  <section anchor="examples" title="Examples">
    <t>
       The following examples provide reference for both the newly
       defined ECDSA algorithm number and the use of the SHA-256
       fingerprint combined with both the new and the existing
       algorithm numbers.
    </t>
    <section title="RSA public key">
      <figure>
        <preamble>
          Given a public key with the following value in OpenSSH
          format <xref target="RFC4716"/>:
        </preamble>
        <artwork>
    ---- BEGIN SSH2 PUBLIC KEY ----
    AAAAB3NzaC1yc2EAAAADAQABAAABAQDCUR4JOhxTinzq7QO3bQXW4jmPCCulFsnh
    8Yi7MKwpMnd96+T7uV7nEwy+6+GWYu98IxFJByIjFXX/a6BXDp3878wezH1DZ2tN
    D/tu/eudz6ErpTFYmnVLyEDARYSzVBNQuIK1UDqvvB6KffJcyt78FpwW27euGkqE
    kam7GaurPRAgwXehDB/gMwRtXVRZ+13zYWkAmAY+5OAWVmdXuQVm5kjlvcNzto2H
    3m3nqJtD4J9L1lKPuSVVqwJr4/6hibXJkQEvWpUvdOAUw3frKpNwa932fXFk3ke4
    rsDjQ/W8GyleMtK3Tx8tE4z1wuowXtYe6Ba8q3LAPs/m2S4pUscx
    ---- END SSH2 PUBLIC KEY ----
        </artwork>
      </figure>
      <section title="RSA public key with SHA1 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 1 1 ( dd465c09cfa51fb45020cc83316fff
                                      21b9ec74ac )
          </artwork>
        </figure>
      </section>
      <section title="RSA public key with SHA-256 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 1 2 ( b049f950d1397b8fee6a61e4d14a9a
                                      cdc4721e084eff5460bbed80cfaa2c
                                      e2cb )
          </artwork>
        </figure>
      </section>
    </section>

    <section title="DSA public key">
      <figure>
        <preamble>
          Given a public key with the following value in OpenSSH format:
        </preamble>
        <artwork>
    ---- BEGIN SSH2 PUBLIC KEY ----
    AAAAB3NzaC1kc3MAAACBAPVFrc0U36gWaywbfJzjcv8ef13qAX4EJl8Na6xqvXh1
    t+aCJEdS7soRjtvK4KsNhk78DjdtnfhEhyFKHHNz3i6/c/s9lP0UjV7mRAo6nA7A
    3Gs6iQElb6O9Fqm6iVSC6bYWilTSB0tYencEEJUoaAua8YQF/uxRzPrReXxGqHnj
    AAAAFQDC9M/pli8VIVmEGOO0wC1TeUTN4wAAAIEAgA2Fbkbbeo0+u/qw8mQFOFWZ
    pTaqNo7d7jov3majbh5LqEVD7yT3MS1GSGhjgvvhus/ehMTqzYbjTc0szUM9JnwT
    7xq15P2ZYDK98IVxrw31jMtsUUEmBqB4DUjTurtcaWmJ9LNaP1/k4bMo0/hotnOc
    OVnIPsTLBFWVvdNRxUAAAACAOZcDcK01NTM1qIIYbBqCffrwjQ+9PmsuSKI6nUzf
    S4NysXHkdbW5u5VxeXLcwWj5PGbRfoS2P3vwYAmakqgq502wigam18u9nAczUYl+
    2kOeOiIRrtSmLfpV7thLOAb8k1ESjIlkbn35jKmTcoMFRXbFmkKRTK8OEnWQ8AVg
    6w8=
    ---- END SSH2 PUBLIC KEY ----
        </artwork>
      </figure>
      <section title="DSA public key with SHA1 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 2 1 ( 3b6ba6110f5ffcd29469fc1ec2ee25
                                      d61718badd )
          </artwork>
        </figure>
      </section>

      <section title="DSA public key with SHA-256 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 2 2 ( f9b8a6a460639306f1b38910456a6a
                                      e1018a253c47ecec12db77d7a0878b
                                      4d83 )
          </artwork>
        </figure>
      </section>
    </section>

    <section title="ECDSA public key">
      <figure>
        <preamble>
          Given a public key with the following value in OpenSSH format:
        </preamble>
        <artwork>
    ---- BEGIN SSH2 PUBLIC KEY ----
    AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAD+9COUiX7W
    YgcvIOdI8+djdoFDVUTxNrcog8sSYdbIzeG+bYdsssvcyy/nRfVhXC5QBCk8IThq
    s7D4/lFxX5g=
    ---- END SSH2 PUBLIC KEY ----
        </artwork>
      </figure>
      <section title="ECDSA public key with SHA1 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 3 1 ( c64607a28c5300fec1180b6e417b92
                                      2943cffcdd )
          </artwork>
        </figure>
      </section>
      <section title="ECDSA public key with SHA-256 fingerprint">
        <figure>
          <preamble>
            The SSHFP Resource Record for this key would be:
          </preamble>
          <artwork>
    server.example.net IN SSHFP 3 2 ( 821eb6c1c98d9cc827ab7f456304c0
                                      f14785b7008d9e8646a8519de80849
                                      afc7 )
          </artwork>
        </figure>
      </section>
    </section>
  </section>

  <section anchor="IANA-considerations" title="IANA Considerations">
    <t>
      This document updates the IANA registry "SSHFP RR Types for
      public key algorithms" and "SSHFP RR types for fingerprint
      types" <xref target="SSHFPVALS"/>.
    </t>
    <section title="SSHFP RR Types for public key algorithms">
      <t>
        The following entries are added to the "SSHFP RR Types for
        public key algorithms" registry:
      </t>
      <texttable anchor="sshfp-public-key-table">
        <ttcol align="center">Value</ttcol>
        <ttcol align="center">Description</ttcol>
        <ttcol align="center">Reference</ttcol>
        <c>3</c>
        <c>ECDSA</c>
        <c>[This doc]</c>
      </texttable>
    </section>
    <section title="SSHFP RR types for fingerprint types">
      <t>
        The following entries are added to the "SSHFP RR types for
        fingerprint types" registry:
      </t>
      <texttable anchor="sshfp-fingerprint-type-table">
        <ttcol align="center">Value</ttcol>
        <ttcol align="center">Description</ttcol>
        <ttcol align="center">Reference</ttcol>
        <c>2</c>
        <c>SHA-256</c>
        <c>[This doc]</c>
      </texttable>
    </section>
  </section>

  <section anchor="security-considerations" title="Security Considerations">
    <t>
      Please see the security considerations in <xref
      target="RFC4255"/> for SSHFP record and <xref target="RFC5656"/>
      for ECDSA algorithm.
    </t>

    <t>
      Users of SSHFP are encouraged to deploy SHA-256 as soon as
      implementations allow for it.  SHA-2 family of algorithms is
      widely believed to be more resilient to attack than SHA-1, and
      confidence in SHA-1's strength is being eroded by recently
      announced attacks <xref target="IACR 2007/474"/>.  Regardless of
      whether or not the attacks on SHA-1 will affect SSHFP, it is
      believed (at the time of this writing) that SHA-256 is the
      better choice for use in SSHFP records.
    </t>

    <t>
      SHA-256 is considered sufficiently strong for the immediate
      future, but predictions about future development in cryptography
      and cryptanalysis are beyond the scope of this document.
    </t>

  </section>

</middle>

  <!--  *****BACK MATTER ***** -->

<?rfc rfcedstyle="no" ?>

<back>
  <!-- References split into informative and normative -->

  <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629;
       here (as shown)
    2. simply use a PI
       "less than character"?rfc include="reference.RFC.2119.xml"?> here (for
       I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included
    files in the same directory as the including file. You can also define
    the XML_LIBRARY environment variable with a value containing a set of
    directories to search.  These can be either in the local filing system
    or remote ones accessed by http (http://domain/dir/... ).
  -->

  <references title="Normative References">

    &RFC1034;
    &RFC1035;
    &RFC2119;
    &RFC4250;
    &RFC4251;
    &RFC4253;
    &RFC4255;
    &RFC5656;

    <reference anchor="FIPS.180-3.2008"
               target="http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf">
      <front>
        <title> Secure Hash Standard </title>
        <author>
          <organization> National Institute of Standards and Technology </organization>
        </author>
        <date month="October" year="2008"/>
      </front>
      <seriesInfo name="FIPS PUB" value="180-3"/>
    </reference>
  </references>
  
  <references title="Informative References">

    &RFC4033;
    &RFC4034;
    &RFC4035;
    &RFC4716;
    &RFC6090;

    <reference anchor="SSHFPVALS"
               target="http://www.iana.org/assignments/dns-sshfp-rr-parameters/dns-sshfp-rr-parameters.xml">
      <front>
        <title> DNS SSHFP Resource Records Parameters </title>
        <author>
          <organization> IANA </organization>
        </author>
      </front>
      <seriesInfo name="IANA registry" value="available at:" />
    </reference>

    <reference anchor="IACR 2007/474"
               target="http://eprint.iacr.org/2007/474.pdf">
      <front>
        <title> Notes on the Wang et al. 2^63 SHA-1 Differential Path </title>
        <author fullname="Martin Cochran" initials="M.C." surname="Cochran"/>
      </front>
      <seriesInfo name="IACR" value="2007/474"/>
    </reference>

  </references>

</back>
</rfc>
