<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes"?>
<?rfc symrefs="yes"?>
<?rfc linkmailto="no"?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<rfc category="std" ipr="trust200902"
   docName='draft-melnikov-spasm-eai-addresses-03'>
<front>
<title abbrev="I18N Mail Addresses in X.509 certificates">
 Internationalized Email Addresses in X.509 certificates
</title>
<author initials="A." surname="Melnikov" fullname="Alexey Melnikov" role="editor">
	<organization>Isode Ltd</organization>
	<address>
    <postal>
      <street>14 Castle Mews</street>
      <city>Hampton</city>
      <region>Middlesex</region>
      <code>TW12 2NP</code>
      <country>UK</country>
    </postal>
    <email>Alexey.Melnikov@isode.com</email>
	</address>
</author>
<author initials="W." surname="Chuang" fullname="Weihaw Chuang" role="editor">
    <organization>Google, Inc.</organization>
    <address>
        <postal>
            <street>1600 Amphitheatre Parkway</street>
            <city>Mountain View</city> <region>CA</region>
            <code>94043</code>
            <country>US</country>
        </postal>
        <email>weihaw@google.com</email>
    </address>
</author>
<date year="2016" />
<area>Security</area>
<keyword>EAI</keyword>
<keyword>PKIX</keyword>
<keyword>email address</keyword>
    
<abstract>

<t>
This document defines a new name form for inclusion in the otherName
field of an X.509 Subject Alternative Name extension that allows a
certificate subject to be associated with an Internationalized Email Address.
</t>

</abstract>
</front>
<middle>
    
<section title="Introduction">

<t><xref target="RFC5280"/> defines rfc822Name subjectAltName choice for representing
<xref target="RFC5322"/> email addresses. This form is restricted to a subset of US-ASCII
characters and thus can't be used to represent Internationalized Email addresses
<xref target='RFC6531'/>.
</t>

</section>

<section title="Conventions Used in This Document">
<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"/>.</t>

<t>The formal syntax use the <xref target="RFC5234">Augmented
Backus-Naur Form (ABNF)</xref> notation.</t>
</section>
    
<section title="Name Definitions" anchor="sec_name_def">

<t>
This section defines the smtputf8Name name as a form of otherName from the
GeneralName structure in SubjectAltName defined in <xref target="RFC5280"/>.
</t>

<t>id-on-smtputf8Name OBJECT IDENTIFIER ::= { id-on XXX }</t>
      
<t>smtputf8Name ::= UTF8String (SIZE (1..MAX))</t>
      
<t>
When the subjectAltName extension contains an Internationalized Email address,
the address MUST be stored in the smtputf8Name name form of otherName.  The
format of smtputf8Name is defined as the ABNF rule smtputf8Mailbox.
smtputf8Mailbox is a modified version of the Internationalized
Mailbox which is defined in Section 3.3 of <xref target='RFC6531'/> which is
itself derived from SMTP Mailbox from Section 4.1.2 of <xref target='RFC5321'/>.
<xref target='RFC6531'/> defines the following ABNF rules for Mailbox whose
parts are modified for internationalization: &lt;Local-part&gt;,
&lt;Dot-string&gt;, &lt;Quoted-string&gt;, &lt;QcontentSMTP&gt;, &lt;Domain&gt;,
and &lt;Atom&gt;.  In particular &lt;Local-part&gt; was updated to also support
UTF8-non-ascii.  UTF8-non-ascii is described by Section 3.1 of <xref
target='RFC6532'/>.  Also sub-domain is extended to support U-label, as
defined in <xref target='RFC5890'/>
</t>

