[Openvpn-devel,2/2] Unconditionally set USER_PASS_LEN to 4096

Message ID 20260315184337.1541272-3-luca.boccassi@gmail.com
State New
Headers show
Series Two small fixes for auth via tokens | expand

Commit Message

luca.boccassi@gmail.com March 15, 2026, 6:39 p.m. UTC
From: Luca Boccassi <luca.boccassi@gmail.com>

When authenticating via a JWT token 128 bytes are not enough, which
breaks the auth process. Currently the hardcoded password limit is
increased to 4k when PKCS11 is enabled, for similar reasons.
Remove the compile time conditional and always set the limit to 4k.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
---
 src/openvpn/misc.h | 4 ----
 1 file changed, 4 deletions(-)

Patch

diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h
index e9cfadba..2c495d41 100644
--- a/src/openvpn/misc.h
+++ b/src/openvpn/misc.h
@@ -58,11 +58,7 @@  struct user_pass
     bool protected;
 
 /* max length of username/password */
-#ifdef ENABLE_PKCS11
 #define USER_PASS_LEN 4096
-#else
-#define USER_PASS_LEN 128
-#endif
     /* Note that username and password are expected to be null-terminated */
     char username[USER_PASS_LEN];
     char password[USER_PASS_LEN];