<html><head></head><body><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Probably could cut more if I put the DET (a specific IPv6 address)<span class="Apple-converted-space"> </span><br></div><div>somehow into subject rather than SAN flagged critical. <span class="Apple-converted-space"> </span></div></blockquote><div><br></div><div>Generally, <span style="font-size: 14.666667px;">removing X.509v3 extensions</span> helps save space, </div><div>yet replacing a SAN with an IPv6 address by a subject DN entry</div><div>simulating the value, e.g., in the CN would be counterproductive<br>because the binary representation in the SAN is more efficient.<br>Here is an example (ab-)using OpenSSL test credential material:</div><div><br></div><pre>openssl x509 -new -CA test/certs/server-ed25519-cert.pem \</pre><pre> -set_serial 2 -CAkey test/certs/server-ed25519-key.pem \</pre><pre> -force_pubkey test/certs/root-ed25519.pubkey.pem -subj / \</pre><pre> -extfile <(printf "subjectAltName = IP:2001:3F:FE3F:F805:A93E:53B7:2709:E0BA\n </pre><pre>                    subjectKeyIdentifier = none\n authorityKeyIdentifier = none") \</pre><pre> -days 365 -outform der | wc | awk '{ print $3 }'</pre><pre><span style="font-size: 14.666667px;">226</span></pre><pre><br></pre><pre>openssl x509 -new -CA test/certs/server-ed25519-cert.pem \</pre><pre> -set_serial 2 -CAkey test/certs/server-ed25519-key.pem \</pre><pre> -force_pubkey test/certs/root-ed25519.pubkey.pem \</pre><pre> -subj "/CN=20013FFE3FF805A93E53B72709E0BA" \</pre><pre> -extfile <(printf "subjectKeyIdentifier = none\n authorityKeyIdentifier = none") \</pre><pre> -days 365 -outform der | wc | awk '{ print $3 }'</pre><pre>238</pre><div><br></div><div><br></div><div>Unfortunately you cannot drop the rather inessential notBefore field,</div><div>and the coding restrictions in RFC 5280</div><div>disallow using a shortened (possibly even empty) string there.</div><div><br></div><div>If certificates could be transmitted/stored in efficiently compressed (zipped) from,<br>theoretically one could save a couple of bytes by choosing as values</div><div>of low-entropy fields such as notBefore, notAfter, subject, and issuer</div><div>not only strings as short as possible, but also with a high portion of repeated chars,</div><div>such as</div><div><br></div><pre>  Issuer: CN = 20010000000000efS</pre><pre>  Not Before: Nov 11 11:11:11 2023 GMT</pre><pre>  Not After : Nov 11 11:11:11 2025 GMT</pre><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">    </span>David</div><div><br></div><div><span></span></div><div><br></div><div>On Wed, 2023-05-31 at 14:19 -0400, Robert Moskowitz wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Well, I got the DER down to 240 bytes by dropping all the constraints.  <br></div><div>Probably could cut more if I put the DET (a specific IPv6 address) <br></div><div>somehow into subject rather than SAN flagged critical.  For your review, <br></div><div>this is what I have come up with.  This will replace what I currently <br></div><div>have in draft-moskowitz-drip-dki<br></div><div><br></div><div>Use of this cert will rely on the DNS structure we will be creating for <br></div><div>DRIP.  For example to find the issuing cert, the CN below maps to a <br></div><div>specific FQDN that any DRIP compliant implementation will know to find.  <br></div><div>And if this cert is not found in the matching ip6.arpa. fqdn it has been <br></div><div>revoked.  This cert is 2x the size of the DRIP specific RATS-styled <br></div><div>Endorsement.  Implementers will be able to choose their poison.<br></div><div><br></div><div>Certificate:<br></div><div>     Data:<br></div><div>         Version: 3 (0x2)<br></div><div>         Serial Number: 160 (0xa0)<br></div><div>         Signature Algorithm: ED25519<br></div><div>         Issuer: CN = 2001003ffe3ff805S<br></div><div>         Validity<br></div><div>             Not Before: May 21 00:00:00 2023 GMT<br></div><div>             Not After : May 24 00:00:00 2023 GMT<br></div><div>         Subject:<br></div><div>         Subject Public Key Info:<br></div><div>             Public Key Algorithm: ED25519<br></div><div>                 ED25519 Public-Key:<br></div><div>                 pub:<br></div><div>                     bf:04:53:a0:11:20:ed:8e:65:1a:e9:f6:95:1a:82:<br></div><div>                     78:3d:a8:20:29:6a:33:8e:ff:d5:4a:0b:a8:46:a9:<br></div><div>                     98:75<br></div><div>         X509v3 extensions:<br></div><div>             X509v3 Subject Alternative Name: critical<br></div><div>                 IP Address:2001:3F:FE3F:F805:A93E:53B7:2709:E0BA<br></div><div>     Signature Algorithm: ED25519<br></div><div>     Signature Value:<br></div><div>         d1:cd:bb:64:03:9e:95:1a:8c:fa:eb:59:a6:65:ff:bc:0f:39:<br></div><div>         e4:4f:ac:81:cf:c5:13:1e:62:e3:f1:bd:84:46:9c:5f:7c:52:<br></div><div>         ff:bd:3e:f8:e7:d4:9d:8d:38:fe:70:62:f9:9c:10:f1:aa:b0:<br></div><div>         46:c8:92:f9:9b:1a:09:d0:d6:0f<br></div><div><br></div><div><br></div><div><br></div><div>On 5/31/23 13:36, Richard Levitte wrote:<br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>The serial number is a defined field in the certificate structure.<br></div><div>It's not optional, so you can't get away from it.<br></div><div><br></div><div>In ASN.1 terms, it's an INTEGER.  In DER terms, the smallest possible<br></div><div>INTEGER occupies 3 bytes (one for the tag, which is 02, one for the<br></div><div>length 01, and one value byte in the decimal range -128..127 (80..7F)).<br></div><div><br></div><div>Without the serial number (just like without any other non-optional<br></div><div>field), whatever you happen to produce will not be a recognisable<br></div><div>X.509 certificate.<br></div><div><br></div><div>That's it.<br></div><div><br></div><div>Cheers,<br></div><div>Richard<br><br><br><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div><br></div><div>     Am 31. Mai 2023 15:41:02 MESZ schrieb Robert Moskowitz <<a href="mailto:rgm@htt-consult.com">rgm@htt-consult.com</a>>:<br></div><div>    <br></div><div>         I tried putting in my conf:<br></div><div>         <br></div><div>         serial = none<br></div><div>         <br></div><div>         and that made an error.<br></div><div>         <br></div><div>         Best I have done is a serial of length 1 byte.  But in my work, the subject or SAN provide uniqueness and CRLs will not be used.  So want to see if I can create a cert with NO serial number.<br></div><div>         <br></div><div>         Thanks<br></div><div><br></div></blockquote></blockquote><div><br></div></blockquote></body></html>