--- embedaddon/strongswan/src/libcharon/sa/ikev1/phase1.c 2020/06/03 09:46:45 1.1.1.1 +++ embedaddon/strongswan/src/libcharon/sa/ikev1/phase1.c 2021/03/17 00:20:09 1.1.1.2 @@ -143,11 +143,10 @@ static shared_key_t *lookup_shared_key(private_phase1_ if (peer_cfg) { /* as initiator or aggressive responder, use identities */ - my_auth = get_auth_cfg(peer_cfg, TRUE); other_auth = get_auth_cfg(peer_cfg, FALSE); - if (my_auth && other_auth) + if (other_auth) { - my_id = my_auth->get(my_auth, AUTH_RULE_IDENTITY); + my_id = this->ike_sa->get_my_id(this->ike_sa); if (peer_cfg->use_aggressive(peer_cfg)) { other_id = this->ike_sa->get_other_id(this->ike_sa); @@ -156,10 +155,7 @@ static shared_key_t *lookup_shared_key(private_phase1_ { other_id = other_auth->get(other_auth, AUTH_RULE_IDENTITY); } - if (my_id) - { - shared_key = find_shared_key(my_id, me, other_id, other); - } + shared_key = find_shared_key(my_id, me, other_id, other); } } else @@ -629,6 +625,7 @@ METHOD(phase1_t, get_id, identification_t*, if (!me->is_anyaddr(me)) { id = identification_create_from_sockaddr(me->get_sockaddr(me)); + auth = this->ike_sa->get_auth_cfg(this->ike_sa, TRUE); auth->add(auth, AUTH_RULE_IDENTITY, id); } }