Make `CipherCtx::cipher_update` more flexible
This change relaxes constraints on the output buffer size when it can be safely determined how many bytes will be put in the output buffer. For supported cryptographic backends (OpenSSL >= 1.1) the cipher's `num` parameter will be consulted for the number of bytes in the block cache. For unsupported backends the behavior will not change (the code will assume full block in the cache). For callers that do the check themselves and want to use other backends (e.g. BoringSSL or LibreSSL) and unsafe `cipher_update_unchecked` function is added. Additionally a `CipherCtx::minimal_output_size` function is added for letting the callers know how big should the output buffer be for the next `cipher_update` call. Fixes #1729. See: https://mta.openssl.org/pipermail/openssl-users/2022-November/015623.html
Loading
Please register or sign in to comment