Use has_more in decrypt_payloads instead of calling enumerate twice.
authorTobias Brunner <tobias@strongswan.org>
Thu, 9 Jun 2011 07:55:44 +0000 (09:55 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 6 Jul 2011 07:43:46 +0000 (09:43 +0200)
src/libcharon/encoding/message.c

index 214612f..f99cb80 100644 (file)
@@ -1312,7 +1312,7 @@ static status_t decrypt_payloads(private_message_t *this, aead_t *aead)
 
                        DBG2(DBG_ENC, "found an encryption payload");
 
-                       if (enumerator->enumerate(enumerator, &payload))
+                       if (this->payloads->has_more(this->payloads, enumerator))
                        {
                                DBG1(DBG_ENC, "encrypted payload is not last payload");
                                status = VERIFY_ERROR;