summaryrefslogtreecommitdiff
path: root/doc/man3/EVP_EncryptInit.pod
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2018-09-14 21:49:34 +0200
committerMatt Caswell <matt@openssl.org>2019-05-08 10:57:59 +0100
commit67c81ec311d696464bdbf4c6d6f8a887a3ddf9f8 (patch)
tree3bfb831749c8819845932255059595dbb6a623a1 /doc/man3/EVP_EncryptInit.pod
parent36e619d70f86f9dd52c57b6ac8a3bfea3c0a2745 (diff)
downloadopenssl-new-67c81ec311d696464bdbf4c6d6f8a887a3ddf9f8.tar.gz
Allow specifying the tag after AAD in CCM mode
This change allows to pass the authentication tag after specifying the AAD in CCM mode. This is already true for the other two supported AEAD modes (GCM and OCB) and it seems appropriate to match the behavior. GCM and OCB also support to set the tag at any point before the call to `EVP_*Final`, but this won't work for CCM due to a restriction imposed by section 2.6 of RFC3610: The tag must be set before actually decrypting data. This commit also adds a test case for setting the tag after supplying plaintext length and AAD. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7243)
Diffstat (limited to 'doc/man3/EVP_EncryptInit.pod')
-rw-r--r--doc/man3/EVP_EncryptInit.pod4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/man3/EVP_EncryptInit.pod b/doc/man3/EVP_EncryptInit.pod
index 9cb863b44b..3c2e36bb89 100644
--- a/doc/man3/EVP_EncryptInit.pod
+++ b/doc/man3/EVP_EncryptInit.pod
@@ -412,7 +412,9 @@ The following I<ctrl>s are supported in CCM mode.
This call is made to set the expected B<CCM> tag value when decrypting or
the length of the tag (with the C<tag> parameter set to NULL) when encrypting.
The tag length is often referred to as B<M>. If not set a default value is
-used (12 for AES).
+used (12 for AES). When decrypting, the tag needs to be set before passing
+in data to be decrypted, but as in GCM and OCB mode, it can be set after
+passing additional authenticated data (see L<AEAD Interface>).
=item EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_CCM_SET_L, ivlen, NULL)