<?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-ietf-lamps-eai-addresses-04'>
<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>
<workgroup>LAMPS</workgroup>
<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 and Issuer Alternate 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'/>.  To facilitate use of these
Internationalized Email addresses with X.509 certificates, this document
specifies a new name form in otherName so that subjectAltName and issuerAltName
can carry them.
</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>
The GeneralName structure is defined in <xref target="RFC5280"/>, and supports
many different names forms including otherName for extensibility.  This section
specifies the smtpUtf8Name name form of otherName, so that Internationalized
Email addresses can appear in the subjectAltName of a certificate, the
issuerAltName of a certificate, or anywhere else that GeneralName is used.
</t>

<t>id-on-smtpUtf8Name OBJECT IDENTIFIER ::= { id-on 9 }</t>

<t>smtpUtf8Name ::= UTF8String (SIZE (1..MAX))</t>

<t>
When the subjectAltName (or issuerAltName) 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 that encode non-ascii characters SHALL
use U-label Unicode native character labels and MUST NOT use A-label <xref target='RFC5890'/>.
This restriction prevents having to determine which label
encoding A- or U-label is present in the Domain.  As per
Section 2.3.2.1 of <xref target='RFC5890'/>, U-label use
UTF-8 <xref target='RFC3629'/> with Normalization Form C and other properties
specified there.  In smtputf8Mailbox, sub-domain that encode solely
ASCII character labels 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"/>.  Name constraints
may specify a complete email address, host name, or domain.  This means
that the local-part may be missing, and domain partially specified.
</t>

<t>
smtpUtf8Name is encoded as UTF8String.  The UTF8String encoding MUST NOT
contain a Byte-Order-Mark (BOM) <xref target='RFC3629'/> to aid consistency
across implementations particularly for comparison.
</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 domain to A-label, this document RECOMMENDS transforming to UTF-8
U-label instead.  This reduces the likelihood of errors by reducing conversions as more
implementations natively support U-label domains.
</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 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>
This specification expressly does not define any wildcards characters and
smtpUtf8Name comparison implementations MUST NOT interpret any character as
wildcards.  Instead, to specify multiple specifying multiple email addresses
through smtpUtf8Name, the certificate should use multiple subjectAltNames or
issuerAltNames to explicitly carry those email addresses.
</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"/> with the extension as noted there
for partial productions.
</t>
<t>
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.
</t>

<t>
Name constraint comparisons in the context <xref target='RFC5280'/> is
specified with smtpUtf8Name name are only done on the subjectAltName
 (and issuerAltName) smtpUtf8Name name, and says nothing more about constraints on other
email address forms such as rfc822Name.  Consequently it may be necessary to include
other name constraints such as rfc822Name in addition to smtpUtf8Name to constrain
all potential email addresses.  For example a domain with both
ascii and non-ascii local-part email addresses may require both rfc822Name and
smtpUtf8Name name constraints.  This can be illustrated in the following
non-normative diagram <xref target="example_constraint" />
which shows a name constraint set in the intermediate CA certificate, which
then applies to the children entity certificates.  Note that a constraint
on rfc822Name does not apply to smtpUtf8Name and vice versa.

<figure anchor="example_constraint">
<artwork>
    +--------------------------------------------------------------+
    |  Root CA Cert                                                |
    +--------------------------------------------------------------+
                            |
                            v
    +--------------------------------------------------------------+
    |  Intermediate CA Cert                                        |
    |    Name Constraint Extension                                 |
    |      Permitted                                               |
    |        rfc822Name: allowed.example.com                       |
    |        smtpUtf8Name: allowed.example.com                     |
    |      Excluded                                                |
    |        rfc822Name: ignored.allowed.example.com               |
    +--------------------------------------------------------------+
                          |   |
                          v   |
    +--------------------------------------------------------------+
    |  Entity Cert (w/explicitly permitted subjects)               |
    |    SubjectAltName Extension                                  |
    |      rfc822Name: student@allowed.example.com                 |
    |      smtpUtf8Name: \u8001\u5E2B@allowed.example.com          |
    +--------------------------------------------------------------+
                              |
                              v
    +--------------------------------------------------------------+
    |  Entity Cert (w/permitted subject- excluded rfc822Name       |
    |  does not exclude smtpUtf8Name)                              |
    |    SubjectAltName Extension                                  |
    |      smtpUtf8Name: \u4E0D\u5C0D@ignored.allowed.example.com  |
    +--------------------------------------------------------------+
</artwork>
</figure>
</t>

</section>



