proposal: Compress arrays after removing transforms
authorTobias Brunner <tobias@strongswan.org>
Thu, 8 Mar 2018 17:22:55 +0000 (18:22 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 21 Mar 2018 09:15:18 +0000 (10:15 +0100)
src/libstrongswan/crypto/proposal/proposal.c

index c18915f..39630a1 100644 (file)
@@ -325,10 +325,12 @@ METHOD(proposal_t, strip_dh, void,
                }
        }
        enumerator->destroy(enumerator);
+       array_compress(this->transforms);
 
        if (keep == MODP_NONE || !found)
        {
                remove_type(this, DIFFIE_HELLMAN_GROUP);
+               array_compress(this->types);
        }
 }
 
@@ -761,6 +763,7 @@ static bool check_proposal(private_proposal_t *this)
        }
 
        array_compress(this->transforms);
+       array_compress(this->types);
        return TRUE;
 }