<?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-02'>
<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 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 fascilitate 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 TBD }</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>

<!--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>
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>

<!--
<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"/> 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.
<!-- 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>

<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 constaints 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.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.example.com  |
    +------------------------------------------------------+
</artwork>
</figure>
</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 encoding with otherName and the additional OID
needed.  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>

<!--
<t><b>IANA request in progress</b> IANA has registered a value TBD for
LAMPS-EaiAddresses-2016 for the Module Identifier (TBD) in the "SMI
Security for PKIX Module Identifier" registry.</t>

<t> <b>IANA request in progress</b> IANA has also registered value TBD for
id-on-smtputf8Name OID (TBD) in the "SMI Security for PKIX Module Identifier"
registry.  This value will be used to identify smtputf8Name in otherName.
The OID appears in <xref target='sec_name_def'/> and again in the reference
definition in <xref target='appndix_asn1'/>.
</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

    id-pkix  OBJECT IDENTIFIER  ::=
        {iso(1) identified-organization(3) dod(6) internet(1) security(5)
        mechanisms(5) pkix(7)}

  --
  -- 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 TBD }

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

  END
</artwork>
</figure>

</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,
Sean Turner, and Jim Schaad for their feedback.
Also thanks to John Klensin for his valuable input on internationalization,
Unicode and ABNF formatting.</t>

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