]> 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, 22 Mar 2023 10:35:10 +0000 (11:35 +0100)
If we don't do this, get_plain() will fail after generating the message
fragmented.

src/libcharon/encoding/message.c

index 18f99ac4dd491c479f7a72c8ef4e45a6adc17ddb..68823905ab7f4a3b89ee0f3bc7baf02dc0b317f8 100644 (file)
@@ -2255,7 +2255,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 */