summaryrefslogtreecommitdiff
path: root/sbin/iked/ca.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-05-23 13:12:20 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-05-23 13:12:20 +0000
commit9c2db31174f57d00473b3711f74b87e453222eaf (patch)
tree1b367d8d96261dd782e8cc5bff07ad21194ab088 /sbin/iked/ca.c
parentd7a361a1ae48e1563b802b70589e6b22b040f9be (diff)
Replace ibuf_release() with ibuf_free() since the former just calls the latter
OK kn@ tb@
Diffstat (limited to 'sbin/iked/ca.c')
-rw-r--r--sbin/iked/ca.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/sbin/iked/ca.c b/sbin/iked/ca.c
index 409e8a67796..cd10fca4dd6 100644
--- a/sbin/iked/ca.c
+++ b/sbin/iked/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.91 2023/03/05 22:17:22 tobhe Exp $ */
+/* $OpenBSD: ca.c,v 1.92 2023/05/23 13:12:19 claudio Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -132,13 +132,13 @@ ca_shutdown(void)
struct iked *env = iked_env;
struct ca_store *store;
- ibuf_release(env->sc_certreq);
+ ibuf_free(env->sc_certreq);
if ((store = env->sc_priv) == NULL)
return;
X509_STORE_free(store->ca_cas);
X509_STORE_free(store->ca_certs);
- ibuf_release(store->ca_pubkey.id_buf);
- ibuf_release(store->ca_privkey.id_buf);
+ ibuf_free(store->ca_pubkey.id_buf);
+ ibuf_free(store->ca_privkey.id_buf);
free(store);
}
@@ -171,7 +171,7 @@ ca_getkey(struct privsep *ps, struct iked_id *key, enum imsg_type type)
ibuf_length(key->id_buf));
/* clear old key and copy new one */
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
memcpy(id, key, sizeof(*id));
}
@@ -348,7 +348,7 @@ ca_setscert(struct iked *env, struct iked_sahdr *sh, uint8_t type, X509 *cert)
iovcnt++;
ret = proc_composev(&env->sc_ps, PROC_IKEV2, IMSG_SCERT, iov, iovcnt);
- ibuf_release(buf);
+ ibuf_free(buf);
return (ret);
}
@@ -401,7 +401,7 @@ ca_setreq(struct iked *env, struct iked_sa *sa,
ret = 0;
done:
- ibuf_release(id.id_buf);
+ ibuf_free(id.id_buf);
return (ret);
}
@@ -757,7 +757,7 @@ ca_getreq(struct iked *env, struct imsg *imsg)
ca_setcert(env, &sh, NULL, type,
ibuf_data(buf), ibuf_size(buf), PROC_IKEV2);
- ibuf_release(buf);
+ ibuf_free(buf);
return (0);
}
@@ -816,9 +816,9 @@ ca_getauth(struct iked *env, struct imsg *imsg)
ret = ca_setauth(env, &sa, sa.sa_localauth.id_buf, PROC_IKEV2);
- ibuf_release(sa.sa_localauth.id_buf);
+ ibuf_free(sa.sa_localauth.id_buf);
sa.sa_localauth.id_buf = NULL;
- ibuf_release(authmsg);
+ ibuf_free(authmsg);
return (ret);
}
@@ -899,7 +899,7 @@ ca_reload(struct iked *env)
/*
* Save CAs signatures for the IKEv2 CERTREQ
*/
- ibuf_release(env->sc_certreq);
+ ibuf_free(env->sc_certreq);
if ((env->sc_certreq = ibuf_new(NULL, 0)) == NULL)
return (-1);
@@ -922,7 +922,7 @@ ca_reload(struct iked *env)
OPENSSL_free(subj_name);
if (ibuf_add(env->sc_certreq, md, len) != 0) {
- ibuf_release(env->sc_certreq);
+ ibuf_free(env->sc_certreq);
env->sc_certreq = NULL;
return (-1);
}
@@ -1267,7 +1267,7 @@ ca_pubkey_serialize(EVP_PKEY *key, struct iked_id *id)
case EVP_PKEY_RSA:
id->id_type = 0;
id->id_offset = 0;
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
if ((rsa = EVP_PKEY_get0_RSA(key)) == NULL)
@@ -1279,7 +1279,7 @@ ca_pubkey_serialize(EVP_PKEY *key, struct iked_id *id)
d = ibuf_data(id->id_buf);
if (i2d_RSAPublicKey(rsa, &d) != len) {
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
goto done;
}
@@ -1289,7 +1289,7 @@ ca_pubkey_serialize(EVP_PKEY *key, struct iked_id *id)
case EVP_PKEY_EC:
id->id_type = 0;
id->id_offset = 0;
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
if ((ec = EVP_PKEY_get0_EC_KEY(key)) == NULL)
@@ -1301,7 +1301,7 @@ ca_pubkey_serialize(EVP_PKEY *key, struct iked_id *id)
d = ibuf_data(id->id_buf);
if (i2d_EC_PUBKEY(ec, &d) != len) {
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
goto done;
}
@@ -1336,7 +1336,7 @@ ca_privkey_serialize(EVP_PKEY *key, struct iked_id *id)
case EVP_PKEY_RSA:
id->id_type = 0;
id->id_offset = 0;
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
if ((rsa = EVP_PKEY_get0_RSA(key)) == NULL)
@@ -1348,7 +1348,7 @@ ca_privkey_serialize(EVP_PKEY *key, struct iked_id *id)
d = ibuf_data(id->id_buf);
if (i2d_RSAPrivateKey(rsa, &d) != len) {
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
goto done;
}
@@ -1358,7 +1358,7 @@ ca_privkey_serialize(EVP_PKEY *key, struct iked_id *id)
case EVP_PKEY_EC:
id->id_type = 0;
id->id_offset = 0;
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
if ((ec = EVP_PKEY_get0_EC_KEY(key)) == NULL)
@@ -1370,7 +1370,7 @@ ca_privkey_serialize(EVP_PKEY *key, struct iked_id *id)
d = ibuf_data(id->id_buf);
if (i2d_ECPrivateKey(ec, &d) != len) {
- ibuf_release(id->id_buf);
+ ibuf_free(id->id_buf);
id->id_buf = NULL;
goto done;
}
@@ -1680,7 +1680,7 @@ ca_validate_pubkey(struct iked *env, struct iked_static_id *id,
if (ret != 0)
ca_sslerror(__func__);
done:
- ibuf_release(idp.id_buf);
+ ibuf_free(idp.id_buf);
EVP_PKEY_free(localkey);
RSA_free(localrsa);
if (len > 0)
@@ -1901,7 +1901,7 @@ ca_x509_subjectaltname_do(X509 *cert, int mode, const char *logmsg,
}
ikev2_print_id(&sanid, idstr, sizeof(idstr));
log_info("%s: altname: %s", logmsg, idstr);
- ibuf_release(sanid.id_buf);
+ ibuf_free(sanid.id_buf);
sanid.id_buf = NULL;
}
/* Compare length and data */
@@ -1916,7 +1916,7 @@ ca_x509_subjectaltname_do(X509 *cert, int mode, const char *logmsg,
}
/* Get first ID */
if (mode == MODE_ALT_GET) {
- ibuf_release(retid->id_buf);
+ ibuf_free(retid->id_buf);
if ((retid->id_buf = ibuf_new(data, len)) == NULL) {
log_debug("%s: failed to get id buffer",
__func__);