[Openvpn-devel,v1] fix key_state_gen_auth_control_files probably checking file creation

Message ID 20251030193940.1295-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v1] fix key_state_gen_auth_control_files probably checking file creation | expand

Commit Message

Gert Doering Oct. 30, 2025, 7:39 p.m. UTC
From: Arne Schwabe <arne@rfc2549.org>

When the auth_failed_reason_file was added, it was forgotten to also add it
to the conditions that determine if the file creation was successful.

Reported-by: Joshua Rogers <contact@joshua.hu>
Found-by: ZeroPath (https://zeropath.com/)
Change-Id: I94d2bdd234a1c416b78924d044bf7e57f1bed8c4
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>

Comments

Gert Doering Oct. 30, 2025, 8:58 p.m. UTC | #1
Yeah, trivial oversight, in the build-up to the rewritten async things 
handling for 2.6...  the consequences are not huge, as usually "all the
files fail" or "none", but still, this is the correct check.

Your patch has been applied to the master and release/2.6 branch (bugfix).

commit 2f8cbf5bc95b80832c84b0396cb7851bf5a2c579 (master)
commit da394db7477300c79953c8b0da710f62698756b0 (release/2.6)
Author: Arne Schwabe
Date:   Thu Oct 30 20:39:34 2025 +0100

     fix key_state_gen_auth_control_files probably checking file creation

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
     Message-Id: <20251030193940.1295-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34067.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c
index 04ef27e..446c4a7 100644
--- a/src/openvpn/ssl_verify.c
+++ b/src/openvpn/ssl_verify.c
@@ -992,7 +992,7 @@ 
     const char *apf = platform_create_temp_file(opt->tmp_dir, "apf", &gc);
     const char *afr = platform_create_temp_file(opt->tmp_dir, "afr", &gc);
 
-    if (acf && apf)
+    if (acf && apf && afr)
     {
         ads->auth_control_file = string_alloc(acf, NULL);
         ads->auth_pending_file = string_alloc(apf, NULL);
@@ -1004,7 +1004,7 @@ 
     }
 
     gc_free(&gc);
-    return (acf && apf);
+    return (acf && apf && afr);
 }
 
 /**