<t>
This document further refines Internationalized <xref target='RFC6531'/> Mailbox ABNF rules
and calls this smtputf8Mailbox.  In smtputf8Mailbox, sub-domain SHALL use U-label Unicode
native character labels and MUST NOT use A-label <xref target='RFC5890'/> to encode non-ascii
characters.  This restriction prevents having to determine which label
encoding A- or U-label is present in the Domain.  Further U-label SHALL use
UTF-8 Unicode <xref target='RFC3629'/>, Normalization Form C and other properties
specified in section 2.3.2.1 of <xref target='RFC5890'/>.  To encode solely
ASCII character labels, sub-domain SHALL use NR-LDH restrictions as specified by
section 2.3.1 of <xref target='RFC5890'/>.  Note that a smtputf8Mailbox has no
phrase (such as a common name) before it, has no comment (text surrounded in
parentheses) after it, and is not surrounded by "&lt;" and "&gt;".
</t>

<t>
In the context of building name constraint as needed by <xref target="RFC5280"/>,
the smtputf8Mailbox rules are modified to allow partial productions to allow
for additional forms required by <xref target="sec_constraint"/>.  This means
that the local-part may be missing, and domain partially specified.
</t>
<!--The
format of an eaiName is a &lt;eaiMailbox&gt; as defined below.  A eaiMailbox has
the form "uLocal-part@uDomain".  --><!--The format of eaiName is a
&lt;Mailbox&gt; as defined by <xref target='RFC6531' x:fmt="of" x:sec="3.3"/>
which is internationalized form of &lt;Mailbox&gt; derived from <xref
target='RFC5321' x:fmt="of" x:sec="4.1.2"/>.--><!--One idea: baseline we just
refer to RFC 5321 Mailbox much like 6531.  -->

<!--
<t>eaiMailbox = uLocal-part "@" uDomain</t>

<t>uLocal-part and uDomain are defined in <xref target='RFC6531'/>.


<cref>Alexey: uLocal-part and uDomain are no longer in RFC 6531, so we need to write explicit rules</cref>
<cref>Weihaw: Agreed we should do explicit rules.  Propose uDomain always be A-label so validators don't need to worry about normalization.  </cref>
</t>
-->

</section>


<section title='Matching of Internationalized Email Addresses in X.509 certificates'
anchor="sec_match">

<t>In equivalence comparison with smtputf8Name, there may be some setup work to enable
the comparison i.e. processing of the smtputf8Name content or the email
address that is being compared against.
The process for setup for comparing with smtputf8Name is split into domain
steps and local-part steps.  The comparison form for local-part always is UTF-8.
The comparison form for domain depends on context.
While some contexts such as certificate path validation in <xref target='RFC5280'/>
specify transforming to A-label, this document RECOMMENDS transforming to UTF-8
U-label even in place of those other specifications.  As more implementations
natively support U-label domain, requiring U-label reduces conversions required,
which then reduces likelihood of errors caused by bugs in implementation.
</t>

<t>
Comparison of two smtputf8Name can be straightforward.  No setup work is needed and it
can be an octet for octet comparison.  For other email address forms such as
Internationalized email address or rfc822Name, the comparison requires additional
setup to convert the format for comparison.  Domain setup is particularly important
for forms that may contain A- or U-label such as International email address, or
A-label only forms such as rfc822Name.  This document specifies the process to
transform the domain to U-label.  (To convert the domain to A-label, follow
the process process specified in section 7.5 and 7.2 in <xref target='RFC5280'/>)
The first step is to detect A-label by using section 5.1 of <xref target='RFC5891'/>.
Next if necessary, transform the A-label to U-label Unicode as specified in
section 5.2 of <xref target='RFC5891'/>.  Finally if necessary convert the
Unicode to UTF-8 as specified in section 3 of <xref target='RFC3629'/>.  In
setup for smtputf8Mailbox, the email address local-part MUST be converted to
UTF-8 if it is not already.  The &lt;Local-part&gt; part of an Internationalized
email address is already in UTF-8.  For the rfc822Name local-part is IA5String
(ASCII), and conversion to UTF-8 is trivial since ASCII octets maps to UTF-8
without change.  Once the setup is completed, comparison is an octet for octet
comparison.
</t>

<!--
<t>The &lt;uLocal-part&gt; part of an Internationalized email address is in UTF-8 and
need to be compared octet for octet.
</t>

