Closed andrewmah closed 5 months ago
Thank you for your issue! I don't have to contribute a fix at the moment, but I would be happy to review a PR fixing it. 🙂
The relevant code can be found below. https://github.com/librasn/rasn/blob/40539e024fc55ba13f89ed16940e74bb453331d4/src/ber/enc.rs#L550-L565
Rasn DER encodes the SET OF type based on lexicographical order of elements; however, I believe the correct order is lexicographical order of encoded elements. For example, the SET OF containing two UTF8 strings "c" and "ab" should be in the order "c" and then "ab" because the encoding "0x0c0163" comes before "0x0c026162"; however, rasn encodes "ab" then "c" because "ab" comes before "c". Reference: https://luca.ntop.org/Teaching/Appunti/asn1.html (section 5.15)
Code snippet to reproduce: