@ -28,29 +28,37 @@ This document was authored by Jeremy Rand, with input from Ryan Castellucci and
Introduction
Introduction
------------
------------
This document extends the Domain Names specification, IFA-0001. It specifies an additional format of encoding the "tls" item type. This format is more suited for integrating "tls" item support into mainstream certificate trust stores, given the API limitations of those trust stores.
This document extends the Domain Names specification, IFA-0001. It specifies an additional format of encoding the `tls` item type. This format is more suited for integrating `tls` item support into mainstream certificate trust stores, given the API limitations of those trust stores.
Dehydrated "tls" Items
Extensible Alternate Encoding for `tls` Items
---------------------------------------------
IFA-0001 specifies that a TLS item is a JSON list. This specification redefines TLS items to instead be a JSON object, of the form `{encoding: data}`. *encoding* can be `"dane"`, in which case `data` is a JSON list in the form specified by IFA-0001. *encoding* can also be `"d8"`, in which case `data` is in the form specified below. If multiple *encoding* keys exist for a single TLS item (e.g. both `dane` and `d8` are available), then implementations MUST pick one of their choice. Implementations MAY assume that all *encoding* options for a TLS item are equivalent. If a TLS item that contains a JSON list instead of a JSON object is encountered, implementations MUST treat the list `list` as the JSON object `{"dane": list}`, which ensures backward-compatibility with IFA-0001.
Dehydrated `tls` Items
----------------------
----------------------
A dehydrated certificate in JSON format looks like:
A dehydrated certificate in JSON format looks like:
It is a JSON object of the form `{"d8":list}`, where `list` is a JSON list of 6 items.
1. a base64 string representing the public key. Typically an EC public key, not RSA, because EC is much more compact. The public key is not compressed, because compressed EC public keys are not widely supported by libraries (particularly the Golang standard library).
1. an integer representing a version number. Currently `1` is the only defined version. Dehydrated certificates with an unknown version MUST be ignored.
2. an integer representing the "not before" part of the validity period, in units of 5 minutes. 5 minutes essentially divides the number by 300, which eliminates slightly more than 1 byte.
2. a base64 string representing the public key. Typically an EC public key, not RSA, because EC is much more compact. The public key is not compressed, because compressed EC public keys are not widely supported by libraries (particularly the Golang standard library).
3. an integer representing the "not after" part of the validity period, in units of 5 minutes. 5 minutes essentially divides the number by 300, which eliminates slightly more than 1 byte.
3. an integer representing the "not before" part of the validity period, in units of 5 minutes. 5 minutes essentially divides the number by 300, which eliminates slightly more than 1 byte.
4. an integer representing the signature algorithm. Typically ECDSA with SHA256.
4. an integer representing the "not after" part of the validity period, in units of 5 minutes. 5 minutes essentially divides the number by 300, which eliminates slightly more than 1 byte.
5. a base64 string representing the signature. Typically ECDSA with SHA256.
5. an integer representing the signature algorithm. Typically ECDSA with SHA256.
6. a base64 string representing the signature. Typically ECDSA with SHA256.
These 5 items are chosen for 3 reasons:
`d8` is an abbreviation for how "dehydrate" is pronounced in English.
1. A valid certificate can be rehydrated from these 5 items (plus a domain name). This means that TLS applications that require possessing a full certificate (not just a public key hash) in order to set up an override can be configured without out-of-band retrieval of a certificate.
These 6 items are chosen for 3 reasons:
2. These items are much smaller than the rehydrated certificate would be, and therefore can comfortably fit into a datastore where storage is expensive (e.g. a Namecoin value).
1. A valid certificate can be rehydrated from these 6 items (plus a domain name). This means that TLS applications that require possessing a full certificate (not just a public key hash) in order to set up an override can be configured without out-of-band retrieval of a certificate.
2. These items are much smaller (they are circa 255 bytes of JSON) than the rehydrated certificate would be, and therefore can comfortably fit into a datastore where storage is expensive (e.g. a Namecoin value).
3. Rehydrated certificates are minimally trusted. For example, rehydrated certificates cannot be valid for other domain names or uses (via SAN, the CA flag, etc.) than the one which the user retrieving a TLSA record expects. As a result, these certificates can be added to a root CA trust store with minimal security implications.
3. Rehydrated certificates are minimally trusted. For example, rehydrated certificates cannot be valid for other domain names or uses (via SAN, the CA flag, etc.) than the one which the user retrieving a TLSA record expects. As a result, these certificates can be added to a root CA trust store with minimal security implications.
To rehydrate into a full certificate, construct a self-signed certificate with the following fields:
To rehydrate into a full certificate, construct a self-signed certificate with the following fields:
@ -63,7 +71,7 @@ To rehydrate into a full certificate, construct a self-signed certificate with t
* SerialNumber: first 19 bytes of SHA256(SHA256(the .bit domain in use) | SHA256(PublicKey) | SHA256(big-endian int64 of NotBefore in units of 5 minutes) | SHA256(big-endian int64 of NotAfter in units of 5 minutes))
* SerialNumber: first 19 bytes of SHA256(SHA256(the .bit domain in use) | SHA256(PublicKey) | SHA256(big-endian int64 of NotBefore in units of 5 minutes) | SHA256(big-endian int64 of NotAfter in units of 5 minutes))
@ -154,9 +161,7 @@ An IFA-0001-based JSON value which uses the above dehydrated certificate looks l
}
}
}
}
}
}
```
~~~
The "d8", 0, 0 before the certificate data is a magic indicator that this is a dehydrated certificate rather than a format based on RFC 6698 (DANE). "d8" is an abbreviation for how "dehydrate" is pronounced in English, and will not collide with future revisions to DANE because DANE uses an integer here while this spec uses a string. The latter 0 is intended as a version field. The former 0 is reserved, and is only present so that the number of elements in a "tls" record is constant regardless of whether it's dehydrated or DANE-based.
Design Goals
Design Goals
------------
------------
@ -171,9 +176,10 @@ There are no changes to item suppression or other processing rules.
Changes to Domain Name Owner Recommendations
Changes to Domain Name Owner Recommendations
--------------------------------------------
--------------------------------------------
Dehydrated "tls" items are more widely compatible with currently deployed TLS implementations, e.g. Google Chrome and Mozilla Firefox. However, because their encoding contains more data than a public key hash, dehydrated "tls" items will incur higher storage costs than the encoding specified in IFA-0001. Domain name owners are advised to consider the tradeoffs between compatibility and storage costs when choosing how to encode their "tls" items. It is our belief that, in most publicly deployed website configurations, the improved compatibility of dehydrated "tls" items makes their usage preferable, and that their increased storage costs are negligible in such configurations.
Dehydrated `tls` items are more widely compatible with currently deployed TLS implementations, e.g. Google Chrome and Mozilla Firefox. However, because their encoding contains more data than a public key hash, dehydrated `tls` items will incur higher storage costs than the encoding specified in IFA-0001. Domain name owners are advised to consider the tradeoffs between compatibility and storage costs when choosing how to encode their `tls` items. It is our belief that, in most publicly deployed website configurations, the improved compatibility of dehydrated `tls` items makes their usage preferable, and that their increased storage costs are negligible in such configurations.