Skip to content

Commit c0cdf30

Browse files
tniessentargos
authored andcommitted
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: #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>
1 parent a5dab9e commit c0cdf30

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/api/crypto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,6 +2885,7 @@ try {
28852885
decipher.final();
28862886
} catch (err) {
28872887
console.error('Authentication failed!');
2888+
return;
28882889
}
28892890

28902891
console.log(receivedPlaintext);

0 commit comments

Comments
 (0)