RFC 3183

Domain Security Services using S/MIME

๐Ÿ“… published October 2001, from ietf

RFC 3183 ๐Ÿ“ฎ๐Ÿ’– Domain Security Services using S/MIME

  • Network Working Group ๐ŸŒธ
  • Authors: T. Dean and W. Ottaway, QinetiQ โœจ
  • Category: Experimental ๐Ÿงช
  • Date: October 2001 ๐Ÿ“…
  • Obsoletes / Updates: nothing listed, so this one doesn't replace or change any earlier RFC ๐ŸŽ€

Status of This Memo โœจ

okay so this memo defines an Experimental Protocol for the Internet community ๐Ÿงช it is NOT an Internet standard of any kind, so think of it as a draft-ish vibe the community is trying out. they're literally asking for discussion and suggestions for improvement ๐Ÿซถ and distribution of this memo is unlimited, so share it with everyone bestie ๐Ÿ’…

the copyright line says Copyright (C) The Internet Society (2001). All Rights Reserved. ๐Ÿ“œ that's the legal part, and it's giving formal energy ๐Ÿ’…

Abstract ๐Ÿฆ‹

this doc explains how the S/MIME (Secure/Multipurpose Internet Mail Extensions) protocol can be processed and generated by a bunch of components in a communication system ๐ŸŽ€ think message transfer agents, guards, and gateways. they all team up to deliver security services, and the whole package is called 'Domain Security Services' ๐Ÿ”ฅ

Acknowledgements ๐Ÿ™ˆ

big thank yous to Luis Barriga, Greg Colla, Trevor Freeman, Russ Housley, Dave Kemp, Jim Schaad and Michael Zolotarev ๐Ÿซถ they left significant comments and the doc is better because of them ๐Ÿ’–

1. Introduction ๐Ÿงš

okay so S/MIME [1] is a whole family of standards that defines a data encapsulation format ๐ŸŽ it gives you data integrity, confidentiality, and authentication โœจ it's built for messaging clients so they can deliver security services to distributed messaging apps ๐Ÿ’…

this doc is all about the interoperability problems and technical limits that pop up when different security domains want to talk securely ๐Ÿ™ˆ like when one domain uses X.400 and another uses SMTP/MIME, which are incompatible messaging tech ๐Ÿ’€ or when a domain needs to talk securely with one of its own members who's sitting on an untrusted domain ๐Ÿ˜ญ the scenarios covered are domain-to-domain, individual-to-domain, and domain-to-individual ๐ŸŒˆ it also works for orgs and enterprises with internal PKIs that the outside world can't reach, but who still want to interoperate using S/MIME ๐Ÿ”

now, end-to-end (desktop-to-desktop) security is not always the move ๐Ÿ™…โ€โ™€๏ธ especially between different security domains ๐ŸŒธ an org thinking about end-to-end security will usually run into some or all of these issues:

  1. Heterogeneous message access methods: users read mail through tools that reformat messages, like web browsers ๐ŸŒ when the Message Store reformats stuff, end-to-end encryption and signature validation become impossible ๐Ÿ’”
  2. Message screening and audit: server-side stuff like searching for banned words or other content, virus scanning, and auditing doesn't play nice with end-to-end encryption ๐Ÿฆ 
  3. PKI deployment issues: there might not be any certificate paths between two orgs ๐Ÿ›ค๏ธ or an org might be protective of its PKI and not want it exposed to outside access ๐Ÿ”’ also, rolling out full PKI for every employee can be expensive, unnecessary, or impractical for big orgs ๐Ÿ’ธ for any of these reasons, direct end-to-end signature validation and encryption are impossible ๐Ÿ˜ญ
  4. Heterogeneous message formats: one org uses X.400 series protocols and wants to chat with another org using SMTP ๐Ÿ“จ reformatting at the gateways makes end-to-end encryption and signature validation impossible too ๐Ÿ’€

this doc describes a way to fix these problems by providing message security at the level of a domain or an organization ๐Ÿฐ it specifies how these 'domain security services' can be provided using S/MIME โœจ domain security services can replace desktop mechanisms or work alongside them ๐Ÿซถ for example, a domain might do desktop-to-desktop signatures but domain-to-domain encryption ๐Ÿ” or it might allow desktop-to-desktop services inside the domain, but enforce domain-based services for talking to other domains ๐Ÿ‘‘

domain services are also useful for individual members of a corporation who are geographically remote ๐ŸŒ they can use them to swap encrypted and/or signed messages with their base ๐Ÿ’Œ

is a domain-based service inherently better or worse than desktop solutions? ๐Ÿค” honestly that's an open question, and experts don't all agree ๐Ÿ˜… some think only end-to-end solutions can be truly secure ๐Ÿ”’ others say things like content checking at domain boundaries add a ton of practical security for many real systems ๐Ÿ›ก๏ธ being able to check signatures at several points along a communications path is another bonus in lots of situations โœจ this debate is outside the scope of this document ๐Ÿ™…โ€โ™€๏ธ what this doc does give you is a set of tools that integrators can tailor in different ways for different needs in different circumstances ๐Ÿงฐ๐Ÿ’–

โš ๏ธ Security heads-up: message transfer agents (MTAs), guards, firewalls and protocol translation gateways all provide domain security services ๐Ÿฐ just like desktop solutions, these components have to be resilient against a wide variety of attacks that try to subvert the security services ๐Ÿ˜ฑ so careful thought should be given to the security of these components, to make sure their siting and configuration minimises the possibility of attack ๐Ÿ”ฅ

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 [2] ๐Ÿ“– ๐Ÿซถ

