Fixes to allegedly make it work on more systems
authoraland <aland>
Sat, 15 Dec 2007 14:56:10 +0000 (14:56 +0000)
committeraland <aland>
Sat, 15 Dec 2007 14:56:10 +0000 (14:56 +0000)
src/modules/rlm_eap/libeap/eap_tls.c
src/modules/rlm_eap/libeap/tls.c

index 9591194..23e0ca3 100644 (file)
@@ -797,7 +797,7 @@ eaptls_status_t eaptls_process(EAP_HANDLER *handler)
         *
         *      The TLS data will be in the tls_session structure.
         */
-       if (SSL_is_init_finished(tls_session->ssl) && (status == EAPTLS_OK)) {
+       if (SSL_is_init_finished(tls_session->ssl)) {
                eaptls_free(&tlspacket);
                return EAPTLS_OK;
        }
index 1096c8c..3234e7c 100644 (file)
@@ -180,7 +180,11 @@ int tls_handshake_recv(tls_session_t *ssn)
                       sizeof(ssn->clean_out.data) - ssn->clean_out.used);
        if (err > 0) {
                ssn->clean_out.used += err;
-       } else if (!int_ssl_check(ssn->ssl, err, "SSL_read")) {
+               record_init(&ssn->dirty_in);
+               return 1;
+       }
+
+       if (!int_ssl_check(ssn->ssl, err, "SSL_read")) {
                return 0;
        }
 
@@ -218,7 +222,8 @@ int tls_handshake_recv(tls_session_t *ssn)
        }
 #endif
 
-       if (ssn->info.content_type != application_data) {
+       err = BIO_ctrl_pending(ssn->from_ssl);
+       if (err > 0) {
                err = BIO_read(ssn->from_ssl, ssn->dirty_out.data,
                               sizeof(ssn->dirty_out.data));
                if (err > 0) {