summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/req.c
diff options
context:
space:
mode:
authorjsing <>2022-02-01 17:13:10 +0000
committerjsing <>2022-02-01 17:13:10 +0000
commit494d008fc41fd07dcc927e26c8c23d91c2f1564d (patch)
tree094581913aa4d49534ea38296879b81b985d64b5 /src/usr.bin/openssl/req.c
parenta24e6b334919c85f647d6b7188f92923394678bb (diff)
downloadopenbsd-494d008fc41fd07dcc927e26c8c23d91c2f1564d.tar.gz
openbsd-494d008fc41fd07dcc927e26c8c23d91c2f1564d.tar.bz2
openbsd-494d008fc41fd07dcc927e26c8c23d91c2f1564d.zip
Revise signer callback interface.
The current design of tls_sign_cb provides a pointer to a buffer where the signature needs to be copied, however it fails to provide a length which could result in buffer overwrites. Furthermore, tls_signer_sign() is designed such that it allocates and returns ownership to the caller. Revise tls_sign_cb so that the called function is expected to allocate a buffer, returning ownership of the buffer (along with its length) to the caller of the callback. This makes it far easier (and safer) to implement a tls_sign_cb callback, plus tls_signer_sign can be directly plugged in (with an appropriate cast). While here, rename and reorder some arguments - while we will normally sign a digest, there is no requirement for this to be the case hence use 'input' and 'input_len'. Move padding (an input) before the outputs and add some additional bounds/return value checks. This is technically an API/ABI break that would need a libtls major bump, however since nothing is using the signer interface (outside of regress), we'll ride the original minor bump. With input from tb@ ok inoguchi@ tb@
Diffstat (limited to 'src/usr.bin/openssl/req.c')
0 files changed, 0 insertions, 0 deletions