]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix Coverity #300461
authorDmitry Belyavskiy <beldmit@gmail.com>
Wed, 6 May 2020 15:12:10 +0000 (18:12 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Wed, 6 May 2020 15:12:10 +0000 (18:12 +0300)
benchmark/sign.c

index 765b9f05088b4908e87723ab6cf86b4ce8643eb6..5c53df79abb24e1ad9fa565d841269896385065f 100644 (file)
@@ -153,8 +153,8 @@ int main(int argc, char **argv)
                if (pass == 0) { /* sign */
                    for (i = 0; i < cycles; i++) {
                        EVP_SignInit(md_ctx, mdtype);
-                       EVP_SignUpdate(md_ctx, data, data_len);
-                       err = EVP_SignFinal(md_ctx, &sigbuf[siglen * i],
+                       err = EVP_SignUpdate(md_ctx, data, data_len)
+                          && EVP_SignFinal(md_ctx, &sigbuf[siglen * i],
                            (unsigned int *)&siglen, pkey);
                        if (err != 1)
                            printf("!");
@@ -163,8 +163,8 @@ int main(int argc, char **argv)
                } else { /* verify */
                    for (i = 0; i < cycles; i++) {
                        EVP_VerifyInit(md_ctx, mdtype);
-                       EVP_VerifyUpdate(md_ctx, data, data_len);
-                       err = EVP_VerifyFinal(md_ctx, &sigbuf[siglen * i],
+                       err = EVP_VerifyUpdate(md_ctx, data, data_len)
+                          && EVP_VerifyFinal(md_ctx, &sigbuf[siglen * i],
                            siglen, pkey);
                        EVP_MD_CTX_reset(md_ctx);
                        if (err != 1)