mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 15:06:33 +01:00
d093e788d1
According to the [NodeJS CCM example](https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_ccm_mode], when decrypting the `plaintextLength` parameter actually refers to the ciphertext length, not the plaintext length: ``` decipher.setAAD(aad, { plaintextLength: ciphertext.length }); ``` The same can be seen in the [OpenSSL docs](https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption) where a call to `EVP_DecryptUpdate` passes the ciphertext length: ``` /* Provide the total ciphertext length */ if(1 != EVP_DecryptUpdate(ctx, NULL, &len, NULL, ciphertext_len)) handleErrors(); ``` This parameter probably should have been called `inputLength` or `bufferLength` instead of `plaintextLength`, so that it makes sense both when encrypting and decrypting, but at least we can correct the sentence in the documentation for now to refer to the correct value. PR-URL: https://github.com/nodejs/node/pull/33095 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> |
||
---|---|---|
.. | ||
addons.md | ||
assert.md | ||
async_hooks.md | ||
buffer.md | ||
child_process.md | ||
cli.md | ||
cluster.md | ||
console.md | ||
crypto.md | ||
debugger.md | ||
deprecations.md | ||
dgram.md | ||
dns.md | ||
documentation.md | ||
domain.md | ||
embedding.md | ||
errors.md | ||
esm.md | ||
events.md | ||
fs.md | ||
globals.md | ||
http2.md | ||
http.md | ||
https.md | ||
index.md | ||
inspector.md | ||
intl.md | ||
modules.md | ||
n-api.md | ||
net.md | ||
os.md | ||
path.md | ||
perf_hooks.md | ||
policy.md | ||
process.md | ||
punycode.md | ||
querystring.md | ||
readline.md | ||
repl.md | ||
report.md | ||
stream.md | ||
string_decoder.md | ||
synopsis.md | ||
timers.md | ||
tls.md | ||
tracing.md | ||
tty.md | ||
url.md | ||
util.md | ||
v8.md | ||
vm.md | ||
wasi.md | ||
worker_threads.md | ||
zlib.md |