From 917ba595c7c7f521107876082cef9ed08d8b87bf Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 19 Sep 2018 11:28:02 +0000 Subject: [PATCH] Do not abort when the ca privenc runs into a timeout. OK claudio@ --- usr.sbin/relayd/ca.c | 7 ++++--- usr.sbin/relayd/relay.c | 10 +++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c index db3b2222163..f72c900e80f 100644 --- a/usr.sbin/relayd/ca.c +++ b/usr.sbin/relayd/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.33 2018/01/24 13:51:36 claudio Exp $ */ +/* $OpenBSD: ca.c,v 1.34 2018/09/19 11:28:02 reyk Exp $ */ /* * Copyright (c) 2014 Reyk Floeter @@ -369,8 +369,9 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa, case -1: fatal("%s: poll", __func__); case 0: - log_warnx("%s: poll timeout", __func__); - return -1; + log_warnx("%s: priv%s poll timeout", __func__, + cmd == IMSG_CA_PRIVENC ? "enc" : "dec"); + return (-1); default: break; } diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c index 8ebd0bd1c14..739c9226b65 100644 --- a/usr.sbin/relayd/relay.c +++ b/usr.sbin/relayd/relay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay.c,v 1.240 2018/08/06 17:31:31 benno Exp $ */ +/* $OpenBSD: relay.c,v 1.241 2018/09/19 11:28:02 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -1910,6 +1910,14 @@ relay_dispatch_pfe(int fd, struct privsep_proc *p, struct imsg *imsg) int relay_dispatch_ca(int fd, struct privsep_proc *p, struct imsg *imsg) { + switch (imsg->hdr.type) { + case IMSG_CA_PRIVENC: + case IMSG_CA_PRIVDEC: + log_warnx("%s: priv%s result after timeout", __func__, + imsg->hdr.type == IMSG_CA_PRIVENC ? "enc" : "dec"); + return (0); + } + return (-1); } -- 2.20.1