PKCS7_verify() unnecessarily creates temp indata BIO which ignores caller's indata BIO callbacks #16429
Labels
branch: master
Merge to master branch
good first issue
Bite size change that could be a good start
help wanted
triaged: refactor
The issue/pr requests/implements refactoring
Milestone
This PKCS7_verify() performance optimization from 2005 creates a new RO mem BIO from the caller's indata mem BIO, even if it's already a RO mem BIO in this code block:
openssl/crypto/pkcs7/pk7_smime.c
Lines 301 to 318 in 69b920b
I have a use case for a callback on a RO mem indata BIO passed to PKCS7_verify() and simply added a test for the indata BIO already being RO to the if statement to avoid the creation of the new tmpin BIO in OpenSSL 1.1.1j so that my callback remained in effect:
However, after taking a closer look, the performance issue with reading RW mem BIOs that existed at the time of this optimization no longer exists, so all the logic related to the tmpin RO mem BIO should be deleted and the caller's indata BIO used as-is.
The text was updated successfully, but these errors were encountered: