ike: Add an additional but separate AEAD proposal to IKE config, if supported
[strongswan.git] / src / libcharon / plugins / vici / vici_config.c
index 52a3dba..83d2216 100644 (file)
@@ -442,17 +442,24 @@ static bool parse_proposal(linked_list_t *list, protocol_id_t proto, chunk_t v)
        if (strcaseeq("default", buf))
        {
                proposal = proposal_create_default(proto);
+               if (proposal)
+               {
+                       list->insert_last(list, proposal);
+               }
+               proposal = proposal_create_default_aead(proto);
+               if (proposal)
+               {
+                       list->insert_last(list, proposal);
+               }
+               return TRUE;
        }
-       else
-       {
-               proposal = proposal_create_from_string(proto, buf);
-       }
-       if (!proposal)
+       proposal = proposal_create_from_string(proto, buf);
+       if (proposal)
        {
-               return FALSE;
+               list->insert_last(list, proposal);
+               return TRUE;
        }
-       list->insert_last(list, proposal);
-       return TRUE;
+       return FALSE;
 }
 
 /**
@@ -1755,8 +1762,16 @@ CALLBACK(config_sn, bool,
        }
        if (peer.proposals->get_count(peer.proposals) == 0)
        {
-               peer.proposals->insert_last(peer.proposals,
-                                                                       proposal_create_default(PROTO_IKE));
+               proposal = proposal_create_default(PROTO_IKE);
+               if (proposal)
+               {
+                       peer.proposals->insert_last(peer.proposals, proposal);
+               }
+               proposal = proposal_create_default_aead(PROTO_IKE);
+               if (proposal)
+               {
+                       peer.proposals->insert_last(peer.proposals, proposal);
+               }
        }
        if (!peer.local_addrs)
        {