- continue;
- }
- notify = (notify_payload_t*)current;
- if (notify->get_notify_type(notify) != REKEY_SA)
- {
- continue;
- }
- switch (notify->get_protocol_id(notify))
- {
- case PROTO_IKE:
- /* TODO: transaction = rekey_ike_sa_create(ike_sa); */
- break;
- case PROTO_AH:
- case PROTO_ESP:
- /* we do not handle rekeying of CHILD_SAs in a special
- * transaction, as the procedure is nearly equal
- * to create a new CHILD_SA. */
- transaction = (transaction_t*)create_child_sa_create(ike_sa);
- break;
- default:
- break;
+ iterator_t *prop_iter;
+ proposal_substructure_t *prop_struct;
+ sa_payload_t *sa_payload = (sa_payload_t*)current;
+
+ prop_iter = sa_payload->create_proposal_substructure_iterator(sa_payload, TRUE);
+ if (prop_iter->iterate(prop_iter, (void**)&prop_struct))
+ {
+ switch (prop_struct->get_protocol_id(prop_struct))
+ {
+ case PROTO_IKE:
+ /* TODO: transaction = (transaction_t*)
+ rekey_ike_sa_create(ike_sa); */
+ break;
+ case PROTO_AH:
+ case PROTO_ESP:
+ transaction = (transaction_t*)
+ create_child_sa_create(ike_sa);
+ break;
+ default:
+ break;
+ }
+ }
+ prop_iter->destroy(prop_iter);