summaryrefslogtreecommitdiff
path: root/sbin/iked/ikev2.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-07-18 15:07:42 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-07-18 15:07:42 +0000
commitbc153e3f6cbb91a8b9a42e0984bd8ece49c0a6aa (patch)
treed323553152fb91c997c630fc83b13c5805ddf443 /sbin/iked/ikev2.c
parent9d536210930f8537854ebc951a2d1376c988d736 (diff)
Kill ibuf_cat() since there is now ibuf_add_buf() in the official API.
OK tb@ tobhe@
Diffstat (limited to 'sbin/iked/ikev2.c')
-rw-r--r--sbin/iked/ikev2.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c
index 349e16a40da..14e05a07012 100644
--- a/sbin/iked/ikev2.c
+++ b/sbin/iked/ikev2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2.c,v 1.373 2023/07/16 15:21:46 claudio Exp $ */
+/* $OpenBSD: ikev2.c,v 1.374 2023/07/18 15:07:41 claudio Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -1609,7 +1609,7 @@ ikev2_init_ike_auth(struct iked *env, struct iked_sa *sa)
if ((pld = ikev2_add_payload(e)) == NULL)
goto done;
firstpayload = IKEV2_PAYLOAD_IDi;
- if (ibuf_cat(e, id->id_buf) != 0)
+ if (ibuf_add_buf(e, id->id_buf) != 0)
goto done;
len = ibuf_size(id->id_buf);
@@ -1623,7 +1623,7 @@ ikev2_init_ike_auth(struct iked *env, struct iked_sa *sa)
goto done;
if ((pld = ikev2_add_payload(e)) == NULL)
goto done;
- if (ibuf_cat(e, peerid.id_buf) != 0)
+ if (ibuf_add_buf(e, peerid.id_buf) != 0)
goto done;
len = ibuf_size(peerid.id_buf);
}
@@ -1639,7 +1639,7 @@ ikev2_init_ike_auth(struct iked *env, struct iked_sa *sa)
if ((cert = ibuf_reserve(e, sizeof(*cert))) == NULL)
goto done;
cert->cert_type = certid->id_type;
- if (ibuf_cat(e, certid->id_buf) != 0)
+ if (ibuf_add_buf(e, certid->id_buf) != 0)
goto done;
len = ibuf_size(certid->id_buf) + sizeof(*cert);
@@ -1654,7 +1654,7 @@ ikev2_init_ike_auth(struct iked *env, struct iked_sa *sa)
if ((cert = ibuf_reserve(e, sizeof(*cert))) == NULL)
goto done;
cert->cert_type = sa->sa_scert[i].id_type;
- if (ibuf_cat(e, sa->sa_scert[i].id_buf) != 0)
+ if (ibuf_add_buf(e, sa->sa_scert[i].id_buf) != 0)
goto done;
len = ibuf_size(sa->sa_scert[i].id_buf) + sizeof(*cert);
}
@@ -1679,7 +1679,7 @@ ikev2_init_ike_auth(struct iked *env, struct iked_sa *sa)
if ((auth = ibuf_reserve(e, sizeof(*auth))) == NULL)
goto done;
auth->auth_method = sa->sa_localauth.id_type;
- if (ibuf_cat(e, sa->sa_localauth.id_buf) != 0)
+ if (ibuf_add_buf(e, sa->sa_localauth.id_buf) != 0)
goto done;
len = ibuf_size(sa->sa_localauth.id_buf) + sizeof(*auth);
@@ -2212,7 +2212,7 @@ ikev2_add_vendor_id(struct ibuf *e, struct ikev2_payload **pld,
return (-1);
if ((*pld = ikev2_add_payload(e)) == NULL)
return (-1);
- if (ibuf_cat(e, id) == -1)
+ if (ibuf_add_buf(e, id) == -1)
return (-1);
return (ibuf_length(id));
@@ -3908,7 +3908,7 @@ ikev2_resp_ike_auth(struct iked *env, struct iked_sa *sa)
if ((pld = ikev2_add_payload(e)) == NULL)
goto done;
firstpayload = IKEV2_PAYLOAD_IDr;
- if (ibuf_cat(e, id->id_buf) != 0)
+ if (ibuf_add_buf(e, id->id_buf) != 0)
goto done;
len = ibuf_size(id->id_buf);
@@ -3924,7 +3924,7 @@ ikev2_resp_ike_auth(struct iked *env, struct iked_sa *sa)
if ((cert = ibuf_reserve(e, sizeof(*cert))) == NULL)
goto done;
cert->cert_type = certid->id_type;
- if (ibuf_cat(e, certid->id_buf) != 0)
+ if (ibuf_add_buf(e, certid->id_buf) != 0)
goto done;
len = ibuf_size(certid->id_buf) + sizeof(*cert);
@@ -3940,7 +3940,8 @@ ikev2_resp_ike_auth(struct iked *env, struct iked_sa *sa)
sizeof(*cert))) == NULL)
goto done;
cert->cert_type = sa->sa_scert[i].id_type;
- if (ibuf_cat(e, sa->sa_scert[i].id_buf) != 0)
+ if (ibuf_add_buf(e, sa->sa_scert[i].id_buf) !=
+ 0)
goto done;
len = ibuf_size(sa->sa_scert[i].id_buf)
+ sizeof(*cert);
@@ -3958,7 +3959,7 @@ ikev2_resp_ike_auth(struct iked *env, struct iked_sa *sa)
if ((auth = ibuf_reserve(e, sizeof(*auth))) == NULL)
goto done;
auth->auth_method = sa->sa_localauth.id_type;
- if (ibuf_cat(e, sa->sa_localauth.id_buf) != 0)
+ if (ibuf_add_buf(e, sa->sa_localauth.id_buf) != 0)
goto done;
len = ibuf_size(sa->sa_localauth.id_buf) + sizeof(*auth);
@@ -4036,7 +4037,7 @@ ikev2_send_ike_e(struct iked *env, struct iked_sa *sa, struct ibuf *buf,
goto done;
if (buf) {
- if (ibuf_cat(e, buf) != 0)
+ if (ibuf_add_buf(e, buf) != 0)
goto done;
if (ikev2_next_payload(pld, ibuf_size(buf),
@@ -5320,7 +5321,7 @@ ikev2_send_informational(struct iked *env, struct iked_message *msg)
log_debug("%s: encryption failed", __func__);
goto done;
}
- if (ibuf_cat(buf, e) != 0)
+ if (ibuf_add_buf(buf, e) != 0)
goto done;
if (ikev2_next_payload(pld, ibuf_size(e),
IKEV2_PAYLOAD_NOTIFY) == -1)
@@ -5351,7 +5352,7 @@ ikev2_send_informational(struct iked *env, struct iked_message *msg)
IKEV2_PAYLOAD_NOTIFY, IKEV2_EXCHANGE_INFORMATIONAL,
0)) == NULL)
goto done;
- if (ibuf_cat(buf, e) != 0)
+ if (ibuf_add_buf(buf, e) != 0)
goto done;
if (ikev2_set_header(hdr, ibuf_size(buf) - sizeof(*hdr)) == -1)
goto done;
@@ -6192,13 +6193,13 @@ ikev2_childsa_negotiate(struct iked *env, struct iked_sa *sa,
ibuf_length(kex->kex_dhpeer));
goto done;
}
- if (ibuf_cat(seed, dhsecret) != 0) {
+ if (ibuf_add_buf(seed, dhsecret) != 0) {
log_debug("%s: failed to set dh secret", __func__);
goto done;
}
}
- if (ibuf_cat(seed, kex->kex_inonce) != 0 ||
- ibuf_cat(seed, kex->kex_rnonce) != 0 ||
+ if (ibuf_add_buf(seed, kex->kex_inonce) != 0 ||
+ ibuf_add_buf(seed, kex->kex_rnonce) != 0 ||
(keymat = ikev2_prfplus(sa->sa_prf,
sa->sa_key_d, seed, ilen)) == NULL) {
log_debug("%s: failed to get IKE SA key material", __func__);