| Network Working Group | D. Crocker |
| Internet Draft | Brandenburg InternetWorking |
| Intended status: Informational | M. Kucherawy |
| Expires: January 12, 2012 | Cloudmark |
| July 11, 2011 |
DomainKeys Security Tagging (DOSETA)
draft-crocker-doseta-base-03
DomainKeys Security Tagging (DOSETA) is a component mechanism that enables easy development of security-related services, such as for authentication or encryption. It uses self-certifying keys based on domain names. The domain name owner can be any actor involved in the handling of the data, such as the author's organization, a server operator or one of their agents. The DOSETA Library provides a collection of common capabilities, including canonicalization, parameter tagging and key retrieval. The DOSETA Signing Template creates common framework for a signature of data that are in a "header/content" form. Defining the meaning of a signature is the responsibility of the service that incorporates DOSETA. Data security is enforced through the use of cryptographic algorithms.
This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress”.
The list of current Internet-Drafts can be accessed at <http://www.ietf.org/ietf/1id-abstracts.txt>.
The list of Internet-Draft Shadow Directories can be accessed at <http://www.ietf.org/shadow.html>.
This Internet-Draft will expire in January 12, 2012.
Copyright © 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the BSD License.
DomainKeys Security Tagging (DOSETA) is a component mechanism enabling development of security-related services, such as for authentication or encryption; it uses self-certifying keys based on domain names [RFC1034]. The domain name owner can be any actor involved in the handling of the data, such as the author's organization, a server operator or one of their agents. The DOSETA Library provides a collection of common capabilities, including canonicalization, parameter tagging and key retrieval. The DOSETA Signing Template creates common framework for signing data that are in a "header/content" form. Defining the intended meaning of a signature is the responsibility of the service that incorporates DOSETA. Data security is enforced through the use of cryptographic algorithms.
The approach taken by DOSETA differs from previous approaches to data signing -- such as, Secure/Multipurpose Internet Mail Extensions (S/MIME) [RFC1847], OpenPGP [RFC4880] -- in that:
DOSETA:
DOSETA derives from Domain Keys Identified Mail (DKIM) [RFC5672] and has extracted the core portions of the its signing specification [DKIMSign], so that they can be applied to other security-related services. For example, the core could support a DKIM-like signing service for web pages, and it could support a data ion mechanism using the same DNS-based, self-certified key service as DKIM.
DOSETA features include:
Possible applications:
http://www.trusteddomain.org/mailman/listinfo/doseta-discuss
This section provides the technical background for the remainder of the document.
As component technology, DOSETA is meant to be incorporated into a service. This specification provides an underlying set of common features and a template for using them to provide a signing service, such as for authenticating an identifier. Hence, the pieces can be depicted as follows, with DKIM being shown as a specific service that incorporates DOSETA:
+--------+ +----------+ +-----------------+
| DKIM | | MIMEAUTH | | Message Privacy |
+---+----+ +-----+----+ +--------+--------+
| | |
++=====V==================V========++ |
|| || |
|| Header/Content Signing Template || |
|| || |
++================+================++ |
| |
++=================V=================================V============++
|| ||
|| D O S E T A L I B R A R Y ||
|| +------------------+ +------------+ +-------------+ +--------+ ||
|| | | | Key | | Parameter | | Tags | ||
|| | Canonicalization | | Management | | Format | | Header | ||
|| | | | (DNS) | | (tag=value) | | Field | ||
|| +------------------+ +------------+ +-------------+ +--------+ ||
|| ||
++================================================================++
DKIM is as specified in [DKIMSign]. MIMEAUTH is an exemplar use of DOSETA, specified in [mimeauth]. Message Privacy is a generic term, indicating any service that provides encryption; it is expected that such a service can use the DOSETA core library, but not take advantage of the DOSETA signing template.
The library comprises:
Within the specification, the label "[TEMPLATE]" is used to indicate actions that are required for tailoring the use of DOSETA into a specific service.
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 [RFC2119].
Additional terms for this document are divided among Identity and Actors.
This section specifies foundational syntactic constructs used in the remainder of the document.
Syntax descriptions use Augmented BNF (ABNF) [RFC5234].
There are three forms of whitespace:
The formal syntax for these are (WSP and LWSP are given for information only):
ABNF:
WSP = SP / HTAB LWSP = *(WSP / CRLF WSP) FWS = [*WSP CRLF] 1*WSP
The definition of FWS is identical to that in [RFC5322] except for the exclusion of obs-FWS.
The following tokens are used in this document:
ABNF:
hyphenated-word = ALPHA
[ *(ALPHA / DIGIT / "-")
(ALPHA / DIGIT) ]
ALPHADIGITPS = (ALPHA / DIGIT / "+" / "/")
base64string = ALPHADIGITPS *([FWS] ALPHADIGITPS)
[ [FWS] "=" [ [FWS] "=" ] ]
hdr-name = field-name
qp-hdr-value = D-quoted-printable
; with "|" encoded The following tokens are imported from other RFCs as noted. Those RFCs SHOULD be considered definitive.
From [RFC5321]:
From [RFC5322]:
From [RFC2045]:
Other tokens not defined herein are imported from [RFC5234]. These are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF, etc.
The D-Quoted-Printable encoding syntax resembles that described in Quoted-Printable [RFC2045], Section 6.7:
The formal syntax for D-Quoted-Printable is:
ABNF:
D-quoted-printable = *(FWS / hex-octet / D-safe-char)
; hex-octet is from RFC2045
D-safe-char = %x21-3A / %x3C / %x3E-7E
; '!' - ':', '<', '>' - '~'
; Characters not listed as "mail-safe"
; in [RFC2049] are also not
; recommended. D-Quoted-Printable differs from Quoted-Printable as defined in [RFC2045] in several important ways:
DOSETA's library of functional components is distinguished by a DNS-based, self-certifying public key mechanism, common data normalization and canonicalization algorithms, and a common parameter encoding mechanism.
Some messages, particularly those using 8-bit characters, are subject to modification during transit, notably from conversion to 7-bit form. Such conversions will break DOSETA signatures. Similarly, data that is not compliant with its associated standard, might be subject to corrective efforts intermediaries. See Section 8 of [RFC4409] for examples of changes that are commonly made to email. Such "corrections" might break DOSETA signatures or have other undesirable effects.
In order to minimize the chances of such breakage, signers convert the data to a suitable encoding, such as quoted-printable or base64, as described in [RFC2045] before signing. Specification and use of such conversions is outside the scope of DOSETA.
If the data is submitted to a DOSETA process with any local encoding that will be modified before transmission, that modification to a canonical form MUST be done before DOSETA processing. For Text data in particular, bare CR or LF characters (used by some systems as a local line separator convention) MUST be converted to the CRLF sequences before the data is signed. Any conversion of this sort SHOULD be applied to the data actually sent to the recipient(s), not just to the version presented to the signing algorithm.
More generally, a DOSETA producer MUST use the data as it is expected to be received by the DOSETA consumer rather than in some local or internal form.
Some data handling systems modify the original data during transit, potentially invalidating a cryptographic function. In some cases, mild modification of data can be immaterial to the validity of a DOSETA-based service. In these cases, a canonicalization algorithm that survives modest handling modification is preferred.
In other cases, preservation of the exact, original bits is required; even minor modifications need to result in a failure. Hence a canonicalization algorithm is needed that does not tolerate any in-transit modification of the data.
To satisfy basic requirements, two canonicalization algorithms are defined: a "simple" algorithm that tolerates almost no modification and a "relaxed" algorithm that tolerates common modifications such as whitespace replacement and data line rewrapping.
Data presented for canonicalization MUST already be in "network normal" format -- text is ASCII encoded, lines are separated with CRLF characters, etc.) See Section 3.1 for information about normalizing data.
Data handling systems sometimes treat different portions of text differentially and might be subject to more or less likelihood of breaking a signature. DOSETA currently covers two types of data:
Some DOSETA producers might be willing to accept modifications to some portions of the data, but not other portions. For DOSETA, a producer MAY specify one algorithm for the header and another for the content.
If no canonicalization algorithm is specified, the "simple" algorithm defaults for each part. DOSETA producers MUST implement both of the base canonicalization algorithms. Because additional canonicalization algorithms might be defined in the future, producers MUST ignore any unrecognized canonicalization algorithms.
Canonicalization simply prepares the data for presentation to the DOSETA processing algorithm.
This section describes basic entries for the Header Canonicalization IANA registry defined in [DKIMSign], , which also applies to DOSETA header canonicalization.
This section describes basic entries for the Message Canonicalization IANA registry defined in [DKIMSign], which also applies to DOSETA Content.
uoq1oCgLlTqpdDX/iUbLy7J1Wic=The sha256 value is:
frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=
2jmj7l5rSw0yVb/vlWAYkK/YBwk=The sha256 value is:
47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
In the following examples, actual whitespace is used only for clarity. The actual input and output text is designated using bracketed descriptors: "<SP>" for a space character, "<HTAB>" for a tab character, and "<CRLF>" for a carriage-return/line-feed sequence. For example, "X <SP> Y" and "X<SP>Y" represent the same three characters.
Example 1: An email message reading:
A: <SP> X <CRLF>
B <SP> : <SP> Y <HTAB><CRLF>
<HTAB> Z <SP><SP><CRLF>
<CRLF>
<SP> C <SP><CRLF>
D <SP><HTAB><SP> E <CRLF>
<CRLF>
<CRLF>
when canonicalized using relaxed canonicalization for both Header and Content results in a Header reading:
a:X <CRLF> b:Y <SP> Z <CRLF>
and a Content reading:
<SP> C <CRLF> D <SP> E <CRLF>
Example 2: The same message canonicalized using simple canonicalization for both Header and Content results in a header reading:
A: <SP> X <CRLF>
B <SP> : <SP> Y <HTAB><CRLF>
<HTAB> Z <SP><SP><CRLF>
and a Content reading:
<SP> C <SP><CRLF> D <SP><HTAB><SP> E <CRLF>
Example 3: When processed using relaxed Header canonicalization and simple Content canonicalization, the canonicalized version has a header of:
a:X <CRLF> b:Y <SP> Z <CRLF>
and a Content reading:
<SP> C <SP><CRLF> D <SP><HTAB><SP> E <CRLF>
DOSETA uses a simple "tag=value" parameter syntax in several contexts, such as when representing associated cryptographic data and domain key records.
Values are a series of strings containing either plain text, "base64" text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid, Section 6.7), or "D-quoted-printable" (as defined in Section 2.6). The definition of a tag will determine the specific encoding for its associated value. Unencoded semicolon (";") characters MUST NOT occur in the tag value, since that separates tag-specs.
Formally the syntax rules are as follows:
ABNF:
tag-list = tag-spec 0*( ";" tag-spec ) [ ";" ]
tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS]
tag-name = ALPHA 0*ALNUMPUNC
tag-value = [ tval 0*( 1*(WSP / FWS) tval ) ]
; WSP and FWS prohibited at beginning and end
tval = 1*VALCHAR
VALCHAR = %x21-3A / %x3C-7E
; EXCLAMATION to TILDE except SEMICOLON
ALNUMPUNC = ALPHA / DIGIT / "_"
Tags MUST interpret a VALCHAR as case-sensitive, unless the specific tag description of semantics specifies case insensitivity.
Tags MUST be unique; duplicate names MUST NOT occur within a single tag-list. If a tag name does occur more than once, the entire tag-list is invalid.
Whitespace within a value MUST be retained unless explicitly excluded by the specific tag description.
Tag=value pairs that represent the default value MAY be included to aid legibility.
Unrecognized tags MUST be ignored.
Tags that have an empty value are not the same as omitted tags. An omitted tag is treated as having the default value; a tag with an empty value explicitly designates the empty string as the value.
Applications require some level of assurance that a producer is authorized to use a cited public. Many applications achieve this by using public key certificates issued by a trusted authority. For applications with modest certification requirements, DOSETA achieves a sufficient level of security, with excellent scaling properties, by simply having the consumer query the purported producer's DNS entry (or a supported equivalent) in order to retrieve the public key. The safety of this model is increased by the use of DNSSEC [RFC4033] for the key records in the DNS.
DOSETA keys might be stored in multiple types of key servers and in multiple formats. As long as the key-related information is the same and as long as the security properties of key storage and retrieval are the same, DOSETA's operation is unaffected by the actual source of a key.
The abstract key lookup algorithm is:
public-key = D-find-key(q-val, d-val, s-val)where:
This document defines a single binding between the abstract lookup algorithm and a physical instance, using DNS TXT records, per Section 3.6. Other bindings can be defined.
It can be extremely helpful to support multiple DOSETA keys for the same domain name. For example:
To these ends, DOSETA includes a mechanism that supports multiple concurrent public keys per signing domain. The key namespace is subdivided using "selectors". For example, selectors might indicate the names of office locations (for example, "sanfrancisco", "coolumbeach", and "reykjavik"), the signing date (for example, "january2005", "february2005", etc.), or even an individual user.
For further administrative convenience, sub-division of selectors is allowed, distinguished as dotted sub-components of the selector name. When keys are retrieved from the DNS, periods in selectors define DNS label boundaries in a manner similar to the conventional use in domain names. Selector components might be used to combine dates with locations, for example, "march2005.reykjavik". In a DNS implementation, this can be used to allow delegation of a portion of the selector namespace.
ABNF:
selector = sub-domain *( "." sub-domain )
The number of public keys and the corresponding selectors for each domain are determined by the domain owner. Many domain owners will be satisfied with just one selector, whereas administratively distributed organizations might choose to manage disparate selectors and key pairs in different regions or on different servers.
As noted, selectors make it possible to seamlessly replace public keys on a routine basis. If a domain wishes to change from using a public key associated with selector "january2005" to a public key associated with selector "february2005", it merely makes sure that both public keys are advertised in the public-key repository concurrently for the transition period during which data might be in transit prior to verification. At the start of the transition period, the outbound servers are configured to sign with the "february2005" private key. At the end of the transition period, the "january2005" public key is removed from the public-key repository.
While some domains might wish to make selector values well known, others will want to take care not to allocate selector names in a way that allows harvesting of data by outside parties. For example, if per-user keys are issued, the domain owner will need to make the decision as to whether to associate this selector directly with the name of a registered end-user, or make it some unassociated random value, such as a fingerprint of the public key.
This section defines a binding using DNS TXT records as a key service. All implementations MUST support this binding.
A DOSETA key is stored in a subdomain named:
ABNF:
dns-record = s "._domainkey." dwhere:
Given a DOSETA‑Signature field with a "d" parameter of "example.com" and an "s" parameter of "foo.bar", the DNS query will be for:
foo.bar._domainkey.example.com
Wildcard DNS records (for example, *.bar._domainkey.example.com) do not make sense in the context of DOSETA and their presence can be problematic. Hence DNS wildcards with DOSETA SHOULD NOT be used. Note also that wildcards within domains (for example, s._domainkey.*.example.com) are not supported by the DNS.
The DNS Resource Record type used is specified by an option to the query-type ("q") parameter. The only option defined in this base specification is "txt", indicating the use of a DNS TXT Resource Record (RR), as defined in Section 3.7. A later extension of this standard might define another RR type.
Strings in a TXT RR MUST be concatenated together before use, with no intervening whitespace. TXT RRs MUST be unique for a particular selector name; that is, if there are multiple records in an RRset, the results are undefined.
This section defines a syntax for encoding stored key data within an unstructured environment such as the simple text environment of a DNS TXT record.
The overall syntax is a tag-list as described in Section 3.3. The base set of valid tags is described below. Other tags MAY be present and MUST be ignored by any implementation that does not understand them.
ABNF:
key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type key-k-tag-type = "rsa" / x-key-k-tag-type x-key-k-tag-type = hyphenated-word ; for future extension
ABNF:
key-n-tag = %x6e [FWS] "=" [FWS] qp-section
ABNF:
key-p-tag = %x70 [FWS] "=" [ [FWS] base64string]
This section specifies the basic components of a signing mechanism; it is similar to the one defined for DKIM. This template for a signing service can be mapped to a two-part -- header/content -- data model. As for DKIM this separates specification of the signer's identity from any other identifiers that might be associated with that data.
DOSETA supports multiple digital signature algorithms:
Signers MUST implement and SHOULD sign using rsa-sha256. Verifiers MUST implement rsa-sha256.
Selecting appropriate key sizes is a trade-off between cost, performance, and risk. Since short RSA keys more easily succumb to off-line attacks, signers MUST use RSA keys of at least 1024 bits for long-lived keys. Verifiers MUST be able to validate signatures with keys ranging from 512 bits to 2048 bits, and they MAY be able to validate signatures with larger keys. Verifier policies might use the length of the signing key as one metric for determining whether a signature is acceptable.
Factors that ought to influence the key size choice include the following:
See [RFC3766] for further discussion on selecting key sizes.
A signature of data is stored into an data structure associated with the signed data. This structure contains all of the signature‑ and key‑fetching data. This DOSETA‑Signature structure is a tag-list as defined in Section 3.3.
When the DOSETA‑Signature structure is part of a sequence of structures -- such as being added to an email header -- it SHOULD NOT be reordered and SHOULD be pre-pended to the message. (This is the same handling as is given to email trace Header fields, defined in Section 3.6 of [RFC5322].)
The tags are specified below. Tags described as <qp-section> are encoded as described in Section 6.7 of MIME Part One [RFC2045], with the additional conversion of semicolon characters to "=3B"; intuitively, this is one line of quoted-printable encoded text. The D-quoted-printable syntax is defined in Section 2.3.4.
Tags on the DOSETA‑Signature structure along with their type and requirement status are shown below. Unrecognized tags MUST be ignored.
ABNF:
sig-v-tag = %x76 [FWS] "=" [FWS] "1"
ABNF:
sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg
sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h
sig-a-tag-k = "rsa" / x-sig-a-tag-k
sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h
x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT)
; for later extension
x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT)
; for later extension ABNF:
sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data sig-b-tag-data = base64string
ABNF:
sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data sig-bh-tag-data = base64string
ABNF:
sig-bh-tag = %x63 [FWS] "=" [FWS] sig-c-header "/" sig-c-contentwhere:
ABNF:
sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg
["/" sig-c-tag-alg]
sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg
x-sig-c-tag-alg = hyphenated-word ; for later extension ABNF:
sig-cl-tag = %x63 %x6C [FWS] "=" [FWS]
sig-cl-tag-claim
["/" sig-c-tag-claim]
sig-c-tag-claim = hyphenated-word
; per DOSETA Claims Registry ABNF:
sig-d-tag = %x64 [FWS] "=" [FWS] domain-name
domain-name = sub-domain 1*("." sub-domain)
; from RFC 5321 Domain,
; but excluding address-literal ABNF:
sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name
0*( [FWS] ":" [FWS] hdr-name ) ABNF:
sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method
*([FWS] ":" [FWS] sig-q-tag-method)
sig-q-tag-method = "dns/txt" / x-sig-q-tag-type
["/" x-sig-q-tag-args]
x-sig-q-tag-type = hyphenated-word ; for future extension
x-sig-q-tag-args = qp-hdr-value ABNF:
sig-s-tag = %x73 [FWS] "=" [FWS] selector
ABNF:
sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT
ABNF:
sig-x-tag = %x78 [FWS] "=" [FWS]
1*12DIGIT Some applications can benefit from additional, common functional enhancements. These are defined here, as options to the core mechanism.
key-id-tag = %x69 %64 [FWS] "=" [FWS] hyphenated-word
Hashing and cryptographic signature algorithms are combined into a procedure for computing a digital signature. Producers will choose appropriate parameters for the signing process. Consumers will use the tags that are then passed as an associated DOSETA‑Signature header field. Section 4.2. In the following discussion, the names of the tags are parameters in that field.
The basic operations for producing a signature are canonicalization, hashing and signing. Canonicalization removes irrelevant variations. Hashing produces a very short representation for the data and signing produces a unique, protected string to be exchanged.
Producers MUST compute hashes in the order defined. Consumers MAY compute them in any order convenient to the producer, provided that the result is semantically identical to the semantics that would occur, had they been computed in this order.
The combined hashing and signing algorithms are:
All tags cited in the "h" parameter MUST be included even if they are not understood by the verifier. Note that the DOSETA‑Signature field is presented to the hash algorithm after the content hash is processed, rather than with the rest of the header fields that are processed before the content hash. The DOSETA‑Signature header structure MUST NOT be cited in its own h= tag. If present, other DOSETA‑Signature header fields MAY be cited and included in the signature process (see Section 5).
When calculating the hash on data that will be transmitted using additional encoding, such as base64 or quoted-printable, signers MUST compute the hash after the encoding. Likewise, the verifier MUST incorporate the values into the hash before decoding the base64 or quoted-printable text. However, the hash MUST be computed before transport level encodings such as SMTP "dot-stuffing" (the modification of lines beginning with a "." to avoid confusion with the SMTP end-of-message marker, as specified in [RFC5321]).
With the exception of the canonicalization procedure described in Section 3.2, the DOSETA signing process treats the content as a simple string of octets. DOSETA content MAY be either simple lines of plain-text or as a MIME object; no special treatment is afforded to MIME content.
Formally, the algorithm for the signature is as follows:
ABNF:
content-hash = hash-alg (canon-content, l-param) data-hash = hash-alg (h-headers, D-SIG, content-hash) signature = sig-alg (d-domain, selector, data-hash)
where:
The following steps are performed in order by signers.
A signer can obviously only sign data using domains for which it has a private key and the necessary knowledge of the corresponding public key and selector information. However, there are a number of other reasons beyond the lack of a private key why a signer could choose not to sign the data.
If the data cannot be signed for some reason, the disposition of that data is a local policy decision.
This specification does not define the basis by which a signer ought to choose which private key and selector information to use. Currently, all selectors are equal, with respect to this specification. So the choices ought to largely be a matter of administrative convenience. Distribution and management of private keys is also outside the scope of this document.
Signers SHOULD NOT sign an existing header field that is likely to be legitimately modified or removed in transit. Signers MAY include any other Header fields present at the time of signing at the discretion of the signer.
The DOSETA‑Signature header field is always implicitly signed and MUST NOT be included in the "h" parameter except to indicate that other preexisting signatures are also signed.
Signers MAY claim to have signed Header fields that do not exist (that is, signers MAY include the header field name in the "h" parameter even if that header field does not exist in the message). When computing the signature, the non-existing header field MUST be treated as the null string (including the header field name, header field value, all punctuation, and the trailing CRLF).
Signers choosing to sign an existing header field that occurs more than once in the message (such as Received) MUST sign the physically last instance of that header field in the header block. Signers wishing to sign multiple instances of such a header field MUST include the header field name multiple times in the h= tag of the DOSETA‑Signature header field, and MUST sign such Header fields in order from the bottom of the header field block to the top. The signer MAY include more instances of a header field name in h= than there are actual corresponding Header fields to indicate that additional Header fields of that name SHOULD NOT be added.
Received: <A> Received: <B> Received: <c>
then the resulting DOSETA‑Signature header field ought to read:
DKIM-Signature: ... h=Received : Received :...and Received Header fields <C> and <B> will be signed in that order.
Signers need to be careful of signing Header fields that might have additional instances added later in the delivery process, since such Header fields might be inserted after the signed instance or otherwise reordered. Trace Header fields (such as Received) and Resent-* blocks are the only fields prohibited by [RFC5322] from being reordered. In particular, since DOSETA‑Signature Header fields might be reordered by some intermediate MTAs, signing existing DOSETA‑Signature Header fields is error-prone.
The signer MUST compute the message hash as described in Section 4.4 and then sign it using the selected public-key algorithm. This will result in a DOSETA‑Signature header field that will include the Content hash and a signature of the header hash, where that header includes the DOSETA‑Signature header field itself.
Entities such as mailing list managers that implement DOSETA and that modify the message or a header field (for example, inserting unsubscribe information) before retransmitting the message SHOULD check any existing signature on input and MUST make such modifications before re-signing the message.
The signer MAY elect to limit the number of bytes of the Content that will be included in the hash and hence signed. The length actually hashed SHOULD be inserted in the "l=" tag of the DOSETA‑Signature header field.
Finally, the signer MUST insert the DOSETA‑Signature header field created in the previous step prior to transmitting the data. The DOSETA‑Signature header field MUST be the same as used to compute the hash as described above, except that the value of the "b" parameter MUST be the appropriately signed hash computed in the previous step, signed using the algorithm specified in the "a" parameter of the DOSETA‑Signature header field and using the private key corresponding to the selector given in the "s=" tag of the DOSETA‑Signature header field, as chosen above in Section 4.5.2
The DOSETA‑Signature header field MUST be inserted before any other DOSETA‑Signature fields in the header block.
Since a signer MAY remove or revoke a public key at any time, it is recommended that verification occur in a timely manner. In many configurations, the most timely place is during acceptance by the border MTA or shortly thereafter. In particular, deferring verification until the message is accessed by the end user is discouraged.
A border or intermediate server MAY verify the data signature(s). An server that has performed verification MAY communicate the result of that verification by adding a verification header field to incoming data.
A verifying server MAY implement a policy with respect to unverifiable data, regardless of whether or not it applies the verification header field to signed messages.
Verifiers MUST produce a result that is semantically equivalent to applying the following steps in the order listed. In practice, several of these steps can be performed in parallel in order to improve performance.
The order in which verifiers try DOSETA‑Signature Header fields is not defined; verifiers MAY try signatures in any order they like. For example, one implementation might try the signatures in textual order, whereas another might try signatures by identities that match the contents of the From header field before trying other signatures. Verifiers MUST NOT attribute ultimate meaning to the order of multiple DOSETA‑Signature Header fields. In particular, there is reason to believe that some relays will reorder the Header fields in potentially arbitrary ways.
A verifier SHOULD NOT treat a message that has one or more bad signatures and no good signatures differently from a message with no signature at all; such treatment is a matter of local policy and is beyond the scope of this document.
When a signature successfully verifies, a verifier will either stop processing or attempt to verify any other signatures, at the discretion of the implementation. A verifier MAY limit the number of signatures it tries to avoid denial-of-service attacks.
In the following description, text reading "return status (explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL") means that the verifier MUST immediately cease processing that signature. The verifier SHOULD proceed to the next signature, if any is present, and completely ignore the bad signature. If the status is "PERMFAIL", the signature failed and SHOULD NOT be reconsidered. If the status is "TEMPFAIL", the signature could not be verified at this time but might be tried again later. A verifier MAY either defer the message for later processing, perhaps by queueing it locally or issuing a 451/4.7.5 SMTP reply, or try another signature; if no good signature is found and any of the signatures resulted in a TEMPFAIL status, the verifier MAY save the message for later processing. The "(explanation)" is not normative text; it is provided solely for clarification.
Verifiers SHOULD ignore any DOSETA‑Signature Header fields where the signature does not validate. Verifiers that are prepared to validate multiple signature Header fields SHOULD proceed to the next signature header field, if it exists. However, verifiers MAY make note of the fact that an invalid signature was present for consideration at a later step.
For each signature to be validated, the following steps need to be performed in such a manner as to produce a result that is semantically equivalent to performing them in the indicated order.
Implementers MUST meticulously validate the format and values in the DOSETA‑Signature header field; any inconsistency or unexpected values MUST cause the header field to be completely ignored and the verifier to return PERMFAIL (signature syntax error). Being "liberal in what you accept" is definitely a bad strategy in this security context. Note however that this does not include the existence of unknown tags in a DOSETA‑Signature header field, which are explicitly permitted.
If any tag listed as "required" in Section 4.2 is omitted from the DOSETA‑Signature header field, the verifier MUST ignore the DOSETA‑Signature header field and return PERMFAIL (signature missing required tag).
If the DOSETA‑Signature header field does not contain the "i" parameter, the verifier MUST behave as though the value of that tag were "@d", where "d" is the value from the "d=" tag.
Verifiers MUST confirm that the domain specified in the "d=" tag is the same as or a parent domain of the domain part of the "i" parameter. If not, the DOSETA‑Signature header field MUST be ignored and the verifier SHOULD return PERMFAIL (domain mismatch).
If the "h" parameter does not include the From header field, the verifier MUST ignore the DOSETA‑Signature header field and return PERMFAIL (From field not signed).
Verifiers MAY ignore the DOSETA‑Signature header field and return PERMFAIL (signature expired) if it contains an "x" parameter and the signature has expired.
Verifiers MAY ignore the DOSETA‑Signature header field if the domain used by the signer in the "d" parameter is not associated with a valid signing entity. For example, signatures with "d=" values such as "com" and "co.uk" might be ignored. The list of unacceptable domains SHOULD be configurable.
Verifiers MAY ignore the DOSETA‑Signature header field and return PERMFAIL (unacceptable signature header) for any other reason, for example, if the signature does not sign Header fields that the verifier views to be essential. As a case in point, if MIME Header fields are not signed, certain attacks might be possible that the verifier would prefer to avoid.
The public key for a signature is needed to complete the verification process. The process of retrieving the public key depends on the query type as defined by the "q" parameter in the DOSETA‑Signature header field. Obviously, a public key need only be retrieved if the process of extracting the signature information is completely successful. Details of key management and representation are described in Section 3.4. The verifier MUST validate the key record and MUST ignore any public key records that are malformed.
When validating a message, a verifier MUST perform the following steps in a manner that is semantically the same as performing them in the following order -- in some cases the implementation might parallelize or reorder these steps, as long as the semantics remain unchanged:
Given a signer and a public key, verifying a signature consists of actions semantically equivalent to the following steps.
Verifiers wishing to communicate the results of verification to other parts of the data handling system can do so in whatever manner they see fit. For example, implementations might choose to add a Header field to the data before passing it on. Any such header field SHOULD be inserted before any existing DOSETA‑Signature or preexisting verification status Header fields in the header field block. The Authentication-Results: header field ([RFC5451]) MAY be used for this purpose.
It is beyond the scope of this specification to describe what actions an Assessment phase will take, but data with a verified DOSETA signature presents an opportunity to an Assessor that unsigned data does not. Specifically, signed data creates a predictable identifier by which other decisions can reliably be managed, such as trust and reputation. Conversely, unsigned data typically lacks a reliable identifier that can be used to assign trust and reputation. It is usually reasonable to treat unsigned data as lacking any trust and having no positive reputation.
In general, verifiers SHOULD NOT reject data solely on the basis of a lack of signature or an unverifiable signature; such rejection would cause severe interoperability problems. However, if the verifier does opt to reject such data
Temporary failures such as inability to access the key server or other external service are the only conditions that SHOULD use a temporary failure code. In particular, cryptographic signature verification failures MUST NOT return temporary failure replies.
Once the signature has been verified, that information MUST be conveyed to the Assessor (such as an explicit allow/whitelist and reputation system) and/or to the end user. If the DDI is not the same as the address in the From: header field, the data system SHOULD take pains to ensure that the actual DDI is clear to the reader.
The verifier MAY treat unsigned Header fields with extreme skepticism, including marking them as untrusted or even deleting them.
While the symptoms of a failed verification are obvious -- the signature doesn't verify -- establishing the exact cause can be more difficult. If a selector cannot be found, is that because the selector has been removed, or was the value changed somehow in transit? If the signature line is missing, is that because it was never there, or was it removed by an overzealous filter? For diagnostic purposes, the exact nature of a verification failure SHOULD be made available to the policy module and possibly recorded in the system logs. If the data cannot be verified, then it SHOULD be rendered the same as all unverified data regardless of whether or not it looks like it was signed.
This generic template requires additional details, to define a specific service:
There are many reasons why a message might have multiple signatures. For example, a given signer might sign multiple times, perhaps with different hashing or signing algorithms during a transition phase.
Similarly, a signer might sign a message including all headers and no "l" parameter (to satisfy strict verifiers) and a second time with a limited set of headers and an "l" parameter (in anticipation of possible message modifications in route to other verifiers). Verifiers could then choose which signature they preferred.
Of course, a message might also have multiple signatures because it passed through multiple signers. A common case is expected to be that of a signed message that passes through a mailing list that also signs all messages. Assuming both of those signatures verify, a recipient might choose to accept the message if either of those signatures were known to come from trusted sources.
Another related example of multiple signers might be forwarding services, such as those commonly associated with academic alumni sites.
A signer that is adding a signature to a message merely creates a new DOSETA‑Signature header, using the usual semantics of the h= option. A signer MAY sign previously existing DOSETA‑Signature Header fields using the method described in Section 4.5.3 to sign trace Header fields.
A signer MAY add more than one DOSETA‑Signature header field using different parameters. For example, during a transition period a signer might want to produce signatures using two different hash algorithms.
Signers SHOULD NOT remove any DOSETA‑Signature Header fields from messages they are signing, even if they know that the signatures cannot be verified.
When evaluating a message with multiple signatures, a verifier SHOULD evaluate signatures independently and on their own merits. For example, a verifier that by policy chooses not to accept signatures with deprecated cryptographic algorithms would consider such signatures invalid. Verifiers MAY process signatures in any order of their choice; for example, some verifiers might choose to process signatures corresponding to the From field in the message header before other signatures. See Section 4.6.1 for more information about signature choices.
Verifiers SHOULD ignore failed signatures as though they were not present in the message. Verifiers SHOULD continue to check signatures until a signature successfully verifies to the satisfaction of the verifier. To limit potential denial-of-service attacks, verifiers MAY limit the total number of signatures they will attempt to verify.
A registry entry MUST contain:
The registry entries are contained in the IANA DOSETA Claims Registry, defined in Section 7.1.2
DOSETA relies on IANA registration data bases specified by DKIM [DKIMSign]. Services that incorporate DOSETA might need to define new registries or add to existing ones.
Per [RFC2434], IANA is requested to establish a DOSETA Claims Registry, for assertions (claims) that are meant by the presence of the DOSETA-based signature that contains the claims. See Section 6 for the definition of the columns in the registry table.
| LABEL | CLAIM DESCRIPTION |
|---|---|
| handled | The signer claims they have had a role in processing the object. (This claim is approximately equivalent to the semantics of DKIM.) |
| validauth | If there is a standardized field listing the purported author of the data, the signer claims that the value in that field is valid. |
| validdata | The signer claims that all of the data in the object valid. |
| validfields | The signer claims that the portions of the object that are covered by the signature hash are valid. |
Any mechanism that attempts to prevent or detect abuse is subject to intensive attack. DOSETA needs to be carefully scrutinized to identify potential attack vectors and the vulnerability to each. See also [RFC4686].
DOSETA core technology derives from DKIM [DKIMSign]. The Security Considerations of that specification applies equally to DOSETA.
The DOSETA "cl=" claims list provides a list of claimed meanings for a DOSETA signature. An opportunity for security problems comes from failing to distinguish between a signer "claim" and claim validity. Whether to trust claims made by a signer requires a level of assessment beyond DOSETA.
| [FIPS-180-2-2002] | U.S. Department of Commerce, , “Secure Hash Standard”, FIPS PUB 180-2, August 2002. |
| [ITU-X660-1997] | “Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)”, 1997. |
| [RFC1034] | Mockapetris, P., “DOMAIN NAMES - CONCEPTS AND FACILITIES”, RFC 1034, November 1987. |
| [RFC2045] | Freed, N. and N.S. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies”, RFC 2045, November 1996. |
| [RFC2049] | Freed, N. and N.S. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples”, RFC 2049, November 1996. |
| [RFC2119] | Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, March 1997. |
| [RFC2434] | Narten, T. and H. Alvestrand, “Guidelines for Writing an IANA Considerations Section in RFCs”, RFC 2434, October 1998. |
| [RFC3447] | Jonsson, J. and B. Kaliski, “Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1”, RFC 3447, February 2003. |
| [RFC5234] | Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF”, RFC 4234, January 2008. |
| [RFC5321] | Klensin, J., “Simple Mail Transfer Protocol”, RFC 5321, October 2008. |
| [RFC5322] | Resnick, P., “Internet Message Format”, RFC 5322, October 2008. |
| [RFC5890] | Klensin, J., “Internationalizing Domain Names in Applications (IDNA): Definitions and Document Framework”, RFC 5890, August 2010. |
The default signature is an RSA signed SHA256 digest of the complete email. For ease of explanation, the openssl command is used to describe the mechanism by which keys and signatures are managed. One way to generate a 1024-bit, unencrypted private key suitable for DOSETA is to use openssl like this:
$ openssl genrsa -out rsa.private 1024
For increased security, the "-passin" parameter can also be added to encrypt the private key. Use of this parameter will require entering a password for several of the following steps. Servers might prefer to use hardware cryptographic support.
The "genrsa" step results in the file rsa.private containing the key information similar to this:
-----BEGIN RSA PRIVATE KEY----- MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj 7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc= -----END RSA PRIVATE KEY-----
To extract the public-key component from the private key, use openssl like this:
$ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM
This results in the file rsa.public containing the key information similar to this:
-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI MmPSPDdQPNUYckcQ2QIDAQAB -----END PUBLIC KEY-----
This public-key data (without the BEGIN and END tags) is placed in the DNS:
brisbane IN TXT
("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ"
"KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt"
"IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v"
"/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi"
"tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB") DOSETA is derived from DKIM [DKIMSign]. DKIM is an evolution of DomainKeys [RFC4870], which was developed by Mark Delany, then of Yahoo!. In particular, the key management service, based on the DNS, and the user-INvisible tagging scheme was developed by him.
This example re-specifies DKIM in terms of DOSETA, while retaining bit-level compatibility with the existing DKIM specification [DKIMSign].
The DOSETA template specifies TEMPLATE information that is required to tailor the signing service:
This section contains specifications that are added to the basic DOSETA H/C Signing Template.
These are DKIM-specific tags:
ABNF:
sig-i-tag = %x69 [FWS] "=" [FWS]
[ local-part ] "@" domain-name ABNF:
sig-l-tag = %x6c [FWS] "=" [FWS]
1*76DIGIT ABNF:
sig-z-tag = %x7A [FWS] "=" [FWS]
sig-z-tag-copy
*( "|" [FWS] sig-z-tag-copy )
sig-z-tag-copy = hdr-name [FWS] ":"
qp-hdr-value
EXAMPLE of a signature header field spread across multiple continuation lines:
DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane; c=simple; q=dns/txt; i=@eng.example.net; t=1117574938; x=1118006938; h=from:to:subject:date; z=From:foo@eng.example.net|To:joe@example.com| Subject:demo=20run| Date:July=205,=202005=203:44:08=20PM=20-0700; bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR
A text length count MAY be specified to limit the signature calculation to an initial prefix of an ASCII text data portion, measured in octets. If the Content length count is not specified, the entire Content is signed.
This capability is provided because it is very common for intermediate data handling services to add trailers to text (for example, instructions how to get off a mailing list). Until such data is signed by the intermediate handler, the text length count can be a useful tool for the verifier since it can, as a matter of policy, accept messages having valid signatures that do not cover the additional data.
The text length count allows the signer of text to permit data to be appended to the end of the text of a signed message. The text length count MUST be calculated following the canonicalization algorithm; for example, any whitespace ignored by a canonicalization algorithm is not included as part of the Content length count. Signers of MIME messages that include a Content length count SHOULD be sure that the length extends to the closing MIME boundary string.
A text length count of zero means that the text is completely unsigned.
Creators wishing to ensure that no modification of any sort can occur will specify the "simple" canonicalization algorithm for all data portions and will and omit the text length counts.
A Content length specified in the "l=" tag of the signature limits the number of bytes of the Content passed to the verification algorithm. All data beyond that limit is not validated by DOSETA. Hence, verifiers might treat a message that contains bytes beyond the indicated Content length with suspicion, such as by truncating the message at the indicated Content length, declaring the signature invalid (for example, by returning PERMFAIL (unsigned content)), or conveying the partial verification to the policy module.
This section defines additions to the DOSETA Library, concerning stored key data.
ABNF:
key-g-tag = %x67 [FWS] "=" [FWS] key-g-tag-lpart
key-g-tag-lpart = [dot-atom-text]
["*" [dot-atom-text] ] ABNF:
key-h-tag = %x68 [FWS] "=" [FWS]
key-h-tag-alg
0*( [FWS] ":" [FWS]
key-h-tag-alg )
key-h-tag-alg = "sha1" / "sha256" /
x-key-h-tag-alg
x-key-h-tag-alg = hyphenated-word
; for future extension ABNF:
key-s-tag = %x73 [FWS] "=" [FWS]
key-s-tag-type
0*( [FWS] ":" [FWS]
key-s-tag-type )
key-s-tag-type = "email" / "*" /
x-key-s-tag-type
x-key-s-tag-type = hyphenated-word
; for future extension ABNF:
key-t-tag = %x74 [FWS] "=" [FWS]
key-t-tag-flag
0*( [FWS] ":" [FWS]
key-t-tag-flag )
key-t-tag-flag = "y" / "s" /
x-key-t-tag-flag
x-key-t-tag-flag = hyphenated-word
; for future extension