summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2021-12-26 15:34:26 +0000
committertb <>2021-12-26 15:34:26 +0000
commit227a7bb288cbe5916b1842111e0352f43e59565c (patch)
tree80fb189e0694686d5db72f8085ff61bcb7c733a9 /src
parent2b668ae5fd00e0dfbe2269cc59cd48b321520667 (diff)
downloadopenbsd-227a7bb288cbe5916b1842111e0352f43e59565c.tar.gz
openbsd-227a7bb288cbe5916b1842111e0352f43e59565c.tar.bz2
openbsd-227a7bb288cbe5916b1842111e0352f43e59565c.zip
Check error returns for HMAC_* to appease coverity.
CID 345114
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/speed.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index 2426e2351b..b5c8c742cc 100644
--- a/src/usr.bin/openssl/speed.c
+++ b/src/usr.bin/openssl/speed.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: speed.c,v 1.26 2021/12/26 15:31:24 tb Exp $ */ 1/* $OpenBSD: speed.c,v 1.27 2021/12/26 15:34:26 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1045,9 +1045,18 @@ speed_main(int argc, char **argv)
1045 print_message(names[D_HMAC], c[D_HMAC][j], lengths[j]); 1045 print_message(names[D_HMAC], c[D_HMAC][j], lengths[j]);
1046 Time_F(START); 1046 Time_F(START);
1047 for (count = 0, run = 1; COND(c[D_HMAC][j]); count++) { 1047 for (count = 0, run = 1; COND(c[D_HMAC][j]); count++) {
1048 HMAC_Init_ex(hctx, NULL, 0, NULL, NULL); 1048 if (!HMAC_Init_ex(hctx, NULL, 0, NULL, NULL)) {
1049 HMAC_Update(hctx, buf, lengths[j]); 1049 HMAC_CTX_free(hctx);
1050 HMAC_Final(hctx, &(hmac[0]), NULL); 1050 goto end;
1051 }
1052 if (!HMAC_Update(hctx, buf, lengths[j])) {
1053 HMAC_CTX_free(hctx);
1054 goto end;
1055 }
1056 if (!HMAC_Final(hctx, &(hmac[0]), NULL)) {
1057 HMAC_CTX_free(hctx);
1058 goto end;
1059 }
1051 } 1060 }
1052 d = Time_F(STOP); 1061 d = Time_F(STOP);
1053 print_result(D_HMAC, j, count, d); 1062 print_result(D_HMAC, j, count, d);