project-chip / rs-matter

Rust implementation of the Matter protocol. Status: Experimental
Apache License 2.0
310 stars 43 forks source link

Fix #109 #131

Closed ivmarkov closed 6 months ago

ivmarkov commented 6 months ago

As discussed, the Extensions struct requires a custom FromTLV as it needs to preserve the order of appearance of the extensions in the TLV, so as to serialize them in that same order in the "for-signing" DER.

As per the Matter spec: "The extensions SHALL appear in the same order in the Matter certificate and in the corresponding X.509 certificates".

The fix is essentially a replica of the approach we are already utilizing for DistNames, as these have identical requirements w.r.t. preserving the order of appearance.