<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!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 rfc4262 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4262.xml">
<!ENTITY rfc5280 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY rfc5321 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5321.xml">
<!ENTITY rfc5322 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5322.xml">
<!ENTITY rfc5751 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5751.xml">
<!ENTITY rfc5754 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5754.xml">
<!ENTITY rfc6530 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6530.xml">
<!ENTITY rfc6672 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6672.xml">
<!ENTITY rfc6698 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6698.xml">
<!ENTITY rfc7218 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7218.xml">
<!ENTITY rfc7258 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7258.xml">
<!ENTITY rfc7671 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7671.xml">
<!ENTITY rfc7873 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7873.xml">
]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc strict='yes'?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc strict="no" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc ipr="trust200902"
    docName="draft-ietf-dane-smime-12"
    category="exp"
>

<front>
<title abbrev="DNS-Based Authentication for S/MIME">
Using Secure DNS to Associate Certificates with Domain Names For S/MIME</title>

<author initials='P.' surname="Hoffman" fullname='Paul Hoffman'>
<organization>ICANN</organization>
<address>
<email>paul.hoffman@icann.org</email>
</address>
</author>
<author initials="J." surname="Schlyter" fullname="Jakob Schlyter">
<organization>Kirei AB</organization>
<address>
<email>jakob@kirei.se</email>
</address>
</author>

<date/>

<abstract>

<t>This document describes how to use secure DNS to associate
an S/MIME user's certificate with the intended domain name,
similar to the way that DANE (RFC 6698) does for TLS.</t>

</abstract>

</front>

<middle>

<section title="Introduction">

<t>S/MIME <xref target="RFC5751"/> messages often contain a certificate
(some messages contain more than one certificate). These certificates
assist in authenticating the sender of the message and can be used
for encrypting messages that will be sent in reply. In order for the
S/MIME receiver to authenticate that a message is from the sender
who is identified in the message, the receiver's mail
user agent (MUA) must validate that this certificate is associated
with the purported sender. Currently, the MUA must trust a trust
anchor upon which the sender's certificate is rooted, and must
successfully validate the certificate. There are other requirements
on the MUA, such as associating the identity in the certificate
with that of the message, that are out of scope for this document.</t>

<t>Some people want to authenticate the association
of the sender's certificate with the sender without trusting a
configured trust anchor.
Given that the DNS administrator for a domain name is authorized to
give identifying information about the zone, it makes sense to allow
that administrator to also make an authoritative binding between
email messages purporting to come from the
domain name and a certificate that might be used by someone
authorized to send mail from those servers. The easiest way to do
this is to use the DNS.</t>

<t>This document describes a mechanism for associating a user's certificate
with the domain that is similar to that described in DANE itself <xref target='RFC6698'/>,
as updated by <xref target="RFC7218"/> and <xref target="RFC7671"/>.
Most of the operational and security considerations for using the mechanism in
this document are described in RFC 6698, and are not described here at all.
Only the major differences between this mechanism and those used in RFC 6698
are described here. Thus, the reader must be familiar with RFC 6698 before
reading this document.</t>

<section title="Terminology">

<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 RFC 2119 <xref target='RFC2119'/>.</t>

<t>This document also makes use of standard PKIX, DNSSEC, and S/MIME
terminology. See PKIX <xref target='RFC5280'/>, DNSSEC <xref target='RFC4033'/>, 
<xref target='RFC4034'/>, <xref target='RFC4035'/>, and SMIME <xref
target='RFC5751'/> for these terms.</t>

</section>

<section anchor="experiment" title="Experiment Goal">
<t>
This specification is one experiment in improving access to public keys
for end-to-end email security. There are a range of ways in which this
can reasonably be done for OpenPGP or S/MIME, for example, using the DNS,
or SMTP, or HTTP.  Proposals for each of these have been made with various
levels of support in terms of implementation and deployment.  For each
such experiment, specifications such as this will enable experiments to
be carried out that may succeed or that may uncover technical or other
impediments to large- or small-scale deployments. The IETF encourages
those implementing and deploying such experiments to publicly document
their experiences so that future specifications in this space can benefit.
</t>

