[Disclaimer: This is my first piece of Elixir code. Be gentle please.]
This PR includes:
Fix to use a fixed order when printing the aggregated subject/issuer string. Maps are unordered, so it was only by chance that the existing tests passed. When I started working on this code, the tests failed immediately until I realized what was going on. So, now the aggregated string is created using a fixed order of attributes. The order I picked was to match how your unit tests were written (assuming that was your desired order).
Fully backwards compatible: Add new support for attributes that appear more than once in the subject/issuer RDN sequences. This happens with Entrust certificates where their issuing cert contains two OU attributes. The previous behavior was to simply discard all but the last value. The new code doesn't change this default behavior, but introduces a multivalue: true option on the parser functions to correctly handle this situation. This requires changing the values of the subject/issuer maps to lists. See commit message for more details. I've added a new cert and several new tests as part of this change.
Small tweaks to the build, which may or may not be the right way to handle things. As I mentioned, this is my first foray into Elixir. I couldn't get the project to build without updating those two files.
Fix a previous refactoring error by someone perhaps? parse_pem had an option called return_base64, which was passed along to parse_der, which did not use that option. It looks like it was renamed to serialize in parse_der, so this fix just updates the name of the option in parse_pem.
[Disclaimer: This is my first piece of Elixir code. Be gentle please.]
This PR includes:
Fix to use a fixed order when printing the aggregated subject/issuer string. Maps are unordered, so it was only by chance that the existing tests passed. When I started working on this code, the tests failed immediately until I realized what was going on. So, now the aggregated string is created using a fixed order of attributes. The order I picked was to match how your unit tests were written (assuming that was your desired order).
Fully backwards compatible: Add new support for attributes that appear more than once in the subject/issuer RDN sequences. This happens with Entrust certificates where their issuing cert contains two OU attributes. The previous behavior was to simply discard all but the last value. The new code doesn't change this default behavior, but introduces a
multivalue: true
option on the parser functions to correctly handle this situation. This requires changing the values of the subject/issuer maps to lists. See commit message for more details. I've added a new cert and several new tests as part of this change.Small tweaks to the build, which may or may not be the right way to handle things. As I mentioned, this is my first foray into Elixir. I couldn't get the project to build without updating those two files.
Fix a previous refactoring error by someone perhaps?
parse_pem
had an option calledreturn_base64
, which was passed along toparse_der
, which did not use that option. It looks like it was renamed toserialize
inparse_der
, so this fix just updates the name of the option inparse_pem
.