]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix incorrect condition for checking password related check
authorArne Schwabe <arne@rfc2549.org>
Sun, 23 Mar 2025 21:13:53 +0000 (22:13 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 24 Mar 2025 07:13:58 +0000 (08:13 +0100)
Commit db48cea chagned logic to move logic from a variable and repeated
checks to an if clause.

The old code had

            const bool ccnr = (options->auth_user_pass_verify_script
                                || PLUGIN_OPTION_LIST(options)
                                || MAN_CLIENT_AUTH_ENABLED(options));

followed by several condition that checked !ccnr

This commit fixes the if clause by correctly applying De Morgan's law.

Github: closes OpenVPN/openvpn#706

Change-Id: I28a8abd0ee3fa9168a716171b0a405476089c4a1
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Message-Id: <20250323211359.14117-1-gert@greenie.muc.de>
URL: https://sourceforge.net/p/openvpn/mailman/message/59164222/
URL: http://gerrit.openvpn.net/c/openvpn/+/912
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 67ef55bfeab13857043a7d365604b7defd63093e..ab5660919133618adc567ebccfaf3ae40d6f1cf4 100644 (file)
@@ -2752,8 +2752,8 @@ options_postprocess_verify_ce(const struct options *options,
 
         }
         if (!options->auth_user_pass_verify_script
-            || PLUGIN_OPTION_LIST(options)
-            || MAN_CLIENT_AUTH_ENABLED(options))
+            && !PLUGIN_OPTION_LIST(options)
+            && !MAN_CLIENT_AUTH_ENABLED(options))
         {
             const char *use_err = "--%s must be used with --management-client-auth, an --auth-user-pass-verify script, or plugin";