Re: Is EVP_CipherFinal required?
"'Matt Caswell' via openssl-users" <[email protected]> Fri, 29 May 2026 08:53:18 +0100
| Newsgroups | gmane.comp.encryption.openssl.user |
|---|---|
| Message-ID | <CAODx15ehuTS37bhengd_5T=_XUh5dNU3aRR+HuWxRam+qgqN4g@mail.gmail.com> |
On Fri, 29 May 2026 at 07:33, Stef Bon <[email protected]> wrote: > > Hi, > > I'm using openssl for a SSH client and server, using EVP_CIPHER_fetch, EVP_CIPHER_CTX, > and EVP_CipherInit to init, > and EVP_CipherUpdate to encrypt and decrypt. Now the data to de/encrypt with SSH is always a multiple of the blocksize (cause the SSH protocol takes care of the padding) so is the function EVP_CipherFinal required? There are no partial blocks... The effects of EVP_CipherFinal are dependent on a number of things including the cipher, any options and the data. For example if you're using a block cipher with padding enabled, there will always be a final "padding" block. If you're using an AEAD cipher then it's typically during the Final that the tag is created/verified. The effects of NOT calling Final are undocumented. So, basically, in some circumstances you might get away without calling it. But if you choose to do so, you better know what you are doing. The effects of getting it wrong could be catastrophic for security. Matt > > Stef > > -- > You received this message because you are subscribed to the Google Groups "openssl-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org > To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/17169225-a61f-4b2f-93ec-c62cc3666682n%40openssl.org. -- You received this message because you are subscribed to the Google Groups "openssl-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/CAODx15ehuTS37bhengd_5T%3D_XUh5dNU3aRR%2BHuWxRam%2BqgqN4g%40mail.gmail.com.