2. Overview of Domain Security Services ๐Ÿฆ‹

this section is a chill, informal tour of the security services S/MIME provides between different security domains ๐ŸŒˆ they're delivered by a combo of mechanisms in the sender's domain and the recipient's domain ๐Ÿค

later sections spell out exactly how these services map onto elements of the S/MIME protocol ๐Ÿ“

the following security mechanisms are specified in this document:

  1. Domain signature
  2. Review signature
  3. Additional attributes signature
  4. Domain encryption and decryption

the signature types defined in this doc are called DOMSEC defined signatures ๐Ÿท๏ธ

the term 'security domain' means a collection of hardware and personnel operating under a single security authority and performing a common business function ๐Ÿข members of a security domain will naturally share a high degree of mutual trust, since they have shared aims and objectives ๐Ÿซถ

a security domain is usually shielded from direct outside attack by physical measures ๐Ÿงฑ and from indirect (electronic) attack by a combo of firewalls and guards at the network boundaries ๐Ÿ”ฅ the interface between two security domains is called a 'security boundary' ๐Ÿšง one example of a security domain is an organizational network ('Intranet') ๐Ÿ’ผ

2.1 Domain Signature โœ๏ธ

a domain signature is an S/MIME signature generated on behalf of a set of users in a domain ๐Ÿ’… it can be used to authenticate information sent between domains, or between a domain and one of its individuals ๐Ÿค for instance, when two 'Intranets' are connected over the Internet, or when an Intranet is connected to a remote user over the Internet ๐ŸŒ it can be used when two domains use incompatible signature schemes internally, or when there are no certification links between their PKIs ๐Ÿ”— in both cases, messages from the originator's domain are signed over the original message and signature (if present) ๐Ÿ“ using an algorithm, key, and certificate that the recipient(s) or the recipient(s) domain can process ๐Ÿ”‘ a domain signature is sometimes called an "organizational signature" ๐Ÿท๏ธ

2.2 Review Signature ๐Ÿ‘€

a third party may review messages before they get forwarded to the final recipient(s), who may be in the same or a different security domain ๐Ÿ•ต๏ธโ€โ™€๏ธ organizational policy and good security practice often require messages to be reviewed before they're released to external recipients ๐Ÿšช once a message has been reviewed, an S/MIME signature gets added to it, and that's the review signature โœ… an agent can check the review signature at the domain boundary to make sure only reviewed messages get released ๐Ÿ›ก๏ธ main character gatekeeping energy ๐Ÿ‘‘

2.3 Additional Attributes Signature ๐Ÿท๏ธ

a third party can add additional attributes to a signed message ๐Ÿ’… an S/MIME signature is used for this, and it's called an additional attributes signature โœ๏ธ an example of an additional attribute is the 'Equivalent Label' attribute defined in ESS [3] ๐Ÿงพ

2.4 Domain Encryption and Decryption ๐Ÿ”

domain encryption is S/MIME encryption performed on behalf of a collection of users in a domain ๐Ÿฐ it can protect information between domains, for example when two 'Intranets' are connected over the Internet ๐ŸŒ it's also useful when end users don't have PKI/encryption capabilities on their desktops, or when two domains use incompatible encryption schemes internally ๐Ÿ™Œ in that last case, messages from the originator's domain are encrypted (or re-encrypted) using an algorithm, key, and certificate that can be decrypted by the recipient(s) or an entity in their domain ๐Ÿ”“ this scheme also covers protecting information between a single domain and one of its members, when both are connected over an untrusted network, like the Internet ๐ŸŒ โœจ

3. Mapping of the Signature Services to the S/MIME Protocol โœจ

okay bestie, this section is where the security services from section 2 finally get mapped onto actual S/MIME bits ๐Ÿ’… ESS [3] brings in the idea of triple-wrapped messages: signed first, then encrypted, then signed again ๐ŸŽ€ This document uses that same triple-wrapping trick too. It also uses something called "signature encapsulation," which is the big one ๐Ÿฆ‹ Signature encapsulation means a signed or unsigned message gets wrapped inside a signature, and that outer signature covers both the content AND the first (inner) signature, if there is one.

Signature encapsulation MAY be performed on the inner and/or the outer signature of a triple-wrapped message.

Here's an example ๐ŸŒธ The originator signs a message, then it gets encapsulated with an 'additional attributes' signature, then it all gets encrypted. After that, a reviewer signs the encrypted data, and a domain signature wraps it all up ๐Ÿ’–

Some policies might want signatures added in a specific order ๐Ÿ‘‘ Since signatures can only be added by encapsulation, you can tell which order they went on. The layers basically tell the story for you โœจ

A DOMSEC defined signature MAY encapsulate a message in one of the following ways:

  1. An unsigned message gets an empty signature layer added to it. In other words, the message is wrapped in a signedData whose signerInfos has no elements. This is for backward compatibility with S/MIME software that doesn't have DOMSEC capability ๐Ÿซถ Because the signerInfos has no signers, the eContentType inside the EncapsulatedContentInfo MUST be id-data as described in CMS [5]. The twist is that the eContent field holds the unsigned message instead of being left empty like section 5.2 in CMS [5] suggests ๐Ÿ˜ญ That way, when a DOMSEC defined signature gets added (method 2 below), it covers the unsigned message.
  2. Signature Encapsulation wraps the original signed message with a DOMSEC defined signature. This means the DOMSEC defined signature covers the message and all the signatures already on it ๐Ÿ”ฅ It also means you can tell the DOMSEC defined signature was added after the ones that were already there.

3.1 Naming Conventions and Signature Types

