do not attempt to encrypt payloads without crypter or signer (allows to override...
authorTobias Brunner <tobias@strongswan.org>
Tue, 2 Oct 2007 13:31:12 +0000 (13:31 -0000)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Oct 2007 13:31:12 +0000 (13:31 -0000)
src/charon/encoding/message.c

index b093d25..567fed4 100644 (file)
@@ -681,6 +681,13 @@ static status_t encrypt_payloads (private_message_t *this,crypter_t *crypter, si
                return SUCCESS;
        }
        
+       if (!crypter || !signer)
+       {
+               DBG2(DBG_ENC, "no crypter or signer specified, do not encrypt message");
+               /* message contains no content to encrypt */
+               return SUCCESS;
+       }
+       
        DBG2(DBG_ENC, "copy all payloads to a temporary list");
        all_payloads = linked_list_create();