indutny / asn1.js

ASN.1 Decoder/Encoder/DSL
MIT License
181 stars 64 forks source link

Entries in a set-of are not being sorted #80

Open justmoon opened 7 years ago

justmoon commented 7 years ago

X.690 (08/2015), section 11 (Restrictions on BER employed by both CER and DER), subsection 11.6 (Set-of components) reads:

The encodings of the component values of a set-of value shall appear in ascending order, the encodings being compared as octet strings with the shorter components being padded at their trailing end with 0-octets.

NOTE – The padding octets are for comparison purposes only and do not appear in the encodings.

This library does not currently sort set-of components in canonical order when encoding DER.

indutny commented 7 years ago

Oh, that's right. Thank you!