[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Andy Polyakov
appro at openssl.org
Mon Jul 2 08:49:17 UTC 2018
The branch OpenSSL_1_1_0-stable has been updated
via e35e5941e0b2f7af1cd56f07ee8d4eaf2b445132 (commit)
from a80f76aff4e0be3f5738cf9b292f940dc06a0e2a (commit)
- Log -----------------------------------------------------------------
commit e35e5941e0b2f7af1cd56f07ee8d4eaf2b445132
Author: Andy Polyakov <appro at openssl.org>
Date: Sat Jun 30 12:52:10 2018 +0200
test/evp_test.c: address sanitizer errors in pderive_test_run.
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6614)
-----------------------------------------------------------------------
Summary of changes:
test/evp_test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/evp_test.c b/test/evp_test.c
index fb2ca27..c2434db 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -1592,19 +1592,19 @@ static int pderive_test_run(struct evp_test *t)
struct pkey_data *kdata = t->data;
unsigned char *out = NULL;
size_t out_len;
- const char *err = "INTERNAL_ERROR";
+ const char *err = "DERIVE_ERROR";
- out_len = kdata->output_len;
+ if (EVP_PKEY_derive(kdata->ctx, NULL, &out_len) <= 0)
+ goto err;
out = OPENSSL_malloc(out_len);
if (!out) {
fprintf(stderr, "Error allocating output buffer!\n");
exit(1);
}
- err = "DERIVE_ERROR";
if (EVP_PKEY_derive(kdata->ctx, out, &out_len) <= 0)
goto err;
err = "SHARED_SECRET_LENGTH_MISMATCH";
- if (out_len != kdata->output_len)
+ if (kdata->output == NULL || out_len != kdata->output_len)
goto err;
err = "SHARED_SECRET_MISMATCH";
if (check_output(t, kdata->output, out, out_len))
More information about the openssl-commits
mailing list