-
Notifications
You must be signed in to change notification settings - Fork 103
Description
I'm not entirely sure on this, but it seems to me that the use of EVP_EncryptUpdate in attic's AES.encrypt is missing a corresponding call to EVP_EncryptFinal. As far as I can tell, the documentation mandates such a call. However, its absence doesn't seem to cause any issues, which might be due to the nature of selected cipher. If that's actually the case, there should probably be a comment somewhere, at least to caution anyone intending to change the cipher at some point in the future.
And another thing I was wondering: the OpenSSL docs say that EVP_EncryptUpdate should be provided with an output buffer that is at least inl + cipher_block_size - 1 long, whereas attic only uses inl as the output buffer size. Again, this might be fine in conjunction with CTR mode, but I couldn't find any definitive statement on that (on OpenSSL's part) so I'm not sure if it's okay for attic to rely on this behavior.