]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Send TLS close notify if application returns SUCCESS
authorMartin Willi <martin@revosec.ch>
Tue, 15 Jan 2013 16:36:11 +0000 (17:36 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 15 Jan 2013 16:43:05 +0000 (17:43 +0100)
src/libtls/tls_fragmentation.c

index c76376b432bb2c45dff9fc683359e3923a7dbdf7..6e4347e3cfefe95353d961c8cc9b75255877af62 100644 (file)
@@ -223,7 +223,7 @@ static status_t process_application(private_tls_fragmentation_t *this,
                                continue;
                        case SUCCESS:
                                this->application_finished = TRUE;
-                               return SUCCESS;
+                               /* FALL */
                        case FAILED:
                        default:
                                this->alert->add(this->alert, TLS_FATAL, TLS_CLOSE_NOTIFY);
@@ -368,7 +368,7 @@ static status_t build_application(private_tls_fragmentation_t *this)
                                break;
                        case SUCCESS:
                                this->application_finished = TRUE;
-                               break;
+                               /* FALL */
                        case FAILED:
                        default:
                                this->alert->add(this->alert, TLS_FATAL, TLS_CLOSE_NOTIFY);
@@ -391,6 +391,10 @@ METHOD(tls_fragmentation_t, build, status_t,
                        this->state = ALERT_SENT;
                        return INVALID_STATE;
                case ALERT_SENT:
+                       if (this->application_finished)
+                       {
+                               return SUCCESS;
+                       }
                        return FAILED;
                case ALERT_NONE:
                        break;