<t>
This document defines an RRtype whose use is Experimental. The goal of
the experiment is to see whether encrypted email usage will increase if
an automated discovery method is available to MTAs and MUAs to help
the end user with email encryption key management.
</t>

<t>
It is unclear if this RRtype will scale to some of the larger email
service deployments. Concerns have been raised about the size of the
SMIMEA record and the size of the resulting DNS zone files. This
experiment hopefully will give the working group some insight into
whether or not this is a problem.
</t>

<t>
If the experiment is successful, it is expected that the findings of
the experiment will result in an updated document for standards track
approval.
</t>

</section>

</section>

<section title="The SMIMEA Resource Record" anchor="smimea_rr">

<t>The SMIMEA DNS resource record (RR) is used to associate an end entity
certificate or public key with the associated email address, thus
forming a "SMIMEA certificate association". The semantics of how the SMIMEA
resource record is interpreted are given later in this document. Note that the information
returned in the SMIMEA record might be for the end entity certificate, or it
might be for the trust anchor or an intermediate certificate.</t>

<t>The type value for the SMIMEA RRtype is defined in <xref target="ianarrtype"/>.
The SMIMEA resource record is class independent.
</t>

<t>The SMIMEA wire format and presentation format are the same as for the TLSA record as
described in section 2.1 of RFC 6698. The certificate usage field, the selector field, and
the matching type field have the same format; the semantics are also the same except where
RFC 6698 talks about TLS at the target protocol for the certificate information.</t>

</section>

<section title="Location of the SMIMEA Record" anchor="email">

<t>
The DNS does not allow the use of all characters that are supported in the
"local-part" of email addresses as defined in <xref target="RFC5322"/>
and <xref target="RFC6530"/>. Therefore, email addresses are mapped into
DNS using the following method:

<list style="symbols">

<t>
The "left-hand side" of the email address, called
the "local-part" in both the mail message format definition <xref
target="RFC5322"/> and in the specification for
internationalized email <xref target="RFC6530"/>) is encoded in UTF-8
(or its subset ASCII). If the local-part is written in another charset
it MUST be converted to UTF-8.
</t>

<t>
The local-part is first canonicalized using the following rules. If
the local-part is unquoted, any whitespace (CFWS) around dots (".")
is removed. Any enclosing double quotes are removed. Any literal quoting
is removed.
</t>

<t>
If the local-part contains any non-ASCII characters, it SHOULD be normalized
using the Unicode Normalization Form C from <xref target="Unicode52"/>. Recommended
normalization rules can be found in Section 10.1 of <xref target="RFC6530"/>.
</t>

<t>
The local-part is hashed using the SHA2-256 <xref target="RFC5754"/> algorithm,
with the hash truncated to 28 octets and represented in its hexadecimal
representation, to become the left-most label in the prepared domain
name.
</t>

<t>
The string "_smimecert" becomes the second left-most label in the
prepared domain name.
</t>

<t>
The domain name (the "right-hand side" of the email address, called the
"domain" in <xref target="RFC5322"/>) is appended to the result of step
2 to complete the prepared domain name.
</t>
</list></t>

<t>
For example, to request an SMIMEA resource record for a user whose email address
is "hugh@example.com", an SMIMEA query would be placed for the following QNAME:
"c93f1e400f26708f98cb19d936620da35eec8f72e57f9eec01c1afd6._smimecert.example.com".
</t>
</section>

<section title="Email Address Variants and Internationalization Considerations">

<t>
Mail systems usually handle variant forms of local-parts. The most
common variants are upper and lower case, often automatically
corrected when a name is recognized as such.  Other variants include
systems that ignore "noise" characters such as dots, so that local
parts johnsmith and John.Smith would be equivalent. Many systems
allow "extensions" such as john-ext or mary+ext where john or mary is
treated as the effective local-part, and the ext is passed to the
recipient for further handling. This can complicate finding the
SMIMEA record associated with the dynamically created email address.
</t>

<t>
<xref target="RFC5321"/> and its predecessors have always made it clear
that only the recipient MTA is allowed to interpret the local-part of an
address. Therefor, sending MUAs and MTAs supporting this specification MUST NOT
perform any kind of mapping rules based on the email address. In order
to improve chances of finding SMIMEA resource records for a particular local-part,
domains that allow variant forms (such as treating local-parts
as case-insensitive) might publish SMIMEA resource records for all variants of
local-parts, might publish variants on first use (for example a webmail
provider that also controls DNS for a domain can publish variants as
used by owner of a particular local-part) or just publish SMIMEA resource records
for the most common variants.
</t>

<t>
<xref target="email"/> above defines how the local-part is
used to determine the location in which one looks for an SMIMEA resource
record. Given the variety of local-parts seen in email, designing a good
experiment for this is difficult as: a) some current implementations
are known to lowercase at least US-ASCII local-parts, b) we know from
(many) other situations that any strategy based on guessing and making
multiple DNS queries is not going to achieve consensus for good reasons,
and c) the underlying issues are just hard - see Section 10.1 of
<xref target="RFC6530"/> for discussion of just some of the issues that
would need to be tackled to fully address this problem.
</t>
<t>
However, while this specification is not the place to try to address these
issues with local-parts, doing so is also not required to determine the
outcome of this experiment.  If this experiment succeeds then further
work on email addresses with non-ASCII local-parts will be needed and
that would be better based on the findings from this experiment, rather
than doing nothing or starting this experiment based on a speculative
approach to what is a very complex topic.
</t>

</section>

<section title="Mandatory-to-Implement Features">

<t>S/MIME MUAs conforming to this specification MUST be able to correctly
interpret SMIMEA records with certificate usages 0, 1, 2, and 3.  S/MIME MUAs
conforming to this specification MUST be able to compare a certificate
association with a certificate offered by another S/MIME MUA using selector
types 0 and 1, and matching type 0 (no hash used) and matching type 1
(SHA-256), and SHOULD be able to make such comparisons with matching type 2
(SHA-512).</t>

<t>S/MIME MUAs conforming to this specification MUST be able to interpret any
S/MIME capabilities (defined in <xref target="RFC4262"/>) in any certificates
that it receives through SMIMEA records.</t>

</section>

<section title='Application Use of S/MIME Certificate Associations'>

<t>
The SMIMEA record allows an application or service to obtain an
S/MIME certificate or public key and use it for verifying a digital signature or
encrypting a message to the public key. The DNS answer MUST pass
DNSSEC validation; if DNSSEC validation reaches any state other than
"Secure" (as specified in <xref target="RFC4035"/>), the DNSSEC
validation MUST be treated as a failure.
</t>

<t>
If no S/MIME certificates are known for an email address, an SMIMEA
DNS lookup MAY be performed to seek the certificate or public key that corresponds
to that email address. This can then be used to verify
a received signed message or can be used to send out an encrypted email
message. An application whose attempt fails to retrieve a DNSSEC verified
SMIMEA resource record from the DNS should remember that failure for some time
to avoid sending out a DNS request for each email message the
application is sending out; such DNS requests constitute a privacy
leak.
</t>

</section>

<section title='Certificate Size and DNS'>

<t>
Due to the expected size of the SMIMEA record, applications SHOULD
use TCP - not UDP - to perform queries for the SMIMEA resource record.
</t>

<t>
Although the reliability of the transport of large DNS resource records
has improved in the last years, it is still recommended to keep the DNS
records as small as possible without sacrificing the security properties
of the public key. The algorithm type and key size of certificates should
not be modified to accommodate this section.
</t>

</section>

<section title='IANA Considerations' anchor="ianarrtype">

<t>This document uses a new DNS RRtype, SMIMEA, whose value (53) was allocated
by IANA from the Resource Record (RR) TYPEs subregistry of the Domain Name
System (DNS) Parameters registry.</t>

</section>

<section title='Security Considerations'>

<t>Client treatment of any information included in the trust anchor is a
matter of local policy. This specification does not mandate that such
information be inspected or validated by the domain name
administrator.</t>

<t>
DNSSEC does not protect the queries from Pervasive Monitoring as defined
in <xref target='RFC7258'/>. Since DNS queries are currently mostly
unencrypted, a query to lookup a target SMIMEA record could reveal
that a user using the (monitored) recursive DNS server is attempting to
send encrypted email to a target.
</t>

