Fix a return value bug in apps/speed.c
authorPaul Yang <kaishen.yy@antfin.com>
Mon, 30 Sep 2019 03:33:24 +0000 (11:33 +0800)
committerPaul Yang <kaishen.yy@antfin.com>
Mon, 30 Sep 2019 05:40:19 +0000 (13:40 +0800)
Those functions returns less than and equal to 0 to indicate an error
occured.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10054)

(cherry picked from commit 94bd168a9e31d1ab4986e94056dfae71ec5f051f)

apps/speed.c

index 20149506cc746ee95d579c402cad1435ebc744e1..7f8ba7c0965108c0f53ab2ed7c47d78b0996455c 100644 (file)
@@ -3106,8 +3106,8 @@ int speed_main(int argc, char **argv)
 
             if ((ed_pctx = EVP_PKEY_CTX_new_id(test_ed_curves[testnum].nid, NULL))
                     == NULL
-                || !EVP_PKEY_keygen_init(ed_pctx)
-                || !EVP_PKEY_keygen(ed_pctx, &ed_pkey)) {
+                || EVP_PKEY_keygen_init(ed_pctx) <= 0
+                || EVP_PKEY_keygen(ed_pctx, &ed_pkey) <= 0) {
                 st = 0;
                 EVP_PKEY_CTX_free(ed_pctx);
                 break;