[openssl] OpenSSL_1_1_1-stable update
Richard Levitte
levitte at openssl.org
Fri Aug 23 16:27:59 UTC 2019
The branch OpenSSL_1_1_1-stable has been updated
via 738da3d0b8c63994e77d22457f8479c23e08b361 (commit)
from 8be96f236969caabf303bec389a2f812b4869c1c (commit)
- Log -----------------------------------------------------------------
commit 738da3d0b8c63994e77d22457f8479c23e08b361
Author: Richard Levitte <levitte at openssl.org>
Date: Fri Aug 23 17:41:23 2019 +0200
test/evp_test.c: distinguish parsing errors from processing errors
Parsing functions are at liberty to return:
1: when parsing on processing of the parsed value succeeded
0: when the parsed keyword is unknown
-1: when the parsed value processing failed
Some parsing functions didn't do this quite right, they returned 0
when they should have returned -1, causing a message like this:
Line 123: unknown keyword PeerKey
When this message (which is displayed when the parsing function
returns -1) would have been more appropriate:
Line 123: error processing keyword PeerKey = ffdhe2048-2-pub
Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9682)
(cherry picked from commit f42c225d7f9a0bce0bf46103343402d3f0ad742f)
-----------------------------------------------------------------------
Summary of changes:
test/evp_test.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/evp_test.c b/test/evp_test.c
index 25bae20380..abb51384e8 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -554,7 +554,7 @@ static int cipher_test_parse(EVP_TEST *t, const char *keyword,
else if (strcmp(value, "FALSE") == 0)
cdat->tag_late = 0;
else
- return 0;
+ return -1;
return 1;
}
}
@@ -565,7 +565,7 @@ static int cipher_test_parse(EVP_TEST *t, const char *keyword,
else if (strcmp(value, "DECRYPT") == 0)
cdat->enc = 0;
else
- return 0;
+ return -1;
return 1;
}
return 0;
@@ -945,7 +945,7 @@ static int mac_test_parse(EVP_TEST *t,
if (strcmp(keyword, "Algorithm") == 0) {
mdata->alg = OPENSSL_strdup(value);
if (!mdata->alg)
- return 0;
+ return -1;
return 1;
}
if (strcmp(keyword, "Input") == 0)
@@ -1292,9 +1292,9 @@ static int pderive_test_parse(EVP_TEST *t,
if (strcmp(keyword, "PeerKey") == 0) {
EVP_PKEY *peer;
if (find_key(&peer, value, public_keys) == 0)
- return 0;
+ return -1;
if (EVP_PKEY_derive_set_peer(kdata->ctx, peer) <= 0)
- return 0;
+ return -1;
return 1;
}
if (strcmp(keyword, "SharedSecret") == 0)
@@ -2142,7 +2142,7 @@ static int digestsigver_test_parse(EVP_TEST *t,
}
if (strcmp(keyword, "Ctrl") == 0) {
if (mdata->pctx == NULL)
- return 0;
+ return -1;
return pkey_test_ctrl(t, mdata->pctx, value);
}
return 0;
More information about the openssl-commits
mailing list