-/* $OpenBSD: iked.h,v 1.198 2021/11/26 16:22:44 patrick Exp $ */
+/* $OpenBSD: iked.h,v 1.199 2021/11/27 21:50:05 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
uint16_t msg_dhgroup; /* dh group */
struct ibuf *msg_ke; /* dh key exchange */
struct iked_id msg_auth; /* AUTH payload */
- struct iked_id msg_id;
+ struct iked_id msg_peerid;
struct iked_id msg_localid;
struct iked_id msg_cert;
struct ibuf *msg_cookie;
-/* $OpenBSD: ikev2.c,v 1.336 2021/11/26 14:05:01 tobhe Exp $ */
+/* $OpenBSD: ikev2.c,v 1.337 2021/11/27 21:50:05 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
id = &sa->sa_iid;
/* try to relookup the policy based on the peerid */
- if (msg->msg_id.id_type && !sa->sa_hdr.sh_initiator) {
+ if (msg->msg_peerid.id_type && !sa->sa_hdr.sh_initiator) {
old = sa->sa_policy;
sa->sa_policy = NULL;
old->pol_nflows) != 0 || msg->msg_policy != old) {
/* get dstid */
- if (msg->msg_id.id_type) {
- memcpy(id, &msg->msg_id, sizeof(*id));
- bzero(&msg->msg_id, sizeof(msg->msg_id));
+ if (msg->msg_peerid.id_type) {
+ memcpy(id, &msg->msg_peerid, sizeof(*id));
+ bzero(&msg->msg_peerid, sizeof(msg->msg_peerid));
}
log_warnx("%s: policy mismatch", SPI_SA(sa, __func__));
ikev2_send_auth_failed(env, sa);
if (!msg->msg_auth.id_type &&
!sa->sa_policy->pol_auth.auth_eap) {
/* get dstid */
- if (msg->msg_id.id_type) {
- memcpy(id, &msg->msg_id, sizeof(*id));
- bzero(&msg->msg_id, sizeof(msg->msg_id));
+ if (msg->msg_peerid.id_type) {
+ memcpy(id, &msg->msg_peerid, sizeof(*id));
+ bzero(&msg->msg_peerid, sizeof(msg->msg_peerid));
}
log_debug("%s: missing auth payload", SPI_SA(sa, __func__));
ikev2_send_auth_failed(env, sa);
return (-1);
}
- if (msg->msg_id.id_type) {
- memcpy(id, &msg->msg_id, sizeof(*id));
- bzero(&msg->msg_id, sizeof(msg->msg_id));
+ if (msg->msg_peerid.id_type) {
+ memcpy(id, &msg->msg_peerid, sizeof(*id));
+ bzero(&msg->msg_peerid, sizeof(msg->msg_peerid));
if (!sa->sa_hdr.sh_initiator) {
if ((authmsg = ikev2_msg_auth(env, sa,
-/* $OpenBSD: ikev2_msg.c,v 1.81 2021/11/26 16:22:44 patrick Exp $ */
+/* $OpenBSD: ikev2_msg.c,v 1.82 2021/11/27 21:50:05 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
ibuf_release(msg->msg_nonce);
ibuf_release(msg->msg_ke);
ibuf_release(msg->msg_auth.id_buf);
- ibuf_release(msg->msg_id.id_buf);
+ ibuf_release(msg->msg_peerid.id_buf);
ibuf_release(msg->msg_localid.id_buf);
ibuf_release(msg->msg_cert.id_buf);
ibuf_release(msg->msg_cookie);
msg->msg_nonce = NULL;
msg->msg_ke = NULL;
msg->msg_auth.id_buf = NULL;
- msg->msg_id.id_buf = NULL;
+ msg->msg_peerid.id_buf = NULL;
msg->msg_localid.id_buf = NULL;
msg->msg_cert.id_buf = NULL;
msg->msg_cookie = NULL;
-/* $OpenBSD: ikev2_pld.c,v 1.120 2021/11/26 16:22:44 patrick Exp $ */
+/* $OpenBSD: ikev2_pld.c,v 1.121 2021/11/27 21:50:05 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
if (((sa->sa_hdr.sh_initiator && payload == IKEV2_PAYLOAD_IDr) ||
(!sa->sa_hdr.sh_initiator && payload == IKEV2_PAYLOAD_IDi)))
- idp = &msg->msg_parent->msg_id;
+ idp = &msg->msg_parent->msg_peerid;
else if (!sa->sa_hdr.sh_initiator && payload == IKEV2_PAYLOAD_IDr)
idp = &msg->msg_parent->msg_localid;
else {
-/* $OpenBSD: policy.c,v 1.87 2021/11/26 16:22:44 patrick Exp $ */
+/* $OpenBSD: policy.c,v 1.88 2021/11/27 21:50:05 tobhe Exp $ */
/*
* Copyright (c) 2020-2021 Tobias Heider <tobhe@openbsd.org>
pol.pol_flags |= IKED_POLICY_TRANSPORT;
memcpy(&pol.pol_peer.addr, &msg->msg_peer, sizeof(msg->msg_peer));
memcpy(&pol.pol_local.addr, &msg->msg_local, sizeof(msg->msg_local));
- if (msg->msg_id.id_type &&
- ikev2_print_id(&msg->msg_id, idstr, IKED_ID_SIZE) == 0 &&
+ if (msg->msg_peerid.id_type &&
+ ikev2_print_id(&msg->msg_peerid, idstr, IKED_ID_SIZE) == 0 &&
(s = strchr(idstr, '/')) != NULL) {
- pol.pol_peerid.id_type = msg->msg_id.id_type;
+ pol.pol_peerid.id_type = msg->msg_peerid.id_type;
pol.pol_peerid.id_length = strlen(s+1);
strlcpy(pol.pol_peerid.id_data, s+1,
sizeof(pol.pol_peerid.id_data));