summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ts
diff options
context:
space:
mode:
authortb <>2026-08-27 07:13:34 +0000
committertb <>2026-08-27 07:13:34 +0000
commit448d7a6a510aab5c772d736a43fb5dcec9dfbd73 (patch)
treef67eb62142f9922c5c57ea2a3c58dadbee783beb /src/lib/libcrypto/ts
parent85f442b9807a72de444e8a0c8670310031ffd5e8 (diff)
downloadopenbsd-448d7a6a510aab5c772d736a43fb5dcec9dfbd73.tar.gz
openbsd-448d7a6a510aab5c772d736a43fb5dcec9dfbd73.tar.bz2
openbsd-448d7a6a510aab5c772d736a43fb5dcec9dfbd73.zip
libcrypto: harden cms_kek_cipher() a bit
When AES key unwrap with padding is in use, the EVP interface breaks its contract and writes more than the outlen it initially reports to the output buffer. This is an old, sneaky trap that the muppet set eons ago and many victims walked right into it, including the muppet himself. If inlen is larger than outlen, allocate inlen bytes to unwrap with padding to avoid a buffer overwrite. This is a variant of OpenSSL's fix. Since we do not support AES keywrap with padding no actual bufer overwrite occurs here at the moment, but if we ever chose to do so (unlikely) this trap would be avoided. There's plenty more traps that the next round of scas will surely find in this absolute trashfire of CMS support code. ok kenjiro
Diffstat (limited to 'src/lib/libcrypto/ts')
0 files changed, 0 insertions, 0 deletions