-
Notifications
You must be signed in to change notification settings - Fork 30k
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
crypto.generateKeyPairSync
results in an abort in node v14.15.1
#44559
Comments
crypto.generateKeyPairSync
results in a abort in node v14.15.1crypto.generateKeyPairSync
results in an abort in node v14.15.1
➜ ~ node
Welcome to Node.js v14.20.0.
Type ".help" for more information.
> crypto.generateKeyPairSync('dsa', {modulusLength:1024, divisorLength:0})
node[86118]: ../src/node_crypto.cc:6347:void node::crypto::GenerateKeyPairJob::ToResult(Local<v8::Value> *, Local<v8::Value> *, Local<v8::Value> *): Assertion `!errors_.empty()' failed.
1: 0x101323535 node::Abort() (.cold.1) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
2: 0x1000b65f9 node::Abort() [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
3: 0x1000b6461 node::Assert(node::AssertionInfo const&) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
4: 0x1001c1cec node::crypto::GenerateKeyPairJob::ToResult(v8::Local<v8::Value>*, v8::Local<v8::Value>*, v8::Local<v8::Value>*) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
5: 0x1001c1ad6 node::crypto::GenerateKeyPair(v8::FunctionCallbackInfo<v8::Value> const&, unsigned int, std::__1::unique_ptr<node::crypto::KeyPairGenerationConfig, std::__1::default_delete<node::crypto::KeyPairGenerationConfig> >) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
6: 0x1001c23eb node::crypto::GenerateKeyPairDSA(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
7: 0x100272328 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
8: 0x1002718bc v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
9: 0x100271022 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
10: 0x100a8ebb9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
11: 0x100a25622 Builtins_InterpreterEntryTrampoline [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
12: 0x100a1f559 Builtins_ArgumentsAdaptorTrampoline [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
13: 0x100a25622 Builtins_InterpreterEntryTrampoline [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
14: 0x100a25622 Builtins_InterpreterEntryTrampoline [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
15: 0x100a2333a Builtins_JSEntryTrampoline [/Users/himself65/.nvm/versions/node/v14.20.0/bin/node]
[1] 86118 abort node |
This is an inconsistency in Commit dae283d seems to have fixed that by accident in v15.0.0 and beyond but that can't be back-ported to the v14.x branch. Can be handled by checking the divisor ourselves before passing it on to openssl. Pull request welcome. |
Closing as v14.x is EoL. |
Version
v14.15.1, v14.20.0
Platform
Linux zys-lab204l 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
crypto
What steps will reproduce the bug?
Setup a node instance,
$ node
and run the following javascript code.
How often does it reproduce? Is there a required condition?
Always. Require no condition.
What is the expected behavior?
If any error occurs, an exception or other similar error-reporting stuff should be thrown. There is no reason to abort the whole node process.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: