apps/speed: fix possible OOB access in some EC arrays
authorFdaSilvaYY <fdasilvayy@gmail.com>
Sun, 29 Apr 2018 23:13:58 +0000 (01:13 +0200)
committerAndy Polyakov <appro@openssl.org>
Fri, 18 May 2018 10:00:37 +0000 (12:00 +0200)
commit4e07941373ac17086ab4e601950c4ca148e8bb31
treedc6f5a662a6b9ab8491e3ccae00cb475e86fe4e3
parent4652a14b787faf192370ef821564e3f5c7afda92
apps/speed: fix possible OOB access in some EC arrays

because there are actually 17 curves defined, but only 16 are plugged for
ecdsa test.
Deduce array size using OSSL_NELEM and so remove various magic numbers,
which required some declarations moving.
Implement OPT_PAIR list search without a null-ending element.
Fix some comparison between signed and unsigned integer expressions.

cherry-picking from commit 5c6a69f539.

Partial Back-port of #6133 to 1.1.0

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6245)
apps/speed.c