<section title="Deployment Considerations" anchor="sec_deployment">
<t>
For email addresses whose local-part is ASCII it may be more reasonable to
continue using rfc822Name instead of smtpUtf8Name.  The use of rfc822Name rather than
smtputf8Name is currently more likely to be supported.  Also use of smtpUtf8Name incurs higher
byte representation overhead due to encoding with otherName and the additional OID
needed.  This may be offset if domain requires non-ASCII characters as smptUtf8Name
supports U-label whereas rfc822Name supports A-label.  This document RECOMMENDS using smtpUtf8Name
when local-part contains non-ASCII characters, and otherwise rfc822Name.
</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 (and issuerAltName) will incur many of the
same security considerations of Section 8 in <xref target='RFC5280'/> but further
complicated by permitting non-ASCII characters in 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>

<section title="IANA Considerations" anchor="sec_iana">
<t>
This document makes use of object identifiers for the smtpUtf8Name defined
in Section <xref target='sec_name_def'/> and the ASN.1 module identifier
defined in Section <xref target='appndix_asn1'/>. IANA is kindly
requested to make the following assignments for:
<list style="symbol">
<t>The LAMPS-EaiAddresses-2016 ASN.1 module in the "SMI
Security for PKIX Module Identifier" registry (1.3.6.1.5.5.7.0).
</t>
<t>The smtpUtf8Name otherName in the "PKIX Other Name Forms" registry
(1.3.6.1.5.5.7.8).</t>
</list>
</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.5912"?> <!-- New ASN.1 for PKIX -->
<?rfc include="reference.RFC.6531"?> <!-- SMTP Extension for Internationalized Email -->
<?rfc include="reference.RFC.6532"?> <!-- Internationalized Email Headers-->

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

<?rfc include="reference.RFC.5322"?> <!-- Email Format -->

</references>

<section title="ASN.1 Module" anchor="appndix_asn1">

<t>The following ASN.1 module normatively specifies the smtpUtf8Name structure.
This specification uses the ASN.1 definitions from
<xref target='RFC5912'/> with the 2002 ASN.1 notation used in that document.</t>

<figure anchor="asn1_module">
<artwork>
  LAMPS-EaiAddresses-2016
    { iso(1) identified-organization(3) dod(6)
      internet(1) security(5) mechanisms(5) pkix(7) id-mod(0)
      id-mod-lamps-eai-addresses-2016(TBD) }

  DEFINITIONS IMPLICIT TAGS ::=
  BEGIN

  IMPORTS
    OTHER-NAME
    FROM PKIX1Implicit-2009
      { iso(1) identified-organization(3) dod(6) internet(1) security(5)
      mechanisms(5) pkix(7) id-mod(0) id-mod-pkix1-implicit-02(59) }

    id-pkix
    FROM PKIX1Explicit-2009
      { iso(1) identified-organization(3) dod(6) internet(1) security(5)
      mechanisms(5) pkix(7) id-mod(0) id-mod-pkix1-explicit-02(51) } &#59;

  --
  -- otherName carries additional name types for subjectAltName, issuerAltName,
  -- and other uses of GeneralNames.
  --

    id-on OBJECT IDENTIFIER ::= { id-pkix 8 }

    SmtpUtf8OtherNames OTHER-NAME ::= { on-smtpUtf8Name, ... }

    on-smtpUtf8Name OTHER-NAME ::= {
        smtpUtf8Name IDENTIFIED BY id-on-smtpUtf8Name
    }

    id-on-smtpUtf8Name OBJECT IDENTIFIER ::= { id-on 9 }

    SmtpUtf8Name ::= UTF8String (SIZE (1..MAX))

  END
</artwork>
</figure>

</section>

<section title="Example of smtpUtf8Name" anchor="appndix_example">
<t>This non-normative example demonstrates using smtpUtf8Name as an otherName in
GeneralName to encode the email address "\u8001\u5E2B@example.com".</t>

<figure anchor="asn1_example">
<artwork>
   The hexidecimal DER encoding of the email address is:
   A022060A 2B060105 05070012 0809A014 0C12E880 81E5B8AB 40657861 6D706C65 2E636F6D

   The text decoding is:
   0  34: [0] {
     2  10:   OBJECT IDENTIFIER '1 3 6 1 5 5 7 0 18 8 9'
    14  20:   [0] {
    16  18:     UTF8String '..@example.com'
          :     }
          :   }
</artwork>
</figure>
<t>The example was encoded on the OSS Nokalva ASN.1 Playground and the above text decoding
is an output of Peter Gutmann's "dumpasn1" program.</t>
</section>

<section title="Acknowledgements">

<t>Thank you to Magnus Nystrom for motivating this document.  Thanks to
Russ Housley, Nicolas Lidzborski, Laetitia Baudoin, Ryan Sleevi, Sean Leonard,
and Sean Turner for their feedback.
Also special thanks to John Klensin for his valuable input on internationalization,
Unicode and ABNF formatting, and to Jim Schaad for his help with the ASN.1 example
and his helpful feedback.</t>

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