skip to content

A public agency proposes publishing employee S/MIME certificates as SMIMEA records under RFC 8162: how does a partner's client find one, and what must hold before it is used?

level: seniorimportance: nice to knowfreq 9%

answer

  1. DANE-style record for mailboxes
  2. hash the local part only
  3. a label beginning with an underscore
  4. anything but Secure is failure

basics

~10 s

The client hashes the address's local part with SHA2-256, truncates it to 28 octets and queries <hex>._smimecert.<domain> for SMIMEA. The answer must validate as DNSSEC Secure, and the certificate must match its usage rules.

solid answer

~50 s

RFC 8162 (Experimental, 2017) maps an address to a DNS name: the local part, in UTF-8 and lightly canonicalised, is hashed with SHA2-256, truncated to 28 octets and written in hex as the leftmost label, followed by `_smimecert` and the mail domain. The `SMIMEA` record has the same fields as TLSA: certificate usage, selector and matching type. The answer MUST pass DNSSEC validation; any state other than Secure is a failure. Usage 1 still requires normal path validation and pins the end-entity certificate, while usage 3 only requires the certificate to match the record, so trust then rests on the zone's DNSSEC alone. A revoked or expired certificate obtained this way MUST NOT be used, even if the message then goes out unencrypted. For the agency, the cost is signed zones on both ends, uncertain client support, and a published list of hashed staff addresses.

code

dns · 7 lines
dns
; SMIMEA for [email protected] (RFC 8162); hash and certificate shortened
; label = hex(SHA2-256("alice")) truncated to 28 octets
2bd806c9...93af71db._smimecert.example.com. 3600 IN SMIMEA 1 0 0 (
    308203a1...e4 )
; usage 1 = PKIX-EE: validate the path normally, and the
;           end-entity certificate must also match this record
; selector 0 = whole certificate, matching type 0 = exact data

go deeper

for a junior

Recall that SMIMEA lets a domain publish a mailbox's certificate in DNS so a sender can encrypt a first message without prior signed mail.

for a middle

Explain the query name: SHA2-256 of the local part truncated to 28 octets, then _smimecert, then the domain, and that the record reuses the TLSA fields.

for a senior

Show why DNSSEC Secure is mandatory, how usage 1 and usage 3 shift trust, and which revoked or expired results a client must refuse.

for a principal

Weigh first-message encryption against signed zones on both sides, an experimental standard, and a published list of hashed staff addresses.

## What SMIMEA is for RFC 8162, published in May 2017 with **Experimental** status, applies the DANE idea (RFC 6698, which publishes TLS certificate associations in DNS) to S/MIME. It gives the domain owner a way to publish, for each mailbox, the certificate or public key to use, so a sender can encrypt the **first** message to an address without having received signed mail from it. Its stated experiment goal is to see whether encrypted mail use grows when automated discovery exists. RFC 8550 (section 4) cites it as an experimental retrieval protocol whose usefulness "may be limited by the small number of the correspondent's certificates that can be retrieved" until it is widely used. ## How a client builds the query name RFC 8162 section 3 maps an address such as `[email protected]` to a DNS name in steps: 1. Take the **local part** (`alice`), in UTF-8. 2. Canonicalise it lightly: remove comments and folding white space around dots, enclosing double quotes and literal quoting; non-ASCII local parts SHOULD be normalised to Unicode NFC. 3. Hash it with **SHA2-256**, **truncate to 28 octets**, and write it in hexadecimal; that is the leftmost label. 4. Add **`_smimecert`** as the second label. 5. Append the **domain** (`example.com`). The domain is deliberately not hashed, so one set of records can serve several zones. Senders MUST NOT apply their own mapping rules to the local part (case folding, dropping dots, removing `+tag` extensions), because only the receiving domain may interpret it (NIST SP 800-177 Rev. 1 is looser, allowing UTF-8 conversion and lower-casing only); a domain that accepts variants has to publish records for the variants it wants found. ## What the record says `SMIMEA` (RR type 53) has the same wire and presentation format as `TLSA`: a **certificate usage**, a **selector** (whole certificate or public key only) and a **matching type** (full data, SHA-256 or SHA-512). Usages carry the RFC 6698 meanings: | Usage | Name in DANE practice | What the client accepts | |---|---|---| | 0 | PKIX-TA | a normally validated certificate whose path includes the named CA | | 1 | PKIX-EE | a normally validated certificate that also matches the record | | 2 | DANE-TA | a certificate that validates with the named certificate as its trust anchor | | 3 | DANE-EE | a certificate that matches the record, with no path validation tested | Conforming clients MUST understand usages 0 to 3, selectors 0 and 1 and matching types 0 and 1, and SHOULD handle matching type 2. ## What must hold before the client uses it - **DNSSEC Secure.** The answer MUST pass DNSSEC validation; Insecure, Bogus or Indeterminate are all treated as failure. That is the whole basis of trust for usages 2 and 3, and RFC 8162 says a certificate from SMIMEA "can only be trusted as much as the DNS domain can be trusted": whoever controls the zone's signing keys controls what senders encrypt to. - **Usage rules met.** For usages 0 and 1 the certificate must also pass ordinary path validation (covered with certificate path validation). - **Current certificate.** A revoked or expired certificate MUST NOT be used, "even if that would result in sending a message in plaintext". - **Look up sparingly.** A lookup MAY be done when no certificate is known for the address. Failed lookups should be remembered and not retried for a while, because each query is a privacy leak; queries SHOULD use TCP because records are large. ## What it costs the publishing organisation - **Signed zones on both sides.** The agency must sign its zone, and each partner's resolver must validate DNSSEC; the zone-signing work itself belongs to the material on DNSSEC. - **A published address list.** RFC 8162 section 9.2 says the hashing "is not a security feature": the records amount to a list of hashed valid addresses, short and common local parts are easy to guess back, and a zone signed with NSEC can be listed in full. NSEC3 makes that significantly harder. - **Who is writing to whom.** Ordinary DNS queries are unencrypted, so a monitored resolver can see that a user is about to send encrypted mail to an address. - **Variants and size.** Address variants need their own records, and certificates make large records. - **Client support.** Being experimental, it cannot be the only route for partners whose clients do not query it. ## Reading the decision A defensible design for the agency publishes usage 1 records for certificates already issued under a public S/MIME hierarchy, which adds DNS as a discovery channel without replacing path validation; usage 3 is the choice only for a domain that wants DNSSEC alone to vouch for its mailboxes.

  • Why does RFC 8162 hash the local part but leave the domain in clear?
    DNS cannot carry every character a local part may contain, so hashing gives a uniform label. The domain stays in clear because the record must live in that domain's zone, and leaving it out of the hash lets the same records be reused across zones joined by DNAME. RFC 8162 is explicit that the hash is not a privacy measure.
  • For an SMIMEA record, what changes when the publisher picks usage 3 instead of usage 1?
    With usage 1 the client still runs normal path validation and additionally requires the end-entity certificate to match the record. With usage 3 the certificate need only match the record, so a domain can publish certificates no public authority issued, and the only thing vouching for them is the zone's DNSSEC chain.

  • The SMIMEA label is a hash of the full address, domain included.
  • An SMIMEA answer that is DNSSEC Insecure can still be used.
  • Hashing the local part keeps the agency's address list private.
  • Senders should strip dots and plus tags from the local part before hashing.
  • SMIMEA is a Standards Track mechanism every S/MIME client implements.
  • SMIMEA usage 3 still requires validation up to a public CA.