aboutsummaryrefslogtreecommitdiff
path: root/test/ssltest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-03-09 10:35:53 +0000
committerMatt Caswell <matt@openssl.org>2016-03-09 12:41:39 +0000
commit2e52e7df518d80188c865ea3f7bb3526d14b0c08 (patch)
tree880dbaa15521723b5c2cd35acbbf51ea9384e66c /test/ssltest.c
parent4fc4faa7a79c71223f326396b79af34d37da6615 (diff)
downloadopenssl-2e52e7df518d80188c865ea3f7bb3526d14b0c08.zip
openssl-2e52e7df518d80188c865ea3f7bb3526d14b0c08.tar.gz
openssl-2e52e7df518d80188c865ea3f7bb3526d14b0c08.tar.bz2
Remove the old threading API
All OpenSSL code has now been transferred to use the new threading API, so the old one is no longer used and can be removed. We provide some compat macros for removed functions which are all no-ops. There is now no longer a need to set locking callbacks!! Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/ssltest.c')
-rw-r--r--test/ssltest.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/test/ssltest.c b/test/ssltest.c
index 8d9b2c8..64bf071 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -970,60 +970,6 @@ static void print_details(SSL *c_ssl, const char *prefix)
BIO_printf(bio_stdout, "\n");
}
-static void lock_dbg_cb(int mode, int type, const char *file, int line)
-{
- static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */
- const char *errstr = NULL;
- int rw;
-
- rw = mode & (CRYPTO_READ | CRYPTO_WRITE);
- if (!((rw == CRYPTO_READ) || (rw == CRYPTO_WRITE))) {
- errstr = "invalid mode";
- goto err;
- }
-
- if (type < 0 || type >= CRYPTO_NUM_LOCKS) {
- errstr = "type out of bounds";
- goto err;
- }
-
- if (mode & CRYPTO_LOCK) {
- if (modes[type]) {
- errstr = "already locked";
- /*
- * must not happen in a single-threaded program (would deadlock)
- */
- goto err;
- }
-
- modes[type] = rw;
- } else if (mode & CRYPTO_UNLOCK) {
- if (!modes[type]) {
- errstr = "not locked";
- goto err;
- }
-
- if (modes[type] != rw) {
- errstr = (rw == CRYPTO_READ) ?
- "CRYPTO_r_unlock on write lock" :
- "CRYPTO_w_unlock on read lock";
- }
-
- modes[type] = 0;
- } else {
- errstr = "invalid mode";
- goto err;
- }
-
- err:
- if (errstr) {
- /* we cannot use bio_err here */
- fprintf(stderr,
- "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n",
- errstr, mode, type, file, line);
- }
-}
-
/*
* protocol_from_string - converts a protocol version string to a number
*
@@ -1129,8 +1075,6 @@ int main(int argc, char *argv[])
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
- CRYPTO_set_locking_callback(lock_dbg_cb);
-
p = getenv("OPENSSL_DEBUG_MEMORY");
if (p != NULL && strcmp(p, "on") == 0)
CRYPTO_set_mem_debug(1);