The moment you look deeply at the user/password code, you'll find dark
secrets, it seems...  thanks for fixing, and adding unit tests as well.

Tested the master branch on a t_client setup with valid/invalid password
cases (file + inline).  Nothing overlong, just basic "this must continue
working".  Works.

Tried to apply this "as is" to 2.7, and "it looks good", but it fails to
build the user-pass-testdriver due to missing infrastructure..

  CC       user_pass_testdriver-test_user_pass.o
test_user_pass.c:373:54: warning: call to undeclared function 
'platform_get_tmp_dir'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
  373 |     const char *authfile = 
platform_create_temp_file(platform_get_tmp_dir(), "user_pass", &gc);
      |                                                      ^
test_user_pass.c:373:54: error: incompatible integer to pointer conversion 
passing 'int' to parameter of type
      'const char *' [-Wint-conversion]
  373 |     const char *authfile = 
platform_create_temp_file(platform_get_tmp_dir(), "user_pass", &gc);
      |                                                      
^~~~~~~~~~~~~~~~~~~~~~
./../../src/openvpn/platform.h:128:51: note: passing argument to parameter 
'directory' here
  128 | const char *platform_create_temp_file(const char *directory, const char 
*prefix,
      |                                                   ^
1 warning and 1 error generated.

.. so not applying to 2.7 for now.  I think it would make sense, but
I don't want to just take half of the patch.


Your patch has been applied to the master branch.

commit 4333525868d68593bbdb5c4270f21275d6a35466 (master)
Author: Selva Nair
Date:   Tue Nov 3 09:13:52 2026 +0100

     misc: Fix username overflow spilling into password

     Signed-off-by: Selva Nair <[email protected]>
     Acked-by: Razvan Cojocaru <[email protected]>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2096
     Message-Id: <[email protected]>
     URL: 
https://www.mail-archive.com/[email protected]/msg40555.html
     Signed-off-by: Gert Doering <[email protected]>


--
kind regards,

Gert Doering



_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to