Open PANCHO7532B opened 2 years ago
cc @nodejs/crypto - I can reproduce the segfaults with e.g. aes128-wrap1 so at the very least we should do something about those.
1 nullptr dereference in WritePrivateKey() -> PEM_write_bio_PKCS8PrivateKey() -> lots of openssl -> asn1_ex_i2c()
I am not sure if this is related: https://github.com/nodejs/help/issues/4211
I am starting to run out of combinations to try for a resolution. I did notice my OpenSSL error number is not listed in this thread among the many other OpenSSL error numbers: 03000096
Version
v20.0.0-nightly2022110286088ab78e
Platform
Linux EURO01 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
crypto
What steps will reproduce the bug?
(continuation of #40814) I made an snippet that tests RSA key pair generations on every cipher made by
crypto.getCiphers()
, an fix suggested by #42793 only applies for ECB ciphers, but most cipher variants are still unusable by the same error or variants of it or segfaultsHow often does it reproduce? Is there a required condition?
These are the broken ciphers:
Additionally, the following ciphers throw an Segmentation fault:
With the exception of
des3-wrap
who fails witherror:1C800066:Provider routines::cipher operation failed
before throwing the following as I try a few more times to encrypt:What is the expected behavior?
An successful encryption/decryption
What do you see instead?
An exception (it varies depending the algorithm used) For example, when using
aes-256-ccm
:For
aes-256-ctr
:For
aes-256-gcm
:For
id-smime-alg-CMS3DESwrap
:Additional information
On my opinion it's still kinda valid? Since this should work by all ciphers detailed by
getCiphers()
Sorry in advance if this might not be valid.