]> 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:20:58 +0000 (13:20 -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)

doc/man3/EVP_EncryptInit.pod

index b759f9020d936a6ee7d5416940f2dae0bf496579..f89fc9ae05068076efa01c404c14aa536f0d33c9 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