From: Dmitry Belyavskiy Date: Sun, 1 Dec 2019 08:53:14 +0000 (+0300) Subject: Difference between EVP_CipherInit and EVP_CipherInit_ex X-Git-Tag: openssl-3.0.0-alpha1~853 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=32745fccdb65c24049a09c93f7170b0236e9893b;ds=sidebyside Difference between EVP_CipherInit and EVP_CipherInit_ex Fixes #10455 Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/10550) --- diff --git a/doc/man3/EVP_EncryptInit.pod b/doc/man3/EVP_EncryptInit.pod index 1ca3e7478e..50a6cc8702 100644 --- a/doc/man3/EVP_EncryptInit.pod +++ b/doc/man3/EVP_EncryptInit.pod @@ -667,6 +667,15 @@ EVP_EncryptFinal_ex(), EVP_DecryptInit_ex(), EVP_DecryptFinal_ex(), EVP_CipherInit_ex() and EVP_CipherFinal_ex() because they can reuse an existing context without allocating and freeing it up on each call. +There are some differences between functions EVP_CipherInit() and +EVP_CipherInit_ex(), significant in some circumstances. EVP_CipherInit() fills +the passed context object with zeros. As a consequence, EVP_CipherInit() does +not allow step-by-step initialization of the ctx when the I and I are +passed in separate calls. It also means that the flags set for the CTX are +removed, and it is especially important for the +B flag treated specially in +EVP_CipherInit_ex(). + EVP_get_cipherbynid(), and EVP_get_cipherbyobj() are implemented as macros. =head1 BUGS