aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-12-16 16:12:24 -0500
committerRich Salz <rsalz@openssl.org>2015-12-16 16:14:49 -0500
commit7644a9aef8932ed4d1c3f25ed776c997702982be (patch)
treed8f1e7fca20ad12683a1e2e52c92b6999ada23a6 /test
parente4cf866322a4549c55153f9f135f9dadf4d3fc31 (diff)
downloadopenssl-7644a9aef8932ed4d1c3f25ed776c997702982be.tar.gz
Rename some BUF_xxx to OPENSSL_xxx
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'test')
-rw-r--r--test/dummytest.c2
-rw-r--r--test/enginetest.c4
-rw-r--r--test/evp_test.c14
-rw-r--r--test/exptest.c2
-rw-r--r--test/heartbeat_test.c2
-rw-r--r--test/ssltest.c2
6 files changed, 15 insertions, 11 deletions
diff --git a/test/dummytest.c b/test/dummytest.c
index 5569db09a8..25ce77b2df 100644
--- a/test/dummytest.c
+++ b/test/dummytest.c
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
q = p + strlen(p);
if (!p)
- program = BUF_strdup("(unknown)");
+ program = OPENSSL_strdup("(unknown)");
else {
program = OPENSSL_malloc((q - p) + 1);
strncpy(program, p, q - p);
diff --git a/test/enginetest.c b/test/enginetest.c
index 54e6eadccd..bbe40e64f5 100644
--- a/test/enginetest.c
+++ b/test/enginetest.c
@@ -205,9 +205,9 @@ int main(int argc, char *argv[])
printf("About to beef up the engine-type list\n");
for (loop = 0; loop < 512; loop++) {
sprintf(buf, "id%i", loop);
- id = BUF_strdup(buf);
+ id = OPENSSL_strdup(buf);
sprintf(buf, "Fake engine type %i", loop);
- name = BUF_strdup(buf);
+ name = OPENSSL_strdup(buf);
if (((block[loop] = ENGINE_new()) == NULL) ||
!ENGINE_set_id(block[loop], id) ||
!ENGINE_set_name(block[loop], name)) {
diff --git a/test/evp_test.c b/test/evp_test.c
index f24494bbc3..91caa4fc25 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -487,7 +487,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
key = OPENSSL_malloc(sizeof(*key));
if (!key)
return 0;
- key->name = BUF_strdup(value);
+ key->name = OPENSSL_strdup(value);
key->key = pk;
key->next = *lst;
*lst = key;
@@ -521,7 +521,7 @@ static int process_test(struct evp_test *t, char *buf, int verbose)
fprintf(stderr, "Line %d: multiple result lines\n", t->line);
return 0;
}
- t->expected_err = BUF_strdup(value);
+ t->expected_err = OPENSSL_strdup(value);
if (!t->expected_err)
return 0;
} else {
@@ -554,9 +554,9 @@ static int check_var_length_output(struct evp_test *t,
}
/* The result printing code expects a non-NULL buffer. */
- t->out_expected = BUF_memdup(expected, expected_len ? expected_len : 1);
+ t->out_expected = OPENSSL_memdup(expected, expected_len ? expected_len : 1);
t->out_expected_len = expected_len;
- t->out_received = BUF_memdup(received, received_len ? received_len : 1);
+ t->out_received = OPENSSL_memdup(received, received_len ? received_len : 1);
t->out_received_len = received_len;
if (t->out_expected == NULL || t->out_received == NULL) {
fprintf(stderr, "Memory allocation error!\n");
@@ -610,7 +610,9 @@ int main(int argc, char **argv)
CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL);
ERR_free_strings();
+#ifdef CRYPTO_MDEBUG
CRYPTO_mem_leaks_fp(stderr);
+#endif
if (t.errors)
return 1;
return 0;
@@ -1052,7 +1054,7 @@ static int mac_test_parse(struct evp_test *t,
if (strcmp(keyword, "Key") == 0)
return test_bin(value, &mdata->key, &mdata->key_len);
if (strcmp(keyword, "Algorithm") == 0) {
- mdata->alg = BUF_strdup(value);
+ mdata->alg = OPENSSL_strdup(value);
if (!mdata->alg)
return 0;
return 1;
@@ -1554,7 +1556,7 @@ static int encode_test_init(struct evp_test *t, const char *encoding)
edata->encoding = BASE64_VALID_ENCODING;
} else if (strcmp(encoding, "invalid") == 0) {
edata->encoding = BASE64_INVALID_ENCODING;
- t->expected_err = BUF_strdup("DECODE_ERROR");
+ t->expected_err = OPENSSL_strdup("DECODE_ERROR");
if (t->expected_err == NULL)
return 0;
} else {
diff --git a/test/exptest.c b/test/exptest.c
index 170de09c16..53286d8924 100644
--- a/test/exptest.c
+++ b/test/exptest.c
@@ -300,7 +300,9 @@ int main(int argc, char *argv[])
BN_free(m);
BN_CTX_free(ctx);
ERR_remove_thread_state(NULL);
+#ifdef CRYPTO_MDEBUG
CRYPTO_mem_leaks(out);
+#endif
BIO_free(out);
printf("\n");
diff --git a/test/heartbeat_test.c b/test/heartbeat_test.c
index 42cbc0217c..2fa82e3169 100644
--- a/test/heartbeat_test.c
+++ b/test/heartbeat_test.c
@@ -240,7 +240,7 @@ static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
result = 1;
} else {
char *actual_payload =
- BUF_strndup((const char *)p, actual_payload_len);
+ OPENSSL_strndup((const char *)p, actual_payload_len);
if (strcmp(actual_payload, fixture.expected_return_payload) != 0) {
printf
("%s failed:\n expected payload: \"%s\"\n received: \"%s\"\n",
diff --git a/test/ssltest.c b/test/ssltest.c
index 0912392649..fd356c7d47 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -253,7 +253,7 @@ typedef struct srp_client_arg_st {
static char *ssl_give_srp_client_pwd_cb(SSL *s, void *arg)
{
SRP_CLIENT_ARG *srp_client_arg = (SRP_CLIENT_ARG *)arg;
- return BUF_strdup((char *)srp_client_arg->srppassin);
+ return OPENSSL_strdup((char *)srp_client_arg->srppassin);
}
/* SRP server */