mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
doc: improve CCM example
Applications should never attempt to use the deciphered message if authentication fails. In reality, this is usually not a problem since OpenSSL does not disclose the plaintext in this case, but it is still a design mistake and can lead to critical security problems in other cipher modes and implementations. PR-URL: https://github.com/nodejs/node/pull/27396 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
8c4bd2af4f
commit
153c101a12
@ -2885,6 +2885,7 @@ try {
|
||||
decipher.final();
|
||||
} catch (err) {
|
||||
console.error('Authentication failed!');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(receivedPlaintext);
|
||||
|
Loading…
Reference in New Issue
Block a user