]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
message: Store original encrypted payload when generating fragments
authorTobias Brunner <tobias@strongswan.org>
Mon, 19 Jul 2021 15:12:09 +0000 (17:12 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 7 Aug 2024 14:20:18 +0000 (16:20 +0200)
If we don't do this, get_plain() will fail after generating the message
fragmented unless it was generated non-fragmented previously.

src/libcharon/encoding/message.c

index fcc36024be809fe0b6d0907c07860e3c8dac903b..5d05e2091c956fbdc7ef8afb052cd1fab8ce9fdf 100644 (file)
@@ -2257,7 +2257,7 @@ METHOD(message_t, fragment, status_t,
                data = generator->get_chunk(generator, NULL);
                if (!is_encoded(this))
                {
-                       encrypted->destroy(encrypted);
+                       this->payloads->insert_last(this->payloads, encrypted);
                }
                aead = keymat->get_aead(keymat, FALSE);
                /* overhead for the encrypted fragment payload */