]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix sigsize usage in apps/speed.c
authorXiaofei Bai <xiaofei.bai@arm.com>
Wed, 3 Nov 2021 03:28:23 +0000 (03:28 +0000)
committerTomas Mraz <tomas@openssl.org>
Tue, 9 Nov 2021 15:11:58 +0000 (16:11 +0100)
commitc37ff82e7c3993292fcc0524e5dde429fa3b65eb
tree3819377a2f5a432ef4d22b530c5e58a15484a7a8
parent419afbf8a3adeffc598e32963bc041599b4007a8
Fix sigsize usage in apps/speed.c

In a recent upstream change
(43da9a14f0e73f42f28ae34219929b44df5d1a11)
the parameter sigsize become a read/write input in
EVP_PKEY_sign(), and after signing, sigsize will be overwritten with
the actual size and used in the verify step. As the speed program
calls EVP_PKEY_sign() on the same context repeatedly, sigsize value is
no longer the initial available size, and may fail in later buffer
size checks.

This fix adds a new buflen member in struct loopargs (which is only
used within apps/speed.c), to save available buffer size and
to be used as sigsize input in EVP_PKEY_sign() calls.
Sigsize still contains the signature size for the verify step.

Signed-off-by: Xiaofei Bai <xiaofei.bai@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16991)

(cherry picked from commit e7414634a59aa61c7917193a31382ced95d40eeb)
apps/speed.c