tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
609 stars 217 forks source link

fix: support unencrypted PKCS#8 keys again #503

Closed mastermatt closed 1 year ago

mastermatt commented 1 year ago

Allow node-rsa to detect the format of the private key by not explicitly specifying an alias for the pkcs1-private-pem format. Reference comment for details.

Fixes #452

@tngan

tngan commented 1 year ago

@mastermatt thanks for the PR.

Is the new function octetStringBuilder only used in testing? The create request function should already return the octet string (which is the query).

mastermatt commented 1 year ago

@tngan octetStringBuilder is part of another change set Im working on, but it doesn't make sense to include it for this PR as, you are correct, it was only being used in the tests. I've I just pushed a commit that removes it and uses the parseRedirectUrlContextCallBack test helper instead.

tngan commented 1 year ago

@mastermatt The change is valid, but I will make a remark in release where samlify only supports the key in PEM format.

Notice: For import, if keyData is PEM string or buffer containing string, you can do not specify format, but if you provide keyData as DER you must specify it in format string.

PEM is the most common format now where DER is just a binary version, we can bring the support easily later on. Thanks for your nice work again.

mastermatt commented 1 year ago

@tngan could you publish a patch version to npm with this change please?

tngan commented 1 year ago

Sure, please check v2.8.9