From: Tobias Brunner Date: Tue, 25 Aug 2020 14:32:40 +0000 (+0200) Subject: libtls: Some code style fixes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba3c90ded16b122163ccc7baf85cf803d7c2c8a6;p=people%2Fms%2Fstrongswan.git libtls: Some code style fixes --- diff --git a/src/libtls/tls_fragmentation.c b/src/libtls/tls_fragmentation.c index f74cf59bf..483613fff 100644 --- a/src/libtls/tls_fragmentation.c +++ b/src/libtls/tls_fragmentation.c @@ -296,7 +296,7 @@ METHOD(tls_fragmentation_t, process, status_t, { break; } - /* fall */ + /* fall-through */ case TLS_APPLICATION_DATA: status = process_application(this, reader); break; diff --git a/src/libtls/tls_peer.c b/src/libtls/tls_peer.c index 471ba49f7..dea39fb16 100644 --- a/src/libtls/tls_peer.c +++ b/src/libtls/tls_peer.c @@ -1611,9 +1611,8 @@ METHOD(tls_handshake_t, finished, bool, { if (this->resume) { - return this->state == STATE_FINISHED_SENT; + return this->state == STATE_FINISHED_SENT; } - return this->state == STATE_FINISHED_RECEIVED; } else diff --git a/src/libtls/tls_protection.c b/src/libtls/tls_protection.c index d286e179a..3d0ec489b 100644 --- a/src/libtls/tls_protection.c +++ b/src/libtls/tls_protection.c @@ -73,7 +73,7 @@ METHOD(tls_protection_t, process, status_t, return NEED_MORE; } - if (this-> version < TLS_1_3 || + if (this->version < TLS_1_3 || type == TLS_APPLICATION_DATA) { if (this->aead_in) @@ -99,7 +99,7 @@ METHOD(tls_protection_t, build, status_t, status = this->compression->build(this->compression, type, data); if (status == NEED_MORE) { - if (this-> version < TLS_1_3 && *type == TLS_CHANGE_CIPHER_SPEC) + if (*type == TLS_CHANGE_CIPHER_SPEC && this->version < TLS_1_3) { return status; }