<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-11-15 17:47 GMT+01:00 Nico Williams <span dir="ltr"><<a href="mailto:nico@cryptonector.com" target="_blank">nico@cryptonector.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Wed, Nov 15, 2017 at 06:11:50PM +1000, James A. Donald wrote:<br>
> On 11/14/2017 12:30 PM, Nico Williams wrote:<br>
</span><span class="gmail-"></span></blockquote><div>[...] </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">
> I cannot find an open source tool that generates canonical per.<br>
<br>
</span>I don't recall whether PER produces canonical encodings.  I imagine it<br>
could, since it's very similar to XDR as I've explained -- there aren't<br>
a lot of choices to make, and if there are any, one could standardize a<br>
variant that leaves no choices (just as DER is such a variant of BER).<br></blockquote><div><br></div><div>PER has 2 possible (cumulative) variants: unaligned, and canonical.</div><div>There's not that much space left in PER for not being canonical. IIRC, SET ordering and padding are the only place where there's a difference.</div><div>I haven't found a *commercial* compiler that generates the canonical variant.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
It's true that there aren't many (any?) open source implementations of<br>
PER.  It's a chicken-egg situation: not much uses PER, so not many tools<br>
support PER.  We should fix this not by creating a replacement for PER<br>
but by creating the tools as we need them.<br></blockquote><div><br></div><div>asn1c (<a href="https://github.com/vlm/asn1c">https://github.com/vlm/asn1c</a>) supports PER. It also supports 2008 ASN.1 (while several compilers only support the 1988 dialect).</div><div>Unfortunately, the support of information object sets isn't complete, and I think it doesn't support parameterized types.</div><div>But apart from that, it does a good job.</div></div><div><br></div>-- <br><div class="gmail_signature">Erwann.</div>
</div></div>