diff options
| author | Linus Nordberg <linus@nordu.net> | 2016-08-31 16:21:34 +0200 | 
|---|---|---|
| committer | Linus Nordberg <linus@nordu.net> | 2016-09-21 13:15:11 +0200 | 
| commit | 0a522fd74cf10a86749d85dde3086ee575a56efe (patch) | |
| tree | a4ca96c66ac889c1415d7e9320288982be5b4d0c | |
| parent | c206fc83904a441fa016bfe653fc20afd4cd6b8f (diff) | |
Remove openssl thread lock handling.
openssl-1.1 uses a new threading API which makes manual locking wrt
openssl not necessary.
| -rw-r--r-- | radsecproxy.c | 25 | 
1 files changed, 0 insertions, 25 deletions
| diff --git a/radsecproxy.c b/radsecproxy.c index c247d5c..e97feae 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -77,8 +77,6 @@ static struct list *clconfs, *srvconfs;  static struct list *realms;  static struct hash *rewriteconfs; -static pthread_mutex_t *ssl_locks = NULL; -static long *ssl_lock_count;  extern int optind;  extern char *optarg;  static const struct protodefs *protodefs[RAD_PROTOCOUNT]; @@ -104,19 +102,6 @@ uint8_t protoname2int(const char *name) {      return 255;  } -/* callbacks for making OpenSSL thread safe */ -unsigned long ssl_thread_id() { -    return (unsigned long)pthread_self(); -} - -void ssl_locking_callback(int mode, int type, const char *file, int line) { -    if (mode & CRYPTO_LOCK) { -	pthread_mutex_lock(&ssl_locks[type]); -	ssl_lock_count[type]++; -    } else -	pthread_mutex_unlock(&ssl_locks[type]); -} -  /* returns 1 if the len first bits are equal, else 0 */  int prefixmatch(void *a1, void *a2, uint8_t len) {      static uint8_t mask[] = { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; @@ -2044,19 +2029,9 @@ void createlisteners(uint8_t type) {  }  void sslinit() { -    int i;      time_t t;      pid_t pid; -    ssl_locks = calloc(CRYPTO_num_locks(), sizeof(pthread_mutex_t)); -    ssl_lock_count = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); -    for (i = 0; i < CRYPTO_num_locks(); i++) { -	ssl_lock_count[i] = 0; -	pthread_mutex_init(&ssl_locks[i], NULL); -    } -    CRYPTO_set_id_callback(ssl_thread_id); -    CRYPTO_set_locking_callback(ssl_locking_callback); -      SSL_load_error_strings();      SSL_library_init(); | 
