summaryrefslogtreecommitdiff
path: root/src/lib/libc
diff options
context:
space:
mode:
authortb <>2023-12-16 09:46:06 +0000
committertb <>2023-12-16 09:46:06 +0000
commita42182d76fe993c8a0476e932acf98d5f2a22fb0 (patch)
treef29a261e6fe9edf9f3347445e4d4320286e8d2d9 /src/lib/libc
parent8c5801801844360150fa92cca587ef463e336988 (diff)
downloadopenbsd-a42182d76fe993c8a0476e932acf98d5f2a22fb0.tar.gz
openbsd-a42182d76fe993c8a0476e932acf98d5f2a22fb0.tar.bz2
openbsd-a42182d76fe993c8a0476e932acf98d5f2a22fb0.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')
0 files changed, 0 insertions, 0 deletions