When applying for a log to be included in Chromium, the CT log policy requires that the log's public key be provided in DER form. However, in practice, most log operators have supplied their public key in PEM form.
The PEM form is both more common and easier to use.
OpenSSL, for example, assumes PEM form by default, and the PEM can easily be copied into a JSON log list.
Therefore, I propose updating the policy to formally allow, and indeed require, that public keys are provided in PEM form. I've created a PR for the ct-policy GitHub repo that makes this change: https://github.com/GoogleChrome/ct-policy/pull/10. Does anyone object?
OpenSSL, for example, assumes PEM form by default, and the PEM can easily be copied into a JSON log list.To be honest, I don't think this is a particularly compelling reason; that is, I'm not sure the inherent "OpenSSL does it" reason is good (after all, there's no need to integrate with OpenSSL here in this area), and the format of the JSON log list doesn't seem a good reason to drive policy, considering that the format is arbitrary.
Therefore, I propose updating the policy to formally allow, and indeed require, that public keys are provided in PEM form. I've created a PR for the ct-policy GitHub repo that makes this change: https://github.com/GoogleChrome/ct-policy/pull/10. Does anyone object?I do not find this a particularly compelling change, certainly not on the requirement side, and I think the example in #c3 shows where it can end up in a bad place.In some ways, it highlights logs that have carefully reviewed the inclusion requirements, and lots that haven't been. One could argue Brown M&Ms, but this is hardly the hill I want to make that stand on. I think it also highlights a problematic inconsistency in ingesting requests, and ensuring compliance with the necessary information.
The question, of course, is why pick a format at all - what are we trying to achieve? The goal is consistency, for sure, and to ensure there is an unambiguous representation. For example, the choice of "DER-encoded SubjectPublicKeyInfo ASN.1" was intentionally and explicitly chosen, because OpenSSL can represent RSA public keys multiple ways - as an RSAPublicKey (RFC 3447) or as a SubjectPublicKeyInfo (RFC 5280 & RFC 3279) - and similarly with EC keys (RFC 3279 & RFC 5480). With PEM encoding, you run into issues with the PEM block header and what the underlying format is chosen.This is why an explicitly specified encoding was requested - DER encoding (avoiding the PEM block header issues), SubjectPublicKeyInfo (avoiding the ambiguity as to the type and representation of the key).
To answer your perhaps rhetorical question of what we are trying to achieve, I don't believe it's just consistency, but also convenience.
--
You received this message because you are subscribed to the Google Groups "Certificate Transparency Policy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ct-policy+unsubscribe@chromium.org.
To post to this group, send email to ct-p...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/ct-policy/20170822113345.9796d72b984922fbce252bc0%40andrewayer.name.
On Tue, 22 Aug 2017 09:04:11 -0700 (PDT)
Rob Percival <robpe...@chromium.org> wrote:
> When applying for a log to be included in Chromium, the CT log policy
> <https://www.chromium.org/Home/chromium-security/certificate-transparency/log-policy>
> requires that the log's public key be provided in DER form. However,
> in practice, most log operators have supplied their public key in PEM
> form. The PEM form is both more common and easier to use. OpenSSL,
> for example, assumes PEM form by default, and the PEM can easily be
> copied into a JSON log list. Therefore, I propose updating the policy
> to formally allow, and indeed require, that public keys are provided
> in PEM form. I've created a PR for the ct-policy GitHub repo that
> makes this change: https://github.com/GoogleChrome/ct-policy/pull/10.
> Does anyone object?
I object:
1. RFC7468 doesn't require the PEM to be of the DER. Someone could
submit a PEM of non-DER BER, which would be rather unpleasant.
2. It's easier to copy DER into a base64-encoded JSON string field,
since you can just pipe the DER through `base64 -w 0`. PEM requires
parsing, conversion to DER, and then base64 encoding.
3. It's easier to compute the log ID from the DER, since you can just
hash it with SHA-256.
I find DER easier to work with. All of my monitoring tools currently
use DER (or base64-encoded DER in a JSON or XML document - which is
*not* the same as PEM).
Regards,
Andrew
I've found it easier to copy the PEM, as you just copy everything between the header and footer and strip the whitespace. On a Windows machine, where there is no `base64` command, it's much more convenient. You might say that the solution to that problem is to not use Windows though ;)
Ours generally use the base64-encoded DER as well. We've found it easy enough copying that straight out of the PEM file. However, the difference in effort is minimal (unless you're unfortunate enough to be using Windows at the time).