You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"body": "This didn't make the cut for the first experiment, but here's a very minor optimization we can do that might benefit some very constrained implementations.\n\nAlmost everyone just keeps their certificates as buffers in memory, but if your signature algorithm has a init/update/final API, and if you have a streaming X.509 parser you, in principle, today could avoid keeping the entire certificate around in memory. I think [BearSSL](https://bearssl.org/x509.html) might do this? (Not sure.)\n\nTBSCertificateLogEntry makes this impossible because the total SEQUENCE length prefix is not know until you've _at least_ gotten to the SubjectPublicKeyInfo, so you know how much shorter it is than the total TBSCertificate. Even if you did have the whole TBSCertificate available, you have to do some annoying math if you want to stream the data into your hash context, rather than making a new allocated copy.\n\nWe could fix both of these by saying `tbs_cert_entry_data` contains just the contents octets of the TBSCertificateLogEntry. That is, you omit the leading outermost tag and length. That allows you compute `entry_hash` in a single pass over the data:\n\n```\nh := hash.New()\nh.Update(tbs.version .. tbs.subject)\nh.Update({OCTET_STRING, hash.Size()}) // subjectPublicKeyInfoHash header\nh.Update(hash(tbs.subjectPublicKeyInfo))\nh.Update(tbs.issuerUniqueID .. tbs.extensions)\nentryHash := h.Final()\n```\n\nThe downside is that if you're implementing this with a bog-standard DER encoder, you have to add a tiny bit of extra code to parse back the tag and length prefix and skip a few bytes. But this is quite easy to do:\n\n```\nfunc SkipFirstHeader(b []byte) []byte {\n // We can assume the tag is SEQUENCE and thus one byte. The\n // length starts at the second byte.\n l := b[1]\n if l < 0x80 {\n return b[2:] // Single-byte length\n }\n return b[2+l&0x7f:] // First byte tells you length of length\n}\n```",
2737
+
"createdAt": "2025-12-02T16:20:24Z",
2738
+
"updatedAt": "2025-12-03T16:38:07Z",
2739
+
"closedAt": null,
2740
+
"comments": [
2741
+
{
2742
+
"author": "bwesterb",
2743
+
"authorAssociation": "COLLABORATOR",
2744
+
"body": "Good idea, but let's hold this change until we need to make another breaking change to the verification code / CA API.",
2745
+
"createdAt": "2025-12-03T11:06:48Z",
2746
+
"updatedAt": "2025-12-03T11:07:30Z"
2747
+
},
2748
+
{
2749
+
"author": "davidben",
2750
+
"authorAssociation": "OWNER",
2751
+
"body": "Oops, uploaded the PR before I saw your comment. Yeah, _definitely_ not proposing to change the current implementation target!",
2752
+
"createdAt": "2025-12-03T16:38:07Z",
2753
+
"updatedAt": "2025-12-03T16:38:07Z"
2754
+
}
2755
+
]
2725
2756
}
2726
2757
],
2727
2758
"pulls": [
@@ -10149,6 +10180,46 @@
10149
10180
]
10150
10181
}
10151
10182
]
10183
+
},
10184
+
{
10185
+
"number": 165,
10186
+
"id": "PR_kwDOJIBkVc6234x2",
10187
+
"title": "Omit the outermost SEQUENCE header in TBSCertificateLogEntry",
0 commit comments