okay, this part is a big deal ๐Ÿ™ˆ Normally, when you get an S/MIME signed message, you expect the signature to belong to whoever sent it. But the services in this document need the recipient to accept messages signed by other entities AND/OR the originator. So when someone else signs, the name in the certificate won't match the message sender's name. A typical S/MIME implementation would flag a warning for that mismatch. (That check blocks a bunch of masquerade attacks, so it's not being dramatic when it says it matters ๐Ÿ’€)

For domain security services, this warning condition SHOULD be suppressed under certain circumstances. Those circumstances are set by a naming convention that spells out the form the signer's name SHOULD adhere to. Following that convention avoids uncontrolled naming and the masquerade attacks that would come with it ๐Ÿ›ก๏ธ

To help with implementation, there's a signed attribute called the 'signature type' attribute that goes inside the S/MIME signature ๐Ÿฆ‹ When a message has it, the naming convention checks get invoked.

Implementations conforming to this standard MUST support the naming convention for signature generation and verification. Implementations conforming to this standard MUST recognize the signature type attribute for signature verification. Implementations conforming to this standard MUST support the signature type attribute for signature generation.

3.1.1 Naming Conventions

Here are the naming conventions for agents generating the signatures specified in this document ๐ŸŽ€

  • For a domain signature, an agent generating this signature MUST be named domain-signing-authority
  • For a review signature, an agent generating this signature MUST be named review-authority.
  • For an additional attributes signature, an agent generating this signature MUST be named attribute-authority.

This name shall appear as the common name (CN) component of the subject field in the X.509 certificate. There MUST be only one CN component present. If the certificate also contains an RFC 822 address, this name shall appear in the end entity component of that address, on the left-hand side of the @ symbol ๐Ÿ’–

For a domain signature, there's an extra rule called the 'name mapping rule' โœจ It says that for a domain signing authority, the domain part of its name MUST be the same as, or an ascendant of, the domain name of the message originator(s) it represents. The domain part is defined like this:

  • For an X.500 distinguished subject name of an X.509 certificate, the domain part is the country, organization, organizational unit, state, and locality components of the distinguished name.
  • For an RFC 2247 distinguished name, the domain part is the domain components of the distinguished name.
  • If the certificate contains an RFC 822 address, the domain part is the RFC 822 address component on the right-hand side of the @ symbol.

Let's do an example, because this is where it clicks ๐Ÿงš A domain signing authority is acting for John Doe of the Acme corporation. His distinguished name is cn=John Doe,ou=marketing,o=acme,c=us and his e-mail address is John.Doe@marketing.acme.com. The domain signing authority could have a certificate with the distinguished name cn=domain-signing-authority,o=acme,c=us and the RFC 822 address domain-signing-authority@acme.com. If John Doe has the RFC 2247 defined address cn=John Doe,dc=marketing,dc=acme,dc=us, then the address cn=domain-signing-authority,dc=acme,dc=us could be used to represent the domain signing authority ๐ŸŒˆ

When the X.500 distinguished subject name has consecutive organizational units and/or localities, the ordering matters a lot ๐Ÿ™ˆ You have to understand that ordering to figure out whether the domain part of the domain signature is an ascendant. In this case, when you parse the distinguished subject name starting from the most significant component (country, locality or organization), the parsed organizational unit or locality counts as the ascendant of the consecutive (unparsed) organizational units or localities.

When parsing an RFC 2247 subject name from the most significant component (the dc entry that represents the country, locality or organization), the parsed dc entry counts as the ascendant of the consecutive (unparsed) dc entries.

Another example, with a deeper hierarchy ๐Ÿ“ A domain signing authority is acting for John Doe of the Acme corporation. His distinguished name is cn=John Doe,ou=marketing,ou=defence,o=acme,c=us and his e-mail address is John.Doe@marketing.defence.acme.com. The domain signing authority could have a certificate with the distinguished name cn=domain-signing-authority,ou=defence,o=acme,c=us and the RFC 822 address domain-signing-authority@defence.acme.com. If John Doe has the RFC 2247 defined address cn=John Doe,dc=marketing,dc=defense,dc=acme,dc=us, then the domain signing authority could have the distinguished name cn=domain-signing-authority,dc=defence,dc=acme,dc=us.

Any message received where the domain part of the domain signing agent's name does not match, or is not an ascendant of, the originator's domain name MUST be flagged.

This naming rule stops agents from one organization pretending to be domain signing authorities for another organization ๐Ÿšซ For the other types of signature defined in this document, no name mapping rule is defined.

Implementations conforming to this standard MUST support this name mapping convention as a minimum. Implementations MAY choose to supplement this convention with other locally defined conventions. However, these MUST be agreed between sender and recipient domains prior to secure exchange of messages.

When verifying the signature, a receiving agent MUST ensure that the naming convention has been adhered to. Any message that violates the convention MUST be flagged ๐Ÿ’…

3.1.2 Signature Type Attribute

An S/MIME signed attribute is used to indicate the type of signature ๐Ÿฆ‹ It's meant to be used together with the naming conventions from the previous section. When an S/MIME signed message containing the signature type attribute is received, it triggers the software to verify that the correct naming convention was used.

The ASN.1 [4] notation of this attribute is:

SignatureType ::= SEQUENCE OF OBJECT IDENTIFIER

id-sti  OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840)
            rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 9 }

-- signature type identifier

If it's present, the SignatureType attribute MUST be a signed attribute, as defined in [5]. If the SignatureType attribute is absent and there are no further encapsulated signatures, the recipient SHOULD assume that the signature is that of the message originator ๐Ÿ‘‘

