summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_ossl.c
diff options
context:
space:
mode:
authorjsing <>2022-02-19 15:59:12 +0000
committerjsing <>2022-02-19 15:59:12 +0000
commitecfbd0cd7a34e8b04af5f08a69bc02929f863d11 (patch)
tree0d7dce316bfd02d76d70207678ebbaff2d3d10b6 /src/lib/libcrypto/dsa/dsa_ossl.c
parentc65c3cdf53ef02b91dc926fc65376098c26a1ae0 (diff)
downloadopenbsd-ecfbd0cd7a34e8b04af5f08a69bc02929f863d11.tar.gz
openbsd-ecfbd0cd7a34e8b04af5f08a69bc02929f863d11.tar.bz2
openbsd-ecfbd0cd7a34e8b04af5f08a69bc02929f863d11.zip
Reduce memmoves in memory BIOs.
Currently, a read/write memory BIO pulls up the data via memmove() on each read. This becomes very expensive when a lot of small reads are performed, especially if there is a reasonable amount of data stored in the memory BIO. Instead, store a read offset into the buffer and only perform a memmove() to pull up the data on a write, if we have read more than 4096 bytes. This way we only perform memmove() when the space saving will potentially be of benefit, while avoiding frequent memmove() in the case of small interleaved reads and writes. Should address oss-fuzz #19881. ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_ossl.c')
0 files changed, 0 insertions, 0 deletions