briansmith / webpki

WebPKI X.509 Certificate Validation in Rust
https://briansmith.org/rustdoc/webpki/
Other
464 stars 165 forks source link

Added an `unrecognized_extensions` hash to the Cert struct #259

Open dreemkiller opened 2 years ago

dreemkiller commented 2 years ago

This is a proposed solution to #258 .

When the feature std is enabled, adds an unrecognized_extensions member to the Cert struct in the form of a HashMap

Modifies the remember_extenstions function to place the data from any unrecognized extension into that HashMap, with the extension ID as the key.

Due to apparent limitations of rust, I was unable to find a way to use the existing oid macro for the match expressions. (hence the addition of [allow(unused_macros)] for the oid macro.

Suggestions on how this could be made cleaner are appreciated.

dreemkiller commented 2 years ago

I've found a way to make it cleaner in the second commit.