<t>
Various components could be responsible for encrypting an email message to
a target recipient.  It could be done by the sender's MUA or a MUA plugin
or the sender's MTA. Each of these have their own characteristics. A
MUA can ask the user to make a decision before continuing. The MUA can
either accept or refuse a message. The MTA must deliver the message as-is,
or encrypt the message before delivering. Each of these components should
attempt to encrypt an unencrypted outgoing message whenever possible.
</t>

<t>
In theory, two different local-parts could hash to the same value. This
document assumes that such a hash collision has a negliable chance of happening.
</t>

<t>
Organisations that are required to be able to read everyone's encrypted email
should publish the escrow key as the SMIMEA record. Mail servers of such
organizations MAY optionally re-encrypt the message to the individual's
S/MIME key.
</t>

<t>
If an obtained S/MIME certificate is revoked or expired,
that certificate MUST not be used,
even if that would result in sending a message in plaintext.
</t>

<t>
Anyone who can obtain a DNSSEC private key of a domain name via coercion,
theft or brute force calculations, can replace any SMIMEA record
in that zone and all of the delegated child zones. Any future messages
encrypted with the malicious SMIMEA key could then be read.
Therefore, an certificate or key obtained from a DNSSEC validated SMIMEA record
can only be trusted as much as the DNS domain can be trusted.
</t>

<section title='Response Size'>
<t>
To prevent amplification attacks, an Authoritative DNS server MAY wish to
prevent returning SMIMEA records over UDP unless the source IP address
has been confirmed with <xref target="RFC7873"/>. Such servers MUST
NOT return REFUSED, but answer the query with an empty answer section
and the truncation flag set ("TC=1").
</t>
</section>

<section title='Email Address Information Leak'>

<t>
The hashing of the local-part in this document is not a security feature.
Publishing SMIMEA records will create a list of hashes of
valid email addresses, which could simplify obtaining a list of valid
email addresses for a particular domain. It is desirable to not ease
the harvesting of email addresses where possible.
</t>

<t>
The domain name part of the email address is not used as part of the
hash so that hashes can be used in multiple zones deployed using DNAME
<xref target="RFC6672"/>. This makes it slightly easier and cheaper
to brute-force the SHA2-256 hashes into common and short local-parts, as
single rainbow tables can be re-used across domains. This can be somewhat
countered by using NSEC3.
</t>

<t>
DNS zones that are signed with DNSSEC using NSEC for denial of existence
are susceptible to zone-walking, a mechanism that allows someone to
enumerate all the SMIMEA hashes in a zone. This can be used in
combination with previously hashed common or short local-parts (in
rainbow tables) to deduce valid email addresses. DNSSEC-signed zones
using NSEC3 for denial of existence instead of NSEC are significantly
harder to brute-force after performing a zone-walk.
</t>

</section>



</section>

<section title='Acknowledgements'>

<t>A great deal of material in this document is copied from
RFC-to-be draft-ietf-dane-openpgpkey-12. That material was
created by Paul Wouters and other participants in the IETF
DANE WG.</t>

<t>Brian Dickson, Miek Gieben, and Martin Pels, and Jim Schaad
 contributed technical ideas and support
to this document.</t>

</section>

</middle>

<back>

<references title="References">

&rfc2119;
&rfc4033;
&rfc4034;
&rfc4035;
&rfc4262;
&rfc5280;
&rfc5321;
&rfc5322;
&rfc5751;
&rfc5754;
&rfc6530;
&rfc6672;
&rfc6698;
&rfc7218;
&rfc7258;
&rfc7671;
&rfc7873;

<reference anchor='Unicode52'>
<front>
<title>The Unicode Standard, Version 5.2.0, defined by:
"The Unicode Standard, Version 5.2.0", (Mountain View, CA: The Unicode
Consortium, 2009. ISBN 978-1-936213-00-9).</title>
<author fullname='The Unicode Consortium'>
<organization>The Unicode Consortium</organization>
</author>
<date month='October' day='1' year='2009' />
</front>
<format type='TXT' target='http://www.unicode.org/versions/Unicode5.2.0/' />
</reference>

</references>

<!--
<references title="Informative References">
</references>
-->

</back>

</rfc>

