diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2019-03-31 00:57:42 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2019-03-31 00:57:42 +0000 |
commit | a133d928c583672b8fd97506a31c8ba345fb64bc (patch) | |
tree | 4c39fd1dcfc53e96d04dcbb7a9f174c3ce45111e /sbin | |
parent | 30564186ed9614e1ab716a378a4f531ba5c2b282 (diff) |
we don't need to set openssl lock callbacks. this code is not threaded.
ok florian
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/unwind/resolver.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 62623cc58e1..74fdfefcc4c 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.29 2019/03/30 12:52:03 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.30 2019/03/31 00:57:41 tedu Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -30,7 +30,6 @@ #include <imsg.h> #include <limits.h> #include <pwd.h> -#include <pthread.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -133,11 +132,6 @@ void trust_anchor_timo(int, short, void *); void trust_anchor_resolve_done(void *, int, void *, int, int, char *, int); -/* for openssl */ -void init_locks(void); -unsigned long id_callback(void); -void lock_callback(int, int, const char *, int); - struct uw_conf *resolver_conf; struct imsgev *iev_frontend; struct imsgev *iev_captiveportal; @@ -155,9 +149,6 @@ static struct trust_anchor_head trust_anchors, new_trust_anchors; struct event_base *ev_base; -/* for openssl */ -pthread_mutex_t *locks; - enum uw_resolver_state global_state = DEAD; enum captive_portal_state captive_portal_state = PORTAL_UNCHECKED; @@ -235,10 +226,6 @@ resolver(int debug, int verbose) evtimer_set(&captive_portal_check_ev, check_captive_portal_timo, NULL); evtimer_set(&trust_anchor_timer, trust_anchor_timo, NULL); - init_locks(); - CRYPTO_set_id_callback(id_callback); - CRYPTO_set_locking_callback(lock_callback); - new_recursor(); SIMPLEQ_INIT(&dhcp_forwarder_list); @@ -1156,35 +1143,6 @@ schedule_recheck_all_resolvers(void) } } -/* for openssl */ -void -init_locks(void) -{ - int i; - - if ((locks = calloc(CRYPTO_num_locks(), sizeof(pthread_mutex_t))) == - NULL) - fatal("%s", __func__); - - for (i = 0; i < CRYPTO_num_locks(); i++) - pthread_mutex_init(&locks[i], NULL); - -} - -unsigned long -id_callback(void) { - return ((unsigned long)pthread_self()); -} - -void -lock_callback(int mode, int type, const char *file, int line) -{ - if (mode & CRYPTO_LOCK) - pthread_mutex_lock(&locks[type]); - else - pthread_mutex_unlock(&locks[type]); -} - int check_forwarders_changed(struct uw_forwarder_head *list_a, struct uw_forwarder_head *list_b) |