All of the signatures defined here are generated and processed as described in [5] ๐ŸŒธ They're told apart by the presence of the following values in the SignatureType signed attribute:

id-sti-domainSig OBJECT IDENTIFIER ::= { id-sti 2 }
-- domain signature.

id-sti-addAttribSig OBJECT IDENTIFIER ::= { id-sti 3 }
-- additional attributes signature.

id-sti-reviewSig OBJECT IDENTIFIER ::= { id-sti 4 }
-- review signature.

For completeness, there's also an attribute type for an originator signature. This signature type is optional, though ๐Ÿซถ It's defined as follows:

id-sti-originatorSig OBJECT IDENTIFIER ::= { id-sti 1 }
-- originator's signature.

All signature types, except the originator type, MUST encapsulate other signatures. Note that a DOMSEC defined signature could be encapsulating an empty signature, as defined in section 3 ๐Ÿ™ˆ

A SignerInfo MUST NOT include multiple instances of SignatureType. A signed attribute representing a SignatureType MAY include multiple instances of different SignatureType values as an AttributeValue of attrValues [5], as long as the SignatureType 'additional attributes' is not present.

If there's more than one SignerInfo in a signerInfos (for example, when different algorithms are used), then the SignatureType attribute in all the SignerInfos MUST contain the same content ๐Ÿ”ฅ

The following sections describe the conditions under which each of these types of signature may be generated, and how they are processed ๐Ÿ’œ

3.2. Domain Signature Generation and Verification

okay so a 'domain signature' is a proxy signature generated on a user's behalf in the user's domain ๐Ÿ’… it MUST follow the naming conventions in 3.1.1, name mapping convention included. it's basically the domain stamping "yep, this left our domain" on a message โœจ before a process signs, it MUST first make sure the originator is legit ๐Ÿ” there are two ways to do that. either you check the 'originator's signature' (if S/MIME signatures are used inside the domain), or, if not, you use something outside S/MIME, like the physical address of the originating client or an authenticated IP link ๐ŸŒธ

if the originator checks out by one of those methods AND every other signature present is valid (including the encrypted ones) ๐ŸŽ€ then a 'domain signature' can get added to the message ๐Ÿ’–

heads up though: if a 'domain signature' is added and the message hits a Mail List Agent (MLA), it's possible the 'domain signature' gets removed ๐Ÿ˜ญ to stop that, the steps in section 5 MUST be followed ๐Ÿ›ก๏ธ

an entity generating a domain signature MUST use a certificate whose subject name follows the naming convention in 3.1.1. no exceptions bestie ๐Ÿ™…โ€โ™€๏ธ

if the originator's authenticity is NOT verified, or any of the signatures present are NOT valid, then a 'domain signature' MUST NOT be generated ๐Ÿ’€ hard stop

on reception, the 'domain signature' SHOULD be used to verify the authenticity of a message โœจ and you MUST check that both the naming convention and the name mapping convention were used the way this standard says ๐Ÿงš

a recipient can assume that a successful domain signature verification also authenticates the message originator ๐Ÿ‘‘ main character energy

if there's an originator signature present, the name in that certificate SHOULD be used to identify the originator, and that info can then be displayed to the recipient ๐Ÿ’œ

if there's no originator signature, the only thing you can assume is the domain the message came from ๐Ÿฆ‹

a domain signer can be assumed to have verified any signatures it encapsulates ๐Ÿซถ so you don't have to re-verify them before treating the message as authentic. BUT this standard doesn't stop a recipient from trying to verify any other signatures that are present ๐Ÿ”Ž

the 'domain signature' is indicated by the presence of the value id-sti-domainSig in a 'signature type' signed attribute ๐Ÿท๏ธ

there MAY be one or more 'domain signature' signatures in an S/MIME encoding ๐ŸŒˆ


3.3. Additional Attributes Signature Generation and Verification

the 'additional attributes' signature type says the SignerInfo carries extra attributes that are tied to the message ๐ŸŽ€

ok so ALL attributes in the applicable SignerInfo MUST be treated as additional attributes ๐Ÿ“ฆ and a successful check of an 'additional attributes' signature only means the attributes are authentically bound to the message. a recipient MUST NOT assume that it also authenticates the message originator ๐Ÿ™ˆ not the same thing, iykyk

an entity generating an 'additional attributes' signature MUST use a certificate whose subject name follows the naming convention in 3.1.1. and on reception, a check MUST be made to ensure the naming convention was used ๐Ÿง

a signer MAY include any of the attributes listed in [3] or in this document when generating an 'additional attributes' signature ๐Ÿ“ these ones have a special meaning when they show up in an 'additional attributes' signature:

  1. Equivalent Label: label values in this attribute are to be treated as equivalent to the security label contained in an encapsulated SignerInfo, if present. ๐Ÿท๏ธ
  2. Security Label: the label value indicates the aggregate sensitivity of the inner message content plus any encapsulated signedData and envelopedData containers. The label on the original data is indicated by the value in the originator's signature, if present. ๐Ÿ”

the 'additional attributes' signature is indicated by the presence of the value id-sti-addAttribSig in a 'signature type' signed attribute ๐Ÿ’… and if this value is present, other Object Identifiers MUST NOT be included in the sequence of OIDs ๐Ÿšซ

there MAY be multiple 'additional attributes' signatures in an S/MIME encoding ๐Ÿ’–


3.4. Review Signature Generation and Verification