<t>The &lt;uDomain&gt; can contain either IDN domain or an ASCII Compatible Encoding (ACE) format.
When comparing two &lt;uDomain&gt;s both MUST be converted to the ACE form as described in
section 7.2 of <xref target='RFC5280'/>.</t>
-->
    
</section>

<section title='Name constraints in path validation' anchor="sec_constraint">

<t>
This section defines use of smtputf8Name name for name constraints.  The format
for smtputf8Name in name constraints is identical to the use in subjectAltName as
specified in <xref target="sec_name_def"/>.
</t>

<t>
Name constraint comparisons in the context <xref target='RFC5280'/> is
specified with smtputf8Name name are only done on the
subjectAltName smtputf8Name name, and says nothing more about constaints on other
email address forms such as rfc822Name.  Constraint comparison on complete email address with
smtputf8Name name uses the matching procedure defined by <xref target="sec_match"/>.
As with rfc822Name name constraints as specified in Section 4.2.1.10 of <xref
target='RFC5280'/>, smtputf8Name name can specify a particular mailbox, all addresses
at a host, or all mailboxes in a domain by specifying the complete email
address, a host name, or a domain.
<!-- While we could make eaiName constraints apply also to rfc822Name and legacy
email addresses (and vice versa for rfc822Name), we add risk in implementations
implementing this correctly.  Its better to force CA to issue the new eaiName
constraints with rfc822Name when needed.-->
</t>

</section>

<section title="Resource Considerations" anchor="sec_resource">
<t>
For email addresses whose local-part is ASCII it may be more reasonable to
continue using rfc822Name instead of smtputf8Name.  Use of smtputf8Name incurs higher
byte representation overhead due to the use of otherName and the additiona OID
needed.  This document RECOMMENDS using smtputf8Name when local-part contains
non-ascii characters, and otherwise rfc822Name.
</t>
</section>

<section title="IANA Considerations">
    
<t><cref>Just need a new OID.</cref></t>

</section>

<section title="Security Considerations" anchor="seccons">


<t><!--weihaw: Any restriction on glyphs allowed?  Should
there be
considerations for prevent homoglyph attacks e.g. restricting glyphs to single
alpabet?  --></t>
<t>
Use for smtputf8Name for certificate subjectAltName will incur many of the
same security considerations of Section 8 in <xref target='RFC5280'/> but further
complicated by permitting non-ASCII characters to the email address local-part.
As mentioned in Section 4.4 of <xref target='RFC5890'/> and in Section 4 of
<xref target='RFC6532'/>  Unicode introduces the
risk for visually similar characters which can be exploited to deceive the recipient.
The former document references some means to mitigate against these attacks.
</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.2119"?> <!-- Keywords -->
<?rfc include="reference.RFC.3629"?> <!-- UTF-8 -->
<?rfc include="reference.RFC.5234"?> <!-- ABNF -->
<?rfc include="reference.RFC.5280"?> <!-- X.509 Certificates -->
<?rfc include="reference.RFC.5321"?> <!-- Simple Mail Transfer Protocol -->
<?rfc include="reference.RFC.5890"?> <!-- Internationalized Domain Names for Applications (IDNA):
                                          Definitions and Document Framework -->
<?rfc include="reference.RFC.5891"?> <!-- Internationalized Domain Names in Applications (IDNA): Protocol -->
<?rfc include="reference.RFC.6531"?> <!-- SMTP Extension for Internationalized Email -->

</references>
<references title="Informative References">
    
<?rfc include="reference.RFC.5322"?> <!-- Email Format -->
<?rfc include="reference.RFC.6532"?> <!-- Internationalized Email Headers-->

</references>
    
<section title="Acknowledgements">

<t>Thank you to Magnus Nystrom for motivating this document.  Thanks to 
Nicolas Lidzborski, Laetitia Baudoin, Ryan Sleevi and Sean Leonard for their
early feedback.  Also thanks to John Klensin for his valuable input on
internationalization, Unicode and ABNF formatting.</t>

</section>
</back>
</rfc>
