diff options
Diffstat (limited to 'src/regress/lib/libssl/ssl')
| -rw-r--r-- | src/regress/lib/libssl/ssl/ssltest.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c index 7137d0c407..4460b1bc37 100644 --- a/src/regress/lib/libssl/ssl/ssltest.c +++ b/src/regress/lib/libssl/ssl/ssltest.c | |||
| @@ -403,60 +403,6 @@ print_details(SSL *c_ssl, const char *prefix) | |||
| 403 | BIO_printf(bio_stdout, "\n"); | 403 | BIO_printf(bio_stdout, "\n"); |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | static void | ||
| 407 | lock_dbg_cb(int mode, int type, const char *file, int line) | ||
| 408 | { | ||
| 409 | static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */ | ||
| 410 | const char *errstr = NULL; | ||
| 411 | int rw; | ||
| 412 | |||
| 413 | rw = mode & (CRYPTO_READ|CRYPTO_WRITE); | ||
| 414 | if (!((rw == CRYPTO_READ) || (rw == CRYPTO_WRITE))) { | ||
| 415 | errstr = "invalid mode"; | ||
| 416 | goto err; | ||
| 417 | } | ||
| 418 | |||
| 419 | if (type < 0 || type >= CRYPTO_NUM_LOCKS) { | ||
| 420 | errstr = "type out of bounds"; | ||
| 421 | goto err; | ||
| 422 | } | ||
| 423 | |||
| 424 | if (mode & CRYPTO_LOCK) { | ||
| 425 | if (modes[type]) { | ||
| 426 | errstr = "already locked"; | ||
| 427 | /* must not happen in a single-threaded program | ||
| 428 | * (would deadlock) */ | ||
| 429 | goto err; | ||
| 430 | } | ||
| 431 | |||
| 432 | modes[type] = rw; | ||
| 433 | } else if (mode & CRYPTO_UNLOCK) { | ||
| 434 | if (!modes[type]) { | ||
| 435 | errstr = "not locked"; | ||
| 436 | goto err; | ||
| 437 | } | ||
| 438 | |||
| 439 | if (modes[type] != rw) { | ||
| 440 | errstr = (rw == CRYPTO_READ) ? | ||
| 441 | "CRYPTO_r_unlock on write lock" : | ||
| 442 | "CRYPTO_w_unlock on read lock"; | ||
| 443 | } | ||
| 444 | |||
| 445 | modes[type] = 0; | ||
| 446 | } else { | ||
| 447 | errstr = "invalid mode"; | ||
| 448 | goto err; | ||
| 449 | } | ||
| 450 | |||
| 451 | err: | ||
| 452 | if (errstr) { | ||
| 453 | /* we cannot use bio_err here */ | ||
| 454 | fprintf(stderr, | ||
| 455 | "openssl (lock_dbg_cb): %s (mode=%d, type=%d) at %s:%d\n", | ||
| 456 | errstr, mode, type, file, line); | ||
| 457 | } | ||
| 458 | } | ||
| 459 | |||
| 460 | int | 406 | int |
| 461 | main(int argc, char *argv[]) | 407 | main(int argc, char *argv[]) |
| 462 | { | 408 | { |
| @@ -495,8 +441,6 @@ main(int argc, char *argv[]) | |||
| 495 | 441 | ||
| 496 | bio_err = BIO_new_fp(stderr, BIO_NOCLOSE|BIO_FP_TEXT); | 442 | bio_err = BIO_new_fp(stderr, BIO_NOCLOSE|BIO_FP_TEXT); |
| 497 | 443 | ||
| 498 | CRYPTO_set_locking_callback(lock_dbg_cb); | ||
| 499 | |||
| 500 | bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE|BIO_FP_TEXT); | 444 | bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE|BIO_FP_TEXT); |
| 501 | 445 | ||
| 502 | argc--; | 446 | argc--; |
