]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Free cached VPs when SSL says that the session is freed
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 08:42:05 +0000 (10:42 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Oct 2011 08:42:05 +0000 (10:42 +0200)
src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c

index c1fb1488c35e8dc5ee98bd4d7eef399e7a7b8de3..19f3fe068292f8cde94f9781f0cafdd990916bcb 100644 (file)
@@ -194,9 +194,6 @@ static int generate_eph_rsa_key(SSL_CTX *ctx)
 
 
 /*
- *     These functions don't do anything other than print debugging
- *     messages.
- *
  *     FIXME: Write sessions to some long-term storage, so that
  *            session resumption can still occur after the server
  *            restarts.
@@ -206,6 +203,7 @@ static int generate_eph_rsa_key(SSL_CTX *ctx)
 static void cbtls_remove_session(UNUSED SSL_CTX *ctx, SSL_SESSION *sess)
 {
        size_t size;
+       VALUE_PAIR *vp;
        char buffer[2 * MAX_SESSION_SIZE + 1];
 
        size = sess->session_id_length;
@@ -213,6 +211,9 @@ static void cbtls_remove_session(UNUSED SSL_CTX *ctx, SSL_SESSION *sess)
 
        fr_bin2hex(sess->session_id, buffer, size);
 
+       vp = SSL_SESSION_get_ex_data(sess, eaptls_session_idx);
+       if (vp) pairfree(&vp);
+
         DEBUG2("  SSL: Removing session %s from the cache", buffer);
         SSL_SESSION_free(sess);