Move all the existing function pointer casts associated with LHASH's two
[openssl.git] / ssl / ssl_sess.c
index 9e01f7275321326ac7e2e7e637beb88d901bec7b..9364612e40570de6a9a967219b91a9c318d7b4cd 100644 (file)
@@ -111,7 +111,7 @@ SSL_SESSION *SSL_SESSION_new(void)
        {
        SSL_SESSION *ss;
 
-       ss=(SSL_SESSION *)Malloc(sizeof(SSL_SESSION));
+       ss=(SSL_SESSION *)OPENSSL_malloc(sizeof(SSL_SESSION));
        if (ss == NULL)
                {
                SSLerr(SSL_F_SSL_SESSION_NEW,ERR_R_MALLOC_FAILURE);
@@ -310,7 +310,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
 #if 0 /* This is way too late. */
 
        /* If a thread got the session, then 'swaped', and another got
-        * it and then due to a time-out decided to 'Free' it we could
+        * it and then due to a time-out decided to 'OPENSSL_free' it we could
         * be in trouble.  So I'll increment it now, then double decrement
         * later - am I speaking rubbish?. */
        CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
@@ -474,7 +474,7 @@ void SSL_SESSION_free(SSL_SESSION *ss)
        if (ss->peer != NULL) X509_free(ss->peer);
        if (ss->ciphers != NULL) sk_SSL_CIPHER_free(ss->ciphers);
        memset(ss,0,sizeof(*ss));
-       Free(ss);
+       OPENSSL_free(ss);
        }
 
 int SSL_set_session(SSL *s, SSL_SESSION *session)
@@ -508,6 +508,7 @@ int SSL_set_session(SSL *s, SSL_SESSION *session)
                if (s->session != NULL)
                        SSL_SESSION_free(s->session);
                s->session=session;
+               s->verify_result = s->session->verify_result;
                /* CRYPTO_w_unlock(CRYPTO_LOCK_SSL);*/
                ret=1;
                }
@@ -593,6 +594,8 @@ static void timeout(SSL_SESSION *s, TIMEOUT_PARAM *p)
                }
        }
 
+static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION *, TIMEOUT_PARAM *)
+
 void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
        {
        unsigned long i;
@@ -605,7 +608,7 @@ void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
        CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
        i=tp.cache->down_load;
        tp.cache->down_load=0;
-       lh_doall_arg(tp.cache,(void (*)())timeout,&tp);
+       lh_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), &tp);
        tp.cache->down_load=i;
        CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);
        }