summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/ca.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-01-24 13:51:37 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-01-24 13:51:37 +0000
commitadb8889d26832ec8acf24267185768185bf56e2a (patch)
treea757e887b030a6ffd46ad4ade22f21e46a3e9397 /usr.sbin/relayd/ca.c
parente878cd683005c0b9ee8498e410cd31da5da72117 (diff)
Log some more errors in the ca code, since there seems to be still a bug
hidden somewhere. Also return after a poll timeout, there is no reason to wait longer than a second for the answer of the ca process. OK jsing@
Diffstat (limited to 'usr.sbin/relayd/ca.c')
-rw-r--r--usr.sbin/relayd/ca.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c
index 3797e900061..db3b2222163 100644
--- a/usr.sbin/relayd/ca.c
+++ b/usr.sbin/relayd/ca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ca.c,v 1.32 2018/01/01 15:01:09 claudio Exp $ */
+/* $OpenBSD: ca.c,v 1.33 2018/01/24 13:51:36 claudio Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -279,8 +279,9 @@ ca_dispatch_relay(int fd, struct privsep_proc *p, struct imsg *imsg)
iov[c++].iov_len = cko.cko_tlen;
}
- proc_composev_imsg(env->sc_ps, PROC_RELAY, cko.cko_proc,
- imsg->hdr.type, -1, -1, iov, c);
+ if (proc_composev_imsg(env->sc_ps, PROC_RELAY, cko.cko_proc,
+ imsg->hdr.type, -1, -1, iov, c) == -1)
+ log_warn("%s: proc_composev_imsg", __func__);
free(to);
RSA_free(rsa);
@@ -356,7 +357,8 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa,
* Send a synchronous imsg because we cannot defer the RSA
* operation in OpenSSL's engine layer.
*/
- imsg_composev(ibuf, cmd, 0, 0, -1, iov, cnt);
+ if (imsg_composev(ibuf, cmd, 0, 0, -1, iov, cnt) == -1)
+ log_warn("%s: imsg_composev", __func__);
if (imsg_flush(ibuf) == -1)
log_warn("%s: imsg_flush", __func__);
@@ -368,7 +370,7 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa,
fatal("%s: poll", __func__);
case 0:
log_warnx("%s: poll timeout", __func__);
- break;
+ return -1;
default:
break;
}