Do not abort when the ca privenc runs into a timeout.
authorreyk <reyk@openbsd.org>
Wed, 19 Sep 2018 11:28:02 +0000 (11:28 +0000)
committerreyk <reyk@openbsd.org>
Wed, 19 Sep 2018 11:28:02 +0000 (11:28 +0000)
OK claudio@

usr.sbin/relayd/ca.c
usr.sbin/relayd/relay.c

index db3b222..f72c900 100644 (file)
@@ -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 <reyk@openbsd.org>
@@ -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;
                }
index 8ebd0bd..739c922 100644 (file)
@@ -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 <reyk@openbsd.org>
@@ -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);
 }