]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Clarify in-place encryption behavior in documentation
authorerbsland-dev <github@erbsland.dev>
Mon, 15 Jul 2024 08:50:37 +0000 (10:50 +0200)
committerNeil Horman <nhorman@openssl.org>
Tue, 16 Jul 2024 17:43:26 +0000 (13:43 -0400)
Fixes #7941: Update the `EVP_EncryptUpdate` documentation to specify that in-place encryption is guaranteed only if the context does not contain incomplete data from previous operations.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24887)

(cherry picked from commit f692ceeedcd104407b7672c67d62d6f86f8ac182)

doc/man3/EVP_EncryptInit.pod

index fbcee9310a5f8106265c1cb564250b24a6c7dddd..ccb40c6aa3bf3c3e9814aec16d477a38b76eb5e9 100644 (file)
@@ -375,9 +375,13 @@ exists.
 
 Encrypts I<inl> bytes from the buffer I<in> and writes the encrypted version to
 I<out>. The pointers I<out> and I<in> may point to the same location, in which
-case the encryption will be done in-place. If I<out> and I<in> point to different
-locations, the two buffers must be disjoint, otherwise the operation might fail
-or the outcome might be undefined.
+case the encryption will be done in-place. However, in-place encryption is
+guaranteed to work only if the encryption context (I<ctx>) has processed data in
+multiples of the block size. If the context contains an incomplete data block
+from previous operations, in-place encryption will fail.
+
+If I<out> and I<in> point to different locations, the two buffers must be
+disjoint, otherwise the operation might fail or the outcome might be undefined.
 
 This function can be called multiple times to encrypt successive blocks
 of data. The amount of data written depends on the block alignment of the