From patchwork Thu Dec 7 23:33:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 139 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director4.mail.ord1d.rsapps.net ([172.30.191.6]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id 4+aeJrVqKlqPXQAAgoeIoA for ; Fri, 08 Dec 2017 05:34:29 -0500 Received: from proxy12.mail.ord1d.rsapps.net ([172.30.191.6]) by director4.mail.ord1d.rsapps.net (Dovecot) with LMTP id 2/SOJrVqKlp8MwAAHDmxtw ; Fri, 08 Dec 2017 05:34:29 -0500 Received: from smtp13.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.ord1d.rsapps.net (Dovecot) with LMTP id wtT1AbVqKloZfgAA7PHxkg ; Fri, 08 Dec 2017 05:34:29 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.34.181.88] Authentication-Results: smtp13.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=karger-me.20150623.gappssmtp.com; dmarc=none (p=nil; dis=none) header.from=karger.me X-Classification-ID: 5e776f42-dc03-11e7-805e-525400b197d9-1-1 Received: from [216.34.181.88] ([216.34.181.88:31628] helo=lists.sourceforge.net) by smtp13.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 64/9D-20656-4BA6A2A5; Fri, 08 Dec 2017 05:34:28 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1eNFyW-00037o-E3; Fri, 08 Dec 2017 10:33:48 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eNFyV-00037h-9T for openvpn-devel@lists.sourceforge.net; Fri, 08 Dec 2017 10:33:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JXuyKMw/5Kur1K1+rWg5yblqgxTTj1UEXWlKMjS31Mk=; b=cUYpIVA99Qkp0wd/IoVt09eNmN lPWrjuFqIzkKSa49tLoMjFtatHvkXn2wGkERimTTGAOrI0Y1/bD8urSLl6aB6hL+0tbdVMdj0xp3l q7mkDqNh2g9lW9RLp1VTrJnUsb4wTFRUgKAiFrpumGX+HAzMYZ1RA3nHG6S5rD9VJ3pA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JXuyKMw/5Kur1K1+rWg5yblqgxTTj1UEXWlKMjS31Mk=; b=I3uppHChWTBGlAdgAUiJ2xhjs+ TNAPLyf7fmQIPg+PtqXosz548j5aKtnC5Po6cwPEGCH0/XjulnlKS609JKYrRM4ntyqwAFg9HpUds oXtwZPpCl0p0MTCqAWjAZLs8O+plU7rPcVrn5sgrOC5njBbW3N2eM9c42UZBT2hrcSlA=; Received: from mail-wm0-f66.google.com ([74.125.82.66]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1eNFyS-0000cI-Gz for openvpn-devel@lists.sourceforge.net; Fri, 08 Dec 2017 10:33:47 +0000 Received: by mail-wm0-f66.google.com with SMTP id n138so2546719wmg.2 for ; Fri, 08 Dec 2017 02:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karger-me.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=JXuyKMw/5Kur1K1+rWg5yblqgxTTj1UEXWlKMjS31Mk=; b=T5UstBOprKXVj4/vd6hp1ayftz5b+L6siNwqWQlVEMjMC5GFnbvaqwl+65EL01G8kY oedeQH/kFn+BeKJvonqTge42FH9aj6QB7N0k4fQ2VSfjR57i+pho85VHbUWV0nrb07PY FAwgmz2VDwQeCNPfAcV+MnWcIQxAyUAiG6uOWzSBv0ccKkKUrVY1fsNLWq+fzWwBWSy8 /Xzo/4XYrE17IrPPks7ZOjX/432AcWZNesY+7pet4hZl1z9LaKs/1gTn4DtTEppZiK4e FZ3++5CN4XzpjocCFHDY6TCLEghXtUDXCAnsHX9aSVca4H6OBmbxJBZZ8ZnUWN0s69lG cCYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JXuyKMw/5Kur1K1+rWg5yblqgxTTj1UEXWlKMjS31Mk=; b=rESbYd+MrbraWxPMpzLSWadbFZnyfxohOEAIs09f09QH258i/Jy7W5Lg/w9FayaODh HRtNoq+EuA6Pbpu/lgKH5SkRHWQaJiVWh3irBLmvN2hoqz75B2Wz7+aj/5E+4vI10caV k/VqJ//kKYhvBmBJtQwgHWb4kDSVtMmO3OFueIV+iCzs6k4620OCEoUq8P851uOl2zjk 2S8BOx1P1p8XYSVL39VyYiEtGI2BsgGTyF0MF2sbDOnDgoArOROzMLy2Z/zPr9zHEE0I ymZIifn+9KXmUIOnt6hQMgCsV6GiAKVFjFVLTZ1t2aMlmQGfDb8Ze34a0jx85cRiTsiv 5lvw== X-Gm-Message-State: AJaThX6PYV7hIwiy+ptXmWeCsS2HxukceO+n8+Ld8N1+z+u+Qh3c8en+ 6zA8LVzZnymxeTmEdo+gU5PcgFWT2bY= X-Google-Smtp-Source: AGs4zMbFcZjFnMkv2achEbotosiSM9KpyeIwwXj7dJWJoXzfNgBiotcQGeD3cV5AI9T/oLVCbBAOmg== X-Received: by 10.80.148.10 with SMTP id p10mr50365294eda.250.1512729218329; Fri, 08 Dec 2017 02:33:38 -0800 (PST) Received: from syzzer-tweakbak.fritz.box ([2001:985:e54:1:881e:647d:3c8e:6ee4]) by smtp.gmail.com with ESMTPSA id p37sm3141723eda.96.2017.12.08.02.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Dec 2017 02:33:37 -0800 (PST) From: Steffan Karger To: openvpn-devel@lists.sourceforge.net Date: Fri, 8 Dec 2017 11:33:31 +0100 Message-Id: <1512729211-8407-1-git-send-email-steffan@karger.me> X-Mailer: git-send-email 2.7.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.125.82.66 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1eNFyS-0000cI-Gz Subject: [Openvpn-devel] [PATCH] Don't throw fatal errors from verify_cert_export_cert() X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Steffan Karger As with create_temp_file(), this function is called on client connects and should not cause fatal errors when I/O (possibly temporarily) fails. The callers of this function are already fixed in the commit that does the same for create_temp_file(). Signed-off-by: Steffan Karger Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
--- src/openvpn/ssl_verify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index ebb1da2..12cff9a 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -557,13 +557,14 @@ verify_cert_export_cert(openvpn_x509_cert_t *peercert, const char *tmp_dir, stru peercert_file = fopen(peercert_filename, "w+"); if (!peercert_file) { - msg(M_ERR, "Failed to open temporary file : %s", peercert_filename); + msg(M_ERRNO, "Failed to open temporary file : %s", peercert_filename); return NULL; } if (SUCCESS != x509_write_pem(peercert_file, peercert)) { - msg(M_ERR, "Error writing PEM file containing certificate"); + msg(M_WARN, "Error writing PEM file containing certificate"); + peercert_filename = NULL; } fclose(peercert_file);