]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
moved tls_t existance test into tls_eap_create() again
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 8 Sep 2010 09:09:11 +0000 (11:09 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 8 Sep 2010 09:09:11 +0000 (11:09 +0200)
src/libcharon/plugins/eap_tls/eap_tls.c
src/libcharon/plugins/eap_tnc/eap_tnc.c
src/libcharon/plugins/eap_ttls/eap_ttls.c
src/libtls/tls_eap.c

index 2980d74b201ed5e1281f9e56cd55452940edc41d..53b61c8476363af3a900a8867ab34946ed5029c1 100644 (file)
@@ -141,11 +141,6 @@ static eap_tls_t *eap_tls_create(identification_t *server,
        frag_size = lib->settings->get_int(lib->settings,
                                        "charon.plugins.eap-tls.fragment_size", MAX_FRAGMENT_LEN);
        tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_TLS, NULL);
-       if (!tls)
-       {
-               free(this);
-               return NULL;
-       }
        this->tls_eap = tls_eap_create(EAP_TLS, tls, frag_size);
        if (!this->tls_eap)
        {
index 432d5efbd3721dea68c7ce31a0731e1eaf046cd2..234b1444dd59ef69234d5ca3910180237a1452b6 100644 (file)
@@ -143,11 +143,6 @@ static eap_tnc_t *eap_tnc_create(identification_t *server,
        frag_size = lib->settings->get_int(lib->settings,
                                        "charon.plugins.eap-tnc.fragment_size", MAX_FRAGMENT_LEN);
        tnc_if_tnccs = tnc_if_tnccs_create(is_server, TLS_PURPOSE_EAP_TNC);
-       if (!tnc_if_tnccs)
-       {
-               free(this);
-               return NULL;
-       }
        this->tls_eap = tls_eap_create(EAP_TNC, tnc_if_tnccs, frag_size);
        if (!this->tls_eap)
        {
index 6b52acc56f20de07b06dea8114670fb8ab39f963..d9220a33caa1be4dc06058cf4a8fdbf912f6d9c6 100644 (file)
@@ -148,11 +148,6 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
        frag_size = lib->settings->get_int(lib->settings,
                                        "charon.plugins.eap-ttls.fragment_size", MAX_FRAGMENT_LEN);
        tls = tls_create(is_server, server, peer, TLS_PURPOSE_EAP_TTLS, application);
-       if (!tls)
-       {
-               free(this);
-               return NULL;
-       }
        this->tls_eap = tls_eap_create(EAP_TTLS, tls, frag_size);
        if (!this->tls_eap)
        {
index f74030bd4a9853a79071c94f8d4e4522339fa164..d923f212643210fab6ec6a1dcb795619e17fac5c 100644 (file)
@@ -325,6 +325,11 @@ tls_eap_t *tls_eap_create(eap_type_t type, tls_t *tls, size_t frag_size)
 {
        private_tls_eap_t *this;
 
+       if (!tls)
+       {
+               return NULL;
+       }
+
        INIT(this,
                .public = {
                        .initiate = _initiate,