| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This causes OpenSSL to fail early if the decryption passphrase is too long, and produces a somewhat helpful error message. Refs: nodejs#25208
|
@tniessen build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/3104/pipeline |
Sorry, something went wrong.
|
This was @sam-github's idea in #25208 (comment), thanks Sam! :) |
Sorry, something went wrong.
|
I think this is technically semver-major? So cc @nodejs/tsc |
Sorry, something went wrong.
|
Oooo, tricky. Where does this fail without this fix and what does that failure look like? It's not from the createPrivateKey() call at the moment as far as I can tell. |
Sorry, something went wrong.
|
@rvagg It is indeed tricky! The failure without this patch is unpredictable. createPrivateKey might fail with the message bad decrypt if the PKCS#7 padding is invalid after decryption, this is the most likely behavior. However, if the PKCS#7 padding matches by chance, it can also result in an asn1 encoding error. And there is a tiny chance that both decryption and ASN.1 decoding succeed (either correctly or incorrectly, but without producing an error), and some other API call would randomly fail later when trying to use the key. Note that this should also be an extremely rare case, supplying such a long passphrase does not make sense since the entropy of the passphrase would far exceed the entropy of the derived decryption key. |
Sorry, something went wrong.
|
OK, so I'm going to go out on a limb and suggest that those failure modes mean we have bugs in our interface and therefore this should be semver-patch. Anyone else have an opinion? @tniessen what's your position? |
Sorry, something went wrong.
|
I'm usually leaning towards semver-patch too easily 😅 This does change the error message and code, but on the other hand, it also provides a stable solution instead of the current unpredictable behavior. Personally, I feel that this should land on all release lines where that is possible, simply to get rid of the unpredictability, but I am also fine with a TSC decision to treat this as semver-major.
From that perspective, this certainly is a bugfix, we should not have accepted passphrases that do not fit into the buffer in the first place. |
Sorry, something went wrong.
|
We've been more lax about semver-major's recently. In this case, someone would have to be relying on passing a passphrase that is too large, and it getting truncated... which is pretty obscure. I'd be OK with semver-patch, mostly because I don't want this to float until the fall for 13.x, continually causing backport conflict. |
Sorry, something went wrong.
|
I removed the semver-major label, feel free to chime in @nodejs/tsc. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Re-build of failing node-test-commit-linux (✔️) |
Sorry, something went wrong.
This causes OpenSSL to fail early if the decryption passphrase is too long, and produces a somewhat helpful error message. PR-URL: nodejs#27010 Refs: nodejs#25208 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
| Back | FazBrowse Home | New Git URL |
This causes OpenSSL to fail early if the decryption passphrase is too long, and produces a somewhat helpful error message. OpenSSL gives us a buffer of limited size (currently 1024 bytes), so there is no way to pass longer passphrases.
Refs: #25208
Checklist