the review signature shows that the signer has reviewed the message ๐Ÿ‘€ successful verification only means the signer approved the message for onward transmission to the recipient(s). when the recipient is in another domain, a device on a domain boundary (like a Mail Guard or firewall) may be configured to check review signatures ๐Ÿงฑ and a recipient MUST NOT assume that a successful verification also authenticates the message originator. not the vibe, bestie ๐Ÿ™…โ€โ™€๏ธ

an entity generating a signed review signature MUST use a certificate whose subject name follows the naming convention in 3.1.1. on reception, a check MUST be made to ensure the naming convention was used โœจ

a review signature is indicated by the presence of the value id-sti-reviewSig in a 'signature type' signed attribute ๐Ÿท๏ธ

there MAY be multiple review signatures in an S/MIME encoding ๐Ÿฆ‹


3.5. Originator Signature

the 'originator signature' says the signer is the originator of the message and its contents ๐Ÿ’œ it's only included in this document for completeness, so don't stress about it too much ๐Ÿซถ an originator signature is indicated either by the absence of the signature type attribute, OR by the presence of the value id-sti-originatorSig in a 'signature type' signed attribute ๐ŸŒธ


4. Encryption and Decryption ๐Ÿ”’

okay so message encryption can be done by a third party on behalf of a set of originators in a domain. that's called domain encryption ๐ŸŽ€ and message decryption can be done by a third party on behalf of a set of recipients in a domain, which is domain decryption โœจ the third party doing this is called a "Domain Confidentiality Authority" (DCA) in this section ๐Ÿ‘‘ both processes are described here ๐Ÿ’–

messages may be encrypted for decryption by the final recipient and/or by a DCA in the recipient's domain ๐Ÿงš the message may also be encrypted for decryption by a DCA in the originator's domain (e.g., for content analysis, audit, key word scanning, etc.) ๐Ÿ”Ž which one actually happens is a system specific issue that depends on system security policy, so it's outside the scope of this document ๐Ÿ™ƒ here's the table for these encryption and decryption processes:

 --------------------------------------------------------------------
|                        | Recipient Decryption |  Domain Decryption |
|------------------------|----------------------|--------------------|
| Originator Encryption  |       Case(a)        |       Case(b)      |
| Domain Encryption      |       Case(c)        |       Case(d)      |
 --------------------------------------------------------------------

case (a), originator encryption for decryption by the final recipient(s), is described in CMS [5] ๐Ÿ“œ in cases (c) and (d), the encryption is done by the DCA in the originator's domain instead of the originator ๐Ÿข and in cases (b) and (d), the decryption is done by the DCA in the recipient's domain instead of the recipient(s) ๐Ÿ”“

a client implementation that conforms to this standard MUST support case (b) for transmission, case (c) for reception, and case (a) for transmission and reception ๐Ÿ’…

a DCA implementation that conforms to this standard MUST support cases (c) and (d) for transmission, and cases (b) and (d) for reception ๐Ÿซถ in cases (c) and (d) the 'domain signature' SHOULD be applied before the encryption โœจ and in cases (b) and (d) the message SHOULD be decrypted before the originators 'domain signature' is obtained and verified ๐Ÿ”

the process of encryption and decryption is documented in CMS [5] ๐Ÿ“– the only extra requirement that domain encryption and decryption brings is greater flexibility in managing keys, covered in the subsections below ๐Ÿ—๏ธ and just like with signatures, a naming convention and name mapping convention are used to locate the correct public key ๐ŸŽฏ

the mechanisms below apply to both key agreement and key transport systems, as documented in CMS [5] ๐ŸŒˆ the phrase 'encryption key' is a collective term for the key management keys used by both techniques ๐Ÿฆ‹

the mechanisms below also apply to individual roving users who want to encrypt messages that get sent back to base ๐Ÿงณโœจ

4.1. Domain Confidentiality Naming Conventions

a DCA MUST be named 'domain-confidentiality-authority' ๐Ÿท๏ธ this name MUST appear in the 'common name(CN)' component of the subject field in the X.509 certificate. also, if the certificate contains an RFC 822 address, this name MUST appear in the end entity part of the address, i.e., on the left-hand side of the '@' symbol ๐Ÿ’Œ

there's an extra naming rule too: the 'name mapping rule' ๐Ÿ—บ๏ธ it says that for a DCA, the domain part of its name MUST be the same as, or an ascendant of (as defined in section 3.1.1), the domain name of the set of entities it represents. the domain part works like this:

  • In the case of an X.500 distinguished name of an X.509 certificate, the domain part is the country, organization, organizational unit, state, and locality components of the distinguished name. ๐ŸŒ
  • In the case of an RFC 2247 distinguished name, the domain part is the domain components of the distinguished name. ๐Ÿงฉ
  • If the certificate contains an RFC 822 address, the domain part is defined to be the RFC 822 address part on the right-hand side of the '@' symbol. ๐Ÿ“จ

example time ๐Ÿ™ˆ say a DCA is acting for John Doe of the Acme corporation, whose distinguished name is 'cn=John Doe,ou=marketing,o=acme,c=us' and whose e-mail address is John.Doe@marketing.acme.com. the DCA could have a certificate with the distinguished name 'cn=domain-confidentiality-authority,o=acme,c=us' and the e-mail address 'domain-confidentiality-authority@acme.com'. and if John Doe has an RFC 2247 defined address of 'cn=John Doe,dc=marketing,dc=defense,dc=acme,dc=us', then the domain signing authority could have a distinguished name of 'cn=domain-signing-authority,dc=defence,dc=acme,dc=us'. the key tied to this certificate would be used for encrypting messages for John Doe ๐Ÿ”‘

any message received where the domain part of the domain encrypting agent's name does NOT match, or is NOT an ascendant of, the domain name of the entities it represents MUST be flagged ๐Ÿšฉ this naming rule stops messages from getting encrypted for the wrong domain decryption agent ๐Ÿ™…โ€โ™€๏ธ

implementations conforming to this standard MUST support this name mapping convention as a minimum ๐Ÿ’– implementations may choose to supplement this convention with other locally defined conventions. however, these MUST be agreed between sender and recipient domains prior to sending any messages ๐Ÿค no surprises, periodt ๐Ÿ’œ

4.2. Key Management for DCA Encryption โœจ

okay so at the sender's domain, DCA encryption happens using either the recipient DCA's certificate or the end recipient's certificate ๐ŸŽ€. the encrypting process has to be able to find the right certificate for the matching DCA in the recipient's domain, or the one for the end recipient ๐Ÿ”Ž. once it's located, the encryption happens and the extra info needed for decryption gets sent to the recipient in the recipientInfo field, as CMS [5] describes ๐Ÿ’Œ. a DCA encryption agent MUST be named according to the naming convention in section 4.1 so that its certificate can be found ๐Ÿซถ.

no specific method for finding that certificate is mandated in this document ๐Ÿ™…โ€โ™€๏ธ. an implementation can check a local certificate store. or a X.500 or LDAP directory can be used in one of these ways:

  1. The directory may store the DCA certificate in the recipient's directory entry. When the user certificate attribute is requested, this certificate is returned.
  2. The encrypting agent maps the recipient's name to the DCA name in the manner specified in 4.1. The user certificate attribute associated with this directory entry is then obtained.

this document does not mandate either of these processes ๐Ÿคทโ€โ™€๏ธ. whichever one you use, the name mapping conventions must be adhered to, in order to maintain confidentiality ๐Ÿ”.

having located the correct certificate, the encryption process is then performed. a recipientInfo for the DCA or end recipient is then generated, as described in CMS [5] ๐Ÿ’….

DCA encryption may be performed for decryption by the end recipient and/or by a DCA. end recipient decryption is described in CMS [5]. DCA decryption is described in section 4.3 ๐Ÿฆ‹.

4.3. Key Management for DCA Decryption

okay, DCA decryption uses a private key that belongs to the DCA, plus the necessary info conveyed in the DCA's recipientInfo field ๐Ÿ—๏ธ.

it should be noted that domain decryption can be performed on messages encrypted by the originator and/or by a DCA in the originator's domain ๐Ÿ‘€. in the first case, the encryption process is described in CMS [5]. in the second case, it's described in 4.2 ๐Ÿงš.


5. Applying a Domain Signature when Mail List Agents are Present.

bestie, this one is seriously important ๐Ÿ˜ญ. a message leaving a DOMSEC domain might run into a Mail List Agent (MLA) before it reaches the final recipient. there's a possibility that this strips off the 'domain signature', and we are NOT about that life ๐Ÿ™…โ€โ™€๏ธ. so the 'domain signature' must be applied to the message in a way that stops an MLA from removing it ๐Ÿ›ก๏ธ.

an MLA will search a message for the "outer" signedData layer, as defined in ESS [3] section 4.2, and strip off all the signedData layers that wrap this "outer" signedData layer ๐Ÿง…. where that "outer" layer is found depends on whether the message has an mlExpansionHistory attribute or an envelopedData layer ๐Ÿค”.

there's a possibility that a message leaving a DOMSEC domain has already been processed by an MLA. if so, an mlExpansionHistory attribute will be present in the message ๐Ÿ“ฌ.

there's also a possibility that the message will contain an envelopedData layer. this happens when the message has been encrypted inside the domain for the domain's "Domain Confidentiality Authority", see section 4.0, and possibly the final recipient too ๐Ÿ”’.

how the 'domain signature' gets applied depends on what's already in the message โœจ. before the 'domain signature' can be applied, the message MUST be searched for the "outer" signedData layer. that search is complete when one of these is found:

  • The "outer" signedData layer that includes an mlExpansionHistory attribute or encapsulates an envelopedData object.
  • An envelopedData layer.
  • The original content (that is, a layer that is neither envelopedData nor signedData).

if a signedData layer containing an mlExpansionHistory attribute has been found, then:

  1. Strip off the signedData layer (after remembering the included signedAttributes).
  2. Search the rest of the message until an envelopedData layer or the original content is found.
  3. Next:
    • a) If an envelopedData layer has been found, then:
      • Strip off all the signedData layers down to the envelopedData layer.
      • Locate the RecipientInfo for the local DCA and use the information it contains to obtain the message key.
      • Decrypt the encryptedContent using the message key.
      • Encapsulate the decrypted message with a 'domain signature'.
      • If local policy requires the message to be encrypted using S/MIME encryption before leaving the domain, then encapsulate the 'domain signature' with an envelopedData layer containing RecipientInfo structures for each of the recipients and an originatorInfo value built from information describing this DCA.

If local policy does not require the message to be encrypted using S/MIME encryption but there is an envelopedData at a lower level within the message, then the 'domain signature' MUST be encapsulated by an envelopedData as described above.

An example when it may not be local policy to require S/MIME encryption is when there is a link crypto present.

  • b) If an envelopedData layer has not been found, then:
    • Encapsulate the new message with a 'domain signature'.
  1. Encapsulate the new message in a signedData layer, adding the signedAttributes from the signedData layer that contained the mlExpansionHistory attribute.

if no signedData layer containing an mlExpansionHistory attribute has been found, but an envelopedData has been found, then:

  1. Strip off all the signedData layers down to the envelopedData layer.
  2. Locate the RecipientInfo for the local DCA and use the information it contains to obtain the message key.
  3. Decrypt the encryptedContent using the message key.
  4. Encapsulate the decrypted message with a 'domain signature'.
  5. If local policy requires the message to be encrypted before leaving the domain, then encapsulate the 'domain signature' with an envelopedData layer containing RecipientInfo structures for each of the recipients and an originatorInfo value built from information describing this DCA.

If local policy does not require the message to be encrypted using S/MIME encryption but there is an envelopedData at a lower level within the message, then the 'domain signature' MUST be encapsulated by an envelopedData as described above.

if no signedData layer containing an mlExpansionHistory attribute has been found and no envelopedData has been found, then:

  1. Encapsulate the message in a 'domain signature'.

that's the whole mail list agent glow-up ๐ŸŒˆ๐Ÿ’–

5.1 Examples of Rule Processing

Okay bestie, these examples show the rules in action ๐Ÿ’… All of the signedData objects here are valid, and none of them are a domain signature ๐ŸŽ€ If a signedData object was a domain signature, you wouldn't need to validate any further signedData objects โœจ

  1. Okay so the first one is a message (S1 (Original Content)) (where S = signedData) whose signedData has no mlExpansionHistory attribute, and it needs a 'domain signature' ๐Ÿ’– We verify S1. There's no "outer" signedData to find, because the original content is right there. There's also no envelopedData or mlExpansionHistory attribute. So we make a brand new signedData layer, S2, that holds a 'domain signature', and the message leaving the domain is (S2 (S1 (Original Content))) ๐Ÿฆ‹
  2. Next, a message (S3 (S2 (S1 (Original Content))) where none of the signedData layers has an mlExpansionHistory attribute, so it gets a 'domain signature' too ๐ŸŒธ We verify S1, S2 and S3. Again there's no "outer" signedData, since the original content shows up, and no envelopedData or mlExpansionHistory either. We wrap a new signedData layer, S4, with the 'domain signature', and the message leaving is (S4 (S3 (S2 (S1 (Original Content))). Iconic layering, no cap ๐Ÿ‘‘
  3. Now a message (E1 (S1 (Original Content))) (where E = envelopedData) where S1 has no mlExpansionHistory attribute, and it needs a 'domain signature' โœจ There's no original "outer" signedData layer, because envelopedData E1 is the outer layer. We decrypt the encryptedContent, verify S1, and wrap the decrypted content in a new signedData layer, S2, which holds a 'domain signature'. Now if local policy says the message has to be encrypted with S/MIME encryption before it leaves the domain, we wrap it in an envelopedData layer, E2, and the message going out is (E2 (S2 (S1 (Original Content)))) ๐Ÿ”ฅ If not, we skip the envelopedData wrapper and send (S2 (S1 (Original Content))) ๐Ÿซถ
  4. This one is a message (S2 (E1 (S1 (Original Content)))) where S2 includes an mlExpansionHistory attribute, so it needs a 'domain signature' ๐Ÿงš We verify S2, and since the mlExpansionHistory attribute is in S2, S2 is the "outer" signedData. We remember the signed attributes in S2 so we can include them later in the new outer signedData that goes on the message. Then we strip S2 off, decrypt the message, and verify S1. The decrypted message gets wrapped in a signedData layer, S3, which holds a 'domain signature'. If local policy requires S/MIME encryption before the message leaves the domain, we wrap it in an envelopedData layer, E2, and then wrap a new signedData layer, S4, around E2. The message going out is (S4 (E2 (S3 (S1 (Original Content))))). If local policy does not require encryption, we skip the envelopedData layer and just wrap a new signedData layer, S4, around S3, so the message going out is (S4 (S3 (S1 (Original Content)). Either way, the signedData S4 carries the signed attributes from S2 ๐Ÿ’œ
  5. Next up, a message (S3 (S2 (E1 (S1 (Original Content))))) where none of the signedData layers include an mlExpansionHistory attribute, so it needs a 'domain signature' ๐Ÿฆ‹ We verify S3 and S2, and when we find envelopedData E1 we strip off those signedData objects. Then we decrypt the encryptedContent and verify S1. The decrypted content gets wrapped in a new signedData layer, S4, with a 'domain signature'. If local policy requires S/MIME encryption before it leaves, we wrap the message in an envelopedData layer, E2, and send (E2 (S4 (S1 (Original Content)))). Otherwise we send (S4 (S1 (Original Content))) without the envelopedData wrapper ๐ŸŒˆ
  6. Here's a message (S3 (S2 (E1 (S1 (Original Content))))) where S3 includes an mlExpansionHistory attribute, so it needs a 'domain signature' ๐Ÿ˜ญ We verify S3 and S2. Since the mlExpansionHistory attribute is in S3, S3 is the "outer" signedData, and we remember its signed attributes for the new outer signedData we'll apply later. We strip off S3. When we reach envelopedData E1, we strip off S2, decrypt the encryptedContent, and verify S1. The decrypted content gets wrapped in a new signedData layer, S4, with a 'domain signature'. If local policy requires S/MIME encryption before it leaves the domain, we wrap it in an envelopedData layer, E2, then wrap a new signedData layer, S5, around E2, and the message going out is (S5 (E2 (S4 (S1 (Original Content))))). If encryption isn't required, the message is wrapped in a new signedData layer, S5, around S4, so it goes out as (S5 (S4 (S1 (Original Content). Either way, S5 carries the signed attributes from S3 ๐Ÿ’…
  7. Last one: a message (S3 (E2 (S2 (E1 (S1 (Original Content)))))) where S3 doesn't include an mlExpansionHistory attribute, so it needs a 'domain signature' ๐Ÿ“ We verify S3, and when we find envelopedData E2 we strip S3 off. Then we decrypt the encryptedContent, verify S2, decrypt the envelopedData E1, and verify S1. The signedData object S2 gets wrapped in a new signedData layer, S4, with a 'domain signature'. Since there's an envelopedData E1 lower down in the message, the new message gets wrapped in an envelopedData layer, E3, and the message going out of the domain is (E3 (S4 (S2 (E1 (S1 (Original Content))))) โœจ

6. Security Considerations โœจ

Okay, this part is seriously important, so listen up ๐Ÿซถ This spec relies on a few well known names, like domain-confidentiality-authority. Organizations have to take care with these names, even if they don't support DOMSEC, so that certificates issued in these names only go to legit entities ๐Ÿ”ฅ If that isn't true, then someone could get a certificate tied to domain-confidentiality-authority@acme.com and as a result might be able to read messages the a DOMSEC client meant for other people ๐Ÿ’€

Implementations MUST protect all private keys. If the signer's private key gets compromised, that permits masquerade ๐Ÿ˜ญ

Similarly, if the content-encryption key gets compromised, the encrypted content may be disclosed ๐Ÿ™ˆ

Compromised key material is a way more serious issue for domain security services than for an S/MIME client ๐Ÿšจ That's because a compromised private key may in turn compromise the security of a whole domain. So, great care should be used when thinking about how to protect it ๐Ÿงš

Domain encryption alone is not secure, and it should be used together with a domain signature to avoid a masquerade attack ๐Ÿ’œ In that attack, an attacker who has obtained a DCA certificate could fake a message to that domain while pretending to be another domain.

When an encrypted DOMSEC message is sent to an end user in a way that the end user's DCA decrypts it, the message will be in plain text, so confidentiality could be compromised. Yikes ๐Ÿ™ˆ

If the recipient's DCA is compromised, then the recipient can't guarantee the integrity of the message ๐Ÿ˜ญ And even if the recipient's DCA correctly verifies a message's signatures, a message could still be undetectably modified when there are no signatures on it that the recipient can verify ๐Ÿ’€


7. DOMSEC ASN.1 Module ๐Ÿงš

DOMSECSyntax
 { iso(1) member-body(2) us(840) rsadsi(113549)
       pkcs(1) pkcs-9(9) smime(16) modules(0) domsec(10) }

 DEFINITIONS IMPLICIT TAGS ::=
 BEGIN

 -- EXPORTS All
 -- The types and values defined in this module are exported for
 -- use in the other ASN.1 modules.  Other applications may use
 -- them for their own purposes.

 SignatureType ::= SEQUENCE OF OBJECT IDENTIFIER

 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
          us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 16 }

 id-sti  OBJECT IDENTIFIER ::= { id-smime 9 }   -- signature type
 identifier

 -- Signature Type Identifiers

 id-sti-originatorSig       OBJECT IDENTIFIER ::= { id-sti 1 }
 id-sti-domainSig           OBJECT IDENTIFIER ::= { id-sti 2 }
 id-sti-addAttribSig        OBJECT IDENTIFIER ::= { id-sti 3 }
 id-sti-reviewSig           OBJECT IDENTIFIER ::= { id-sti 4 }

 END -- of DOMSECSyntax

8. References ๐Ÿ“š

[1] Ramsdell, B., "S/MIME Version 3 Message Specification", RFC 2633, June 1999.

[2] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[3] Hoffman, P., "Enhanced Security Services for S/MIME", RFC 2634, June 1999.

[4] International Telecommunications Union, Recommendation X.208, "Open systems interconnection: specification of Abstract Syntax Notation (ASN.1)", CCITT Blue Book, 1989.

[5] Housley, R., "Cryptographic Message Syntax", RFC 2630, June 1999.


9. Authors' Addresses ๐ŸŒธ

Tim Dean
QinetiQ
St. Andrews Road
Malvern
Worcs
WR14 3PS

Phone: +44 (0) 1684 894239
Fax:   +44 (0) 1684 896660
EMail: tbdean@QinetiQ.com

William Ottaway
QinetiQ
St. Andrews Road
Malvern
Worcs
WR14 3PS

Phone: +44 (0) 1684 894079
Fax:   +44 (0) 1684 896660
EMail: wjottaway@QinetiQ.com

Copyright (C) The Internet Society (2001). All Rights Reserved.

Okay so, the legal bit ๐Ÿงพ (ngl it's giving lawyer energy, but it matters!!). You're allowed to copy this document and share it with others. You can also write derivative works that comment on it, explain it, or help people implement it, and those can be prepared, copied, published, and distributed, in whole or in part, with no restrictions of any kind. The one condition is that the copyright notice and this paragraph are included on every copy and every derivative work. ๐ŸŽ€

BUT the document itself can't be modified in any way. You can't remove the copyright notice or the references to the Internet Society or other Internet organizations. There are two exceptions. The first is developing Internet standards, where you have to follow the copyright procedures in the Internet Standards process. The second is translating it into languages other than English. ๐ŸŒ

The permissions above are perpetual, and the Internet Society or its successors or assigns will never revoke them. Forever vibes ๐Ÿฆ‹

The bit below is in all caps for a reason, bestie ๐Ÿ’€ This document and the information in it is provided on an "AS IS" basis. THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement ๐Ÿซถ

Big thank-you energy here: the RFC Editor function is currently funded by the Internet Society. ๐ŸŒธ

๐Ÿ“ฆ where this page comes from