void and remove error handling in the callers.
OK patrick@ mvs@
-/* $OpenBSD: crypto.c,v 1.86 2021/10/13 13:08:58 bluhm Exp $ */
+/* $OpenBSD: crypto.c,v 1.87 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
/*
* Add crypto request to a queue, to be processed by a kernel thread.
*/
-int
+void
crypto_dispatch(struct cryptop *crp)
{
- int error = 0, lock = 1, s;
+ int lock = 1, s;
u_int32_t hid;
s = splvm();
task_set(&crp->crp_task, (void (*))crypto_invoke, crp);
task_add(tq, &crp->crp_task);
}
-
- return error;
}
/*
-/* $OpenBSD: cryptodev.h,v 1.75 2021/10/13 13:08:58 bluhm Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.76 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
int crypto_newsession(u_int64_t *, struct cryptoini *, int);
int crypto_freesession(u_int64_t);
-int crypto_dispatch(struct cryptop *);
+void crypto_dispatch(struct cryptop *);
int crypto_register(u_int32_t, int *,
int (*)(u_int32_t *, struct cryptoini *), int (*)(u_int64_t),
int (*)(struct cryptop *));
-/* $OpenBSD: softraid_crypto.c,v 1.141 2021/05/10 08:17:07 stsp Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.142 2021/10/13 22:43:44 bluhm Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
struct sr_crypto_wu *crwu;
struct sr_crypto *mdd_crypto;
daddr_t blkno;
- int rv = 0;
+ int rv;
DNPRINTF(SR_D_DIS, "%s: sr_crypto_rw wu %p\n",
DEVNAME(wu->swu_dis->sd_sc), wu);
mdd_crypto = &wu->swu_dis->mds.mdd_crypto;
crwu = sr_crypto_prepare(wu, mdd_crypto, 1);
crwu->cr_crp->crp_callback = sr_crypto_write;
- rv = crypto_dispatch(crwu->cr_crp);
- if (rv == 0)
- rv = crwu->cr_crp->crp_etype;
+ crypto_dispatch(crwu->cr_crp);
+ rv = crwu->cr_crp->crp_etype;
} else
rv = sr_crypto_dev_rw(wu, NULL);
-/* $OpenBSD: softraid_raid1c.c,v 1.3 2021/05/10 08:17:07 stsp Exp $ */
+/* $OpenBSD: softraid_raid1c.c,v 1.4 2021/10/13 22:43:44 bluhm Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
struct sr_crypto_wu *crwu;
struct sr_raid1c *mdd_raid1c;
daddr_t blkno;
- int rv = 0;
+ int rv;
DNPRINTF(SR_D_DIS, "%s: sr_raid1c_rw wu %p\n",
DEVNAME(wu->swu_dis->sd_sc), wu);
mdd_raid1c = &wu->swu_dis->mds.mdd_raid1c;
crwu = sr_crypto_prepare(wu, &mdd_raid1c->sr1c_crypto, 1);
crwu->cr_crp->crp_callback = sr_raid1c_write;
- rv = crypto_dispatch(crwu->cr_crp);
- if (rv == 0)
- rv = crwu->cr_crp->crp_etype;
+ crypto_dispatch(crwu->cr_crp);
+ rv = crwu->cr_crp->crp_etype;
} else
rv = sr_raid1c_dev_rw(wu, NULL);
-/* $OpenBSD: ip_ah.c,v 1.155 2021/10/13 14:36:31 bluhm Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.156 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
memcpy(&tc->tc_dst, &tdb->tdb_dst, sizeof(union sockaddr_union));
tc->tc_rpl = tdb->tdb_rpl;
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
drop:
m_freem(m);
tc->tc_rdomain = tdb->tdb_rdomain;
memcpy(&tc->tc_dst, &tdb->tdb_dst, sizeof(union sockaddr_union));
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
drop:
m_freem(m);
-/* $OpenBSD: ip_esp.c,v 1.173 2021/10/13 14:36:31 bluhm Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.174 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
crde->crd_len = m->m_pkthdr.len - (skip + hlen + alen);
}
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
drop:
m_freem(m);
crda->crd_len = m->m_pkthdr.len - (skip + alen);
}
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
drop:
m_freem(m);
-/* $OpenBSD: ip_ipcomp.c,v 1.75 2021/10/13 14:36:31 bluhm Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.76 2021/10/13 22:43:44 bluhm Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
{
const struct comp_algo *ipcompx = tdb->tdb_compalgxform;
struct tdb_crypto *tc;
- int hlen, error;
+ int hlen;
struct cryptodesc *crdc = NULL;
struct cryptop *crp;
tc->tc_rdomain = tdb->tdb_rdomain;
tc->tc_dst = tdb->tdb_dst;
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
}
int
crp->crp_opaque = (caddr_t)tc;
crp->crp_sid = tdb->tdb_cryptoid;
- error = crypto_dispatch(crp);
- return error;
+ crypto_dispatch(crp);
+ return 0;
drop:
m_freem(m);
-/* $OpenBSD: ipsec_input.c,v 1.182 2021/10/05 11:45:26 bluhm Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.183 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
/* Reset the session ID */
if (tdb->tdb_cryptoid != 0)
tdb->tdb_cryptoid = crp->crp_sid;
- error = crypto_dispatch(crp);
- if (error) {
- DPRINTF("crypto dispatch error %d", error);
- goto drop;
- }
+ crypto_dispatch(crp);
return;
}
DPRINTF("crypto error %d", crp->crp_etype);
-/* $OpenBSD: ipsec_output.c,v 1.88 2021/10/13 14:36:31 bluhm Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.89 2021/10/13 22:43:44 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
/* Reset the session ID */
if (tdb->tdb_cryptoid != 0)
tdb->tdb_cryptoid = crp->crp_sid;
- error = crypto_dispatch(crp);
- if (error) {
- DPRINTF("crypto dispatch error %d", error);
- goto drop;
- }
+ crypto_dispatch(crp);
return;
}
DPRINTF("crypto error %d", crp->crp_etype);