Skip to contentSkip to conversation

Change in openvpn[master]: fix key_state_gen_auth_control_files probably checking file creation

Openvpn-devel In review plaisthos (Code Review) 2 participants 6 messages Oct 29, 2025 – Oct 30, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1761744141000.I94d2bdd234a1c416b78924d044bf7e57f1bed8c4@...2715...

#1 lore raw

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email

to review the following change.

Change subject: fix key_state_gen_auth_control_files probably checking file creation
......................................................................

fix key_state_gen_auth_control_files probably checking file creation

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.

Found-by ZeroPath (https://zeropath.com/)
Change-Id I94d2bdd234a1c416b78924d044bf7e57f1bed8c4

---
M src/openvpn/ssl_verify.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1327/1

src/openvpn/ssl_verify.c +2 -2
index 04ef27e..446c4a7 100644
@@ -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);
 }
 
 /**

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I94d2bdd234a1c416b78924d044bf7e57f1bed8c4
Gerrit-Change-Number: 1327
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email )

Change subject: fix key_state_gen_auth_control_files probably checking file creation
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I94d2bdd234a1c416b78924d044bf7e57f1bed8c4
Gerrit-Change-Number: 1327
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Oct 2025 19:39:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 fix key_state_gen_auth_control_files probably checking file creation

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

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.

Found-by ZeroPath (https://zeropath.com/)
Change-Id I94d2bdd234a1c416b78924d044bf7e57f1bed8c4

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 <[email protected]...>

src/openvpn/ssl_verify.c +2 -2
index 04ef27e..446c4a7 100644
@@ -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);
 }
 
 /**
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: fix key_state_gen_auth_control_files probably checking file creation

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 <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34067.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: fix key_state_gen_auth_control_files probably checking file creation
......................................................................

fix key_state_gen_auth_control_files probably checking file creation

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.

Found-by ZeroPath (https://zeropath.com/)
Change-Id I94d2bdd234a1c416b78924d044bf7e57f1bed8c4

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34067.html

---
M src/openvpn/ssl_verify.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1327/2

src/openvpn/ssl_verify.c +2 -2
index 993d22c..a16f5fa 100644
@@ -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);
 }
 
 /**

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I94d2bdd234a1c416b78924d044bf7e57f1bed8c4
Gerrit-Change-Number: 1327
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email )

Change subject: fix key_state_gen_auth_control_files probably checking file creation
......................................................................

fix key_state_gen_auth_control_files probably checking file creation

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.

Found-by ZeroPath (https://zeropath.com/)
Change-Id I94d2bdd234a1c416b78924d044bf7e57f1bed8c4

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1327
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34067.html

---
M src/openvpn/ssl_verify.c

1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpn/ssl_verify.c +2 -2
index 993d22c..a16f5fa 100644
@@ -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);
 }
 
 /**

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1327?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I94d2bdd234a1c416b78924d044bf7e57f1bed8c4
Gerrit-Change-Number: 1327
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>