-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyobject.asymmetricKeyType crashes on C++ assertion #26775
Comments
You are right... Maybe we shouldn't allow such keys to be created in the first place? There are some OIDs we should support and I intend to work on that soon (currently working on |
Or, as you said, we could allow to construct them as long as OpenSSL supports it and return |
they are, see: |
Not instantiating i don't think i can quite pull off myself, returning |
or throwing an error? |
Throwing an error on a getter of an existing KeyObject instance sounds rather awkward to me. |
I didn't read carefully enough, ignore that.
Is there any reason we shouldn't also add all the currently defined values in evp.h to the switch? |
@sam-github That sounds reasonable. (A couple of days ago, I desperately tried to get node to accept an |
A followup discussion to #26319
We're still crashing here on any unhandled key. e.g:
This makes the API rather unstable since end-users can force key material that will crash the process. Developers have no way to detect this other than parsing the key material before sending it to create(private|public)Key, kinda killing the KeyObject point.
The sane thing here would be return
"unsupported"
/"unknown"
or to not instantiate the KeyObject at all and throw in JS instead.Returning
unsupported
is enough for libraries using KeyObjects to check if they want to accept the key./cc @tniessen @sam-github @bnoordhuis what do you think?
The text was updated successfully, but these errors were encountered: