summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-12-02 00:49:35 +0100
committerRichard Levitte <levitte@openssl.org>2015-12-07 17:40:20 +0100
commitbfb0641f932490c2e7fb5f9f7cb4a88017a5abfa (patch)
tree6b6b0a9dfe55b4b3a2e5961ed1778dd156128f35 /test
parent959ed5316c84d0e12ad18acfd40cefe15603ddfb (diff)
Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test')
-rw-r--r--test/ecdsatest.c4
-rw-r--r--test/evp_extra_test.c12
-rw-r--r--test/evp_test.c8
-rw-r--r--test/gost2814789test.c4
-rw-r--r--test/mdc2test.c4
-rw-r--r--test/sha1test.c4
-rw-r--r--test/sha256t.c6
-rw-r--r--test/sha512t.c6
8 files changed, 24 insertions, 24 deletions
diff --git a/test/ecdsatest.c b/test/ecdsatest.c
index dcd9ba0a55..a55a553df8 100644
--- a/test/ecdsatest.c
+++ b/test/ecdsatest.c
@@ -188,7 +188,7 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)
const char message[] = "abc";
unsigned char digest[20];
unsigned int dgst_len = 0;
- EVP_MD_CTX *md_ctx = EVP_MD_CTX_create();
+ EVP_MD_CTX *md_ctx = EVP_MD_CTX_new();
EC_KEY *key = NULL;
ECDSA_SIG *signature = NULL;
BIGNUM *r = NULL, *s = NULL;
@@ -246,7 +246,7 @@ int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)
ECDSA_SIG_free(signature);
BN_free(r);
BN_free(s);
- EVP_MD_CTX_destroy(md_ctx);
+ EVP_MD_CTX_free(md_ctx);
BN_clear_free(kinv);
BN_clear_free(rp);
return ret;
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 50c9e918f2..a5363085f5 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -279,8 +279,8 @@ static int test_EVP_DigestSignInit(void)
size_t sig_len = 0;
EVP_MD_CTX *md_ctx, *md_ctx_verify;
- md_ctx = EVP_MD_CTX_create();
- md_ctx_verify = EVP_MD_CTX_create();
+ md_ctx = EVP_MD_CTX_new();
+ md_ctx_verify = EVP_MD_CTX_new();
if (md_ctx == NULL || md_ctx_verify == NULL)
goto out;
@@ -319,8 +319,8 @@ static int test_EVP_DigestSignInit(void)
ERR_print_errors_fp(stderr);
}
- EVP_MD_CTX_destroy(md_ctx);
- EVP_MD_CTX_destroy(md_ctx_verify);
+ EVP_MD_CTX_free(md_ctx);
+ EVP_MD_CTX_free(md_ctx_verify);
EVP_PKEY_free(pkey);
OPENSSL_free(sig);
@@ -333,7 +333,7 @@ static int test_EVP_DigestVerifyInit(void)
EVP_PKEY *pkey = NULL;
EVP_MD_CTX *md_ctx;
- md_ctx = EVP_MD_CTX_create();
+ md_ctx = EVP_MD_CTX_new();
pkey = load_example_rsa_key();
if (pkey == NULL ||
@@ -349,7 +349,7 @@ static int test_EVP_DigestVerifyInit(void)
ERR_print_errors_fp(stderr);
}
- EVP_MD_CTX_destroy(md_ctx);
+ EVP_MD_CTX_free(md_ctx);
EVP_PKEY_free(pkey);
return ret;
diff --git a/test/evp_test.c b/test/evp_test.c
index 92e153f2d3..725af8a53a 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -691,7 +691,7 @@ static int digest_test_run(struct evp_test *t)
EVP_MD_CTX *mctx;
unsigned char md[EVP_MAX_MD_SIZE];
unsigned int md_len;
- mctx = EVP_MD_CTX_create();
+ mctx = EVP_MD_CTX_new();
if (!mctx)
goto err;
err = "DIGESTINIT_ERROR";
@@ -713,7 +713,7 @@ static int digest_test_run(struct evp_test *t)
goto err;
err = NULL;
err:
- EVP_MD_CTX_destroy(mctx);
+ EVP_MD_CTX_free(mctx);
t->err = err;
return 1;
}
@@ -1100,7 +1100,7 @@ static int mac_test_run(struct evp_test *t)
if (!md)
goto err;
}
- mctx = EVP_MD_CTX_create();
+ mctx = EVP_MD_CTX_new();
if (!mctx)
goto err;
err = "DIGESTSIGNINIT_ERROR";
@@ -1128,7 +1128,7 @@ static int mac_test_run(struct evp_test *t)
goto err;
err = NULL;
err:
- EVP_MD_CTX_destroy(mctx);
+ EVP_MD_CTX_free(mctx);
OPENSSL_free(mac);
EVP_PKEY_CTX_free(genctx);
EVP_PKEY_free(key);
diff --git a/test/gost2814789test.c b/test/gost2814789test.c
index 486326cefe..2ab0782f80 100644
--- a/test/gost2814789test.c
+++ b/test/gost2814789test.c
@@ -1391,7 +1391,7 @@ int main(int argc, char *argv[])
*/
continue;
}
- mctx = EVP_MD_CTX_create();
+ mctx = EVP_MD_CTX_new();
if (mctx == NULL) {
fflush(NULL);
fprintf(stderr, "ENGINE_ctrl_cmd_string: malloc failure\n");
@@ -1417,7 +1417,7 @@ int main(int argc, char *argv[])
siglen = 4;
OPENSSL_assert(EVP_DigestSignFinal(mctx, bTest, &siglen));
EVP_PKEY_free(mac_key);
- EVP_MD_CTX_destroy(mctx);
+ EVP_MD_CTX_free(mctx);
enlu = (int)tcs[t].ullLen;
enlf = 0;
l = siglen;
diff --git a/test/mdc2test.c b/test/mdc2test.c
index 4cf952c3f5..938a3c13b7 100644
--- a/test/mdc2test.c
+++ b/test/mdc2test.c
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
ebcdic2ascii(text, text, strlen(text));
# endif
- c = EVP_MD_CTX_create();
+ c = EVP_MD_CTX_new();
EVP_DigestInit_ex(c, EVP_mdc2(), NULL);
EVP_DigestUpdate(c, (unsigned char *)text, strlen(text));
EVP_DigestFinal_ex(c, &(md[0]), NULL);
@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
} else
printf("pad2 - ok\n");
- EVP_MD_CTX_destroy(c);
+ EVP_MD_CTX_free(c);
# ifdef OPENSSL_SYS_NETWARE
if (ret)
printf("ERROR: %d\n", ret);
diff --git a/test/sha1test.c b/test/sha1test.c
index 6b8ad42141..676cc84839 100644
--- a/test/sha1test.c
+++ b/test/sha1test.c
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
ebcdic2ascii(test[1], test[1], strlen(test[1]));
#endif
- c = EVP_MD_CTX_create();
+ c = EVP_MD_CTX_new();
P = test;
R = ret;
i = 1;
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", err);
#endif
EXIT(err);
- EVP_MD_CTX_destroy(c);
+ EVP_MD_CTX_free(c);
return (0);
}
diff --git a/test/sha256t.c b/test/sha256t.c
index 25f762f82b..2ff9ed2a71 100644
--- a/test/sha256t.c
+++ b/test/sha256t.c
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
fprintf(stdout, ".");
fflush(stdout);
- evp = EVP_MD_CTX_create();
+ evp = EVP_MD_CTX_new();
if (evp == NULL) {
fflush(stdout);
fprintf(stderr, "\nTEST 3 of 3 failed. (malloc failure)\n");
@@ -133,14 +133,14 @@ int main(int argc, char **argv)
fprintf(stdout, ".");
fflush(stdout);
- EVP_MD_CTX_init(evp);
+ EVP_MD_CTX_reset(evp);
EVP_DigestInit_ex(evp, EVP_sha224(), NULL);
for (i = 0; i < 1000000; i += 64)
EVP_DigestUpdate(evp, "aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa"
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa",
(1000000 - i) < 64 ? 1000000 - i : 64);
EVP_DigestFinal_ex(evp, md, NULL);
- EVP_MD_CTX_destroy(evp);
+ EVP_MD_CTX_free(evp);
if (memcmp(md, addenum_3, sizeof(addenum_3))) {
fflush(stdout);
diff --git a/test/sha512t.c b/test/sha512t.c
index dff19aaa57..e1f30de2ce 100644
--- a/test/sha512t.c
+++ b/test/sha512t.c
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
fprintf(stdout, ".");
fflush(stdout);
- evp = EVP_MD_CTX_create();
+ evp = EVP_MD_CTX_new();
if (evp == NULL) {
fflush(stdout);
fprintf(stderr, "\nTEST 3 of 3 failed. (malloc failure)\n");
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa",
(1000000 - i) < 288 ? 1000000 - i : 288);
EVP_DigestFinal_ex(evp, md, NULL);
- EVP_MD_CTX_init(evp);
+ EVP_MD_CTX_reset(evp);
if (memcmp(md, app_c3, sizeof(app_c3))) {
fflush(stdout);
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
"aaaaaaaa" "aaaaaaaa" "aaaaaaaa" "aaaaaaaa",
(1000000 - i) < 64 ? 1000000 - i : 64);
EVP_DigestFinal_ex(evp, md, NULL);
- EVP_MD_CTX_destroy(evp);
+ EVP_MD_CTX_free(evp);
if (memcmp(md, app_d3, sizeof(app_d3))) {
fflush(stdout);