]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
Skip the close notify if application layer completes successfully
authorMartin Willi <martin@revosec.ch>
Tue, 24 Aug 2010 08:29:54 +0000 (10:29 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 24 Aug 2010 08:30:24 +0000 (10:30 +0200)
src/libtls/tls_alert.c
src/libtls/tls_fragmentation.c

index 34f159e7700803d6f3cc3a9eda23801077c76356..8a4fa7d77e5dd656191c7a35f3e4c4f2a198fbe8 100644 (file)
@@ -138,8 +138,15 @@ METHOD(tls_alert_t, get, bool,
                this->consumed = TRUE;
                *level = TLS_FATAL;
                *desc = this->desc;
-               DBG1(DBG_TLS, "sending fatal TLS alert '%N'",
-                        tls_alert_desc_names, this->desc);
+               if (this->desc == TLS_CLOSE_NOTIFY)
+               {
+                       DBG1(DBG_TLS, "sending TLS close notify");
+               }
+               else
+               {
+                       DBG1(DBG_TLS, "sending fatal TLS alert '%N'",
+                                tls_alert_desc_names, this->desc);
+               }
                return TRUE;
        }
        else
index b941c97a5ea466728d48f79a6fe72d997d591db3..ea5c89769fe1f791b90f6b7410207bbfa78bb68c 100644 (file)
@@ -211,7 +211,7 @@ static status_t process_application(private_tls_fragmentation_t *this,
                                continue;
                        case SUCCESS:
                                this->application_finished = TRUE;
-                               /* FALL */
+                               return SUCCESS;
                        case FAILED:
                        default:
                                this->alert->add(this->alert, TLS_FATAL, TLS_CLOSE_NOTIFY);
@@ -340,7 +340,7 @@ METHOD(tls_fragmentation_t, build, status_t,
                                                        break;
                                                case SUCCESS:
                                                        this->application_finished = TRUE;
-                                                       /* FALL */
+                                                       return SUCCESS;
                                                case FAILED:
                                                default:
                                                        this->alert->add(this->alert, TLS_FATAL,