diff options
author | tb <> | 2023-12-16 09:46:06 +0000 |
---|---|---|
committer | tb <> | 2023-12-16 09:46:06 +0000 |
commit | 6ca0c8883c60c6abbbfb61d72fa5a87fc7ff57bb (patch) | |
tree | f29a261e6fe9edf9f3347445e4d4320286e8d2d9 /src/lib/libc/stdlib/merge.c | |
parent | 4cf0a9d7b82d30cc1eb329cfe63c9b341b58ce76 (diff) | |
download | openbsd-6ca0c8883c60c6abbbfb61d72fa5a87fc7ff57bb.tar.gz openbsd-6ca0c8883c60c6abbbfb61d72fa5a87fc7ff57bb.tar.bz2 openbsd-6ca0c8883c60c6abbbfb61d72fa5a87fc7ff57bb.zip |
Implement and use a do_cipher() wrapper
Instead of using five different idioms for eight callers of the do_cipher()
method in EVP_{Decrypt,Encrypt}{Update,Final_ex}(), wrap the API insanity
in an evp_cipher() function that calls do_cipher() as appropriate depending
on the EVP_CIPH_FLAG_CUSTOM_CIPHER being set or not. This wrapper has the
usual OpenSSL calling conventions.
There is one complication in EVP_EncryptUpdate() in the case a previous
call wrote only a partial buffer. In that case, the evp_cipher() call is
made twice and the lengths have to be added. Add overflow checks and only
set outl (the number of bytes written) to out on success.
ok jsing
Diffstat (limited to 'src/lib/libc/stdlib/merge.c')
0 files changed, 0 insertions, 0 deletions